You are on page 1of 11

Western University

Faculty of Engineering
Mechatronics Systems Engineering Program
MSE 3302B: Sensors and Actuators
Lesson 2 - Examples

The problems below should be completed by hand calculation unless otherwise stated.
1. Derive the transfer function (Y(s)/X(s)) for the following sets of differential equations using x(t)
as the input and y(t) as the output:
d 3 y(t ) d 2 y(t ) dy (t ) dx (t )
a. 5 + 2 + + 3 y (t ) − 3 − 4 x(t ) = 0
dt 3 dt 2 dt dt
t
d 2 y(t ) dy (t ) dx(t )
b. 2
+6 + y(t ) + 4∫ y(τ )dτ = + x(t )
dt dt 0
dt
d 4 y(t ) d 2 y(t ) dy (t )
c. + + 2 − 9 z (t ) = 0
dt 4 dt 2 dt
d 2 x(t ) dx (t )
6 2
+3 − z (t ) = 0
dt dt

2. In the motor position servo shown in Fig. 1 with G(s)=(s+1)/[s(s+5)] and Gc(s) = K, calculate the
steady-state errors of the system for a unit step and a unit ramp input each applied first to the
reference input Yd and then to disturbance input D. Explain the results obtained physically.
D

Yd Y
Gc(s) G(s)

Figure 1

3. In Fig. 2, with G(s)=A/(Ts+1), the parameters A and T are nominally 1, but each may vary from
0.5 to 2 with operating conditions. Find K such that despite these variations the steady-state
errors for step inputs will not exceed 5% and the system time constant will stay below 0.2
seconds.
Yd Y
K G(s)

Figure 2
4. For the system in Fig. 2 with G(s) = (s+1)(s+3)/[s2(s+2)(s+6)]:
a. What is the system type number?
b. What is the gain of the loop gain function?
c. What are the steady-state errors for unit step and unit ramp inputs?

5. For the system in Fig. 2 with G(s) = 1/[(s+2)(s+7)]:


a. What is the dominating time constant of G(s)?
b. For what value of K will feedback make the dominating system time constant half of that
of part (a)?
c. For the K in part (b), calculate the steady-state error to a unit step response.
d. What limits the increase of K to reduce the steady-state error?
e. Find K and the corresponding steady-state error for a system damping ratio of about 0.7.

6. For the motor position servo system shown in Fig. 3 with G(s)=1/[s(s+3)]:
a. Find K without the rate or velocity feedback (Kg=0) for a system damping ratio of 0.5
and find the corresponding steady-state error for a unit ramp input.
b. Again with Kg=0, what value of K will give a steady-state unit ramp error of 0.1 and what
is the corresponding damping ratio?
c. With K as in part (b), what value of Kg will give a system damping ratio of 0.5? How
does the steady-state error compare with that in part (b)?
Yd + Y
K G(s)
-

Kgs

Figure 3

7. The plant transfer function in Fig. 4 represents a tall rocket with G(s)=1/[s(s-2)]. Such a plant is
open-loop unstable (i.e. unstable without feedback control). Use Matlab to:
a. Plot the root locus to determine if the system can be stabilized by P control (Gc(s) = Kc).
b. If not, could the unstable pole of G be cancelled by a zero of Gc to stabilize the system,
and if not, why?
c. Choose an idealized controller that can stabilize the system and find the corresponding
range of gains for stability.
Yd Y
Gc(s) G(s)

Figure 4
8. If Fig. 4 with G(s)=1/[s(s+1)(s+4)] models a robot joint control, using Matlab:
a. Design an approximate PD control Gc(s)=K(s+z)/[s+p] for a dominant damping ratio of
about 0.5 and a time constant of 1 second. Choose the pole at p to be 10 times the value
of the zero, z. Provide the root locus.
b. Calculate the steady-state errors for unit step and unit ramp inputs.
c. Model the system in Simulink with a saturation block of ±10 at the output of the
controller, Gc, and comment on the effect of the saturation on the unit step response.
d. Remove the saturation block and add a backlash block of width 0.1 to the output of the
plant G before the feedback point. Comment on the effect of adding backlash on the unit
step response.
Solutions
7a)
Root Locus
2.5

1.5

0.5
Imaginary Axis

-0.5

-1

-1.5

-2

-2.5
-0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
Real Axis
We can clearly see that no value of K will stabilize the system.

7b)
Theoretically you could cancel the unstable pole with a zero in the controller but practically it is
impossible to match it exactly so instability will still be present.
7c)
Many controllers can stabilize the system. Typically one would use a PD controller or a lead controller.
If the controller was
1+𝑠
𝐺! = 𝐾
1 + 0.1𝑠
The gain K must be at least greater than 4.8 which is the minimum gain to put the poles on the
imaginary axis as shown below.
Root Locus Editor for Open Loop 1 (OL1)
15

10

5
Imag Axis

-5

-10

-15
-10 -8 -6 -4 -2 0 2 4
Real Axis
8a)
controller:
𝑠+1
𝐺! = 216
𝑠 + 40
root locus:

8b)
𝑠+1 1
𝐺! 𝐺 = 216
𝑠 + 40 𝑠 𝑠 + 0.5 (𝑠 + 3)
𝑠+1 1 216
𝐾!" = lim 𝑠 ∙ 216 = = 3.6
!→! 𝑠 + 40 𝑠 𝑠 + 0.5 (𝑠 + 3) 40 0.5 (3)
type 1:
• for a step ess=0
• for a ramp ess = 1/Ktn = 27.8%
8c)
Simulink:
216(s+1) 1

Step (s+40) s(s+0.5)(s+3)


