双pid循环
我正在研究一个机器人项目,该项目涉及控制大型机械臂的位置。建议使用双PID循环,我想知道这涉及什么。
正如我所描述的,第一个 PID 回路应该处理手臂的速度(因为预计手臂又重又长,因此“更难”控制),然后第二个回路控制手臂的位置和进给其值进入第一个PID。
我以前使用过 PID,按照 wikipedia 上提供的表格来校准循环。 (又名:不要假设我能够使用复杂的方法来校准循环)
所以我正在寻找一些好的资源来帮助如何校准循环,以及一些关于如何校准循环的信息(伪代码)让它发挥作用,再加上这是否是一个好主意。
I am working on a robotic project, that involves controlling the position of a large robotic arm. The suggestion was to use a double PID loop, and I am wondering what is involved in this.
As it was described to me, the first PID loop should deal with the speed of the arm (as it is expected to be heavy and long and thus "harder" to control) and then a second to control the position of the arm and feed its value into the first PID.
I have used PIDs before, by following the table provided on wikipedia to calibrate the loop. (AKA: Do not assume that I will be able to use a complex method to calibrate the loop)
So I am looking for some good sources to help in how to calibrate the loops, and also a little bit of information (pseudocode) on how to get this working, plus if this is even a good idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
大多数机器人手臂都有一个用于控制电机扭矩的低电平电流环路、另一个用于控制速度的低电平电压环路和一个用于控制电机位置的较高电平位置环路。您希望尽可能建立一个前馈系统来考虑重力和摩擦等已知影响。您希望低级循环尽可能快地运行。较高级别的位置环可能会稍微慢一些。例如,低电平循环可以以 5Khz(每 0.0002 秒)运行,位置循环可以以 250 Hz(0.004 秒)运行。
Most robot arms have a low level current loop for controlling motor torque, another low level voltage loop for controlling velocity, and a higher level position loop for controlling motor position. To the extent possible you want to set up a feed forward system to account for known effects like gravity and friction. You want the low level loops to run as quickly as possible. The higher level position loop can be somewhat slower. For example the low level loop may run at 5Khz (every 0.0002 seconds), the position loop at 250 Hz (0.004 seconds).
模拟您的循环。我怎么强调都不为过(特别是如果您将采用手动调整方法)。如果您可以使用 Simulink,那么 Simulink 就是您的最佳选择。如果没有,还有其他方法来模拟手臂。
如果您确定两个循环是最好的方法(我不相信),那么首先将问题分解为两个不同的控制循环并独立解决它们。例如,首先开发一个速度环,以实现并维持具有可接受的控制性能的速度目标。然后,开发一个位移环,以使用少量固定的离散速度来实现并保持一个位置。
当这两个问题得到满意的解决后,您就可以使用位移环来设置速度环的目标。这就是仿真变得至关重要的地方:控制系统将是非线性的(但在应用恒系数 PID 时,您实际上是在假设合理的线性度测量)。您可以通过使用位移环为速度环设置可变目标来复合非线性。时机至关重要:在设置新的速度目标之前,位移环必须给速度环一些时间来实现目标。
调整将是一个挑战。我通过完全避免调整来解决了一个复杂的 PID 问题。相反,我使用模拟退火算法来发现最佳 PID 系数。请注意,这种方法假设了两件事:a)可以可靠地模拟问题,b)存在客观性能标准。
Simulate your loops. I can't stress this enough (particularly if you will be employing manual tuning methods). If you have access to it, Simulink is the way to go. If not, there are other approaches to model an arm.
If you are certain that two loops is the best approach (and I'm not convinced), then first break the problem into two distinct control loops and solve them independently. As an example, first develop a velocity loop to achieve and maintain a speed target with acceptable control performance. Then, develop a displacement loop to achieve and maintain a position using some small number of fixed, discrete speeds.
Once these two problems are solved to your satisfaction, you can use the displacement loop to set targets for the velocity loop. This is where simulation becomes vital: the control systems will be nonlinear (but you are effectively assuming a reasonable measure of linearity when applying constant-coefficient PID). You are compounding that non-linearity by using the displacement loop to set a variable target for your velocity loop. The timing will be critical: the displacement loop must give the velocity loop some time to achieve a target goal before setting a new speed target.
Tuning is going to be a challenge. I solved a complex PID problem by avoiding tuning altogether. Instead, I used a simulated annealing algorithm to discover the best PID coefficients. Note that this approach assumed two things: a) the problem could be reliably simulated, and b) the existence of an objective performance criterion.