# PID in a system with pole at origin

I've seen in a lot of places some methods of tuning a PID controller. Most of them will say that one should apply a step input to the system and based on that response you can tune the PID parameters following some rule of thumb. But what about a system which one of its pole is at origin? In other words, a step response on a system like that will have an infinitely increasing ramp in the output (theoretically).

An example:

let's say we have a spinning wheel (fixed at center) and all we can control is the amount of torque applied to make it spin. If we can read its position (angle) and we want to design a PID controller to set its position (more or less like a step-motor). How can that be done? Note that a step input in this case will be a constant torque and this will make the wheel spin faster and faster. How should one proceed?

• What specific method are you looking at? It doesn't actually matter if the wheel spins faster and faster, by injecting a small step torque for a given amount of time you can characterize the system... At the t=x point where the system is basically at constant acceleration it's not providing any new information (that's your DC component). Aug 7 '14 at 3:56

There shouldn't be any reason a standard pid couldn't function in the example you gave. As long the position is being sampled at a reasonably high rate. If the pid in your system was only updated at .5 hz then the pid might have a problem keeping the wheel from over accelerating. However, if that's the fastest your system can sample the pid algorithm then I suggest stop using an under-clocked 4040 (or a MC14500 for that matter). Now let's say you had this system, and you wanted to balance it upright. A bare pid wouldn't work so well here because it would overshoot near the top and not apply enough torque when perpendicular to the ground. The solution would be to realize that the torque required to hold it in place would be cos(angle to ground) * mass at end. If you had your theoretical system always apply that much torque, then applying a pid on top of that could work quite well (if T = cos(θ) * M + x where T is the applied torque then altering x will produce the same acceleration no matter what *θ is).

Usually, what happens in practice is that you barely have access to the commanded torque. Instead, you can control electrical quantities, such as voltage and/or current, that in a electrical motor can be readily related to the torque applied to the shaft. This is to say that further dynamics appear in the response and thus the PID should be aware of them.

For example, a DC electrical motor is well described by the following transfer function:

$$F(s)=\frac{\theta(s)}{V(s)}=\frac{K}{s\cdot(1+\tau s)},$$

where $V$ is in the input voltage and $\theta$ is the measured angular position of the motor shaft. To a certain extent, by neglecting the elasticity of the gearbox, one can also apply the same plant model to a system where $\theta$ refers to the joint encoder measurements.

As you can see, there is still a pole in the origin, but this is not a real problem for the identification. So, before tuning the PID, it is always a good rule to understand what kind of system we are dealing with to then ground whatever approach we have in mind on the basis of the knowledge we have of such a system.

To come back to the point, the unknown parameters $K$ and $\tau$ account for the DC gain and the dynamical properties of the system, respectively. To find good values for $K$ and $\tau$ you can consider relying on a least-squares identification method (in its batch or recursive implementations) or even on the Extended-Kalman-Filter estimator (EKF).

The EKF technique can be profitably applied to the state-space system whose transfer function is $F(s)$, augmented of two further states representing the evolution of $K$ and $\tau$ which is in turn implicitly assumed to be constant (i.e. with null derivatives).

Given the template $F(s)$ of your system, you can then inject proper input signals (e.g. step-wise, chirp, pulse trains), measure the output angular position, go through the identification methods and determine good representative values of the free parameters. Once done with that, put the model to test by assessing its performance when stimulated by signals you did not employ in identification (e.g. by varying both the input amplitude and input waveform).

Particular care should be taken for estimating the working area where the system behaves linearly and where your model is supposed to generate good response profiles (e.g. check if the actuator intrinsic nonlinearities have an impact or not). If you experience significant deviations between the measurements and the predictions, then you have to refine the model (e.g. increase model order, introduce dead-time ...).

What's the reason why we struggle to find a good representation of the plant? Because, of course, the model provides us with an easy way to tackle the PID tuning problem. You can resort to simulation, to well-established rules available in literature or even to simple considerations as below.

The P design may turn out from the requirement of tracking a reference signal whose frequency content is limited to the band $\omega_c$. Therefore, we have to equate $\left|F(j\omega_c)\right|$ to 1, hence:

$$\left|\frac{K_PK}{j\omega_c(1+j\tau \omega_c)}\right|=1,$$

from which we get: $$K_P=\frac{\omega_c}{K}\sqrt{1+\left(\tau \omega_c\right)^2},$$

where $K_P$ is the proportional gain.

Since the system is already equipped with an integrator (i.e. the pole in the origin), we don't need the integral part of the PID, thanks to the so-called internal model principle. Nonetheless, for disturbance rejection purpose, one can design the I part under some mild conditions as:

$$K_I=\omega_{dr}K_P-\frac{\omega_{dr}^2\left(1-\tau \omega_{dr}\right)}{K},$$

where $K_I$ is the integral gain and $T_{dr}=3/\omega_{dr}$ is the time period wherein a step-wise disturbance is required to be canceled out.

For instance, the scenario described by daweim0 will definitely require the integral gain to have zero steady-state error while counteracting the gravity component. The feed-forward term will be very helpful too.