Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
CONTROL LABORATORY ENG5022
SERVO-MOTOR CONTROL AND
SYSTEM SIMULATION –
CONTINUOUS AND DIGITAL
PART 1
This is Part 1 of the lab handout.
You must first complete this part before continuing with Part 2.
TABLE OF CONTENTS
Introduction ................................................................................................................................................................................2
Objectives ................................................................................................................................................................................2
Some practical tips ..............................................................................................................................................................2
Assessment .............................................................................................................................................................................3
Submission ........................................................................................................................................................................3
1 Part 1: Simulation ...........................................................................................................................................................4
1.1 Open loop system ..................................................................................................................................................4
1.1.1 System modelling ........................................................................................................................................4
1.1.2 Creation of Transfer Functions in MATLAB .....................................................................................6
1.1.3 Simulation of the plant model ................................................................................................................7
1.2 Continuous-time controller ........................................................................................................................... 11
1.2.1 Controller Design ...................................................................................................................................... 11
1.2.2 Simulation with Simulink ...................................................................................................................... 12
1.2.3 Nyquist analysis ........................................................................................................................................ 13
1.3 Digital Control ..................................................................................................................................................... 16
1.3.1 Discrete equivalent of the plant.......................................................................................................... 16
1.3.2 Digital design by emulation .................................................................................................................. 16
1.3.3 Simulation of the Digital Controller .................................................................................................. 18
1.3.4 Effect of the sample time ....................................................................................................................... 19
Control Laboratory Page 2
INTRODUCTION
OBJECTIVES
The aim of this exercise is to design and evaluate a controller which regulates the position of the
output shaft of a servo motor.
The exercise has two parts: in Part 1 you will model the system and assess the performance using
a linear model of the system. In Part 2 you will use a realistic model of the system which
represents aspects you will encounter with a real system, so you can compare the performance
with the linear simulation. The lab will run over two sessions, during which you are expected to
complete both parts.
At the end of the two lab sessions, you should be able to:
• derive the mathematical model of the servo plant from first principles and how to
implement this in MATLAB,
• appreciate the differences between the system simulation and the behaviour of the real
system,
• design and implement a continuous controller,
• use the Nyquist stability criterion to estimate the robustness of the feedback control system,
• implement the continuous-time controller and evaluate its performance,
• create a digital equivalent of the plant for use in a simulation,
• design a digital controller by emulation, based on the continuous controller design,
• compare the performance of the digital controller with its continuous counterpart, and
assess the impact of the sampling time on the digital control loop,
• evaluate the controllers with a real servo motor system, and compare their performance
with simulations.
SOME PRACTICAL TIPS
You will be using MATLAB and Simulink throughout this lab. This software is available on School of
Engineering computers which can be accessed on the Virtual PCs (COSE Desktop)
https://rdweb.wvd.microsoft.com/arm/webclient/index.html. You can also install Matlab /
Simulink on your own computer (create an account using your UofG email address on
www.mathworks.com and you’ll get a download link), or run the lab on the Mathwork webclient
(https://matlab.mathworks.com).
In addition to Matlab and Simulink, you will need to install the Control Systems toolbox.
Control Laboratory Page 3
ASSESSMENT
Each student must
1) answer the questions throughout this lab sheet and complete the corresponding Moodle
quizzes (one quiz for each Part), and
2) write a short individual report, covering both parts. The report must not exceed 3 pages
(excluding plots and figures) and should contain:
• your name and student number,
• a description of the work done in the lab, explaining the tools and methods used,
• a summary of the results obtained and the observations made, including all plots required
in the lab sheet,
• a discussion of what other methods could be used to improve the results.
Note: The short individual report should not be a repetition of the questions which you have
already answered in the Moodle quizzes.
SUBMISSION
You need to
• complete the two Moodle quizzes available on the course Moodle page
• submit
o the short individual report as a PDF file under Lab report submission,
o the 7 Simulink model files (extension “.slx”) which correspond to the 5 models
mentioned in this lab sheet under Simulink model submission
on the Control Systems M Moodle page,
by the submission date shown on Moodle.
The Moodle quizzes and report will be assessed and contributes 10% to your final mark.
NOTE: This assignment is part of the assessment for this course, so you are required to complete
the submission in order to gain credits. As the individual assignment is part of your summative
assessment it is subject to the University’s plagiarism policy
(https://www.gla.ac.uk/myglasgow/leads/students/plagiarism/).
While you can discuss the lab with your fellow students, you must create the Simulink
models and complete the lab individually.
Control Laboratory Page 4
1 PART 1: SIMULATION
1.1 OPEN LOOP SYSTEM
We will start by deriving the analytical model of the open loop system from first principles by
modelling the electrical and mechanical components of the servo motor system. This plant model
will then be implemented in MATLAB and we will analyse its frequency response, using the Nyquist
plot as an analytical method and comparing this with experimental results. Finally, we will compare
the open loop response of the model with that of the real system.
1.1.1 SYSTEM MODELLING
The Quanser QUBE-Servo 2 is a direct-drive rotary servo system. Its motor armature circuit
schematic is shown in Figure 1 and the electrical and mechanical parameters are given in Table 1.
The DC motor shaft is connected to the load hub. The hub is a metal disk used to mount the disk
load, and has a moment of inertia of Jh . A disk load is attached to the output shaft with a moment of
inertia of Jd .
Figure 1: QUBE-Servo 2 DC motor and load
Here is the supply voltage, and are the motor resistance and inductance, respectively,
is the back emf produced by the motor as it turns and is the current through the motor. The
motor torque is denoted by , the shaft angle is and the motor shaft velocity is = ̇.
Using Kirchhoff’s voltage law we obtain the following equation:
() − () −
()
− () = 0
Since ≪ , the motor inductance can be ignored, and the equation can now be simplified to
() =
() − ()
The back emf created by the motor is proportional to the motor shaft velocity, ̇ = , i.e.
() = ̇(). Replacing in the equation above results in
() =
() − ̇()
The torque generated by the motor is proportional to the current through the motor,
() = ()
where is the motor-torque constant. Replacing with the equation above results in
() =
() − ̇()
We now consider the mechanical aspects of the motor. Applying Newton’s 2nd law of motion to the
motor shaft results in
Control Laboratory Page 5
( + ℎ + )̈() = ()
where , ℎ and are the moment of inertia of the motor, the hub and the disk, respectively.
The moment of inertia of a disk about its pivot, with mass and radius , is
=
1
2
2
which allows us to calculate ℎ and , given their mass and radius. The total equivalent moment of
inertia is therefore,
= + ℎ + = +
1
2
ℎℎ
2 +
1
2
2
Thus
̈() =
() − ̇()
or
̈() + ̇() = ()
Q1.1: Take the Laplace transform of this equation and derive the transfer function
() =
()
()
You should now implement this system in MATLAB.
Using the MATLAB editor, write a MATLAB script to calculate the numerator and
denominator coefficients of the transfer function, using the physical parameters given in
Table 1 at the end of this section.
Bring this transfer function into monic form, i.e. make sure that the coefficient associated with the
highest power of s in the denominator is equal to 1. This can be achieved by dividing numerator and
denominator by the coefficient associated with the highest power of s in the denominator.
Q1.2: Write down the resulting transfer function in monic form:
Q1.3: What are the poles and the zeros of the plant transfer function?
Control Laboratory Page 6
1.1.2 CREATION OF TRANSFER FUNCTIONS IN MATLAB
You will use the function tf from the Control System toolbox to implement the transfer function
which you have derived, in MATLAB, using a transfer function object (TF object).
The expression P = tf(num,den) creates a continuous-time transfer function with
numerator(s) and denominator(s) specified by the vector-variables num and den. The output
variable P is a TF object storing the transfer function data.
In the Single-Input Single Output (SISO) case, num and den are the row vectors of numerator and
denominator coefficients ordered in descending powers of s. These two vectors need not have equal
length and the transfer function need not be proper.
For example,
• h = tf([1 0],1) specifies the pure derivative ( )h s s= ,
• g = tf([15],[6 3 2]) specifies the proper transfer function
26
( )
2
15
3s
s
s
g
+ +
= .
Amend the MATLAB script which you have created above to implement the system transfer
function using the tf command and assign it to the variable P.
Symbol Description Value
DC Motor
Rm Terminal resistance 8.4Ω
kt Torque constant 0.042 N.m/A
km Motor back-emf constant 0.042 V/(rad/s)
Jm Rotor inertia 4.0 × 10
−6 kg.m2
Lm Rotor inductance 1.16 mH
mh Load hub mass 0.0106 kg
rh Load hub mass 0.0111 m
Load Disk
md Mass of disk load 0.053 kg
rd Radius of disk load 0.0248 m
Table 1: QUBE Servo 2 system parameters.