# How to implement PID control for robotic arm?

I'm wondering that, PID control is a linear control technique and the robot manipulator is a nonlinear system, so how it is possible to apply PID control, in this case. I found a paper named: PID control dynamics of a robotic arm manipulator with two degrees of freedom. on slide share page, is this how we use PID control for robotic arm, is there any name for this approach? and how to remove the ambiguity that PID is linear control technique and the robot is nonlinear system. Any suggestions?

• You can use it for joint control or you have to make some assumes like nonlinear elements are constant – acs May 5 '15 at 10:20
• @acs assumes nonlinear elements are constant, is not useful at all, because it simplify the problem two much as it will not resemble the actual situation. Can you expand your first statement more? or suggest what is this approach is the refereed link. – AlFagera May 5 '15 at 10:22
• @AlFagera Although the non-linear system is ultimately responsible for the overall position of the robot arm, the transition between joint positions can be controlled by the linear PID controller. – Scott Downey May 5 '15 at 10:40
• control of angular movement of just one joint. no calculation of arm movement – acs May 5 '15 at 11:29

As @acs said, PID control is used for individual joint control. And you ignore all non-linearities. And typically this is good enough. Sure each joint's control isn't completely optimal, but they should be stable. You can have each joint doing position or velocity control. Then you can do trajectory control at a higher level.

For whole arm control where you want to take into account non-linearities, you do non-linear control. Drake is one such toolbox that does this.

• You can't ignore nonlinear terms. I would rather say one needs to explicitly cancel nonlinear terms. This is known as feedback linearization. That actually what it is going on in this case. PD and PID controllers are utilized with feedback linearization approach. In other words, the system is treated as a linear model. – CroCo Jan 9 '16 at 0:27

There are at least two different ways to get it:

• Explanation 1)

For a very special class of mechanical systems like the robotics manipulator, the control law $u=-K_pe+g(q)$ with $K_p$ symmetric positive definite matrix, $e=q_d-q$ (with $q_d$ the set-point and $q$ the actual angular position from the encoders) and $g(q)$ gravitational component leads to have:

$$M(q)\ddot{q} + C(q)\dot{q} + g(q) = u + g(q)$$ (supposing no forces applied to the end-effector)

and then an internal energy as:

$$V(q,\dot{q}) = \frac{1}{2}\dot{q}{^T}M(q)\dot{q} + \frac{1}{2}e^{T}K_pe + U(q)$$

with $U(q)$ the potential energy per gravity compensation.

It can be shown that assuming that energy as Lyapunov candidate function leads to have the system asintotically internally stable and the state variable $q$ convergent to $q_d$ like a spring of stiffness $K_p$. If during this regulation we want to adjust also convergence rate and/or accuracy we can extend the same concept by introducing respectively the symmetric positive definite matrices $K_d$ and $K_i$ with the respective errors $\dot{e}=\dot{q_e}-\dot{q}$ and $\int e(t)dt$.

• Explanation 2)

the substitution operated in your paper in (15) drives the substitution of nonlinear terms due to $M(q)$, $C(q)$, $g(q)$ with linear ones, and provides a "global" linearity to the system since the relationship input-output becomes described by the linear ODE:

$$u = K_p(q_d − q) − K_d(\dot{q_d}-\dot{q})$$