# How to design compensator for control system

I wanted to make this system so that there is zero steady-state error when there is a ramp input.

As far as I know there is no steady-state error in a type 2 system so to turn G(s), a type 1 system to type 2 system I add an integrator (1/s) so that there will be 2 poles at the origin thus making the system type 2 but by doing this the system become unstable and no matter how I adjust the gain it is still unstable because there will always be a positive pole.

And as far as i know to fix this, i have to add a lead or lag compensator but the problem is i dont know how to design one. I watch a lot of videos in youtube regarding designing a lead/lag compensator but i still dont understand. Hopefully someone can help me with the design of this compensator. I think that is how and what i am suppose to do to ^

• The simplest way is to add a zero to the OLTF: $(1+Ts)$. This will pull one of poles at s=0 into the left half of the s-plane. The value of T should place the zero to the right of the non-zero open loop poles.
– Chu
Nov 24, 2019 at 14:12

As suggested by Chu, a simple extra zero should do the job. Why adding another pole at the origin to cancel the static error since the plant already has one? The zero will thus be positioned to select the right crossover $$\f_c\$$ and the desired phase margin.

The transfer function of the plant can be rewritten in a low-entropy format, showing the time constants at work: $$\H(s)=\frac{1}{\frac{s}{\omega_{po}}(1+\frac{s}{\omega_p})}\$$ with $$\\omega_{po}=445\,s^{-1}\$$ and $$\\omega_{p}=2.25\,ms^{-1}\$$. To counteract the pole position and cross the 0-dB axis with a -1-slope, we can position the zero for a 60° phase margin (PM). The zero position is obtained via the following expression: $$\f_z=\frac{f_c}{tan^{-1}(PM-arg(H(f_c)-180°)}\$$.

The gain of the compensator is calculated to compensate the pole attenuation at the selected crossover $$\f_c\$$: $$\G_0=\frac{1}{|H(f_c)|}\frac{1}{\sqrt{1+(\frac{f_c}{f_z})^2}}\$$. A Mathcad sheet tells us if we got it right: One we have these data on hand, we can test the closed-loop response to a 1-V step; The response is perfect and the error is null as expected.

I don't have time now to type it. Now it is easy to design $$\K_p\$$ to meet the transient response. Just construct the root locus and proceed from this point.