Control Lab1
Control Lab1
ECNG 2005
LABORATORY & PROJECT DESIGN III
Contents
1.
2.
3.
Pre-Lab .................................................................................................................................... 4
4.
3.1.
3.2.
3.3.
Pre-Lab Exercise............................................................................................................. 5
In-Lab .................................................................................................................................... 25
4.1.
List of Figures
Figure 3.1: DC Motor operation and construction........................................................................ 7
Figure 3.2: The Motor and Inertial Load Simplified Block Diagram............................................. 9
Figure 3.3: Magnetically Induced Force on a DC Motor Armature .............................................11
Figure 3.4: DC Motor Electric Circuit.......................................................................................... 12
Figure 3.5: Simplified Open Loop Block Diagram of the DC Motor........................................... 20
Figure 4.1: DCMCT Trainer Module and Schematic (Quanser) ..................................................26
Figure 4.2: Modeling Module of the QICii Software .................................................................. 28
Figure 4.3: Locating the Push-Button and the LEDs....................................................................32
Figure 4.4: Step Response Test Input and Output.........................................................................45
List of Tables
Table 3.1: Open-Loop System Nomenclature ............................................................................... 8
Table 3.2: Modeling Pre-Laboratory Assignment Results .......................................................... 22
Table 4.1: QICii Modelling Module Nomenclature..................................................................... 29
Table 4.2: Default Parameters for the Modelling Module............................................................ 32
Table 4.3: Motor Resistance Experimental Results...................................................................... 37
Table 4.4: Back-EMF Constant Experimental Results ................................................................ 41
Table 4.5: Module Parameters for the Step Response Test ......................................................... 46
Table 4.6: Results Summary Table............................................................................................... 52
Table 4.7: DCMCT Model Parameter Specifications................................................................... 54
Table 4.8: DCMCT Sensor Parameter Specifications................................................................ ..56
1
b
....17
s+a
k
...18
s + 1
KTd
18
Td s + 1
Equation 5.1: ws ( s) =
KVm ( s )
..30
s + 1
s m
..30
Tf s + 1
k
..45
s + 1
y
...46
u
Equation 5.7: ws ( s ) =
km
.51
km
(Lm s + Rm )
J eq +
R
m
1
..51
km (s + 1)( e s + 1)
ECNG 2005
LABORATORY & PROJECT DESIGN III
http://myelearning.sta.uwi.edu/
Semester II 2008 / 2009
1. GENERAL INFORMATION
Lab #:1
Name of the Lab:
Lab Weighting:
10%
Delivery mode:
Lecture
Online
Lab
Estimated total
study hours 1 :
Recommended
prior knowledge
and skills 3 :
Estimate includes teaching time, study time, and student preparation time for classes and labs.
Include any Co-requisites, Post-requisites, or Forbidden course /lab combinations with respective code (C/P/F).
3
Lecturers can state lab input requirements in terms of student behaviours.
2
Course Staff
Lucia Cabrera-Jones
Andre Morris
Position/Role
Teaching
Assistant
Laboratory
Technician
E-mail
Phone
2462
3193
Office
Office
Hours
322
Control
Systems
Lab
Cognitive
Level
3. PRE-LAB
Due Date:
Submission
Procedure:
Estimated time to
completion:
Submit to TA
The servomotor must be matched to the intended application. Usually the most important
specification pertains to the level of torque that can be developed over a given range of
speed. For example, DC motors would be used when a large amount of torque must be
developed at zero or low speeds (as in passenger electric trains). On the other hand, less
expensive AC motors are favored for higher speed applications. In both cases, the gearbox or
belt/pulley system helps to increase the torque and/or speed range of the motor. The control
strategy used depends on the precision of control required. Low precision systems may use
no controls at all (open loop). Feedback increases the level of precision.
A DC motor is used to convert electrical energy to mechanical energy usually in the form of
rotation or linear motion. Rotational motors are by far the most common. Rotation is effected
through the magnetic interaction of two systems: the armature and stator systems.
The armature system is comprised of a winding on a soft iron core coupled to the shaft of the
motor. The stator generates a fixed magnetic field that threads the armature system. This can be
achieved by use of a permanent magnet (permanent magnet DC motor) or an electromagnet
comprised of a coil (stator field winding) wound on magnetic material. Application of a voltage
to the armature winding sets up a separate magnetic field which interacts with the field generated
in the stator system resulting in motion of the armature and shaft. If the armature excitation were
to be maintained, the shaft would rotate to a steady state position. Continuous rotation can be
achieved by cleverly switching the armature excitation. Figure 3.1 provides a diagrammatic
summary of the details discussed above.
Typical DC Motor
Stator system
In general, DC motors are set up for ARMATURE CONTROL or FIELD CONTROL. For
armature control, the field current is kept constant while the motor speed is varied by
changing the armature current; since a constant field current implies a constant magnetic
7
The motor, inertial load, power amplifier, encoder along with the signal conditioning required to
obtain estimate velocity is modeled by the Motor and Inertial Load subsystem, as represented in
Figure 3.2. The block has one input: the voltage to the motor Vm and one output: the angular
velocity of the motor m. Additionally, a second input is also considered: the disturbance torque,
Td, applied to the inertial load.
(a)
Ra
La
Amplifier
Vm
ea
JL, bL
eb
N
T
L
Jm, bm
Motor
Gearbox
Inertial and
viscous load
(b)
Figure 3.2:- The motor and Inertial Load Subsystem: (a) simplified block diagram
(b) expanded block diagram
Note:-This laboratory exercise uses SI units throughout. km is used to represent both the torque
constant and the back-electro-motive force constant.
Solution:
10
4.1
Magnetic
field
strength,
B
Armature
conductor
Armature
current I
Motor
shaft
2. Figure 3.4 is a schematic of the armature circuit of a standard DC motor. Derive the
relationship, expressed in the Laplace domain characterizing, between the armature current
(ia) and voltages (ea, eb).
11
La
Td
Ia
ea
m
eb =km m
Tm
Jeq
3. Using the previous result determine and evaluate the motor electrical time constant, e.
Assume that the shaft is stationary. The parameters of the motor are listed in Appendix.1.
System Parameters
Solution:
4. Assume e is negligible and simplify the motor electrical relationship previously determined.
What is the simplified electrical equation?
12
5. Determine the equivalent moment of inertia of the motor rotor and the load, assuming n=1
since the motor drives the load directly (there is not gear). Neglecting the friction in the
system, derive from first dynamic principles the mechanical equation of motion of a DC
motor.
Solution:
6. Calculate the moment of inertia of the inertial load which is made of aluminum. Also,
evaluate the motor total moment of inertia. Assume that the load is a perfect disc i.e. zero
thickness and uniformly distributed mass. Resume the system parameter values Jeq , Km and
Rm.using the data sheet that is given in Table A.1
7.
Solution:
13
14
2. Determine the motor maximum current, Imax, and maximum generated torque,
Tmax.(Torque /Speed characteristics).Explain.
Solution:
3. During the in-laboratory session you will be experimentally estimating the motor resistance
Rm. This can be done by applying constant voltages to the motor and measuring the
corresponding current while holding the motor shaft stationary.
Derive an expression that will allow you to solve for Rm under these conditions. Explain.
Solution:
15
Draw the block diagram and determine the transfer function, G,V(s), of the motor from
voltage applied to the motor to motor speed. Explain
Hint:
1.
The motor armature inductance Lm should be neglected. The friction of the motor is so small that
can be considered as cero.
Solution:
16
2.
Express and evaluate G,v(s) as a function of the parameters a and b, defined such as:
b
G ,v =
s+a
[4.2]
Solution:
17
3.
Express and evaluate G,V(s) as a function of the parameters K and , defined such as:
k
G , v =
s + 1
[4.3]
Solution:
4.
Determine and evaluate the transfer function, G,T(s), from disturbance torque applied to the
inertial load to motor speed. Express G,T(s) as a function of the parameters KTd and Td, as
defined below:
G ,T ( s ) =
KTd
Td s + 1
[4.4]
Show that Td =
Solution:
18
Derive the motor open-loop block diagram clearly showing the effect of all major
parameters above (see class notes).
Solution:
5.
6.
Simplify the open-loop block diagram obtained so that it has the block structure depicted in
Figure 3.5 HINT: Determine the composite transfer function for the block drawn in 7 above.
19
Solution:
The transfer function G,V(s) previously derived is only an approximation since the
inductance of the motor has been neglected. Considering the motor electrical time constant
e previously evaluated, justify the approximation.
Solution:
7.
20
21
Table 3.2 below MUST be completed before you come to the in-laboratory session to
perform the experiments.
Question
Description
Symbol
Value
Unit
J1
Kg.m 2
Jeq
Kg.m 2
max
Rad/s
Imax
Tmax
Nm
km
Nm/A
Rm
kg.m/(Ws4)
22
1/(V. s )
rad/(V.s)
rad/(N.m.s)
23
24
4. IN-LAB
Allotted Completion 4 hours
Time:
1. The Quanser DCMCT rig
Required lab
2. PC with serial port and operational JAVA engine which is needed to
Equipment:
power the GUI used in this lab
4.1. In-Lab Procedure
4.1.1 Lab Specifics
The motor used in this lab is a Maxon 18-Watt permanent magnet DC motor. The motor is
mounted on the DC Motor Control Trainer (DCMCT) rig manufactured by Quanser. This
trainer rig allows the user/student to operate and control the motor using analog electronics or
a PC. The DCMCT consists of (Fig 4.1)
1. a potentiometer for precision speed and position sensing
2. a digital shaft encoder for precision speed and position sensing.
3. a QIC Processor Core consisting of a 16F877 PIC microcontroller. This allows for
control and monitoring of the DCMCT from a PC connected to the DCMCT serial port.
Various options can be selected by onboard jumpers. For this series of lab, we will use the
QIC Processor Core under PC control to provide the excitation signals and monitor motor
variables.
Maxon DC Motor
Removable inertial Load
Linear Power Amplifier
High Resolution Optical
encoder
5. Ball
Bearing
Servo
Potentiometer
6. Removable Belt to drive
the potentiometer
7. i. PC Interface Option:
this is implemented by
using DtoA and AtoD
converters
ii. Analog Controller
Option: to implement
controllers using analog
electronic circuits
8. Breadboard Option: to
implement
controllers
with your own circuits
9. Embedded/Portable
Option: The QIC installs
in this socket to perform
embedded control in
place
of
PC-based
control
10. Serial Port (used by
QICii)
11. PIC Reset Switch
12. User Switch: Momentary
Action
Pushbutton
Switch
For
Manual
Interaction
13. Inertial Load Storage Pin
14. Jumper J6: to switch
between HIL and QIC
use
15. 6mm Power Jack
16. Power Supply I leader: J4
17. Analog Signals I leader:
ii 1
26
In this lab you will be asked to derive the theoretical open-loop model of the system and to assess
its performance limitations. The DCMCT system is designed in such a way that a good model can
be derived from first principles. The physical parameters can all be determined by simple
experiments. Using QICii and the QET you will apply inputs to the process and observe its
outputs thus allowing you to estimate system parameters using static and dynamic measurements.
The model is to be validated by comparing the measured step response with that obtained from a
simulation of the derived model.
Our model will not consider the effect of nonlinearities, although these affect the system
primarily via amplifier and motor saturation. Other effects such as higher order dynamics and
measurement noise are also ignored.
In this section you would be using the QICii Modeling module to determine the open loop model
of the DC motor. The user interface for the module should be similar to the one shown in Figure
4.2. Table 4.1 lists the main elements comprising the QICii Modeling module user interface.
Every element is uniquely identified through an ID number and located in Figure 4.2.
27
2.5.1. M
28
Label
Parameter Description
Unit
Speed
rad/s
Current
Im
Voltage
Vm
Signal
Generator
Signal
Amplitude
Frequency
Hz
Offset
Speed
Voltage
Vm
10
rad/(V.s)
11
12
Tf
Tf
29
QICii runs a simulation of the system in parallel with the hardware. The output of the simulation
can be used for model fitting and validation. The input of the simulation is equal to the motor
voltage and the output of the simulation is displayed (blue trace) in the same window as the
actual motor speed (red trace). The simulation model parameters K and can be adjusted from
the front panel. The simulated motor speed, s, is obtained from the simulated transfer function
and actual motor voltage using the assumed transfer function model:-
s ( s ) =
KVm ( s )
s +1
[5.1]
The implemented digital controller in the QIC runs at a sample rate of 100 Hz, i.e.,
h=0.01s
[5.2]
Note that the actual speed is obtained by filtering the position signal using the following filter:-
m =
s m
Tf s + 1
[5.3]
30
In order to power up the DCMCT you will first need to launch the QICii software as follows:
a. Go Start-Programs-Quanser-QICii-QIcii .
b. A command window will appear before the QICii screen is launched
Once this screen appears follow these instructions below in order to start running the lab.
1. Make sure the drop down menu on the left at the top of the QICii screen is set to
Modelling and the port is set to COM1.
2. Press the Download program button on top of the QICii window
3. Click on the Write (F4) button of the PIC downloader popup window
4. Push the Reset button on the QIC, Figure 5.2 to start the down load.
5. Once the download is complete, close the pop-up window. Press the Reset button again
on the QIC .The two LEDs should start flashing.
6. Press the User Switch, which is close to the flashing light. Automatically the removable
inertial load will start to spin.
7. Press the Connect/Disconnect button to Connect and hence, display the trace.
The default module parameters loaded after download are given in Table 4.2.
31
Reset
Push -button
Signal
Tf
Type
[V]
[Hz]
[V]
[rad/(V.s)] [s]
[ s]
Square
2.0
0.4
0.0
10.0
0.01
0.2
Wave
Entering data: The lab requires that you change the input voltage several times. Thi scan be
done on the PC keyboard or using the green up/down arrows on your QICii
interface.
NB: If you are using your PC keyboard, make sure to press the ENTER key
after entering the new value.
32
In case of disconnection:
1. Press the Reset button again on the QIC .The two LEDs should start
flashing.
2. Press the User Switch, which is close to the flashing light.
3. Press the Connect/Disconnect button to Connect and hence, display the
trace.
A procedure of this type is very useful to make sure that a system functions properly. Follow the
steps described below.
1.
Step 1.Run the system open-loop by changing the voltage of the motor. The motor voltage is set
by the signal generator. With zero signal amplitude, increase the signal offset gradually from
1 to 5 with increments of 1, to generate a constant voltage. Observe the steady-state speed,
current, and velocity? Record the values obtained. Include in your results a snapshot of the
change in the steady state speed showing the transition of one speed to another. What
happens to the variables as the offset increases?
33
Current (A)
Velocity (rad/seg)
Comments
Step 2.
Although the motor maximum input voltage is 15 V, the Offset numeric input is limited to 5 V.
Determine the maximum velocity and compare with calculations made in the Pre-Lab section
3.5.1 Q1?
34
Step 3. Keeping the amplitude at zero Change the value of the offset (starting at zero) on the
motor and increase it gradually in steps of 0.06 until the motor starts to move. Determine the
voltage when this occurs. Repeat the procedure at least 3 times. Repeat the test with negative
voltages Record the values obtained. Explain why the voltages obtained may vary?
Positive
Direction
Negative
Direction
Comments
35
Some of the parameters of the mathematical model of the system can be determined by
measuring how the steady-state velocity and current changes with the applied voltage. To
experimentally estimate the motor resistance, follow the steps described below:
Step 1.Set the generated signal amplitude to zero. If the signal offset is different from zero then
the motor will spin in one direction, since a constant voltage is applied. You can change the
applied voltage by entering the desired value in the Offset numeric control of the Signal
Properties box. You can also read the actual motor current from the digital display. The
value is in Amperes. Fill the following table (i.e. Table 1.5). For each measurement hold the
motor shaft stationary by grasping the inertial load to stall the motor. Note that for zero
Volts (Offset zero) you will measure a current, Ibias, that is possibly non-zero. This is an
offset in the measurement which you need to subtract from subsequent measurements in
order to obtain the right current. Note also that the current value shown in the digital display
is filtered and you must wait for the value to settle before noting it down. The readings of
the measured currents Imeas must be made to 3 d.p. The recorded value must be taken an
average of 3 times when reading each sample.
36
Vm(i)
Offset in Measured
[V]
Sample:
Vm(i)
Measured Current:
[V]
Imeas(i) [A]
Im(i) [A]
-5
-4
-3
-2
-1
10
Rm(i) []
Step 2: From Table 4.3, above; explain the procedure you used to estimate the resistance Rm and
Ravg.
37
Step 3.The system parameters are given in Table 4.7. Compare the estimated value for Rm (i.e.
Ravg) with the specified value and discuss your results.
38
Follow the steps described below to experimentally estimate the motor back-EMF constant:
Step 1.With the motor free to spin, apply the same procedure as above and fill the
following table (i.e. Table 4.4). You can read a value for the motor angular speed from the
digital display. Wait a few seconds after you enter a new voltage value as the displayed
speed values are low-pass filtered. The angular speed value is in radians per seconds. The
current measurement may have an offset which you will need to account for. The speed
measurement will have a very small offset which will need to be compensated for. Calculate
the motor back-EMF constant for each measurement iteration and then calculate an average
for the 10 measurements. You should use the value of Ravg that you estimated in the previous
section.
39
Vm(i) Ibias
Ravg
[V]
[]
Sample:
[V]
-5
-4
-3
-2
-1
[A]
m(i) [rad/s]
Imeas(i)
Im(i)
km(i)
[A]
[A]
[V.s/rad]
40
10
Step 3.The system parameters are given in Table A.1. Compare the estimated value for km
(kmavg )
41
From the above estimates, obtain a numerical expression for the motor open-loop transfer
function G,V. What are the estimated open-loop steady-state gain and time constant? How does
this compare with the open-loop transfer function you obtained in Section 4.2.3 Dynamic
Models: Open-Loop Transfer Functions, Question 5?
42
Determine the measurement noise for speed control by running the motor with a constant
voltage and observing the fluctuations in the velocity. Use two values of constant voltage and
compare the differences.
Hint: In order to view the noise on the actual speed (red trace) use the magnifier
key,
2. Does the noise level depend on the velocity? Observe as the speed increases what happens to
the disturbance frequency? Justify your answer. Do you also observe any repeatable
fluctuations in your velocity signal? Suggest one probable source of these fluctuations?
Hint:
Can the fluctuations in your velocity signal be related to the motor position?
44
4.10
A linear model of a system can also be determined purely experimentally. The idea is simply to
observe how a system reacts to different inputs and change the structure and parameters of a
reference model until a reasonable fit is of the model and actual responses is obtained. The
inputs can be chosen in many different ways and there is a large variety of methods.
The step response test is carried out by applying a constant input to bring the system, which must
be stable, to a suitable steady state point. The input is then changed rapidly to a new level and the
output is recorded. A simple model of the form:
G ,v =
K
s + 1
[5.4]
45
Assume that the input changes with u and that the corresponding changes in the steady state
output are y. An estimate of the steady-state gain is then given by:
K=
y
u
[5.5]
The quantity is approximately given by the time the output has reached 63% of its total
change.
4.10.2 Experimental Procedure
Please read appendix which describes how to use the QICii plots to take measurements of the
acquired data, to start and stop the plots, and to measure point coordinates on the plots
Step 1. Apply a series of step inputs to the open-loop system by setting the QICii module
parameters as described in Table 4.5
Signal
Amplitude
Frequency
Offset
Type
[V]
[Hz]
[V]
[rad/(V.s)]
[s]
Square
0.4
0.0
Wave
46
Step 2. The open-loop controller now applies a constant-amplitude voltage square wave to the
motor. Step voltages are applied to the motor from the signal generator with a period that is
so long that the system well reaches steady-state at each step. The motor should run at the
corresponding constant speeds. Determine the parameters K and of the model defined in
[5.4] and compare them with the model obtained by first principles in Section 3.5.2,
Question 3.Explain
Step 3. The fact that K = 0 means that the model output is zero. Activate the model by
changing the simulation parameters K and . to the values you previously estimated from the step
response test. Do you obtain a good fit between the estimated and the actual responses? Explain
and print your screen result.
47
Step 4 Compare with the results of first principles modeling in Section 4.2.3 Dynamic Models:
Open-Loop Transfer Functions, Question 6. Is your model valid. Explain. Print the screen
showing the comparative results.
48
Concluding Remarks
There are typically two types of disturbances in a control system. Load disturbances that drive
the system away from its desired behaviour and measurement noise that corrupts the information
obtained from the sensors.
Since this motor does not do any useful work there are no real load disturbances in this case. A
load disturbance can be simulated by gently touching the inertial load with your finger. Load
disturbances can also be simulated by injecting an extra voltage on the motor. The major noise
source for position control is due to the quantization of the angle measurements due to the
encoder.
4.11.2 Automating the Tests
The experimental tests you have done can easily be automated. Measurement of motor resistance
Rm and motor constant km can be done as follows:
Resistance measurement:
Keep the wheel fixed with a clamp. Sweep the voltage slowly for a full cycle, measure
the current, display curve, and present the linear fit and a measure of deviation from
linearity.
Current constant:
Free wheel. Sweep the voltage slowly for a full cycle, measure the speed, display curve,
and present the linear fit and a measure of deviation from linearity.
The system parameter estimation procedures can also be automated by replacing manual search
by an optimization algorithm. Automated test procedures of this type are essential to ensure
quality in mass manufacturing.
4.11.3 Nonlinearities
Many aspects of control can be dealt with using linear models. There are however some
nonlinear aspects that always have to be taken into account. The major nonlinearities are:
49
The limitation in signal ranges implies that the motor transfer functions G,V and G,T do not
describe the system well for large signals.
The other main nonlinearities are due to Coulomb friction, approximately equivalent to 0.2-0.5V,
and quantization in the encoder 2/4096 = 1.5 10-3 rad.
4.11.4 Unmodeled Dynamics
To have an indication of the accuracy of a model it is necessary both to have an estimate of the
accuracy of its parameters and also an assessment of dynamics that has been neglected.
One obvious factor is that the controller and the computation of the velocity is implemented in a
computer. The encoder gives values of the angle that are quantized with a resolution of 2/4096
= 1.5 10-3 rad. Since the controller is implemented on a computer there are also dynamic effects.
50
The system has no sensor for velocity. The velocity is instead obtained by taking filtered
differences of the position. A common rule of thumb is to approximate the effect of the computer
by adding a delay of half a sampling interval or 0.005 s. Since the velocity is computed by taking
differences of the angles between two sampling intervals there is an additional delay in the
velocity signal of one sampling interval. Because of the extra sampling period required to
compute velocity from the encoder position, the time delay will be approximately one and a half
sampling interval. The signal is also filtered which introduces additional dynamics.
The inductance of the rotor has already been mentioned previously. The model we have obtained
is an approximation because we have neglected the inductance in the motor rotor. A more
accurate transfer function from voltage to motor speed is thus:-
G ,v ( s ) =
km
k
J eq +
( Lm s + Rm )
R
m
[5.6]
1
km ( s + 1) ( e s + 1)
[5.7]
2
m
G ,v ( s ) =
Introducing the numerical values we find = 0.0929 s and e = 0.0000774 s, which means
51
Table 4.6 should be completed using Table 3.2, which contains data from the pre-laboratory
assignments, as well as experimental results obtained during the in-laboratory session.
Question
Section Description
Symbol Pre-Lab
Value
In-Lab
Unit
Result
1.
max
rad/s
1.
Positive
Voltage
Coulomb
Friction Vfp
N/A
1.
Negative
Voltage
Coulomb
Friction Vfn
N/A
2.
Rm
3.
km
N.m/A
4.
rad/(V.s)
52
4.
rad/(V.s)
53
Unit
Value
Motor
km
Nm/A
0.0502
Rm
10.6
Lm
mH
0.82
Nm
0.033
18
Jm
Kg.m 2
1.16E(-6)
0.005
Mi
kg
0.068
ri
0.0248
15
1.5
22
Linear Amplifier
Vmax
V/V
54
Value
Unit
1.112
A/V
0.1
Line Count
1024
Lines/rev
0.0879
/count
Type
TTL
Encoder signals
A, B, Index
Encoder
Potentiometer
39
/V
78
/V
Resistance
10
Bias voltage
4.7
Electrical range
350
667
RPM/V
1333
RPM/V
Tachmoeter
55
NB Analog sensor calibration constants for the QIC A/D converters are twice those for the RCA
output jacks. This is because the RCA outputs are in the 5V range while the QIC A/D inputs
are in the 0-5V range.
56
57
58