# Developing Lead Compensator to Decrease Settle Time

This is a follow up to this question.

I've approximated the transfer function for a system to be H = zpk([0.012 -1.05 18],[-0.22 -0.22 -45 -1000],10000);. My goal is to try to reduce the settle time to under 3 seconds. Thanks to answers on my previous question, I found the issue was that I have a slow, unstable zero at 0.012 - meaning I have a non-minimum phase system.

I've been looking into how to fix this issue, and found compensators could be used to counteract the slow zero. At first I implemented a parallel compensator, which did indeed help. I was able to get the settle time down to 20 seconds when previously it was above 50. From my research it seems that a lead compensator can help in reducing the rise time and settle time, but I've been having trouble with the implementation, as the math to determine the zeros and poles for the compensator are bit complex.

I believe it will be of the form $$C(s) = K_c\frac{s-z_0}{s-p_0}$$ where the zero, pole, and gain are determined, in part, using the root locus plot. If anyone could help me in determining an effective compensator, that would be greatly appreciated.

I deleted a previous attempt using a approach with the single lead compensator and provide this alternative solution below.

The root locus shows all closed loop pole locations, which follow the root locus trajectories as the loop gain is adjusted. From that we can choose closed loop pole locations that meet our requirements for settling time, loop bandwidth, stability etc. In general the dominant poles will set the loop characteristics such that we can ignore all "weaker" poles. Dominant poles are the ones closes to the imaginary axis (in the left half plane specifically for stability). This is because the impulse response decays faster as the pole is further from to the imaginary axis (consider that a real pole at $$s = -x$$ has an impulse response given by $$e^{-xt}$$), so if one pole is significantly closer, it will be continuing to decay long after the further pole has mostly diminished.

Here is the root locus for the OP's plant prior to any compensation. All open loop poles will terminate in the open loop zeros as the loop gain is increased, and the open loop zeros never change, becoming the closed loop zeros. Since there are more finite poles than finite zeros (as a proper system), there is an additional zero at infinity. So we see the two dominant open loop poles at $$s=-0.22$$ start out going up and down in the positive and negative imaginary direction, circle around and meet in the right half plane where one turns and terminates on the zero at $$s=0.012$$ while the other terminates in the zero at $$s = +18$$) (off the plot to the right). The other pole at $$s=-45$$ terminates in the zero shown at $$s=-1.05$$ while the remaining pole at $$s=-1000$$ terminates in the zero at infinity going in the direction of the negative real axis.

Here is the resulting root locus after using a compensator that uses two zeros at $$s=-.22$$ to cancel the two dominant poles and then a pole at $$s= -1.05$$ to cancel that low frequency zero and one more pole at $$s= -2$$ to terminate in the zeros in the right half plane (that can't be cancelled). With a loop gain of 0.1164 the damping factor is 0.93 which provides for fastest rise time while keeping a reasonable overshoot (the distance from the real axis is the natural frequency while the distance from the imaginary axis is the decay time as previously described; by increasing the natural frequency we introduce some ringing into the loop but it will increase the rise/fall time by getting to the target level quicker--if we overdue that then we get excessive ringing/overshoot which is not desirable).

With the resulting comparative step response (this has a very large negative excursion but will be fully settled in less than the 3 seconds desired by the OP:

This solution using pole-zero cancellation will be very sensitive to the accuracy of the cancellation; any small error will result in a residual transient that will take a long time to settle.

• Thank you so much for this detailed response! The explanations are very helpful. In the last paragraph for the compensator you said poles at $s=1.05$ and $s=2$. Did you mean for these to be negative? Compensators are a new topic for me so I was just hoping for some clarification on how you write the compensator controller in matlab. For instance, would the controller be given by zpk([-0.22,-0.22],[-1.05,-2],[0.1164]) (where 0.1164 is the loop gain)? Apr 17 at 21:57
• Yes it should be negative and you could do it as you did Apr 17 at 22:08
• Using zpk([-0.22,-0.22],[-1.05,-2],[0.1164]) for the controller, I'm finding that it's settling at zero rather than 1. Did I by chance make a mistake in dealing with the loop gain and damping factor? Apr 17 at 23:19
• You need to add gain to the overall result- it didn’t settle at zero but a smaller number— so just add a simple gain multiple at the output Apr 17 at 23:20
• Thank you! I added a gain block of 400 right before my output which indeed causes it to settle at 1 (rather than 0.0025 as it was previously). But now of course the overshoot is amplified to 200... Do you have a suggestion on how I can resolve this issue? Thanks again for your help! Apr 17 at 23:36