# the use of lead compensator and do we need a lead compensator for a system with infinite gain margin?

#### w1586569

Joined Nov 30, 2018
12
Hi everyone,
I have built a controller for the following system and the gain margin comes to infinity. And the next question is whether can we design a digital compensator that would achieve a steady state error to be less 1% due to a step reference of 1 micrometer. I'm not sure about this as i get infinite gain margin and 0 steady steady state error already without a compensator.

A typical hard disk drive actuator can be modelled quite accurately as a double integrator:
G(s)=Y(s)/U(s)=6×10^7/^2
where y is the displacement of the read/write head in micrometre and u is the actuator input in volts. The sampling used in a typical hard disk drive servo system is 10 kHz. It is required to design an appropriate controller so the resulting closed-loop system has an overshoot less than 25% and a settling time less than 8 milliseconds as the response to a step reference of 1 micrometer.
1)Design a digital PD, PI, or PID controller to meet the above design specifications using the emulation based method. Show all the detailed design procedure and the results of your simulations using MATLAB and Simulink.

2)Can you design a digital lead compensator that would achieve the above design specifications?

this is what i got without a compensator
View attachment 195363

View attachment 195364

if someone can provide me some guidance on Q2 and Q3 it would be much appreciated Last edited:

#### MrAl

Joined Jun 17, 2014
8,556
[/QUOTE]
G(s)=Y(s)/U(s)=6×10^7/^2
That's a double integrator? I dont think so. Show the proper function.

Last edited:

#### w1586569

Joined Nov 30, 2018
12

#### w1586569

Joined Nov 30, 2018
12

That's a double integrator? I dont thick so. Show the proper function.
[/QUOTE]

oh sorry my bad I have miss-typed the equation
correction: G(s)=Y(s)/U(s)=6×10^7/s^2 #### MrAl

Joined Jun 17, 2014
8,556
Hi,

Ok that's better i guess.

Now what was your transfer function assuming that was the forward gain?
Did you use:
Y(s)/U(s)=G(s)/(1+G(s))
or something different?

I ask because a forward only double integrator would result in a very fast rising exponential response for a step change like y=K*t^3 or something like that, so you could not be getting a reasonable response without some feedback. But please explain a bit more.

#### w1586569

Joined Nov 30, 2018
12
Hi,

Ok that's better i guess.

Now what was your transfer function assuming that was the forward gain?
Did you use:
Y(s)/U(s)=G(s)/(1+G(s))
or something different?

I ask because a forward only double integrator would result in a very fast rising exponential response for a step change like y=K*t^3 or something like that, so you could not be getting a reasonable response without some feedback. But please explain a bit more.
yes that's correct I used the equation you mentioned. This is my model with controller and the plant
View attachment 195385
so the overall closed loop equation is Hcl(s) = G(s)D(s) / ( 1+G(s)D(s) )

#### MrAl

Joined Jun 17, 2014
8,556
yes that's correct I used the equation you mentioned. This is my model with controller and the plant
View attachment 195385
so the overall closed loop equation is Hcl(s) = G(s)D(s) / ( 1+G(s)D(s) )
Ok very good, i am happy you are showing the entire setup now. That makes it easier for myself and/or others to help with this.

Now just one more little question...
How did you get such a nice step response with that setup and D(s)=1?
You said you did not use a compensator yet so i am assuming D(s)=1.
However, that results in a wild response, like an oscillator.
So can you tell me what you did to get that nice step response?

#### w1586569

Joined Nov 30, 2018
12
Ok very good, i am happy you are showing the entire setup now. That makes it easier for myself and/or others to help with this.

Now just one more little question...
How did you get such a nice step response with that setup and D(s)=1?
You said you did not use a compensator yet so i am assuming D(s)=1.
However, that results in a wild response, like an oscillator.
So can you tell me what you did to get that nice step response?
So basically the D(s) is my PD controller which is kp + s. kd and then i found the overall closed loop equation in terms of kp(proportional gain ) and kd(derivative gain).

Then there's a standard graph for finding the damping factor to satisfy the given overshoot.(i've attached it bellow )
View attachment 195389
In the question it asks for overshoot less than 25%, so the damping factor(ζ) must be greater than 0.4 and then I found the natural frequency(ωn) from the given settling time.
finally I could find the values of kp and kd cuz denominator of the closed loop transfer function( Hcl(s) = G(s)D(s) / ( 1+G(s)D(s) ) ) also comes to a quadratic equation.

#### MrAl

Joined Jun 17, 2014
8,556
So basically the D(s) is my PD controller which is kp + s. kd and then i found the overall closed loop equation in terms of kp(proportional gain ) and kd(derivative gain).

Then there's a standard graph for finding the damping factor to satisfy the given overshoot.(i've attached it bellow )
View attachment 195389
In the question it asks for overshoot less than 25%, so the damping factor(ζ) must be greater than 0.4 and then I found the natural frequency(ωn) from the given settling time.
finally I could find the values of kp and kd cuz denominator of the closed loop transfer function( Hcl(s) = G(s)D(s) / ( 1+G(s)D(s) ) ) also comes to a quadratic equation.
Yes but you said you did not use a compensator in your original post and i knew that you could not get that kind of response without some compensation, so that's why i had to ask.

#### w1586569

Joined Nov 30, 2018
12
Yes but you said you did not use a compensator in your original post and i knew that you could not get that kind of response without some compensation, so that's why i had to ask.
oh I see so my PD controller is a lead compensator? I'm bit confused now why did they ask to build a PD controller in the first question and again a lead compensator in the second question?

Last edited:

#### MrAl

Joined Jun 17, 2014
8,556
oh I see so my PD controller is a lead compensator? I'm bit confused now why did they ask to build a PD controller in the first question and again a lead compensator in the second question?
Well not that's not the point. The point was that you said you used NO compensator but yet you got a reasonable response.

And no technically the PD controller is a little different than a true lead compensator.

#### w1586569

Joined Nov 30, 2018
12
Well not that's not the point. The point was that you said you used NO compensator but yet you got a reasonable response.

And no technically the PD controller is a little different than a true lead compensator.
aha i see its the wording i've used here so basically some authors use compensator or controller without any clear threshold but in my case
View attachment 195401
i should have mention this with the question. so yh i have designed a controller to the plant and thats how how i got the step response.

But I need some guidance with Q2 and Q3
it would be much appreciated #### MrAl

Joined Jun 17, 2014
8,556
Ok so did you try a lead compensator yet?
Try doing an analog lead compensator first.

LATER:
I should have asked do you know what a typical analog lead compensator looks like?

Last edited: