Servo
Servo
Servo
The main objective of this course project is studying the behavior and response of the second
and third order of servo motor systems. We can summarize the objectives as follows
Studying the trajectories the system poles as a function of the tuning parameters used to
modify the behavior of the system and its effect.
Studying tuning parameters that can independently affect speed of response and final
response.
Studying limitations of models of a servo-system.
Use matlab tool Simulink in order to simulate and investigate the servo system.
2. Introduction
In control system terminology, a servo is a closed loop system that consists of a plant,
controller, and feedback as illustrated in figure 1. Each of these elements can be made up
of a few or many parts. These elements work together to make sure that the actual position
(or other measure) matches the commanded position (as close as possible). So Servo
systems are well known for their superior performance in demanding motion applications
A plant is the system under control. Plants usually consist of a motor, amplifier, and
mechanical structure. Figure 2 depicts a picture of a motor used in servo systems. The key
element of the plant is the actuator (the part of the motor that does work).
Fig.2: servomotor
2.3. Feedback
Feedback is one of two things that separate an open loop system from a closed loop system.
Feedback devices send updates about the plant to the controller. Feedback devices are
usually position encoders. Other examples of feedback devices are resolvers,
thermocouples, focus sensors, and strain gauges. The end section of the motor shown above
contains an encoder.
2.4. Controller
The controller takes feedback from the plant and commands such that the plant does what
it is commanded to do. In a motion system, the motion controller acts as the controller. The
most common application of the controller is sending torque commands to a motor in
response to encoder feedback. In addition to commanding a torque to accelerate a motor,
the controller will compensate for external disturbances (such as friction) and make sure
that the plant stays on course.
3. Project works
In this project, we will study three different models of the position servo with different
accuracies are used:
A second order linear model of position obtained by neglecting the small electric
time constant of the motor and considering only the large mechanical time
constant.
A third order linear model of position that includes both electrical and mechanical
time constants of the motor.
A third order model of position that includes nonlinearities such as servo amplifier
saturation and dead zone nonlinearities induced by phenomenon such as static
friction.
In this section, we must derive the transfer function of the system including unity feedback
and tuning parameters Kp for the system in figure 3 as follows
𝑘𝑝 𝑘𝑚 𝑘𝑝 𝑘𝑚
𝑘𝑝 𝐻(𝑠) 2
𝜏𝑚 𝑠 + 𝑠 𝜏𝑚 𝑠 2 + 𝑠 𝑘𝑝 𝑘𝑚
𝐺(𝑠) = = = 2 =
1 + 𝑘𝑝 𝐻(𝑠) 𝑘 𝑘
𝑝 𝑚
2
𝜏𝑚 𝑠 + 𝑠 + 𝑘𝑝 𝑘𝑚 𝜏𝑚 𝑠 + 𝑠 + 𝑘𝑝 𝑘𝑚 (1)
1+
𝜏𝑚 𝑠 2 + 𝑠 𝜏𝑚 𝑠 2 + 𝑠
𝑘𝑝 5
. 5𝑠 2 + 𝑠 + 𝑘𝑝 5
From the denominator of 𝐺(𝑠) we can evaluate the characteristic equation as follows:
𝐶𝐸 = 𝜏𝑚 𝑠 2 + 𝑠 + 𝑘𝑝 𝑘𝑚 (2)
By arranging the characteristic equation with respect to the free tuning parameter, 𝑘𝑝 we can
obtain the root locus equation as follows:
𝑘𝑚 (3)
1 + 𝑘𝑝 =0
𝜏𝑚 𝑠 2 + 𝑠
Using matlab code to draw the rootlocus and investigate the suitable values for tuning
parameter Kp, we have two cases
Case 2; set Kp = 50
We obtain the following results that described two cases in figures 4 and 5.
Fig. 4: Root locus plot of Second order system for free parameter 𝒌𝒑
Fig. 5: Root locus plot of Second order system for free parameter 𝒌𝒑 = 50
We can draw the rootlocus plot for the second order motor model for the free parameter𝑘𝑝 ,
choosing 𝑘𝑚 = 5 and 𝜏𝑚 = 0.5 . Figure (4) describes the root locus, we can determine the
range of the gain 𝑘𝑝 that would place the system in different response mode. The gain 𝑘𝑝
values and their corresponding response mode are summarized in table (1).
Table 1: 𝒌𝒑 values range for second order motor model response mode
From figure 5, we noted that Kp fixed value then the system has only imaginary poles and
damping will vary over the imaginary axis.
Finally, we have chosen three values for 𝑘𝑝 that would place system in different modes. The
step responses for those values are depicted in figure (6) to figure (8). In figure (6), the gain
𝑘𝑝 = 0.1 has placed the system in critically damped mode. In figure (7), the gain 𝑘𝑝 = 0.03
has placed the system in overdamped mode. In figure (8), the gain 𝑘𝑝 = 0.8 has placed the
system in underdamped mode.
Fig.6: Step response of second order motor model with gain 𝒌𝒑 = 𝟎. 𝟏 (Critically damped)
Fig.7: Step response of second order motor model with gain 𝒌𝒑 = 𝟎. 𝟎𝟑 (Overdamped)
Figure 8: Step response of second order motor model with gain 𝒌𝒑 = 𝟎. 𝟖 (Underdamped)
𝑘𝑝 𝑘𝑚 𝑘𝑝 𝑘𝑚
𝑘𝑝 𝐻(𝑠) 𝑠(𝜏𝑚 𝑠 + 1)(𝜏𝑒 𝑠 + 1) 𝑠(𝜏𝑚 𝑠 + 1)(𝜏𝑒 𝑠 + 1)
𝐺(𝑠) = = =
1 + 𝑘𝑝 𝐻(𝑠) 𝑘𝑝 𝑘𝑚 𝑠(𝜏𝑚 𝑠 + 1)(𝜏𝑒 𝑠 + 1) + 𝑘𝑝 𝑘𝑚
1+
𝑠(𝜏𝑚 𝑠 + 1)(𝜏𝑒 𝑠 + 1) 𝑠(𝜏𝑚 𝑠 + 1)(𝜏𝑒 𝑠 + 1)
𝑘𝑝 𝑘𝑚 𝑘𝑝 𝑘𝑚
𝐺(𝑠) = =
𝑠(𝜏𝑚 𝑠 + 1)(𝜏𝑒 𝑠 + 1) + 𝑘𝑝 𝑘𝑚 𝜏𝑒 𝜏𝑚 𝑠 + (𝜏𝑒 + 𝜏𝑚 )𝑠 2 + 𝑠 + 𝑘𝑝 𝑘𝑚
3
(4)
Now, we adjust Km=5, τ m =0.5 and Kp = .1 as the critically damped value that obtained previously
for the second order model. Then we plot on the same graph the step response of the following
values ( τ e =1, .5, .4, .3, .2, .1). We get the following results that illustrated in figure 10.
Fig. 10: step response of different values ( τ e =1, .5, .4, .3, .2, .1)
In figure (10), we have evaluate step response for different values of electric time constant 𝜏𝑒 and
for selected critically value of 𝑘𝑝 that obtained in the second order model. We can observe that as
electric time constant increased then the overshoot reduced and the system transferred from
underdamped case into critically damped case.
In figure 11, the maximum values of overshoot are described with the various values of electric
time constant, from the figure the rootlocus illustrated that as time constant increased the overshoot
deteriorated dramatically but the system becomes critically damped.
Fig. 11: the maximum overshoot of different values ( τ e =1, .5, .4, .3, .2, .1)
From 𝐺(𝑠) we can find the characteristic equation by making denominator equal to zero:
𝐶𝐸 = 𝜏𝑒 𝜏𝑚 𝑠 3 + (𝜏𝑒 + 𝜏𝑚 )𝑠 2 + 𝑠 + 𝑘𝑝 𝑘𝑚 (5)
By arranging the characteristic equation with respect to the free parameter, 𝜏𝑒 we can obtain the
root locus equation as follows:
𝜏𝑒 𝑠 3 + 𝑠 2 (6)
1 + 𝜏𝑒 =0
𝜏𝑚 𝑠 2 + 𝑠 + 𝑘𝑚 𝑘𝑝
Since the numerator order is higher than the denominator, matlab will not be able to draw root
locus plot for this equation. Thus, we can adjust the root locus equation to the following form:
1 𝜏𝑚 𝑠 2 + 𝑠 + 𝑘𝑚 𝑘𝑝 (7)
1+ =0
𝜏𝑒 𝜏𝑒 𝑠 3 + 𝑠 2
1
By adjusting the root locus equation to this form the gain of the plot will be and the start and
𝜏𝑒
end points are switched. On other words, In this case, the start point of the plotted root-locus are
the end points or the true one; same thing for the end point. The value of the free parameter which
the root-locus plot will give is equal to 1/τ e. We obtain the root locus plot for the third order motor
1
model for the free parameter 𝜏 , 𝑘𝑚 = 5 and 𝜏𝑚 = 0.5 using equation (7) in figure (12) to figure
𝑒
𝟏
Fig. 12: Root locus plot of third order motor model for the free parameter 𝝉 and 𝒌𝒑 = 𝟎. 𝟏
𝒆
𝟏
Fig. 13: Root locus plot of third order motor model for the free parameter 𝝉 and 𝒌𝒑 = 𝟎. 𝟎𝟑
𝒆
𝟏
Fig. 14: Root locus plot of third order motor model for the free parameter 𝝉 and 𝒌𝒑 = 𝟎. 𝟖
𝒆
We can use the rootlocus plots to determine where we can approximate the system to second order
system with two dominant poles, that is when the real part of two dominant pole is 10 times greater
than the real part of the third pole ( given that real part of the poles is negative for a stable system).
The summary of the range of the values of the electric time constant 𝜏𝑒 for selected values of the
gain 𝑘𝑝 where it can be approximated to second order system with two dominant poles is given in
table (2).
Table 3: 𝝉𝒆 values range for third order motor model where it can be approximated to a second
order system with two dominant poles for 𝒌𝒑 = (𝟎. 𝟎𝟑, 𝟎. 𝟏, 𝟎. 𝟖)
𝒌𝒑 𝝉𝒆
𝑘𝑝 = 0.03 0 → 0.0602 & 2.0439 → ∞
𝑘𝑝 = 0.1 0 → 0.1088 & 1.6204 → ∞
𝑘𝑝 = 0.8 0 → 0.390 &2→∞
We can notice that for𝑘𝑝 ≥ 0.5, 𝜏𝑒 drives the system toward instability for 𝜏𝑒 > .5 approximately
and as 𝑘𝑝 increases, 𝜏𝑒 > 0 drives system into instability. Furthermore, as the values of 𝑘𝑝 increase,
the stable region of the system becomes very small; However, it is still possible to find a range of
very small values for 𝜏𝑒 where we can approximate the system to a second order system with two
dominant poles.
In the last section of this part, we select three different values of electric time constant with Kp’s
from the 2nd order model. Then plot the step response and compare it to the 2nd order case.
Figures from 15- 17 describe the behavior of third order system. By comparing the results obtained
in second order system, we can notice that the second order model predication was inaccurate for
small values of 𝜏𝑒 since it drove the system into instability.
Fig. 15: Step response of third order motor model with gain 𝒌𝒑 = 𝟎. 𝟏 and 𝝉𝒆 = (𝟎 , 𝟎. 𝟔𝟖, 𝟏. 𝟗)
Fig. 16: Step response of third order motor model with gain 𝒌𝒑 = 𝟎. 𝟎𝟑 and 𝝉𝒆 =
(𝟎 , 𝟎. 𝟔𝟖, 𝟏. 𝟗)
Fig. 17: Step response of third order motor model with gain 𝒌𝒑 = 𝟎. 𝟖 and 𝝉𝒆 = (𝟎 , 𝟎. 𝟔𝟖, 𝟏. 𝟗)
Fig. 18: Step response of third order motor model with gain 𝒌𝒑 = 𝟎. 𝟖 and 𝝉𝒆 =. 𝟎𝟓
Fig. 19: Step response of third order motor model with gain 𝒌𝒑 = 𝟎. 𝟖 and 𝝉𝒆 =. 𝟎𝟓
Fig. 20: Step response of third order motor model with gain 𝒌𝒑 = 𝟎. 𝟖 and 𝝉𝒆 =. 𝟎𝟓
By arranging the characteristic equation (3) with respect to the free parameter, 𝑘𝑝 we can obtain
the root locus formula as follows:
𝑘𝑚 (8)
1 + 𝑘𝑝 =0
𝜏𝑒 𝜏𝑚 𝑠 3 + (𝜏𝑒 + 𝜏𝑚 )𝑠 2 + 𝑠
After getting formula 8, We can draw the root locus plot for the third order motor model for the
free parameter 𝑘𝑝 , 𝑘𝑚 = 5 , 𝜏𝑒 = 0.05 and 𝜏𝑚 = 0.5 in figure (21) using formula (8). From the
rootlocus, we can determine the range of the gain 𝑘𝑝 that would place the system in different
response mode. The gain 𝑘𝑝 values and their corresponding response mode are summarized in
table (4).
Fig. 21: Root locus plot of third order model for the free parameter 𝒌𝒑 and 𝝉𝒆 = 𝟎. 𝟎𝟓
Table 2: 𝒌𝒑 values range for third order motor model response mode for 𝝉𝒆 = 𝟎. 𝟎𝟓
In figure (22), we can see samples from each mode that can the system assume as predicted by the
third order model. In figures (18,19 and 20), we have used the values predicted form the second
order model and obtained their step response in third order model. Despite, the results almost
matches the behaviour predicted by the second order; we can see from table (4) that system is
unstable for𝑘𝑝 : 4.4 → ∞, which was not predicted by second order model.
Fig. 22: Step response of third order motor model with gain 𝜏𝑒 = 0.05 and 𝑘𝑝 =
(0 .02, 0.0951,0.3,4.9)
if i<5
figure(2)
subplot(2,2,i)
else
figure(3)
subplot(1,3,i-4)
end
step(G);
title(['Step Response of G(s) K_p = ' num2str(kp) ]);
end
In this part of the project, we have constructed a Simulink model in figure (23) to obtain the step
response of a third order motor model with saturation nonlinearity.
Fig. 23: Third order motor with saturation nonlinearity Simulink model
We can notice form figure (24) to figure (27) that the response of the system is different from the
obtained response in the third order linear model. First, we notice that the response of the system
was shifted toward the underdamped range while it was previously overdamped and critically
damped for the same gain𝑘𝑝 . Second, we do not have unstable response because of the saturation
nonlinearity, so instead of shooting towards infinity, the response starts oscillating and the
magnitude of oscillation is related to the saturation level as follows: for large saturation levels, we
have limit cycle response while for small saturation levels we have chattering response.
Fig.24: Step response of third order nonlinear motor model with 𝑳 = ±𝟗𝟎 and 𝒌𝒑 =
(𝟎 . 𝟎𝟐, 𝟎. 𝟎𝟗𝟓𝟏, 𝟎. 𝟑, 𝟒. 𝟗)
Fig.25: Step response of third order nonlinear motor model with 𝑳 = ±𝟕𝟎 and 𝒌𝒑 =
(𝟎 . 𝟎𝟐, 𝟎. 𝟎𝟗𝟓𝟏, 𝟎. 𝟑, 𝟒. 𝟗)
Fig.26: Step response of third order nonlinear motor model with 𝑳 = ±𝟒𝟎 and 𝒌𝒑 =
(𝟎 . 𝟎𝟐, 𝟎. 𝟎𝟗𝟓𝟏, 𝟎. 𝟑, 𝟒. 𝟗)
Fig.27: Step response of third order nonlinear motor model with 𝑳 = ±𝟏𝟓 and 𝒌𝒑 =
(𝟎 . 𝟎𝟐, 𝟎. 𝟎𝟗𝟓𝟏, 𝟎. 𝟑, 𝟒. 𝟗)
From figure (24) to figure (27), we have obtained a sample of step response for each response
mode that the third order nonlinear motor model can assume for different saturation levels. The
following table summarizes the range of 𝑘𝑝 values which will place the system in each response
mode for saturation levels that selected in order to see the behaviour of the system, to perform that
we selected the following values for saturation levels 𝐿 = ±(0.05,3,10,100).
Table 3: 𝒌𝒑 values range for third order nonlinear motor model response mode for 𝑳 =
±(𝟎. 𝟎𝟓, 𝟑, 𝟏𝟎, 𝟏𝟎𝟎)
We can notice that as the saturation level increases, the magnitude of the oscillation for 𝑘𝑝 > 3.8
increases, such that for small saturation levels, we have chattering response and for moderate
saturation levels, we have Oscillatory response and for large saturation levels, we have limit cycle
response.
We can see from figure (28) to figure (30) the step responses for a third order motor model with
dead zone nonlinearity for different selected dead zone bands. We can see from the figures that the
system do not respond to the input when it is within the dead zone band and starts to respond when
the input value exceeds the dead zone band limit. Since the step input amplitude is 1, the gain
𝑘𝑝 reflects the amplitude of the input. Also, it’s clear that from figure 30 as the band between 1 and
-1, the response behaves oscillatory then it becomes stable but it’s noted that from figure 29 the
system becomes unstable however it starts with a low oscillatory and that happened in the range
of dead zone range= ±(. 2).
Figure 18: Step response of third order nonlinear motor model with 𝑩 = ±𝟒 and 𝒌𝒑 =
(𝟎 . 𝟎𝟐, 𝟎. 𝟎𝟗𝟓𝟏, 𝟎. 𝟑, 𝟒. 𝟗)
Figure 29: Step response of third order nonlinear motor model with 𝑩 = ±. 𝟐 and𝒌𝒑 =
(𝟎 . 𝟎𝟐, 𝟎. 𝟎𝟗𝟓𝟏, 𝟎. 𝟑, 𝟒. 𝟗)
Figure 30: Step response of third order nonlinear motor model with 𝑩 = ±𝟏 and 𝒌𝒑 =
(𝟎 . 𝟎𝟐, 𝟎. 𝟎𝟗𝟓𝟏, 𝟎. 𝟑, 𝟒. 𝟗)
clc
close all
clear
kpa=[0.02 0.0951 0.3 4.9];
l=[ 30 20 10 5];
b=[.2 1 4];
for j=1:4
L=l(j);
if j<4
B=b(j);
end
for i=1:4
kp=kpa(i);
sim('SERVO.mdl')
figure(j)
subplot(2,2,i)
plot(t,A);
title(['Step Response of G(s) with saturation level L=' num2str(L) '
to ' num2str(-L) ', and K_p = ' num2str(kp) ]);
xlabel('Time(Second)');
ylabel('Amplitude');
if j<4
figure(j+5)
subplot(2,2,i)
plot(t,A1);
title(['Step Response of G(s) with deadzone band B=' num2str(B) '
to ' num2str(-B) ', and K_p = ' num2str(kp) ]);
xlabel('Time(Second)');
ylabel('Amplitude');
end
end
end
Conclusion:
Almost everyone who has worked with servo systems has had at least one challenging experience
while trying to tune a servo. Theory often doesn’t seem to work very well in practice. And
oftentimes successfully tuning a servo requires a lot of trial and error.
Derivative gain is used to dampen overshoot and oscillation, which are the typical side affects of
proportional gain, so derivative gain is typically associated only with dampening a servo it is
possible for it to actually increase servo instability.
In this course project, we have studied different control systems of electric motors that include,
second order model, third order model and third order nonlinear model. After studying the results
it’s clear to say that as increase the complexity of the system, its approaches like the actual response
of the servomotor and the accuracy of the predication increases. Although, the main goal of the
simulation is to support fair approximation to actual system response and even low order modes
of the servomotor approximation could be helpful and give more vision on system response.
Finally, until the servo is tuned, the system is effectively out of balance. Only after a servo has
been tuned can the controller calculate the appropriate torque/velocity command output for a given
user defined motion.
Future work and enhance the servo tuning process
As with most jobs you need the right tool, and the right tool for this job is to design Servo Tuning
program.