Yideal
Sum
Zero-­‐Pole Zero-­‐Pole1
To  Workspace

Output

Ysat

To  Workspace1
216(s+1) 1
(s+40) s(s+0.5)(s+3)
Sum1 Saturation1
Zero-­‐Pole3 Zero-­‐Pole2
Ybklsh

To  Workspace2

216(s+1) 1
(s+40) s(s+0.5)(s+3)
Sum2 Backlash
Zero-­‐Pole4 Zero-­‐Pole5

1.4
ideal
saturation

1.2

0.8

0.6

0.4

0.2

0
0 5 10 15 20 25
Actually saturation seems to improve the response in that the overshoot is reduced!
8d)
1.4
ideal
backlas
h
1.2

0.8

0.6

0.4

0.2

0
0 5 10 15 20 25

The backlash results in cycling around the theoretical steady-state value.

9a.
𝑈 4𝑧 + 2 4 + 2𝑧 !!
= =
𝐸 5𝑧 + 1 5 + 𝑧 !!

𝑈 5 + 𝑧 !! = 𝐸 4 + 2𝑧 !!

5𝑢 𝑛 + 𝑢 𝑛 − 1 = 4𝑒 𝑛 + 2𝑒[𝑛 − 1]

4𝑒 𝑛 + 2𝑒 𝑛 − 1 − 𝑢[𝑛 − 1]
𝑢𝑛 =
5
9b.
𝑈 4𝑧 ! + 3𝑧 − 1 4 + 3𝑧 !! − 𝑧 !!
= =
𝐸 𝑧 ! + 2𝑧 1 + 2𝑧 !!

𝑈 1 + 2𝑧 !! = 𝐸(4 + 3𝑧 !! + 𝑧 !! )

𝑢 𝑛 + 2𝑢 𝑛 − 1 = 4𝑒 𝑛 + 3𝑒 𝑛 − 1 − 𝑒[𝑛 − 2]

𝑢 𝑛 = 4𝑒 𝑛 + 3𝑒 𝑛 − 1 − 𝑒 𝑛 − 2 − 2𝑢 𝑛 − 1
10.
PI:
𝑈 𝐾! 𝑧𝑇 𝐾! 𝑧 − 𝐾! + 𝐾! 𝑇𝑧
= 𝐾! + = 𝐾! + 𝐾! =
𝐸 𝑠 𝑧−1 𝑧−1

𝑈 (𝐾! + 𝐾! 𝑇) − 𝐾! 𝑧 !!
=
𝐸 1 − 𝑧 !!

𝑈 1 − 𝑧 !! = 𝐸((𝐾! + 𝐾! 𝑇) − 𝐾! 𝑧 !! )

𝑢 𝑛 = 𝑢 𝑛 − 1 + (𝐾! + 𝐾! 𝑇)𝑒 𝑛 − 𝐾! 𝑒[𝑛 − 1]

PD:
𝑈 𝑧 − 1 𝐾! 𝑧𝑇 + 𝐾! 𝑧 − 𝐾!
= 𝐾! + 𝐾! 𝑠 = 𝐾! + 𝐾! =
𝐸 𝑧𝑇 𝑧𝑇

𝑈 𝐾! 𝑇 + 𝐾! − 𝐾! 𝑧 !!
=
𝐸 𝑇
𝐾! 𝐾!
𝑢 𝑛 = 𝐾! + 𝑒𝑛 − 𝑒[𝑛 − 1]
𝑇 𝑇
PID:
𝑈 𝐾! 𝑧𝑇 𝑧−1
= 𝐾! + + 𝐾! 𝑠 = 𝐾! + +𝐾! + 𝐾!
𝐸 𝑠 𝑧−1 𝑧𝑇

𝑈 𝐾! 𝑇 𝑧 ! − 𝑧 + 𝐾! 𝑇 ! 𝑧 ! + 𝐾! 𝑧 ! − 2𝑧 + 1
=
𝐸 𝑇 𝑧! − 𝑧

𝑈 𝐾! 𝑇 1 − 𝑧 !! + 𝐾! 𝑇 ! + 𝐾! 1 − 2𝑧 !! + 𝑧 !!
=
𝐸 𝑇 1 − 𝑧 !!

𝐾!
𝑈 1 − 𝑧 !! = 𝐸 𝐾! 1 − 𝑧 !! + 𝐾! 𝑇 + 1 − 2𝑧 !! + 𝑧 !!
𝑇

𝐾! 𝐾! 𝐾!
𝑢 𝑛 = 𝑢 𝑛 − 1 + 𝐾! + 𝐾! 𝑇 + 𝑒 𝑛 − 𝐾! + 2 𝑒 𝑛−1 + 𝑒[𝑛 − 2]
𝑇 𝑇 𝑇
11.
%Clear everything
clc
clear

%*****Analog*****
G=zpk([],[0 -0.5 -3],1)
Gc=tf(216*[1 1],[1 40])
Gcl=feedback(Gc*G,1)
pole(Gcl)
%check that the real part of analog poles is <0 (i.e. in LHP)

%*****Digital*****
T=0.001
Gcd=c2d(Gc,T,'tustin')

Gd=c2d(G,T,'zoh')

Gcld=feedback(Gcd*Gd,1)
pole(Gcld)
%check that the magnitude of digital poles <1

%comparing the performance between analog and digital for a step input
step(Gcl,Gcld)

Result:
211.89𝑧 − 211.7
𝐺𝑐 𝑧 =
𝑧 − 0.9608

𝑢 𝑛 = 0.9608𝑢 𝑛 − 1 + 211.89𝑒 𝑛 − 211.7𝑒[𝑛 − 1]

You might also like