CI2 Control Lab Assignment CW1A QP
CI2 Control Lab Assignment CW1A QP
Objectives
Introduction
This assignment is individual assignment. Each student will be assigned a different set specification,
the settle time and overshoot Mp. Make sure you have your own set of tS and MP.
The assignment has two parts:
PART A: Design the digital controller GC (𝑧) using indirect design method. [25 marks]
PART B: Design a digital controller GC (𝑧) using direct design method. [25 marks]
Submission method:
online (pdf file) on Blackboard , save your file as “ s/nr _ your full name _ CW1A”
Student
Name
ID:
Assigned overshoot = _____%; Settling time = _____ ms
Sampling period TS= 1 msec
Declaration of Originality
I understand that Plagiarism is the act of taking and using the whole or any part of another person’s
work and presenting it as my own without proper acknowledgement.
I understand that Plagiarism is an academic offence and if I am found to have committed or abetted
the offence of plagiarism in relation to this submitted work, disciplinary action will be enforced, which
means that I can fail this subject!
Page 1 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
PART A: Design a digital controller for the DC motor position control system
using indirect design method.
Objectives:
To understand the system design specifications
To understand the discrete-time control system and digital compensator
To design a digital compensator for the motor position control system using indirect method
Use MATLAB to simulate the system and verify your design of the controller
• Settling time (2%) between 0.02 and 0.08 seconds. (20ms to 80ms)
• Overshoot no more than 30% (5%, 10%, 15%, 20%, 25%)
• Minimum towards zero steady state error.
s + zero z+a
GC ( s) = k C Bilinear transform GC ( z ) = k z
s + pole z +b
Page 2 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
The indirect design method is to be used to determine the compensator parameters. Please read
through Chapter 5 of the CI2 lecture notes for the details of this method.
1. Determine the desired damping ratio and natural frequency of the system based on the desired
performance specifications. Ask your Lecturer to know your specified Overshoot MP and
settle time tS
2. Derive the closed-loop transfer function of the motor control system (with the compensator)
in the s-domain.
3. Let zero = 1/ Tm ; namely let the compensator zero cancel the motor pole.
4. Compare the closed-loop characteristic equation with the desired characteristic equation to
determine the compensator parameters k C and pole (in the s-domain).
2 z −1 z −1
s= = 1000
Ts z + 1 z +1
s + zero z+a
GC ( s) = k C Bilinear transform GC ( z ) = k z
s + pole z +b
7. Simulate your system and verify if all specifications are met. You can simulate in either ways
as shown in Figure 2-1.
Compensator DC Motor
R(z) C(z)
+ 70
ZOH 𝑠(𝑠 + 50)
_
Page 3 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
Tasks: Answer questions 1 ~ 4 and write your answer in your Assignment answer:
Question 1: Determine the desired damping ratio and natural frequency based the
specifications assigned to you
−
1− 2
MP = e → Damping ratio: = ? ______
4
ts = → Natural frequency: n = ? ______
n
The expected characteristic equation: s 2 + 2 n s + n2 = 0 is
____________________________________
The motor control system in the s-domain is shown in Figure 2-2. It is assumed that the motor transfer
𝟕𝟎
function 𝐆𝐦 (s) =
𝒔(𝒔+𝟓𝟎)
R(s) + 70 C(s)
_ 𝑠(𝑠 + 50)
pole = ____________
k C = _____________
The required compensator transfer function is:
s + zero
GC ( s) = k C = ___________________
s + pole
Page 4 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
Set the sampling period 𝑇𝑠 = 1 ms, and apply Tustin’s Bilinear Transformation to transfer your
designed compensator from s-domain to z-domain.
2 𝑧−1 𝑧−1
𝑠= = 2000
𝑇𝑠 𝑧 + 1 𝑧+1
Gc (z ) = ________________________
Question 4: Simulate your final system and print out the results
Comment on the simulation result on how the compensator has improved the
system’s response.
Page 5 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
Course Work 1
Part B
Student
Name
ID:
Declaration of Originality
I understand that Plagiarism is the act of taking and using the whole or any part of another person’s
work and presenting it as my own without proper acknowledgement.
I understand that Plagiarism is an academic offence and if I am found to have committed or abetted the
offence of plagiarism in relation to this submitted work, disciplinary action will be enforced. This will
mean that I might fail this subject! Anyone caught to have copied work from classmate, both will be given
ZERO marks.
Page 6 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
Objectives:
To design a digital compensator using direct method (in z plane)
Write program in m-file code and use Simulink to verify your result.
z −
GC ( z ) = k
z−
Your task is to determine the compensator parameters such that the assigned specifications (overshoot
and settling time) are satisfied as verified by SIMULINK simulation.
The direct design method is to be used to determine the compensator parameters. This method is
based on the root locus of the system. Refer also to chapter 5 of lecture notes.
Page 7 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
1. Determine the desired closed-loop poles in the s-domain based on the damping ratio and
natural frequency of the system that you have calculated in PART 1.
s = −n j n 1 − 2 = …..
2. From the definition of z-transform, transfer the desired closed-loop poles from the s-
domain to the z-domain.
- j 1− 2 T
z=e =e
n n
sTs s
= …….
Convert z to algorithm form: z = z (cos z j sin z ) = a jb
3. Draw the root locus of the motor in the z-plane based the transfer function GHP (z ) that
you have obtained in PART A - Q4. If the root locus passes through the desired closed-
loop poles z = a jb , then you only need a proportional controller GC ( z) = k and the
value of k can be determined from the root locus.
4. If the root locus does not pass through the desired closed-loop poles z = a jb (most
z −
possibly this is the case), then you need a compensator GC ( z ) = k .
z−
5. Let = the pole of the GHP (z ) (the one that is other than 1).
6. Write the open-loop transfer function of the system with the compensator as following,
where k and are to be determined.
z −
GC ( z )GHP ( z ) = k GHP ( z )
z−
Page 8 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
Question 1: Determine the desired closed-loop poles in the s-domain based on the damping
ratio and natural frequency of the system that you have calculated in PART 1.
s = −n j n 1 − 2 = ______________________
Use MATLAB to plot the root locus based on the motor transfer function
GHP (z ) that you have obtained in PART A Q4 (without compensator)
Print the root locus with only P-controller and with the PID controller (with
compensator) and comment the difference between them. Write two different
script/m-file for this and compare the two different results, comment on its stability.
Question 2: Select the compensator zero to cancel one pole of GHP (z ) {other than z=1}.
= ________________
Im
z-plane
z = a + jb
pole(1)
zero pole( )
x x Re
Zero of GHP(z) 0 pole 1 of GHP(z)
Figure: Determine
Page 9 / 10 pages
Control & Instrumentations 2 CW1A (digital control lab assignment)
zero = _________________________
pole(1) = _________________________
pole( ) = _________________________
1
k= = ___________________
z −
GHP ( z )
z− z = a + jb
z −
GC ( z ) = k = _________________
z−
Question 4: derive the state space representation of the system with new PID controller
Use Matlab to acquire the state space representation for the new transfer function G(z) (using PID
compensator)
Write a simple m-file code to apply unit step and get the output result for this new transfer function
and compare this results with your results in Part B (using only P controller).
Note: Do NOT include the questions of this assignment as part of your submission!
End of CW1A
Page 10 / 10 pages