Analog & Digital Motor Control Manual
Analog & Digital Motor Control Manual
Analog & Digital Motor Control Manual
Motor Control
Curriculum Manual CA06
Issue: ME1219/E
Lesson Module: 17.06/0
CA06
Curriculum Manual
Chapter
Contents
Pages
Introduction
............................................................................................. i - iv
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
CA06
Curriculum Manual
CA06
Curriculum Manual
Introduction
Introduction
This curriculum text is designed to introduce analog and digital control methods
used to control the MS15 DC Motor Control Module.
The work is presented in a largely non-mathematical form with the aim of clearly
establishing the principles involved prior to the mathematical approach that has to
be accepted beyond this level.
This curriculum makes use of Real-time WindowsTM based Virtual Control
Laboratory software and a Control Laboratory Input/Output (CLIO) interface
module which enables the student PC workstation to:
CA06
Curriculum Manual
The digital control material presented in the later chapters of this curriculum text
is split into two sections in order to cover this subject in its broadest possible
context. The first explains the techniques associated with analog interfacing and
the second with digital interfacing. Numerous hands-on exercises are included
covering both approaches.
WARNING
All DC motors have a limited life. When not performing an experiment, switch the
unit off or remove the signal applied to the motor input (click disable on the
control software).
The motor should be prevented from entering a state of high frequency oscillation
for more than a few seconds. This manifests itself as either an audible buzz or
rough running of the motor. If this condition is not removed the motor may fail.
The experiments in this manual ensure that this condition should not arise. If it
does, remove the input to stop the oscillation and check that the instructions have
been followed correctly.
CA06
Curriculum Manual
Your Workstation
Depending on the laboratory environment in which you are working, your
workstation may, or may not, be computer managed. This will affect the way that
you use this curriculum manual.
If you are in any doubt about whether your workstation is computer managed, you
should consult your instructor.
iii
CA06
Curriculum Manual
iv
CA06
Curriculum Manual
Chapter 1
Analog Control - Equipment Overview
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
1.1
CA06
Curriculum Manual
Introduction
Practical exercises are an integral part of the course and waveforms displayed on
the PC are used to illustrate parts of the course.
A PC with the Virtual Control Laboratory software and CLIO Control Laboratory
Input/Output interface is used to replace a number of different traditional
instruments, eliminating the need for separate signal generator, oscilloscope,
multimeter or controller.
In this first chapter, you will refresh your knowledge of the DC Motor which is
used as the 'Plant' and familiarize yourself with the interface board and the
operation of the software.
1.2
DC
MOTOR
Disengage
Engage
Vin
E
0V
Brake
Slotted
Disk
Gray
Disk
TACHO
GENERATOR
OUTPUT
POTENTIOMETER
OUTPUT
Vout
0V
Vout
0V
DIGITAL CONTROL
P.W.M. INPUT
Pw
E
0V
GRAY CODE
D0
D1
D2
Vin
Pw
Calibrated Disk
Digital Speed Readout
Tacho
Generator
Vout
Load
D3
0V
SLOTTED
DISC
Po
0V
CA06
Curriculum Manual
Tachogenerator
Gearing
9:1
Output
Potentiometer
Enable
Power
Amplifier
Signal
Conditioning
Signal
Conditioning
Vin
Drive
Vout
Velocity
Vout
Position
CA06
Curriculum Manual
The 4 mm socket for this input is in the MOTOR DRIVE INPUT section of the
module and is marked VIN.
) line is grounded
The analog drive input is only available when the Not Enable (E
and the MOTOR DRIVE switch (upper switch at center bottom of the circuit
board) is in the VIN position.
Velocity (or speed) output
The tachogenerator is connected to the output shaft and produces (after signal
conditioning) a DC voltage in the range 5 volts proportional to the rotational
velocity of the motor. This output provides the primary feedback of information
for closed loop speed control applications and performs a secondary role in many
positional applications. A positive voltage is produced with the output shaft
rotating in a counter-clockwise direction.
The 4 mm socket for this output is in the TACHOGENERATOR OUTPUT section
of the module and is marked VOUT.
This velocity output signal is only available when the TACHOGENERATOR
switch (lower switch at center bottom of the circuit board) is in the VOUT position.
With the switch in the LOAD position, the tachogenerator is connected to a variable
resistor load which can be used to load the motor.
Position output
The output shaft carries a calibrated disc (degrees) and is coupled to a precision
potentiometer which, via appropriate signal conditioning, provides a DC voltage in
the range 5 volts according to the position of the output shaft. This potentiometer
output provides the primary feedback of information for closed loop position
control over about 340 of output rotation. The output voltage is 0 when the shaft
is at 180, positive for angles above this and negative for angles below this.
The 4 mm socket for this output is in the POTENTIOMETER OUTPUT section of
the module and is marked VOUT.
CA06
Curriculum Manual
1.3
0V
-12V
ADJ V+
Vo
ADJ V-
JL
1.4
Virtual Instrumentation
Virtual Instrumentation means that a personal computer (PC) is being used in
place of a number of conventional instruments such as a Signal Generator,
Oscilloscope, Panel Meter and a number of different types of controller.
Fig 1.4 overleaf shows a schematic of the Virtual Control Laboratory used in this
course.
In this course we are concerned with understanding the performance of the closed
loop systems rather than how you would build a controller. To simplify the
experiments, all the controls are on the screen. This means that the control is
always being implemented digitally but, as long as the conversion to digital and
the conversion back to analog are performed fast enough, the system can represent
an analog controller.
5
CA06
Curriculum Manual
Drive
Velocity
Signal
Generator
Controller
Position
Reference
Display
Control
PLANT
Plant
AS3
Command
Potentiometer
Reference
Parallel Port
INTERFACE
Drive
MS15
DC MOTOR
Velocity
Position
CLIO
Interface
The digital computer is connected to the MS15 DC Motor module via the CLIO
Interface unit. This contains a fast Digital to Analog Converter (DAC) which
provides a continuous analog drive to the motor and a 3-input Analog to Digital
Converter (ADC) to convert the analog outputs from the motor (tachogenerator
and potentiometer) and the command potentiometer into digital form for the
computer.
1.5
CA06
Curriculum Manual
To/From Computer
Parallel Port
which should be wired to the E socket on the motor board. The 4 mm socket for
this output is in the ANALOG DRIVE section of the CLIO interface and is marked
a.
E
7
CA06
Curriculum Manual
1.5a
1.5b
output position.
output torque.
output speed.
output position.
output torque.
output speed.
CA06
Curriculum Manual
1.5c
1.5d
position control.
speed control.
The measurement range of the input signals to the CLIO module is:
a
1.6
2V
5V
10V
15V
CA06
Curriculum Manual
SYSTEM POWER
+12V
-12V
ADJ V+
+12V
5V, 1A
0V
POWER
Vo
0V
ADJ V-
-12V
JL
JL
0V
-12V
ANALOG CONTROL
MOTOR DRIVE
Vin
E
0V
TACHO
GENERATOR
OUTPUT
POTENTIOMETER
OUTPUT
Vout
0V
Vout
0V
+5V
Vout
Ea
0V
P.W.M. INPUT
ANALOG
DRIVE
DAC
Cable To
Parallel Port
Vel
Pos
Ref
DIGITAL CONTROL
0V
ANALOG
MEASUREMENT
ADC
0V
Pw
E
0V
Pw
Ed
PWM
DRIVE
0V
GRAY CODE
D0
D1
D2
Vin
D3
Pw
0V
D0
D1
D2
GRAY
CODE
D3
0V
Vout
Load
SLOTTED
DISC
Po
P0
0V
10
0V
SLOTTED
DISC
JL
CLIO
CA06
Curriculum Manual
1.7
11
CA06
Curriculum Manual
The Plant
This is to the right of the screen. For this section of the course, the Plant is
normally set to MS15 Analog indicating that the software is assumed to be
interfaced to the analog control section of the MS15 DC Motor Control
Module.
The Display
This takes up the lower two-thirds of the screen. Up to 8 channels can be
displayed, normally in graphical form. This allows the relationships between
various signals to be examined. The channels are color coded with the
measurement point, channel number and trace color shown on the Controller
mimic diagram. To access the controls of a particular channel, point the mouse and
click at the channel number in the channel select area. Only the channels which
have a meaning with the selected control method are available.
There are three other display options selectable via the Display option on the Tool
Bar. These are:- Bar, Meter and List. Select Display | Meter and you will see a
numerical display of the signals being measured. Go back to Graph using
Display | Graph.
Adjusting on-screen controls
All on-screen controls are set by pointing and clicking.
'Flip' Controls
These have a control bar above and below the legend or number. Clicking the
upper bar flips the legend to the next in the sequence or increments the digit.
Clicking the lower bar flips the legend to the previous one in the sequence or
decrements the number. Try it and see - you will not harm anything. Click
above Signal Generator, Signal, Step and see the legend change to Random.
Click below Random and see the legend return to Step. Note that the click
area actually extends up or down from the center of the legend. Now click
above and below the Signal Generator Level numbers. When you are sure how
this works, return the number to 0%.
12
CA06
Curriculum Manual
'Select' Controls
These look like push buttons. Click on the option you require. To practice,
point and click at 2 in the Channel Select area and see the Scale change to
show the scale for channel 2. The ON/OFF, Magnify and Shift controls for
channel 2 are now available. These behave rather like oscilloscope controls.
Change them to see their effects. Return them to Magnify = 1, Shift = 0.
1.8
Controller
Open-loop
DC-Level
50%
0%
10 msec
External
0
Plant
MS15 Analog
Graph
1 Input
ON
2 Position
ON
4 Velocity
Display
Graph
ON
Output Potentiometer
Command Potentiometer
Engage
180
13
CA06
Curriculum Manual
This table format will be used throughout this manual to indicate the initial
settings for an experiment and for changes that need to be made to existing
settings.
Set the command potentiometer to 180 and switch power ON. Nothing much
should happen. Enable the motor by clicking in the Disable box
Changing speed using the Command Potentiometer
Rotate the Command Potentiometer towards 360. The motor will start to rotate
counter-clockwise. On the screen you will see the traces move.
Channel 1/Dark Blue/Input follows the command potentiometer movement.
With the angle above 180, the drive voltage is positive and the shaft rotates
counter-clockwise.
Channel 2/Blue/Position shows the position of the output shaft. As the output
shaft position moves towards 360 on the calibrated dial, the trace moves up the
screen towards +5 volts. Near the top, the output potentiometer reaches the end
of its range then jumps to the bottom of the screen as it picks up the negative
voltage equivalent to 0 (approximately -5V).
Channel 4/Purple/Velocity follows the command input as it is changed but
lags behind any movement. This is the measurement of speed of rotation from
the Tachogenerator. It can be seen that this signal tends not to show a constant
velocity even when the command potentiometer is not being moved. This is a
characteristic of mechanical tachogenerators.
Vary the position of the command potentiometer and observe how the traces
change. As the command position goes below 180, the motor rotates in the
opposite direction and the output position ramps down before shooting up to the
top of the screen.
Stop the motor by setting the command potentiometer to 180.
14
CA06
Curriculum Manual
CA06
Curriculum Manual
Degrees at 1V
Gain Kd - degrees/volt
x Vout +
16
CA06
Curriculum Manual
1.8a
In speed control, with External input, the motor is stationary when the
command potentiometer is at:
b 90
c 180
d 270
a 0
1.8b
1.8c
Setting the Signal Generator Offset positive causes the motor to rotate:
a clockwise.
1.8d
counter-clockwise.
slow down.
17
CA06
Curriculum Manual
Student Assessment 1
1.
2.
3.
4.
5.
18
constant acceleration.
CA06
Curriculum Manual
Chapter 2
Introduction to Control Systems
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
19
2.1
CA06
Curriculum Manual
Controller
Open-loop
DC-Level
50%
0%
10 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
2 Position
OFF
4 Velocity
Display
Graph
ON
Output Potentiometer
Command Potentiometer
Disengage
180
The reference input is set to Internal which uses the internal signal generator to
drive the system.
Switch ON and enable the motor. Nothing should happen.
The Controller is set to Open-loop. This means that there is no feedback control.
20
CA06
Curriculum Manual
Input Voltage
Disable the motor then plot your results in the graph in Fig 2.1 in your workbook.
You will get a graph as shown overleaf in Fig 2.1.
It can be seen that there is not a linear relationship between input voltage and
speed. To run the motor at half speed, the input has to be set to approximately
56% of its range.
With open loop, there is no guarantee that the actual speed will equal the set
speed.
Many systems do work in open loop but it does not lead to good control.
The first objective of a control system is that the controlled output
reaches the value desired of it.
21
CA06
Curriculum Manual
22
Tacho voltage
CA06
Curriculum Manual
Not only is there a nonlinear relationship between input voltage and speed but the
speed will change depending on the load.
If the control objective is to maintain a constant velocity under changing load
conditions, then we cannot use open-loop control. A tape recorder operates under
changing load as the tape is transferred from one spool to the other. So an openloop control cannot be used to control a system subject to a changing load.
The second objective of a control system is that it maintains its
output under changing load conditions.
Minimizing Transients
The third problem with a dynamic system is the time it takes to reach the required
value from rest. We are all familiar with the comparison between cars based on the
time to go from 0 to 60 mph (or 0 to 100 kph).
Put the brake back to 0, set the Offset to 0% and the Signal to Step. Adjust the
Level until the velocity output reaches 50% (2.5V) at the end of the step period.
You are now asking the motor to reverse and seeing how long it takes the velocity
to reach its new value. Measure the time from when the input changes until the
output reaches 2V. The Time expansion controls may help you with this
measurement.
Open-loop no load transient time to 2.5V =
secs
Owing to the inertia of the motor and other factors, it takes some time for the
motor to react to a change in demand. The time it takes to make a change is called
the Transient Time.
The third objective of a control system is to reduce the transient time
to as short as possible.
23
CA06
Curriculum Manual
24
CA06
Curriculum Manual
You have seen that feedback control does work. Eventually you will understand
how it works but before you can do that you must learn how to describe the
behavior of the plant you are trying to control.
2.1a
2.1b
2.1c
2.1d
2.1e
linear.
nonlinear.
In a realistic control system, when the input is changed, the output should:
a
In a realistic control system, when the load is changed, the output should:
a
not change.
return to its previous steady state value after a short transient time.
Which of these features of a home generally does not contain a closed loop
control system:
a washing machine.
b oven.
c
refrigerator.
toaster.
25
2.2
CA06
Curriculum Manual
Plant Model
There becomes too many different entities described by the word 'system'. In this
manual the word 'Plant' is used to describe the unit that has to be controlled.
System will be reserved for the complete unit - Plant plus Controller.
All linear systems follow the same rules
In the illustrations above, you saw that the motor was characterized by how it
responded to a Step input - the Transient Response - and how it behaved after the
transient had died out - the Steady State Response.
The transient was of the motor speed in response to a change in drive voltage. If
you applied the same step signal to a resistor/capacitor network as shown in
Fig 2.2 below, you would get similar curves.
You also get similar curves if you measure the temperature after switching on an
oven or the room heating of your home. The water level in a cistern after if has
been flushed also follows this curve.
These are examples from mechanical engineering, electrical engineering,
thermodynamics and hydraulics. All linear dynamic systems obey the same rules.
Although the DC Motor is used as an example, the techniques being taught have
applications in many other disciplines such as financial systems, management
systems, learning systems and any dynamic system which can be described by the
same differential equations which describe the behavior of engineering systems.
Output Volts
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
R
Vin
Vout
= RC = 1 second
1.0
2.0
26
3.0
4.0
5.0
Time - Seconds
CA06
Curriculum Manual
Many systems are subjected to a step change in demand. Controlling the head
position of the hard disk drive in the PC you are using is such an example. For
these systems, the response in time is important.
There are other systems where the demand input is a ramp, not a step. Examples of
these systems are Satellite Tracking Aerials and Scanning Radar systems. Here we
are concerned with how the system tracks the steadily moving input in time.
For Step and Ramp inputs, the control engineer works with the Time Model of the
system, which is how the system behaves in time after the signal is applied to it.
Characterizing a system by its frequency response
There are other systems where the demand input is much more complex. Consider
the situation where a battle tank is trying to destroy a target while moving at high
speed across rough terrain. The barrel must remain steady in space. The demand
input in this case is a changing signal with no pattern to it - a Random Signal. The
actual signal cannot be specified but the frequency range of the signal can be
found and the system designed to cope with such a range of frequencies.
For Random or complex periodic signals, the control engineer works with the
Frequency Model of the system, which is how the system behaves to a range of
sine waves of different frequencies.
Developing the plant model
A control engineer needs to know how to determine both the Time and Frequency
Models of systems and how to design controllers using these models.
The usual starting point is to investigate the behavior of the basic plant and, on the
basis of the results, add whatever controller is required to improve the
performance to a satisfactory level.
Transducers and signal conditioning devices have to be added to monitor events
and produce signals suitable for manipulation. These cannot be 'perfect' and we
must always seek to minimize errors that are introduced by our instrumentation
devices but generally the dynamics of the monitoring equipment are
inconsequential in the overall system.
27
CA06
Curriculum Manual
Only a certain level of performance can be achieved. There are limits to the
current that power supplies can deliver, the torque that motors can deliver, and so
on.
Representing the system mathematically will only allow such effects to be
included if they are accounted for in the analysis and, in all cases, involve a
certain degree of compromise. During the course we will see instances where the
actual behavior of the system does not agree with that predicted because of such
effects. Initially such 'nonlinear' behavior will be ignored and only the Linear
Small Signal Model will be considered.
The Linear Small Signal Model is the behavioral description of the
system when small changes are made which do not take the system
into nonlinear operating areas.
28
CA06
Curriculum Manual
2.2a
2.2b
All linear dynamic systems obey the same rules. This means that a control
engineer:
a must know the detailed engineering of many types of system.
If you wished to determine the transient response of a plant, you would use:
If you wished to determine the random response of a plant, you would use:
29
CA06
Curriculum Manual
Student Assessment 2
1.
2.
3.
30
the output should recover to its steady state value if the load changes.
financial systems.
management systems.
all of the above and any system represented by linear differential equations.
Which of the following is not required in plant model for control purposes:
a the transient behavior.
CA06
Curriculum Manual
Chapter 3
Time Response
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
31
3.1
CA06
Curriculum Manual
Step Response
We wish to determine a model which describes the time behavior of the plant
using the 'Black Box' approach. To do this, you will ask the motor to change speed
and infer the relationship between input voltage and output speed from the way in
which the motor responds. You will be measuring the Step Response of the
motor.
Fig 3.1 shows the block diagram of the motor with the parts used for a speed
control system included within the shaded region.
Motor Shaft Motion
Loaded
Motor
Tachogenerator
Gearing
9:1
Output
Potentiometer
Power
Amplifier
Signal
Conditioning
Signal
Conditioning
Vin
Drive
Vout
Velocity
Vout
Position
E
Enable
32
Controller
Open-loop
Step
60%
0%
20 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
2 Position
OFF
4 Velocity
Display
Graph
ON
Output Potentiometer
Command Potentiometer
Disengage
180
CA06
Curriculum Manual
Disengage the output potentiometer then switch power ON and Enable the motor.
The output velocity trace (purple) on the PC shows what is called the Step
Response (what happens when there is a step change in the input).
There are two parts to any output time response when there is a change in input:
A Transient period which occurs immediately the input changes and during
which the system seems to be dominated by something other than the input.
A Steady State condition which is reached after the transient has died out. The
system seems to have settled down to the influence of the input.
The transient situation is produced by elements within the plant which cannot
respond instantly. Mass in a mechanical system and capacitance in an electrical
system both store energy so it takes time to change the velocity of a mass or to
change the voltage across a capacitor.
In the DC motor, it is the mass of the motor armature and all the disks and dials
connected to the motor shaft which require energy to get them moving or stop
them moving. Actually it is the inertia of these elements, not mass, since we are
dealing with rotating bodies.
The purple trace is the Step Response of motor speed. Observe that the speed does
become constant after a time but initially lags behind the input. Expand the time
scale by decreasing the Rate to 10msec and click the x2 time multiplier. Click
Freeze | Freeze. This freezes the display at the end of the current cycle. The
'Frozen' control box appears when the cycle ends. The motor can now be disabled
and measurements made from the screen.
You are going to measure the Gain and Time Constant which characterize the
motor. Fig 3.2 overleaf shows the measurements to be made. The measurement
facility is activated from the Frozen control box by clicking Time ON. The
measurement lines and value boxes appear on the graph.
33
secs
+5.000
Volts
Time
+0.500
CA06
Curriculum Manual
+1.000
+1.500
+2.000
Slope
Line A
T 0.225
Slope
+0.000
Amplitude
A +2.750
Line B
B -2.750
-5.000
Line T
Fig 3.2 Sketch of output showing measurements to be made
34
CA06
Curriculum Manual
Output Span
Output span is the amount by which the output changes in response to the
input changes.
Change to channel 4/Velocity/purple and repeat the measurements on the
purple trace. Line B should be positioned where the trace can be seen starting
at the left of the graph.
Output Span = A4 - B4 =
Enter these results in your workbook.
Gain
Gain, or Magnitude Ratio or Amplitude Ratio, is the ratio between input
and output when they have reached a steady state. The spans have been
measured when the output has reached a steady state so:
Gain =
Output Span A4 B4
=
=
Input Span
A1 B1
Transient Response
There are a number of ways to characterize the transient response. These come
under the general heading of 'Rise Time' but there are many different definitions of
Rise Time. You will measure three different times then we will see how these are
related.
Initial Slope Method
Make sure that lines A and B are the final and initial values of trace 4
respectively.
Click in the Slope box. The line from the beginning of the transient sloping
up to the right has changed to blue. This allows you to measure the initial
slope of the velocity trace. The slope of the line can be changed by clicking
in the graph area. The top of the line will move to the time at which you
clicked.
35
CA06
Curriculum Manual
Move the slope line until its slope is the same as that of the initial part of
the transient, such that the blue line covers the initial part of the purple
velocity trace line.
Click in the Time box. The vertical time line is highlighted.
Click where the slope line crosses line A. The time shown is the Time
Constant measured by the initial slope method.
Time Constant t1 =
seconds
The time constant can also be calculated from the time it takes the transient to
reach the final value.
Move the Time line to the time at which the velocity trace first reaches its
final value (when the purple trace reaches line A).
The time shown is 5 time constants from the start of the transient
Time Constant t2 =
seconds
63% Method
Another time measurement is the time it takes for the transient to change by
63%.
From above, the output span = A4 - B4. The 63% level is then:
B4 + 0.63 (A4 - B4) =
volts
Use the values you have measured to calculate the 63% level for your
experiment.
Click the A box to highlight Line A and move it to the 63% level. You may
not be able to set the line exactly owing to the screen resolution.
Expanding the scale using the Magnify and Shift controls may help. The
traces require to be redrawn using Freeze | Redraw option after Magnify
or Shift are changes.
Now click the Time box and move the time line to the time at which the
velocity trace reaches its 63% level. The time shown is the Time Constant
measured by the 63% method.
Time Constant t3 =
36
seconds
CA06
Curriculum Manual
t1
t2
ms
t3
ms
Input Span
ms
Output Span
volts
Gain
volts
Experience has shown us that the 63% measurement is more accurate than the
other two techniques so use t3 as the time constant in your model.
Enter your model gain and time constant into Table 3.2 in your workbook
Plant Gain Kp
Time Constant
msec
3.1a
If the input signal goes from 1 to 2 volts and the output signal goes from 5 to
10 volts, what is the system gain?
3.1e
37
3.2
CA06
Curriculum Manual
Eqn 3.1
where e is the exponential (or natural) number 2.7183... . is called the Time
Constant and, with the Gain, fully characterizes a first order lag. t1, t2 and t3 are
measured estimates of this time constant.
To check that the measured step response is an exponential, or close to it, the
computer can plot the response of an ideal curve over the measured one.
Click on Plant | Servo. The Plant has changed to a simulation of a servomotor
such as the MS15. In the top box of the plant area, set Kp equal to the gain you
have measured. In the next lower box enter the value of time constant measured
(in milliseconds) then click in the Overlay box alongside the plant area. Note that
for the overlay feature to be of use the magnify feature must be set to x1.
This will show you the measured response of the motor (purple) and the response
of an exponential (light green) having the Gain and Time Constant you have
measured. The values of gain and time constant can be changed and the graph
redrawn until you have a good fit between the experimental data and the response
of the theoretical model. The values of Gain and Time Constant set are the
parameters which can be used to model the plant.
The two traces will not be an exact match owing to nonlinearities in the
electronics and mechanics (such as deadband in the drive amplifier, or static
bearing friction) but should be close enough for you to see that the response of the
motor speed to a step input can be represented by an exponential function.
The two parameters that define the model are
Gain and Time Constant.
Gain (K) is the Steady State relationship between input and output.
Time Constant () defines the Transient Time.
38
CA06
Curriculum Manual
From Table 3.2, the control model parameters for the motor, under no
load conditions are:
Time Constant () =
Gain (K) =
seconds
3.2a
Is there an adequate match between the measured motor response and the
response of the theoretical model?
Yes or No
3.2b
3.3
Use the Windows calculator on the computer to calculate the value of the curve.
Do this at multiples of the time constant.
t
Using the keying sequence given below, calculate the values of 1 e when
+/-
Inv
Ln
+/-
This calculates [1 e 1 ]
39
CA06
Curriculum Manual
This gives the answer 0.632... . This is where the 63% figure used earlier came
from. After 1 time constant, an exponential response to a step has covered 63.2%
of its total span.
The same keying sequence, but beginning with the other time ratios shown (0, 2,
3, 4 and 5), can be used to calculate the exponential values after 0 and 2 to 5 time
constants.
t/
[1 e ]
From these figures, you can see that a step response will be at a value which is
32.8% (100 - 63.2) of its span away from its final value after 1 time constant, and
0.7% of its span away from its final value after 5 time constants. It can therefore
be assumed that the transient has died out and the response has reached its Steady
State value after 5 time constants.
There is an easier keying sequence. The first result gave us the value at the first
time constant as 0.632 = 1 - 0.368. The value at the nth time constant is 1 0.368n .
Initial Slope
One of the characteristics of an exponential is that a line drawn at the initial slope
crosses the final value of curve after one time constant. This was used as one of
the methods of measuring the time constant of the motor. It can also be used to
sketch an exponential curve without calculating lots of points along the curve.
Sketching an exponential
t
is the time multiplier so it is assumed that = 1 and the time scale is multiplied
by the time constant to give the actual time curve. This process is called
normalization.
40
CA06
Curriculum Manual
Fig 3.3 shows a sketch of the normalized exponential. Using the following
procedure, you can sketch the exponential in your workbook.
Draw a line from the starting point normalized amplitude value = 0 (at
normalized time t = 0) to value = 1 (at t = 1). This is the initial slope of the
normalized exponential curve.
Mark the 63% point (value = 0.63) at t = 1 (the curve has covered 63% of its
span, and is therefore 0.37 away from its normalized final value of 1). The
curve will pass through this point.
Draw a straight line from the 63% point (at t = 1) to normalized amplitude
value = 1 (at t = 2). This line is the final slope of the first section of the curve
(from t = 0 to t = 1) and the initial slope of the second section (from t = 1 to
t = 2).
During this second section of the curve the curve will again cover 63% of the
distance to its final value (which, with an initial value at t = 1 of 0.37 away
from its final value, gives the value at t = 2 of 0.37 x 0.37 = 0.14 away from its
final value (or normalized amplitude value of 1 - 0.14 = 0.86).
Draw a straight line from 14% at t = 2 to 1 at t = 3. This is the final slope of the
second section and the initial slope of the third section. Each section can be
treated as if it is the first section of a new exponential. By the fifth section the
changes are too small to be graphed.
1
Time
Amplitude
0.5
1 e t
41
3.3a
3.4
CA06
Curriculum Manual
A plant has a gain of 0.8 and time constant of 3 seconds. Using the normalized
sketch of a step response, determine the output response (in volts) to a 2 volt
step input after 1.5 seconds.
).
t
3.5
42
CA06
Curriculum Manual
The brake has the effect of increasing the friction. Unfreeze the display by
selecting Freeze | Start then select Plant | MS 15 Analog. Set the eddy current
brake to position 2 and repeat the gain and time constant measurements.
Unloaded gain =
Loaded gain =
=
=
ms
ms
Your results should show that both the gain and time constant are changed. Both
changes are due to increased frictional losses.
3.5a
3.6
Position Response
You may have noticed that, so far in this chapter, it is the speed that has been
measured, not position. There is a good reason for this.
With the motor disabled, engage the output potentiometer. Unfreeze then enable
the motor and click channel 2/Position/ON. This shows the position output and
does not make much sense. There are a number of difficulties in measuring the
position of the servo shaft while driving speed.
The output potentiometer only measures position over 1 revolution so, as the
dial goes through 360, the trace jumps from top to bottom (or vice versa) of
the graph.
During the transient period there may be odder looking curves as the transient
goes over the dead spot in the potentiometer.
43
CA06
Curriculum Manual
The reason for this is that position is the integral of velocity so that, with a
constant velocity, the position keeps changing. It can be difficult to measure
something that is constantly moving which is why velocity was used to identify
the plant time constant.
Although it can make identification difficult, you will see later that the integral
effect makes servo control easier.
To be able to model the plant it is necessary to know the relationship between the
velocity measured by the tachometer voltage and rate of change of position
measured by the potentiometer voltage This relationship is called the Integral
Gain Ki.
With the motor disabled, change the settings to those shown below.
File
CA06PE03
Signal Generator
Signal
Level
Offset
Rate
Reference
DC Motor
Brake
Controller
Open-loop
DC Level
60%
40%
10 msec
Internal
Plant
MS15 Analog
Graph
1 Input
ON
2 Position
ON
4 Velocity
ON
Output Potentiometer
Command Potentiometer
Display
Graph
Engage
180
Enable the motor. The motor will run at a constant speed with the potentiometer
output ramping up then returning to the bottom of the screen.
Make a note in your workbook of the velocity as shown on the red LED display.
Velocity =
rpm
Set the timebase multiplier to x2, freeze the picture and switch the time markers
ON. The graph will look like that shown in Fig 3.4.
The rate of change of position is measured by measuring the time it takes for the
position trace (blue) to go from the bottom of the screen to the top.
Select channel 2 then set Line A to +4.000 volts and Line B to -4.000 volts.
Using the Time line, measure the times at which the output ramp crosses the
two voltage markers. Enter these values into Table 3.4. of your workbook.
A B
Slope =
volts/second.
T 2 T1
44
CA06
Curriculum Manual
Select channel 4 and use a voltage line to measure the tachometer voltage Vvel.
(purple trace)
Calculate the integrator gain Ki = Slope/Vvel volts per second per volt.
secs
+5.000
Volts
0.000
0.500
1.0 00
1.500
2.000
Line A
Time
T 0.270
Vvel
Slope
+0.000
Amplitude
A +4.000
B -4.000
Line B
-5.000
T1
T2
A
Volts
+4.000
B
Volts
-4.000
T1
secs
T2
secs
Slope
volts/sec
Vvel
volts
Ki
Position is the:
45
3.6b
3.7
CA06
Curriculum Manual
Which of the following is not true - Position is not used for identification of a
servomotor because:
a the limited range of the output potentiometer makes it difficult to measure the
transient.
b it is difficult to measure the transient on top of the output ramp especially
when it crosses the dead spot of the output potentiometer.
c noise on the output makes it difficult to see the transient.
T2 secs
Vvel volts
T2-T1 secs/rev
revs/sec
revs/min
RPM
0.5
1.0
1.5
+5.000
Volts
Time
T 0.800
Vvel
Slope
+0.000
Amplitude
A +1.600
B -4.000
-5.000
T1
46
T2
Kr
CA06
Curriculum Manual
x Vvel
In Chapter 1, you have already obtained the relationship between output voltage
and degrees.
Degrees = (Kd x Vpos) + Degrees Offset =
3.7a
3.8
Determining the velocity of the output shaft by measuring the time for one
cycle gave a result which agreed with the tachogenerator output on the motor
rig.
Yes or No
Vin
Drive
Loaded Motor +
Tachogenerator
Gearing 9:1 +
Output Potentiometer
Gain Kp = 0.92
Time Const = 0.225
Integrator Gain
Ki = 10.4
Vout
Position
Vout
Velocity
3.8a
47
3.9
CA06
Curriculum Manual
3.8b
In a test, the tachogenerator produced a voltage of 3.5 volts and the integral
gain Ki was measured to be 10. What would be the expected rate of change of
the output position (in volts/second)?
3.8c
In the same test as question 3.8b, what would be the output RPM if the
conversion ratio Kr = 50?
A short sharp jab to the system. Theoretically the Impulse Response tells the
same information as the Step Response but there is so little energy in the
impulse that the plant hardly moves enough to see any response.
Unfreeze and Enable the motor. Select Signal - Pulse, Level - 100% and
Offset - 0%. Observe that the velocity does not change much and the response
is very inconsistent. It would be difficult to measure the gain and time
constant from these traces, especially if there was additional plant noise on
them.
Ramp
Many systems have to be able to follow a ramp but the open loop ramp
response is not easy to analyze. Motors tend to be nonlinear at low speed and
this distorts the measured signal.
Select Signal - Ramp, Level - 60%. A triangular shaped waveform is
generated which ramps up at a constant rate then reverses to ramp down at the
same rate. The velocity signal tries to follow the input ramp but lags behind.
There is a considerable kink in the speed curve as the motor stops then
reverses. This is due to nonlinearities - static friction in the motor and
deadband in the drive amplifier.
48
CA06
Curriculum Manual
You may have noticed that the velocity signal is not exactly constant when the
motor is asked to run at a constant rate. The signal is said to be noisy. As far as
plant signals go, the motor signals are very quiet. Real plant is often much noisier
than this. One of the problems can be to extract meaningful data out of the noise.
There are mathematical techniques that can be used for this.
If the input signal itself is normally noisy, this noise signal can be used to identify
the plant but again this involves considerable calculation.
Sometimes putting step changes into a plant is not acceptable to the plant
operators. In these cases, low level artificial noise can be introduced which will
not interfere with the plant operation but which will allow mathematical
techniques to be used to identify the plant. This technique, called Pseudo Random
Testing, is often used in the identification of slow plant where the time constant is
measured in minutes, hours or even days.
49
CA06
Curriculum Manual
Student Assessment 3
1.
c
2.
Which of the three time constant measurements would seem to be the most accurate?
a initial slope.
b 63%.
10%-90%.
3.
After how many time constants can the transient period be said to be over:
a 3.
b 4.
c 5.
d 6.
4.
Which of these signals is also used to determine the time model of a plant:
a impulse.
b ramp.
c noise.
d sinusoid.
50
CA06
Curriculum Manual
Chapter 4
Frequency Response
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
51
4.1
CA06
Curriculum Manual
4.2
Frequency Response
Sine waves are naturally occurring phenomena. Pluck a guitar string and it
vibrates sinusoidally. A 'pure' musical tone is a sinusoid. Middle C is a sinusoid
vibrating at 261.63 cycles per second. The S.I. unit is the Hertz (Hz = cycles per
second = revolutions per second) after the German physicist who first described
the concept.
It can be shown that any signal can be made up from a series of sinusoids of
different frequencies and amplitudes so that there is a definite mathematical
relationship between the frequency composition of a signal and its shape in time.
For plant identification purposes, the nice thing about a sine wave is that if you put
a sine wave into a linear 'black box', you get out a sine wave of the same
frequency but changed in amplitude and phase. Knowing the output frequency
allows the signal to be extracted from noise using tuned filters or digital filtering
techniques.
52
CA06
Curriculum Manual
Fig 4.1 shows typical input and output sinusoids to and from a black box plant.
Black Box
Plant
Input
sinewave
Output
sinewave
Phase
Lag
Time
Input
Amplitude
Output
Amplitude
The output has a different amplitude from the input and the ratio:
Output Amplitude
is called the Amplitude Ratio.
Input Amplitude
From the diagram, it can be seen that the output sinusoid lags in time behind the
input. This lag is measured in Degrees and is called the Phase Lag .
Phase Lag can be calculated from the time difference between the peak of the two
sinusoids. The Frequency of a signal (in Hertz, Hz) is the number of cycles in one
second. The Period is the time to complete 1 cycle so is the inverse of frequency:
Period (seconds) =
1
Frequency (Hz)
53
CA06
Curriculum Manual
Load setup | CA06PE04. The setup is given below. Note that the Rate has been
replaced by Frequency and that the horizontal scale of the graph is now is now in
Degrees.
File
CA06PE04
Signal Generator
Signal
Level
Offset
Freq
Reference
DC Motor
Brake
Controller
Open-loop
Sine
60%
0%
100 mHz
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
2 Position
OFF
4 Velocity
Display
Graph
ON
Output Potentiometer
Command Potentiometer
Disengage
180
54
CA06
Curriculum Manual
Select Phase D by clicking in the D box. Move the vertical line until it
intersects with the peak value. The reading in the box is the phase shift relative
to 0 of the input trace. As you are measuring the phase shift at the peak, the
phase lag will be the measured value minus 90.
Input Amplitude = 6.0 Volts peak-to-peak
Frequency
Output
(Volts p-p)
Phase Lag
(Degrees)
Amplitude Ratio
A
Amplitude
Ratio
20log10A (dB)
10 mHz
20 mHz
50 mHz
100 mHz
200 mHz
500 mHz
1 Hz
2 Hz
5 Hz
10 Hz
Table 4.1 Frequency Response Test
The Amplitude Ratio is the ratio of Input to Output volts at any particular
frequency.
These results may be plotted in a number of different ways but, for our purposes,
the most useful is the BODE PLOT where the amplitude ratio and phase are
plotted separately against log frequency. For reasons that will be explained later in
this section, it is the logarithm of the amplitude ratio which is used, not the
amplitude ratio itself. The amplitude ratio is converted into decibels (dB) by the
formula:
V
Amplitude Ratio (dB) = 20 log10 out
Vin
Calculate the Amplitude Ratio in dB and enter this into your table. This table can
now be used to draw the Bode Plot. Fig 4.2 is the Bode plot of the results in
Table 4.1.
Preprinted Log/Linear graph paper can be obtained from technical stationers. A
blank graph sheet is provided in your workbook for you to plot your results.
55
0.01
CA06
Curriculum Manual
0.7 0.78
1.0
0.1
Frequency (Hz)
10
0
Ampl
db
-3db
Slope
-20dB/decade
-10
-20
0.70
-45
Amplitude Ratio
At low frequency, the Amplitude Ratio is the Gain (Kp) of the plant. At high
frequency, the Amplitude Ratio drops linearly on the graph. The straight line
actually drops at a rate of -20 dB/decade, such that every time the frequency
increases by a factor of 10, the amplitude drops by 20 dB. On your graph, draw a
straight line with this slope as a best fit to the high frequency section of the
measured curve. This line is shown dashed in Fig 4.2. It is only on a Bode plot that
the curve at high frequency becomes a straight line making it easy to determine
the slope.
56
CA06
Curriculum Manual
Also, draw a horizontal line to extend the low frequency part of the curve to
higher frequencies. The frequency at which these two lines meet is called the Cutoff Frequency or Break Frequency. At the break frequency, the actual curve
should be 3 dB below the low frequency level.
A first order lag is characterized, in frequency, by its low frequency
gain and its cut-off frequency.
Phase Response
At low frequency, there is no phase shift. At high frequency, the Phase tends
towards -90 (90 lag).
At the Break Frequency the phase is at -45.
Finding the Break Frequency
The frequency at which these two lines meet is the break frequency.
Adjust the lines if necessary to ensure that the actual amplitude curve is at
3 dB and the phase shift is -45 at the break frequency.
From the Bode plot in Fig 4.2, the break frequency has been determined by the
three techniques. Enter your values into Table 4.2 in your workbook and calculate
the average of the three readings.
From slope
Hz
From -3 dB point
Hz
Average
From -45
Hz
Hz
Radian Frequency
So far the frequency has been stated in Hz or Cycles/second. There is another
measure of frequency called Radian Frequency. Radians are an angular
measurement and there are 2 radians per cycle, such that 2 radians are
equivalent to 360. Radian Frequency has the symbol , where = 2 f , and has
dimensions radians/second.
57
CA06
Curriculum Manual
1
1
1
or Time Constant =
=
c 2 f c
Gain Kp
Time Constant
Time
Frequency
Table 4.3 Comparison of Time and Frequency Tests
4.2a
4.2b
58
CA06
Curriculum Manual
4.2c
4.2d
Which of the following is not true. The cut-off frequency of a 1st order lag is
the frequency at which:
a the amplitude ratio is 3 dB below its low frequency value.
b the phase lags by 45.
c the gain is 1.
d the high frequency slope of the amplitude ratio intersects the low frequency
value.
4.2e
4.3
Do the frequency and time models obtained agree reasonably with each
other?
Yes or No
59
CA06
Curriculum Manual
0.01
1.0
Frequency (Hz)
10
0
Ampl
db
-10
-20
measured
theoretical
For the mathematically minded, the frequency response curves are described by
the equations:
Amplitude Ratio =
Gain
1+
c
and Phase = arctan
c
4.3a
60
CA06
Curriculum Manual
4.4
4.4a
4.5
61
CA06
Curriculum Manual
Student Assessment 4
1.
If a plant has a measured cut-off frequency of 2 Hz, what is the time constant of this
plant (in seconds)?
a
2.
0.08
d 0.10
10 dB
20 dB
-10 dB
d -20 dB
10 dB/decade
20 dB/decade
-10 dB/decade
d -20 dB/decade
57.3
60
d 90
62
0.06
The slope of the amplitude response of a first order lag at high frequency is:
a
4.
The input signal is 5 volts p/p and the output is 0.5 volts p/p. What is the amplitude
ratio in decibels?
a
3.
0.04
45
CA06
Curriculum Manual
Chapter 5
Principles of Feedback
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
63
5.1
CA06
Curriculum Manual
Introduction to Feedback
So far you have been measuring the characteristics of the plant without control
applied. Now we shall see the effect of adding feedback.
Fig 5.1 is the block diagram of a general control system.
Reference
Error
Input
Controller
Plant
Controlled
Output
C
F
Reference
Feedback
Error
Input
Drive
E=R-F
F
Feedback
5.1a
The plant drive is created by passing the error signal through the:
a feedback block.
b controller block.
c plant block.
64
CA06
Curriculum Manual
5.1b
The error signal is created by comparing the input signal with the:
b drive signal.
a feedback signal.
c output signal.
5.2
Transfer Function
To be able to analyze such a system, it is necessary to know the characteristics of
each of the elements in the system. You have already seen how to measure the
characteristics of the plant and the job of the control engineer is to decide on the
characteristics of the controller and the feedback. A formal method of describing
these elements and manipulating them is required.
The term Transfer Function is used to describe the relationship between the input
and the output of a block and is usually denoted by the symbol G.
Transfer Function G =
Output
Input
or
Output = G Input
Transfer Functions can be equations in time or frequency but all that is of concern
at the moment is that the output can be calculated if the transfer function and input
are known.
Blocks described by transfer functions can be connected in series (one after the
other) as shown in Fig 5.2. The output of the first block is input to the second
block, creating a series connection of the two blocks.
G2
G1
G1 X G2
65
CA06
Curriculum Manual
If two blocks are in parallel, such that both have the same input and their outputs
are summed together, then a parallel connection results, as shown in Fig 5.3.
G1
R
C
G2
G1 + G2
66
CA06
Curriculum Manual
5.3
5.2a
If two blocks G1 and G2 are in series, the overall block is represented by:
b G1 x G2
c G1 - G2
d G1 / G2
a G1 + G2
5.2b
If two blocks G1 and G2 are in parallel, the overall block is represented by:
a G1 + G2
b G1 x G2
c G1 - G2
d G1 / G2
Error
Controller
Drive
Plant
G
Controlled
Output
Feedback
H
Fig 5.4 Block Diagram of a General Control System
Studying Fig 5.4 and applying the rules of block combination, it can be seen that:
Output ( C) = K G Error ( E )
C = K . G. E
Eqn 5.1
and that:
Error ( E ) = Input ( R ) H Output ( C)
E = R ( H C) Eqn 5.2
Manipulate this to get the Output(C) on one side and Input(R) on the other:
67
C + K . G. H. C = K . G. R
CA06
Curriculum Manual
C( 1 + K . G . H ) = K . G . R
C=
K.G
R
1 + K . G. H
Bring the input over to the left to give the Closed Loop Transfer Function (CLTF):
Output C
K.G
=
=
Input
R 1 + K . G. H
Eqn 5.3
K.G is called the Forward Loop Transfer Function (FLTF) and K.G.H is
called the Open Loop Transfer Function (OLTF). The Closed Loop Transfer
Function can then be written as:
CLTF =
FLTF
, or, in words:
1 + OLTF
Forward Loop
Closed Loop
Transfer Function
Transfer Function
Open Loop
1+
Transfer Function
Knowing values for the plant, feedback and controller transfer functions, this
equation allows us to predict how the closed loop control system will behave.
5.4
E = R H. C = R H. K . G. E
E + K . G . H . E = R E(1 + K . G . H ) = R
68
E
1
=
R 1 + K . G. H
Eqn 5.4
CA06
Curriculum Manual
5.5
C
K.G
=
R 1 + K . G. H
For Steady State performance we do not need to consider the dynamic effects so
each of the transfer functions can be represented by its gain. Transient
performance will be considered in Section 5.7. Dividing top and bottom by KG
gives:
C
=
R
Eqn 5.5
1
+H
K.G
or
Output = Input
If only it were so easy. There are two difficulties to just increasing the gain. One is
the transient effects which will be considered later and the other is noise in the
measurement. As you may have noticed, the velocity measurement available from
the tachometer tends to be noisy. If the gain is high, this noise is amplified and
affects the performance of the motor.
Lets observe this in practice.
69
CA06
Curriculum Manual
Signal
Generator
Reference
Input
Error
Internal
Controller
Drive
Controlled
Output
Plant
Motor + Tacho
Gain K
Gain Kp
Time Const p
Velocity
Computer
Bench
The circuit is arranged so that the voltage from the tachometer (measuring motor
velocity) is compared with the demanded velocity from the signal generator. The
difference between these two signals, the error, is amplified and used to drive the
motor.
Note: so far we have used speed and velocity as being interchangeable. To be
exact, speed is a scalar quantity with magnitude only (such as 100 rpm), whereas
velocity is a vector quantity with magnitude and direction (such as 100 rpm
clockwise).
Start VCL software and Load setup | CA06PE05. The on-screen mimic should be
compared with Fig 5.5. The Input signal is trace 1 (dark blue), the output velocity
is trace 4 (purple), Error is trace 3 (dark green) and Drive is trace 5 (brown). The
mimic shows where these measurements are made.
File
CA06PE05
Signal Generator
Signal
Level
Offset
Rate
Reference
DC Motor
Brake
70
Controller
Proportional
DC-Level
0%
50%
10 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
3 Error
4 Velocity
Display
Graph
5 Drive
ON
ON
Output Potentiometer
Command Potentiometer
Disengage
180
ON
CA06
Curriculum Manual
In Chapter 3, the gain Kp of the motor was found. Substituting Kp for G gives the
forward loop gain K.G = K.Kp. The velocity voltage is fed back directly so H = 1.
In this case, the Closed Loop Transfer Function can be written as:
CLTF =
C
K . Kp
=
R 1 + K . Kp
Eqn 5.6
1
E
=
R 1 + K . Kp
Eqn 5.7
Check that the gain K in the gain box on the on-screen mimic is set to 1 and
switch ON the motor. Investigate how the error decreases as the gain is increased.
With the Reference Velocity set to 2.5 volts (50%), measure the Output Velocity
and Error as the gain is increased. Make these measurements for the values of gain
shown in Table 5.1 and enter the results in your workbook. If the motor starts to
make a lot of noise at high gain, abandon the high gain settings as this could
damage the motor.
Input Voltage, R = 2.5 volts, Plant gain Kp =
Gain K
Velocity
(Volts)
C/R
C/R
Theory
Error
(Volts)
E/R
E/R
Theory
Comment
1
2
5
10
20
50
100
Table 5.1 Accuracy as gain is increased.
71
CA06
Curriculum Manual
Observation of the Drive signal should show that this signal gets noisier as the
gain increases - all of the tacho measurement noise is being amplified. This noise
is not good for the motor.
5.5a
5.6
Closing the loop decreases the sensitivity to changes within the plant.
The system is said to be stiffer.
Speed control was the problem which was solved by the first control device.
James Watt was using his new steam engines to power factories. As the belt driven
machines were engaged or disengaged from the engine, the speed changed
resulting in poor quality product. In 1788 he developed the 'Flying Ball' Governor
to regulate the speed of the engines. As the speed dropped, the steam valve was
opened. As the speed increased the valve was closed. The Flying Ball Governor is
a mechanical proportional controller and models are still in use today.
5.6a
72
increase.
CA06
Curriculum Manual
5.7
tp
Eqn 5.8
1 + K.K p
As the controller gain is increased, the time constant falls leading to a speeding up
of the system. Why should this be so since the inertia and friction of the motor
have not changed? Consider Fig 5.6:
3
2
1
0
4
5
Time - seconds
Fig 5.6 Exponential Curves With The Same Time Constant But Different Amplitudes
The two exponential curves shown have the same time constant but are of
different amplitude. There is a 3:1 ratio in amplitude. Since the larger curve has to
cover 3 times the distance in the same time, initially it must be moving 3 times
faster than the smaller curve.
In a feedback system, it is the error amplified which provides the drive. Initially
the error is the size of the step change and this is amplified so there is a large
signal to drive the motor pumping more energy into the system. That is the theory.
In practice it does not quite work out that way.
73
CA06
Curriculum Manual
File
CA06PE05
Signal Generator
Signal
Level
Offset
Rate
Reference
DC Motor
Brake
Controller
Proportional
Step
20%
0%
10 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
3 Error
4 Velocity
Display
Graph
5 Drive
ON
ON
ON
Output Potentiometer
Command Potentiometer
Disengage
180
Using your measured value for gain Kp and time constant p from Chapter 3,
calculate the expected time constant cl at each of the gains in Table 5.2 using
Equation 5.5. Measure the actual time constant using the same technique that was
used in Chapter 3 to measure time constants and enter the theoretical and
experimental values into your workbook.
To help, the Time control should be set to x8 and the Magnify control to 5 on
channel 4. Owing to the static friction, it is not easy to measure the time constant
with K = 1 so, for this measurement only, set the Level to 40%.
Kp =
Gain K
1
2
3
4
5
10
p =
Theoretical Time Constant
seconds
Measured Time Constant
For K = 1 3, the value for time constant follows the theory, i.e. increasing the
gain decreases the time constant. However, above K = 3, the theory falls down as
the time constant does not decrease in proportion to the increase in gain. The time
constant with K = 10 should be approximately 1/5th of that with K = 1. Why is it
not?
74
CA06
Curriculum Manual
Set K = 10 and look at the Drive signal - the brown trace. When the step occurs,
the initial error is 2V. The drive, theoretically, should be K x Error = 20V. But the
maximum drive signal available is only 5V so the system saturates. Much less
power than expected is being fed to the motor so the transient time does not
decrease as expected. Once the drive saturates, the rise time of the transient
becomes almost constant.
This is one of the practical nonlinear effects which was mentioned earlier.
5.7a
As the controller gain is increased, would you expect the steady state error to:
a increase.
b stay the same.
c decrease.
5.7b
5.7c
drive saturation.
5.7d
As the controller gain is increased, would you expect the closed loop time
constant to:
a increase.
b stay the same.
c decrease.
5.7e
Did the measured closed loop time constant behave as expected (decreasing
steadily until saturation is reached) over the range of gains measured?
Yes or No
75
5.7f
5.8
CA06
Curriculum Manual
Using your measured values for plant gain Kp and time constant p, calculate
the gain K necessary for a closed loop time constant of 75 ms.
File
CA06PE05
Signal Generator
Signal
Level
Offset
Freq
Reference
DC Motor
Brake
Controller
Proportional
Sine
20%
0%
1 Hz
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
3 Error
4 Velocity
Display
Graph
5 Drive
ON
ON
ON
Output Potentiometer
Command Potentiometer
Disengage
180
Measure the phase lag of the output at the three gain settings shown in Table 5.3
and enter the values your workbook. Compare this figure with the open loop phase
lag at this frequency as measured in Chapter 4.
Open loop phase lag at 1 Hz
Closed loop phase lag at 1 Hz
K=1
K=5
K = 10
Table 5.3 Closed Loop Phase Lag
76
CA06
Curriculum Manual
The phase lag has reduced indicating that the break frequency does increase with
increasing gain. This time the increase continues as the gain increases. If you
observe the drive signal you will see that, even at a gain of 10, it is not saturating.
Because the input signal does not have steps in it, the error is never too great and
the system stays within the linear region.
5.8a
5.9
77
CA06
Curriculum Manual
Student Assessment 5
1.
error.
2.
A plant consists of two blocks in series. They have gains of 10 and 2. Is the overall gain
of the plant:
a 2
b 10
c 12
d 20
3.
A plant consisting of a single lag with a gain of 12 has closed loop control with unity
feedback and a controller gain of 1.5. If the input is 2 volts, is the output voltage:
a 1.8
b 1.9
c 2.0
d 25
4.
Which of the following causes the closed loop time constant not to decrease as the gain
increases:
a experimental error.
b drive saturation.
c
5.
78
amplifier deadband.
slow computer.
CA06
Curriculum Manual
Chapter 6
Proportional Position Control
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
79
6.1
CA06
Curriculum Manual
Introduction to Servomechanisms
Position control using a DC motor is one of the major applications of control.
Many of the control solutions were developed for this type of problem - mainly to
do with the aiming of artillery weapons by the military. There are many more
peaceful applications for this type of control. The DC motor is also called a
Servomotor and this branch of control is called Servomechanisms.
Fig 6.1 shows a sketch of the test system we have. Fig 6.2 is the block diagram of
the system.
Input
Position
Input
Voltage
DC
Motor
Drive
Controller
Output
Position
9:1
Gearbox
Velocity Feedback
Velocity
Voltage
Output
Voltage
Tacho
Position Feedback
Fig 6.1 Sketch of a Simple Servo Controller
Reference
Input
Signal
Generator
Error
Controller
Gain Kc
Velocity
Kv
Drive
Controlled
Output
Plant
Motor +
Gearbox
Tacho
Position
Computer
Fig 6.2 Block Diagram of a Servo System
80
Bench
CA06
Curriculum Manual
In its simplest type of application, the artillery operator turns one dial to rotate the
weapon barrel to point in the required horizontal direction, and another dial to
elevate the barrel to point at the required vertical angle to the horizon. When the
barrel is positioned correctly, the artillery weapon is fired. It important to get the
weapon on target as quickly as possible.
Proportional Position Control
We will investigate the behavior of a position control system with proportional
control.
Start VCL software and Load setup | CA06PE06.
File
CA06PE06
Signal Generator
Signal
Level
Offset
Rate
Reference
DC Motor
Brake
Controller
Servo
Step
20%
0%
10 msec
External
0
Plant
MS15 Analog
Graph
1 Input
2 Position
3 Error
4 Velocity
Display
Graph
ON
ON
OFF
OFF
Output Potentiometer
Command Potentiometer
5 Drive
OFF
Engage
180
Check that controller gain Kc is set to 0.8 and VFB (Velocity Feedback) is Off.
The additional feedback control box labeled VFB is not active during this
investigation. Make sure that the output potentiometer is engaged then switch
power ON.
To illustrate that this is a position servo, rotate the Command Potentiometer
between 30 and 300 and watch the output dial follow, albeit rather sluggishly.
Increase Kc to 5 and turn the input dial again. This time the output dial moves
much faster but wobbles (oscillates) around before it settles to a steady value.
Somewhere between these two gains there may be an optimum setting.
You can see the behavior of the system on the screen. Trace 1 (dark blue) is the
input position and trace 2 (blue) is the output position. The other 3 traces, Error,
Velocity and Drive, are available for other parts of the exercise but are currently
Off.
81
CA06
Curriculum Manual
Change the Reference Input to Internal. The signal generator should be set to
Step 20%. You will see the step response of the closed loop position system on
the blue trace. With Kc = 5, this oscillatory response is different to anything
observed with the proportional speed control system examined in the last chapter.
6.1a
When the gain is low, which of the following best describes the movement of
the output potentiometer as it tries to follow the input disk?
a Sluggish.
b Swift with no oscillations.
c Swift with a lot of oscillation.
6.1b
When the gain is high, which of the following best describes the movement of
the output potentiometer as it tries to follow the input disk?
a Sluggish.
b Swift with no oscillations.
c Swift with a lot of oscillation.
6.2
1
1
+1
K.G
A high gain is required to give a closed loop transfer function of 1. But, from the
observations just made, it would appear that C/R = 1 with a low value of gain Kc.
Why is this so? The answer lies in the integration effect between velocity and
position. At any steady velocity, after an infinite time you will have traveled an
infinite distance so we can say that the steady state gain of an integrator is infinite.
82
CA06
Curriculum Manual
The effect of the integral can be looked at in another way. Any position error will
drive the motor. The feedback ensures that the motor will be driven to reduce that
error. The motor will stop turning when there is no error.
This can be explained diagramatically. Examine Fig 6.3. When the error, and
hence velocity, is a steady value the position will be a ramp - ignoring the
transient lag effects of the motor. Position is the integral of velocity, or in other
words the sum of all the velocities over a time.
Voltage
Velocity
Position
= integral of velocity
Time
Fig 6.3 Signals Within the System
You can see what happens to the motor if you look at little time slices of the
signal. This is shown in Fig 6.4. When the step is applied, there is a large error so
the motor runs at high speed and the position ramps up quickly. At the end of the
first period, the output has moved towards the input so the error is reduced and the
motor now runs more slowly. The position also changes more slowly. At the end
of each period, the motor is running more slowly and the position is changing
more slowly but it will eventually get to where we cannot distinguish the output
position from the input position.
83
Voltage
CA06
Curriculum Manual
Required Position
Position
Error
Time
Fig 6.4 Position Response to a Step
Set Kc = 0.8 and you will see the position (channel 2) and error (channel 3) behave
in the way described although the traces are much smoother.
For speed control, the motor could be described by its gain and time constant.
Because position is the integral of velocity, in position control systems the motor
is described by its gain, its time constant and an integration effect.
A position type control system (one with an integration effect in the
forward path) will have no steady state error to a steady position
input.
At low gain, the steady state error may not have been zero. This is due to practical
considerations. If you look back at Fig 2.1 in your workbook, you will see that a
small drive voltage is required before the motor will move. This, and static friction
in the bearings, can cause a small steady state error when the gain is low.
6.2a
84
Except when the gain is very low, did the output always reach the steady state
value set?
Yes or No
CA06
Curriculum Manual
6.3
Transient Behavior
Compared with the speed control system, having the additional integration effect
between velocity and position eliminates the steady state error. However, the
integration does create problems with the transient behavior.
Increase Kc to 3 and you will see the problem. Although the steady state value is
reached, eventually, there is a lot of trouble getting there. If you were on a lift and
it oscillated like this, you would not be very pleased.
We could just leave the gain at 0.8 but this would not give the speediest response.
In Fig 6.3, the effects of the motor lag were ignored. This is adequate at low gain
but not when the gain is increased. Including the lag effect gives signals as in
Fig 6.5.
Velocity
Position
Lag
Straight line approximation
Time
Fig 6.5 Signals within the System including the effect of the motor lag
When the step is applied, there is a delay before the motor reaches the speed
demanded. This causes the position to lag behind the ideal signal. If this lag is
added to the linear approximation, the response shown in Fig 6.6 results.
85
CA06
Curriculum Manual
Position
Required Position
Error
Time
Within each time slice, the change in position is lagging behind the signal driving
the velocity.
When the error signal reaches zero telling the motor to stop, the motor runs on
beyond the required position owing to its inertial lag. The motor then has to be
reversed to allow the position potentiometer to reach the required position. The lag
tends to make the system less stable.
The servo system with only proportional control can give an adequate response
but, with only one control, a system can be designed for a particular speed of
response or for a particular degree of oscillation.
6.3a
86
CA06
Curriculum Manual
6.4
6.5
6.4a
Is it the case that increasing the load by applying the brake has no affect on
the steady state performance:
Yes or No
6.4b
Increasing the load by applying the brake makes the transient response:
a more sluggish.
b
more oscillatory.
Summary
Position control adds an integration effect into the system. This gives excellent
steady state performance but the gain setting can give a variety of transient
responses - ranging from the sluggish to the oscillatory - depending on the load.
An understanding of the oscillatory performance is required before ways of
increasing the speed of response without causing oscillations can be introduced.
87
CA06
Curriculum Manual
Student Assessment 6
1.
2.
3.
88
Which of the following is not true. In a position control system, the steady state position
error is zero because:
a the low frequency gain of an integrator is high.
b
the output voltage is added to the input voltage to create the motor drive.
Compared to an open loop system, closing the loop under changing load conditions:
a has no affect.
b
CA06
Curriculum Manual
Chapter 7
Behavior of Second Order Systems
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
89
7.1
CA06
Curriculum Manual
1
c
Output
b
a - low gain
90
Time
CA06
Curriculum Manual
When the gain is low, the response is sluggish and is said to be Overdamped. An
overdamped response is characterized by two separate time constants.
Curve b shows the fastest response this system can have without any oscillation.
This response is said to be Critically Damped. A critically damped response is
characterized by two time constants both of the same value.
With higher gain, the response overshoots and oscillates. This type of response is
said to be Underdamped. An underdamped response cannot be characterized by
time constants. Mathematically it is described by a decaying sinusoid.
Examining Fig 7.1, the "best" response would appear to be somewhere between
curves b and c. Before we can predict the gain necessary to give a specified
response, we need to know how to describe the behavior of a second order system.
Underdamped systems are often described by the amount the response overshoots
and by the frequency at which it oscillates.
There are two other parameters used to describe second order systems - Damping
Factor and Natural Frequency of Oscillation.
To be able to predict the overshoot and frequency of oscillation of a closed loop
system, we must develop how the different parameters are related to the gain and
time constant of the plant being controlled.
7.1a
7.1b
critically damped.
slightly underdamped.
very underdamped.
91
7.1c
7.1d
7.2
CA06
Curriculum Manual
Peak
Change
1
Steady State
Change
Output
Period Td
0.5
Time to 1st peak Tp
Rise Time Tr
0
92
Time
CA06
Curriculum Manual
1+
ln(overshoot ratio)
overshoot ratio = e
1 2
Eqn 7.1a
% overshoot = 100 e
1 2
Eqn 7.1b
93
CA06
Curriculum Manual
To save lots of calculation, this relationship has been graphed in Fig 7.3. Fig 7.3b
depicts the region of most interest to control engineers.
% Overshoot
100
90
80
70
60
50
40
30
20
10
0
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
10
8
6
4
2
0
0.6
0.7
0.8
Damping Factor
Damping Factor
(a)
(b)
0.9
7.2a
7.2b
94
d < 0.7
7.2c
7.2d
CA06
Curriculum Manual
7.3
fd =
1
Td
d = 2 f d =
2
where Td is the period of the oscillation.
Td
The time to the first peak, Tp, is half the period. The damped frequency can then
be found by measuring the time to the first peak:
d =
Tp
Natural Frequency
If there was no damping at all ( = 0), the system would continuously oscillate at a
frequency which is called the Natural Frequency of the system. This is given the
symbol n. The relationship between Natural and Damped frequencies is:
n =
Eqn 7.2a
1 2
d = n 1 2
Eqn 7.2b
It can be seen from Fig 7.1 that d increases as the gain increases, which means
that increasing the gain makes the system work faster but at the expense of
increasing the overshoot.
7.3a
The natural frequency is the frequency at which the system will oscillate
when:
a >1
b =1
<1
d =0
95
7.4
CA06
Curriculum Manual
Reference
Input
Signal
Generator
Error
Controller
Drive
Gain Kc
Loaded Motor
+ Tachogenerator
Gain Kp
Time Const
Cutoff
frequency c
Gearing 9:1 +
Output
Potentiometer
Integrator Gain Ki
Velocity
Position
The two parameters describing the system are Gain (Kp x Ki) and Time Constant
. The time constant can also be stated as its inverse, the cut-off frequency c. The
proportional gain in the controller must also be considered so the forward loop
gain of the servo system is K = Kc x Kp x Ki.
Damping Factor
96
Eqn 7.3
CA06
Curriculum Manual
When K >
With K <
For the best response, such that 0.7 < < 1, set K to between
and c .
2
4
5
4 K c 1 10
5
40 K c
1
Kc =
= 0.255
8 0.49
0.49 =
Knowing the model of the plant, the controller gain can be used to set the
overshoot of the closed loop system.
Natural Frequency
Eqn 7.4
Eqn 7.5
2c
4
97
CA06
Curriculum Manual
Tp =
25
= 12.75 6.25 = 6.5 = 2.53 rad/sec
4
=
= 1.24secs
w d 2.53
Since c is fixed by the motor and the other system mechanics, the gain Kc is the
only control variable in proportional control. Varying Kc affects both d and .
Using only proportional gain control, we can design for a particular overshoot or a
particular time to first peak but not both. Additional techniques will be introduced
in the next chapter which will allow both d and to be controlled.
7.4a
7.4b
7.5
a K< c
b K= c
4
4
>K> c
2
4
K<
c
2
98
CA06
Curriculum Manual
Controller
Servo
Plant
MS15 Analog
Graph
1 Input
2 Position
3 Error
4 Velocity
Step
30%
0%
10 msec
Internal
Display
Graph
ON
ON
OFF
OFF
5 Drive
Engage
180
Output Potentiometer
Command Potentiometer
ON
Set the gain Kc to 1.5. and Kv to 0 (VFB is not used in this exercise).
Switch On and, when a complete graph has been drawn, freeze the traces and
enable the Time markers.
Using the markers, measure the steady state output change and the peak output
change. This allows the overshoot to be calculated.
Obtain the damping factor from Fig 7.3.
Measure the time to first peak.
Calculate the damped frequency d and then the natural frequency n.
Enter these values in Table 7.1 in your workbook
Gain Kc
1.5
Overshoot
Tp seconds
d rad/sec
n rad/sec
Using the model obtained in Chapters 3 and 4, calculate the expected values for
damping factor and natural frequency with Kc = 1.5. Enter the values into
Table 7.2.
Kc
1.5
Kp
Ki
c rad/sec
n rad/sec
Table 7.2 Calculated values for Damping Factor and Natural Frequency
99
CA06
Curriculum Manual
These results are in good agreement considering the nonlinearities within the drive
motor and experimental error in this experiment and those used to determine the
plant parameters.
7.5a
7.5b
7.6
Compared with the calculated values, were the experimental values for
damping factor and natural frequency:
a almost exactly correct.
reasonably close.
nowhere near.
Which of the following would not contribute to errors between calculated and
measured values for damping factor and natural frequency:
a nonlinearities in the drive amplifier.
computer error.
Fig 7.2 shows the step response of a second order system with the time to first
peak and the overshoot marked.
So far the time response has been described by Tp, the time to first peak. With
small overshoots this time can be difficult to measure so Rise Time, Tr, is used
instead. In this context, Rise Time is the time it takes for the step response to reach
its final value for the first time. Obviously this only has meaning if there is an
overshoot. Rise time is dependent on both damped frequency and damping factor.
For a given damping factor, rise time is proportional to the inverse of damped
frequency, which gives:
Tr
100
1
d
CA06
Curriculum Manual
Decay Time
Another characteristic of the response which has not been discussed is the time it
takes for the oscillation to die away. This is called the Decay Time. This is an
exponential with time constant d = n .
Fig 7.5 shows a number of step responses with the same n and different values of
. These curves can be used to estimate a step response when the parameters are
known.
=0.1
=0.25
=0.5
=0.7
=1
=2
n =1
Fig 7.5 Second Order Step Response for Various Damping Factors
101
7.7
CA06
Curriculum Manual
Gain
dB
-20
-40
slope:
-40dB/decade
n=1
-60
0
Phase
-90
-180
0.01
0.1
1.0
10
Frequency
Fig 7.6 Second Order frequency Response
102
100
CA06
Curriculum Manual
At high frequencies the amplitude drops at -40 dB/decade along a line which
crosses the 0 dB axis at n.
The phase change when = n is -90 and tends to -180 at high frequency.
It can be seen from these graphs that knowing n and allows the closed loop
frequency response to be drawn.
7.7a
The slope of the 2nd order frequency response at high frequencies cuts the
0 dB line at the:
a cutoff frequency c.
b damped frequency d.
7.8
natural frequency n.
d resonant frequency r.
Summary
Second order servo systems can be described in terms of their Damping Factor
and Natural Frequency n but specified values of both cannot be achieved with
just proportional control.
103
CA06
Curriculum Manual
Student Assessment 7
1.
The frequency of oscillation of a 2nd order response to a step input is called the:
a cutoff frequency c.
b damped frequency d.
c
2.
c
3.
resonant frequency r.
damped frequency d.
resonant frequency r.
0.105 rad/sec.
0.42 rad/sec.
The high frequency slope of the 2nd order frequency response is:
a -10 dB/decade.
b -20 dB/decade.
104
natural frequency n.
c
4.
natural frequency n.
-30 dB/decade.
-40 dB/decade.
CA06
Curriculum Manual
Chapter 8
Position Control with Velocity Feedback
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
105
8.1
CA06
Curriculum Manual
Velocity Feedback
In Chapter 7 it was shown that a system can be characterized by its Natural
Frequency n and its Damping Factor .
The natural frequency n is a measure of the speed of response of the system, the
time to first peak being dependent mainly on n. The damping factor is an
indication of how oscillatory the system is. It was also shown that, in a closed loop
system, the proportional gain affected both n and . Increasing gain makes the
system respond faster but also makes it more oscillatory. This results in greater
overshoot and longer settling time.
What is required is a scheme whereby the proportional gain can be increased to
speed up the system and another control introduced to increase the damping.
The additional control added is called Velocity Feedback (VFB). In the early
days of electromechanical servo systems, it was easy to introduce velocity
feedback as a voltage proportional to rotational velocity can be obtained from the
signals associated with an electric motor. Nowadays a separate tachogenerator is
more likely to be used to generate the velocity signal.
Reference
Input
Signal
Generator
Error
Controller
Gain Kc
Loaded
+
Motor
+ Output
Potentiometer
Integrator
Gain Kp
Time Const
Cutoff c
Velocity Feedback
Kv
106
Controlled
Output
Drive
Gain Ki
Position
Velocity
CA06
Curriculum Manual
To influence the damping factor, the apparent time constant of the motor must be
changed. In section 5.7 it was found that increasing the gain of the speed
controller did reduce the time constant. Velocity Feedback uses this fact to
produce an inner control loop with Kv being a time constant adjustment
independent of the proportional gain. The block diagram of this is shown in Figure
8.1.
Start VCL and load CA06PE08. The setup will be:
File
CA06PE08
Signal Generator
Signal
Level
Offset
Rate
Reference
DC Motor
Brake
Controller
Servo
Step
10%
0%
10 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
2 Position
3 Error
4 Velocity
Display
Graph
ON
ON
OFF
ON
Output Potentiometer
Command Potentiometer
5 Drive
ON
Engage
180
Switch on the system. The Gain Kc should be set to 2.5 and the Velocity Feedback
Kv to 0 (Off). The Magnify control of the input and position traces have been set
to 5.
The system is very underdamped. Observe that the drive signal (brown) does not
go negative to brake movement until the position (blue) has gone above the input
(dark blue). Selecting Time x4 will make this more obvious.
Now add Velocity Feedback by setting Kv to 1.00. The oscillations have been
reduced. Observe that the drive now goes negative to brake the motor well before
the output reaches its final value.
Increase Kv to 2.00. Braking now starts even earlier. Velocity Feedback has
stabilized the system.
Adjust Kv until there is just a small overshoot and note the value in your
workbook. This is usually considered the 'best' or 'optimal' setting for a particular
gain.
Velocity Feedback for optimum setting Kv =
107
8.1a
8.2
CA06
Curriculum Manual
a small overshoot.
no overshoot whatsoever.
K , i.e. if
Using the x2, x4 or x8 time expansion controls will allow the rise times to be
measured more accurately.
Set the gain to each of the values shown in Table 8.1. For each gain adjust Kv to
give the same overshoot. Measure the rise time, calculate the expected rise time
(using the Kc = 2.5 values and 1 K proportionality) and enter the values into
your workbook.
Gain Kc
2.5
10
VFB Kv
Rise Time Tr seconds
Expected Rise Time
Table 8.1 Rise Time vs Gain
For a gain of 5, the Rise Time should agree with that expected but with a gain of
10 it may be higher than expected owing to drive saturation.
108
CA06
Curriculum Manual
However, owing to drive saturation, high gain will make the response to large
changes differ from that to small changes. The gain and velocity feedback have to
be optimized for the most important type of signal.
Having two controls allows two parameters to be controlled. Gain
controls the speed of response and velocity feedback controls the
amount of damping.
Load Sensitivity
With Kc = 10 and Kv at the setting to give optimum response, set the eddy current
brake to position 2. Observe that there is little change to the overall response even
though the extra load changes the gain and time constant of the plant. The
response is now dominated by the loop gain and the velocity feedback.
8.2a
Experimentally, did the rise time agree with theory as the gain was increased:
a over the full range of gain.
109
8.2b
8.3
CA06
Curriculum Manual
have no affect.
1+
ln(overshoot )
It can be shown that the controller proportional gain, Kc, required for the specified
time to first peak and damping factor is given by:
2
1
1
.
Kc = .
2
Tp (1 ) K p K i c
K v = 2
Kc Ki
1
Kp c Kp
110
CA06
Curriculum Manual
Design Exercise
Determine the gain and velocity feedback necessary for your servo system to have
an overshoot of 10% and a time to first peak of 300 ms.
Kc =
Kv =
Enter these values into the controller and check measure the resulting overshoot
and time to first peak with an input Level of 12%.
Plant Overshoot =
Tp =
seconds
Change the plant to Plant | Servo. Enter your model values into the plant gain,
time constant and integral gain boxes. Measure the overshoot and time to first
peak of the model.
Model Overshoot =
Tp =
seconds
The model values should be close to the specification but those for the plant may
be a bit out. There are a number of reasons for this which would include errors in
determining the model values and nonlinearities in the motor set.
The design calculations get you close. This is as good as you can expect.
8.3a
Kc =
8.3b
Kv =
111
8.3c
8.3d
8.4
CA06
Curriculum Manual
When the computer model was used, did the calculated values of Kc and Kv
give:
a the response expected.
112
CA06
Curriculum Manual
8.4a
8.4b
8.5
With the ramp input, what affect did increasing velocity feedback have on the
steady state response?
a Increased the following error.
No effect.
With the ramp input, what affect did increasing velocity feedback have on the
transient response?
a Increased the oscillations.
No effect.
Summary
Velocity Feedback is an effective way of stabilizing servo systems which have to
respond to step inputs. Increasing gain gives better response times and increases
the stiffness. Increasing Velocity Feedback increases the damping thus reducing
the oscillations.
113
CA06
Curriculum Manual
Student Assessment 8
1.
2.
If the gain is increased by 3, the time to first peak will decrease by a factor of:
a 0.333
b 0.58
c 0.7
d 1
3.
Which of the following would not cause errors in calculating values for Kc and
Kv?
114
Computer error.
CA06
Curriculum Manual
Chapter 9
Three-Term or PID Control
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
115
9.1
CA06
Curriculum Manual
Three-Term Control
Servo control grew out of the need to control the targeting of artillery. Three-term
control is a few decades older and was developed to control petrochemical plant.
The original three-term controller (the Brown Pneumatic Controller/Recorder) was
an intrinsically safe controller which could be used in hazardous locations.
Examples of the modern version (manufactured by Honeywell) are still in use
today. However, most three-term controllers are now electronic in operation but
the terminology remains. Although the underlying mathematics are the same for
three-term and servo control, sometimes different names are used for the same
concept.
First we must look at the problems three-term control is trying to solve. Look back
at Chapter 5 where speed control of the motor was discussed. The plant (the DC
motor with speed output) is represented by its time constant and gain. There is no
integral action in this type of plant.
It was seen that, with proportional control, there was always an error in the output.
This error decreased as the gain increased but never disappeared. High gain also
speeded up the transient response but could introduce unwanted overshoot and
oscillations.
So, how is the steady state error eliminated without encountering oscillation and
other stability problems? That is the problem which was solved by the original
pneumatic three-term controller.
In Chapter 6 it was shown the integral effect between velocity and position
eliminated the steady state error and in Chapter 8 velocity feedback was used to
stabilize the system. Velocity is the rate of change (or the derivative) of position.
So, having an integral effect in the forward loop is good for steady state error and
having derivative action is good for stability.
The way in which the pneumatic controller worked placed the integral and
derivative actions in parallel with the proportional element resulting in a threeterm Proportional, Integral and Derivative (or PID) controller in the forward path
of the control loop. Fig 9.1 opposite shows how this is configured.
116
CA06
Curriculum Manual
Reference
Input
Error
Signal
Generator
Controlled
Output
Drive
Proportional
Plant
Integral
Motor + Tacho
Derivative
Controller
Velocity
Fig 9.1 Block Diagram of a System with Three-Term Control
9.1a
9.1b
9.1c
9.1d
117
9.2
CA06
Curriculum Manual
Proportional Control
Start VCL and load CA06PE09.
File
CA06PE09
Signal Generator
Signal
Level
Offset
Rate
Reference
DC Motor
Brake
Controller
PID
Step
50%
0%
10 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
3 Error
4 Velocity
ON
ON
Output Potentiometer
Command Potentiometer
Display
Graph
5 Drive
6 PB
7 Integral
8 Deriv
OFF
OFF
OFF
OFF
Disengage
180
Set Integral time constant (Itc) Off and Derivative time constant (Dtc) to 0. The
controller is now proportional only.
The proportional control is marked PB. This stands for Proportional Band.
Proportional Band is the inverse of gain. When expressed as a percent,
100
%PB =
. This nomenclature is a result of the origins of PID control.
Kc
Set PB to 100% (KC = 1). Switch on the system. A considerable error can be seen
between the input (ch1 dark blue) and the velocity (ch4 purple). Going back to
Chapter 5, Eqn 5.6, the output will be K/(1+K). Since K = K c K p , and KP is
close to 1, the error will be around 50%.
Increase the controller gain to 2.5 by setting PB to 40%. Observe that the error has
been reduced but is still considerable. You can also observe that the response time
has decreased indicating that the system has speeded up.
Decrease the PB to 4% (controller gain = 25). As the gain is increased, the error
reduces but the drive signal and the output get increasingly noisy.
The shortcomings of proportional control on a system without an integration effect
were examined in Chapter 5.
Proportional Band on its own does not give adequate control. There is always an
error and increasing the gain to reduce the error causes the plant to run rough.
118
CA06
Curriculum Manual
9.2a
9.2b
9.3
dampen oscillations.
Integral Control
Position control of the servo did not have a steady state error to a step input
because of the natural integration between velocity and position. It therefore
seems that the way to achieve zero steady state error is to have an integrator in the
forward loop.
The pneumatic controller placed the integrator in parallel with the proportional
band. It was found that this configuration gave a more stable response than having
the integrator in series with the proportional element.
Decrease the input Level to 30% and set the PB to 40%. Now set the Integral
time constant (Itc) to 1 second and click the On/Off box to bring in the Integral
controller. Click channel 7 ON. Observe that, during the positive step, the
output of the integral term (channel 7 yellow) now ramps upward with time as
the error is integrated. This pushes the output closer to the required value.
Decrease the Integral time constant until a good response is obtained. This
should occur when the Integral time constant is of the order of 0.1s. The
Integral action has removed the steady state error.
If the integral goes off scale and the system will not respond, click the Itc to Off
then back to On. This resets the integrator.
The Integral time constant (or Integral Time) sets the response speed of the
integrator. In some texts and installations, Integral Gain is used instead of Integral
Time. Integral Gain is the inverse of Integral Time - the shorter the Integral Time,
the higher the Integral Gain.
119
CA06
Curriculum Manual
Although adding an integrator in this way does make the system more prone to
oscillation, the closed loop system does not oscillate as readily as did the position
system since the integrator in parallel with the proportional gain creates a
dampening effect rather like that introduced by velocity feedback. As a result,
many plants can be controlled by just the two terms, P+I.
9.3a
9.3b
9.4
dampen oscillations.
Derivative Control
Velocity Feedback was introduced to stabilize the position servo system. Since
velocity is the rate of change (or the derivative) of position, velocity feedback can
also be termed derivative feedback so derivative action may be required to
stabilize the system.
The DC Motor is rather a simple system as it can be represented by a first order
lag. As a result, the test rig being used does not exhibit the characteristics that
makes it necessary to use derivative action. The effect of derivative action can be
seen on a simulated system.
Make a note in your workbook of the PI settings you have determined for the DC
Motor system.
PB =
120
Itc =
CA06
Curriculum Manual
Change the Plant to Process. The computer is now simulating a more complicated
plant. Set PB = 30% and Itc = 0.24s. The Output should be showing an oscillatory
transient. Increase the Derivative time constant (Dtc) until only a small overshoot
can be seen. Derivative action works in a way similar to Velocity Feedback acting
to stabilize the system - in theory. The plant being simulated is more like real
process than the simple DC motor.
Make a note in your workbook of the derivative setting you have determined.
Dtc =
9.4a
dampen oscillations.
121
9.4b
9.5
CA06
Curriculum Manual
122
CA06
Curriculum Manual
Output
Output
Output Span
So
Line of
Maximum
Slope
Input
Input Span
Si
Time
T
Select Controller | Open Loop and Plant | Process. The signal generator should
be set to Signal | Step, Level | 30% and Rate | 10 msec. Once a step had been
drawn, freeze the picture and make the measurement - as detailed overleaf required for the tuning calculation. Enter each of the measurements into your
workbook.
123
CA06
Curriculum Manual
Output Span - So
Measure the output span - the difference between the initial value and steady state
value of the output.
Output span So =
Volts
Input Span - Si
Measure the input span - the difference between the initial value and steady state
value of the input.
Input span Si =
Volts
Using Line B and Slope controls, determine the line of maximum slope. It might
be helpful to change channel 4 Magnify to 1/2 and Time to x2.
The time constant is the time the line of maximum slope takes to travel from the
initial output value to the final output value.
=
seconds
Time Delay T
The time delay T is the time at which the line of maximum slope crosses the initial
value line.
T=
Seconds
Controller Settings
The controller settings are then calculated from the table below.
Controller Type
P only
P+I
P+I+D
Gain Kc
Si
So T
S
0.9 i
So T
S
1.2 i
So T
124
Integral TI
Derivative TD
3.3 T
Kc
2 T
Kc
0. 5 T K C
CA06
Curriculum Manual
For our PID example, calculate KC (and hence PB%), TI and TD and enter the
values in Table 9.2.
Controller Type
P+I+D
Gain KC
PB%
Integral TI
Derivative TD
Unfreeze the display, restore the controller to PID and use the values calculated as
the controller settings.
Do these settings give a good transient response? No, but Ziegler-Nichols was not
designed to minimize the transient with a step input. However, the values
calculated do get you into the correct region.
With PID, Ziegler-Nichols usually leads to a system which is too underdamped.
Usually both integral and derivative time constants need to be increased.
Try setting TI to 0.5 and TD to 0.5TI, leaving PB as calculated. This gives a much
less oscillatory response.
In practice, techniques like this are used during plant commissioning to get
approximate settings for the controller. Thereafter, the operators adjust the settings
for what they consider to be best performance under their operating conditions.
In 90% of PID installations, the Derivative action is switched off. As has been
shown, where there is a lot of noise in a system, derivative action tends to amplify
the noise causing excessive wear on the actuators.
9.5a
Did the Ziegler-Nichols values for PB, TI and TD lead to a system which was:
a
underdamped.
overdamped.
125
9.6
CA06
Curriculum Manual
Error
Controlled
Output
Drive
Plant
Proportional
Integral
Motor + Tacho
Derivative
Signal
Generator
Controller
Velocity
In this configuration, the gain precedes the integral and derivative terms. Most
texts use the serial configuration, often without stating that they do so.
There is a simple relationship between the integral and derivative settings in the
two different configurations.
Serial
ti
td
Parallel
TI = ti/Kc
TD = td x Kc
Parallel
TI
TD
Serial
ti = TI x Kc
td = TD/Kc
For the serial configuration, the Ziegler-Nichols settings are shown in Table 9.4.
126
CA06
Curriculum Manual
Controller Type
P only
P+I
P+I+D
Gain Kc
Si
So T
S
0.9 i
So T
S
1.2 i
So T
Integral TI
Derivative TD
3.3 T
2T
0.5 T
9.6a
9.7
and
td = 0.25
There are two forms of PID controller. Provided that the settings are
adjusted properly, do both give the same control action?
Yes or No
Summary
Three-term or PID control is widely used in the process industries. Proportional
Band defines the gain of the loop, Integral action eliminates steady state error after
a change in input or load and Derivation action can stabilize the system.
The controller may be tuned manually or, with modern microprocessor based
controllers, by the controller itself or by an external computer.
127
CA06
Curriculum Manual
Student Assessment 9
1.
2.
3.
128
internal routines.
CA06
Curriculum Manual
Chapter 10
Stability
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
129
CA06
Curriculum Manual
Gain = K
Time Const =
Controller
Proportional
Step
25%
0%
100 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
3 Error
4 Velocity
Display
Graph
5 Drive
OFF
ON
ON
Output Potentiometer
Command Potentiometer
Disengage
180
The motor is now configured as a proportional speed control system. Set the
Gain K to 0.6. The system will not run well with these settings.
Now change to positive feedback by clicking the summing circle. The - will
change to + giving positive feedback.
130
CA06
Curriculum Manual
Observe that the output speed is stable even though there is positive feedback.
Increase the gain to 0.7 then to 0.8 observing that, as the gain is increased, the
motor speeds up. This is not a good control system but it is stable.
To keep the drive within the screen limits, reduce the step level to 15% then
increase the gain to 0.9. The output is still stable.
Now increase the gain to 1.0. After the step change, the drive and speed can be
seen to be increasing with time. The system is now unstable. Increase the gain to
1.1 and the instability will be more obvious.
Disable the motor.
10.1a
10.1b
the feedback was negative and the control gain was less than 1.
the feedback was positive and the control gain was greater than 1.
the feedback was positive and the control gain was less than 1.
10.2 Stability
Obviously positive feedback is not a good idea so why is it being introduced?
From earlier chapters, you will know that a plant can be represented by a number
of lags. In Chapter 4 it was shown that a lag consists of an amplitude response and
a phase response. At high frequencies, the phase response of a single lag
approaches -90, such that a high frequency sine wave would lag by 90. A second
order plant could lag by up to 180 and a third order system by up to 270, each
additional lag contributing -90.
What happens to a sine wave which is phase shifted by -180? It is inverted since
sin( - 180) = -sin.
131
CA06
Curriculum Manual
So, if the plant can phase shift a signal by -180, negative feedback has been
turned into positive feedback and there may be a stability problem.
The experiment showed that a positive feedback system could be stable provided
that the gain is low. Mathematical analysis can show that a system will be stable
provided that the amplitude response is less than 1 at the frequency when the
phase lag is 180.
Stability - A negative feedback system will be stable if, when the open loop
phase lag is 180, the open loop amplitude ratio (or gain) is less than 1.
From this, it is obvious that plant with only one or two lags cannot be unstable as
the phase lag never exceeds 180.
There are a number of ways of assessing the stability of a plant, some
mathematical and some graphical. The most useful for our purposes is the Bode
Diagram which was introduced in Chapter 4.
10.2a
10.2b
the open loop gain is 1 or greater when the phase lag is 180.
the phase lag is less than 180 when the open loop gain is greater than 1.
132
CA06
Curriculum Manual
20
Gain
dB 0
0.1
10
Frequency
100
10
100
-40
0
Phase
-90
Phase Margin = 58
-180
-270
0.01
0.1
133
CA06
Curriculum Manual
180T
degrees where T is the time delay in seconds.
The phase of a transport lag can be added to the Bode Plot and from this the
minimum speed of the conveyor belt can be determined to ensure that the control
system is stable.
Since transport lag effectively adds phase lag to a system, it makes it easier for a
phase lag of 180 to be reached while the gain is greater than 1. Transport lag thus
has the tendency to destabilize systems.
This can be seen using the simulated plant. Change Controller | PID,
Plant | Process, Level = 25% and Rate = 10 msec. Set the controller settings to
the Ziegler-Nichols values which were determined in Chapter 9 to give a
reasonable response.
In the Plant area, the Sample Delay control adds transport lag. Increase the delay
and observe the effect on the step response. At what delay does the system become
unstable owing to the extra phase lag introduced by the transport delay?
System becomes unstable with transport lag delay =
Set the delay to 7 and vary the controller settings to give good control of this
plant. To start with, reduce the gain a bit (increase PB).
134
CA06
Curriculum Manual
Itc =
Dtc =
Compare these settings with those used in Chapter 9 for the plant with delay 2.
The most noticeable change is that the gain has had to be reduced. This is in line
with the stability theory. Increasing transport lag decreases gain margin while
reducing the controller gain increases the gain margin.
10.4a
10.4b
To maintain stability with increased transport lag, the gain should be:
a increased.
10.4c
left unchanged.
decreased.
135
CA06
Curriculum Manual
Student Assessment 10
1.
2.
3.
the open loop gain is greater than 1 when the phase lag is 180.
the open loop gain is less than 1 when the phase lag is 180.
the difference between the low frequency amplitude ratio and the amplitude ratio when
the difference between the amplitude ratio at 90 lag and 270 lag.
4.
136
the difference between the low frequency phase lag and the lag when the amplitude ratio
is 1.
the amount by which the phase lag can be increased before instability occurs.
the difference between 180 lag and the high frequency lag.
the difference between the lag when the amplitude ratio is 1 and the lag at high
frequency.
Transport lag:
CA06
Curriculum Manual
Chapter 11
The Use of Computers for Control
Objectives of
this Chapter
Having completed this chapter you will be able to:
137
CA06
Curriculum Manual
138
CA06
Curriculum Manual
11.1a
11.1b
139
CA06
Curriculum Manual
345
Drive
Digital
Controller
Digital
to Analog
Controlled
Output
Process
Analog to
Digital
Computer System
Fig 11.1 Schematic of a Direct Digital Control System
The plant signals are measured using analog or digital techniques. The drive signal
is calculated by the microprocessor and used to drive the plant.
This type of system and the interfacing techniques involved are described in later
chapters of this manual.
The advantages of such controllers are that the same hardware can be used to
deliver a wide range of control schemes, the differences between applications
being in the software, not the hardware. It is also much easier to provide digital
readouts and user friendly setup controls when a microprocessor is used.
The digital controller may also perform tuning functions and, with a suitable
network interface, report operations to a central supervisory computer. It may also
receive setup instructions from the supervisory computer. Reporting may consist
of regular logs (status reports) and exception reports when the controller variable
is in an alarm condition.
140
CA06
Curriculum Manual
Reference
Inputs
Digital
to Analog
Process 1
Computer
Digital
to Analog
Process 2
Digital
to Analog
Process 3
Multiplexer
Analog to
Digital
Fig 11.2 Schematic of a Multi-loop Digital Control System
141
CA06
Curriculum Manual
Supervisory
Computer
Communication
bus
communucation
bus
SCADA stands for Supervisory Control And Data Acquisition. Most modern
process plants are controlled using a SCADA system as outlined in Fig 11.3.
Operator
Console
Direct
Digital
Controller
Process 1
Direct
Digital
Controller
Process 2
Direct
Digital
Controller
Process 3
Logging
Printer
Archive
to Disk
142
CA06
Curriculum Manual
11.4a
11.4b
11.4c
11.4d
143
CA06
Curriculum Manual
In the rest of the course we shall introduce the digital techniques used in single
loop control. We shall cover:
Analog Interfacing
Student Assessment 11
1.
2.
Which of the following statements is not true? Using digital computers in control
systems:
a gives greater flexibility of control strategy.
b
144
multi-loop control.
SCADA system.
CA06
Curriculum Manual
Chapter 12
Analog Interfacing
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
145
CA06
Curriculum Manual
146
CA06
Curriculum Manual
Hardware and software routines in the computers blur this distinction. An 8-bit
machine will have double word instructions and 32-bit machines have byte and
half word instructions. The computer that is chosen for a particular application is a
compromise between speed, power, space and cost.
Table 12.1 shows the range of decimal numbers which can be handled by each of
the word lengths. Negative numbers can be represented in binary form by a
technique called 2's complement which allows easy addition and subtraction of
binary numbers.
Word length
8
16
32
Unsigned
0 to 255
0 to 65536
0 to 4294967296
Signed
-128 to 127
-32768 to 32767
- 2147483648 to 2147483647
An 8 bit number has a resolution slightly better than 0.4% such that 1 bit
represents 1/256 or 0.004 (0.4%) of the total range. This is accurate enough for
many systems such as oven temperature control or washing machine water level
control but most industrial systems require better accuracy than this. For most
industrial direct digital control systems, a 16 bit word is adequate. Generally an
overall accuracy of 0.1% is acceptable. This is equivalent to a 10-bit (1/1024)
resolution.
12.2a
12.2b
16
32
147
CA06
Curriculum Manual
SYSTEM POWER
+12V
5V, 1A
POWER
0V
-12V
JL
+5V
VOUT
Ea
+
Optional
Multimeter
0V
To/From Computer
Parallel Port
ANALOG
DRIVE
DAC
Vel
Pos
0V
Ref
ANALOG
MEASUREMENT
ADC
0V
Pw
Ed
PWM
DRIVE
0V
D0
D1
D2
GRAY
CODE
D3
0V
P0
0V
148
SLOTTED
DISC
JL
CLIO
CA06
Curriculum Manual
Controller
DAC
Plant
MS15 Analog
Graph
Display
Meter
DC-Level
0%
0%
100 msec
4 Velocity
Output Potentiometer
Command Potentiometer
ON
Disengage
180
On the CLIO interface board, Vout is connected to the Vel input so channel 4 of
the panel meter displays the voltage that the DAC is outputting to the Vout socket.
If you wish to monitor the output directly, a 4 digit digital voltmeter can be
connected to the Vout pin with the range selected so that the least significant digit
displays 1 mV.
The mimic shows a 6-bit Digital to Analog Converter (DAC) register. The box
beneath the DAC register shows the voltage (millivolts) expected to be outputted
by the DAC.
The task is to take a binary digital word and from it create a voltage proportional
to the value of the word. In this case, the least significant digit (lsd) corresponds to
80 mV.
Make sure all digits are at 0 - clicking within a digit box toggles the bit between 0
and 1. The output should be 0 volts but, on the on-screen digital display, there may
be a small offset owing to errors in the measurement system. Click the lsd - the
box on the right - and the output should change to 80 mV.
149
CA06
Curriculum Manual
Click the other bits in turn as shown in Table 12.2 to determine the voltages
generated by each of the other bits. Enter the results in Table 12.2 in your
workbook.
bit 5
bit 4
bit 3
bit 2
bit 1
0
0
0
0
0
0
1
1
1
0
0
0
0
0
1
0
0
1
0
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
0
1
0
0
1
0
0
0
0
0
1
bit 0
80mV
0
1
0
0
0
0
0
1
1
Decimal
Value
0
1
2
Expected
Output
0
80mV
63
5.04V
Voltage
Reading
Other patterns may be tried to confirm that the output voltage is the sum of the
weighting of each of the bits set.
This example is for a unipolar 6-bit DAC with a reference voltage of 5.12 volts.
Because there are 2n = 2 6 = 64 steps, the Resolution is:
Resolution =
Reference 512
.
=
= 80mV
Steps
64
150
CA06
Curriculum Manual
R/2
Reference
Voltage
23
2
R
2R
21
4R
20
8R
Output
Voltage
R-2R Ladder
Another technique used is the R-2R ladder network. This is shown in Fig 12.3.
151
CA06
Curriculum Manual
With this configuration, the current flowing in each rung of the ladder is half that
of the rung to the right. The currents in rungs set to 1 are summed in the
operational amplifier to form the output voltage. Since only two resistor values are
used, this configuration is much easier to produce especially on a semiconductor
chip.
The DAC used in the CLIO interface unit is a 12 bit R-2R unit. The reference
voltage is 4.096 volts. The output is amplified by a factor of 2.5 and offset by a
negative DC voltage (-5.12V) to give a bipolar output (an output capable of both
positive and negative values). This gives a resolution of (4.096x2.5)/4096 =
2.5 mV. The range is from -5.120V to +5.1175V.
12.3a
If a DAC has a resolution of 2.5 mV, what voltage (in millivolts) will be
generated if the DAC input is set to 1010011?
12.3b
If this is a 12 bit DAC, what (in volts) is the full scale output of the DAC?
b 10.2325 V
c 10.2350 V
d 10.2375 V
a 10.2300 V
12.3c
all of these.
152
CA06
Curriculum Manual
Input
Comparator
Successive
Approximation
Register
DAC
23
22
21
Reset
Clock
20
Digital
Output
Set the signal generator Signal = DC Level, Offset = 72%. This should generate a
voltage of 3.600V on the Vout socket. This is used as the input to the converter
and can be measured by the voltmeter if it is connected into the circuit.
Make sure that all the digits in the word to be determined are 0. Digits are toggled
by clicking in the digit box.
In Fig 12.4, it can be seen that the output of the digital word is connected to a
DAC. The output of this DAC is compared with the signal to be measured. The
objective is to set the output of the DAC to be the same as the voltage being
measured. The digital input to the DAC is then the digital value of the input
signal.
Select Display|Graph. Channel 4 (purple) is the voltage to be measured and this
voltage can be seen in the scale area when ch4 is selected. Channel 2 (blue) is the
output of the measurement DAC and again the voltage can be read in the scale
area when ch2 is selected.
Each digit is tested in turn, starting with the most significant digit (msd) on the
left.
Set the msd to 1 by clicking its box. Is the DAC output (blue) greater than the
input (purple)? If it is, your guess at the value of the msd is wrong so set it back to
0. If the DAC output is less, your guess is correct so leave the bit set to 1. Enter
the value obtained in the msd box in Table 12.3 of your workbook.
153
CA06
Curriculum Manual
Now test each of the digits down the chain in the same way. Set the bit to 1 and, if
the DAC output is greater than the voltage to be measured, reset the bit to 0
otherwise accept the value of 1. As you enter each binary digit, you will see the
decimal of the measured value approach that of the input value. By testing each
digit in turn, you have successively approximated the binary value to give a digital
representation of the input analog value.
Offset %
72%
50%
30%
Input
Voltage
3.600
msd
1
lsd
80mV
1
Measured
Voltage
3.600
Set the signal generator offset to the other values shown in Table 12.3 and find the
digital values of these offsets.
In practice, the successive approximation register, DAC and comparator are all
built onto a single chip. This type of ADC works reasonable quickly - in the order
of microseconds. Each bit in the conversion required 1 clock pulse so increasing
the resolution does not greatly add to the conversion time. The accuracy depends
on the accuracy of the DAC and, like the stand alone DAC discussed above, 12 bit
accuracy is now common place at relatively low cost.
Sample/Hold
With Successive Approximation, the digital value is being converted back to
analog and compared with the actual signal being measured. There can be a
problem if the actual signal changes during the conversion process. For this
reason, a Sample/Hold circuit is always placed before the converter. Before
conversion starts, this samples the value to be measured by charging a capacitor
then holds the analog value steady on the capacitor during the conversion process.
Multiplexing
ADC's are not inexpensive products. Often it is too expensive to allocate a
separate ADC to each variable that has to be measured. Inputs are brought to an
array of switches. In turn, each input is connected to the ADC and the conversion
made. Such an arrangement is called Multiplexing and the device containing the
switches is called a Multiplexer.
154
CA06
Curriculum Manual
Fig 12.5 shows the complete schematic of the Successive Approximation ADC
used on the CLIO board.
8:1 Multiplexer
Ref
Pos
Vel
Channel
Select
Sample
Hold
12 bit Digital
Output
5V Analog
Inputs
Fig 12.5 ADC System used in CLIO Interface
The CLIO ADC is an 8 channel 12-bit bipolar ADC converting signals in the
range -5.12 to 5.1175 volts with a resolution of 2.5 mV. Only three of the channels
are actually used.
Like DACs, an ADC is characterized by its range and resolution. In addition,
conversion speed is also factor.
Other Conversion Techniques
There are a number of other ADC techniques in use.
Ramp Converter An up/down counter connected to a DAC is used. If the DAC
output is less than the input, the counter counts up. If it is
greater than the input, the counter counts down. This is an
inexpensive way of providing individual ADCs per channel
provided the input never changes fast.
Flash Converter This is the type of converter used for digitizing video signals.
It is fast, expensive and low resolution.
155
Sigma Delta
12.4a
12.4b
12.4c
12.4d
Sigma Delta.
Dual Slope.
Flash.
156
CA06
Curriculum Manual
Sigma Delta.
Flash.
CA06
Curriculum Manual
157
CA06
Curriculum Manual
Vary Amplitude and Time to see the measurement problems that arise when the
sampling is too slow and the resolution is not good enough.
Aliasing
Set Time back to 1 and Amplitude to 12-bits. Set Rate to 700mS (7secs for NT
operating system). You are now sampling 700 times slower than previously. The
sine wave is being sampled just slightly faster than once every two cycles. It will
take a few minutes to build up the picture, especially when using NT.
The measured input now looks like a low frequency sine wave. This is not good.
You are trying to measure a high frequency but, because of inappropriate
sampling, the computer is seeing a much lower frequency. This is called Aliasing
and occurs when a frequency signal is sampled less than twice per period. Instead
of the correct frequency, the computer sees a low frequency alias. This can create
a lot of problems in a control system if there is high frequency noise on the
measurement. The controller will see the low frequency alias as an error and try to
eliminate a signal which does not really exist.
The sampling rate of the ADC and DAC system should be chosen to be fast
enough to respond to the fastest inputs or disturbances and the signals should be
filtered to eliminate unwanted high frequencies which might cause aliases.
158
CA06
Curriculum Manual
Student Assessment 12
1.
2.
4.
0.1%
0.01%
d 0.001%
The ratio of resistor values required for a 10 bit R-2R DAC is:
a
3.
0.4%
2048:1
1024:1
512:1
d 2:1
Is reasonably fast.
Is extremely expensive.
A small steady state error in a digital position control system can be caused by:
a
aliasing.
159
160
CA06
Curriculum Manual
CA06
Curriculum Manual
Chapter 13
Direct Digital Control
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
161
CA06
Curriculum Manual
0010
1010
msd used as sign bit
----1100 -4 Obviously this does not work.
162
CA06
Curriculum Manual
Invert
1
4
-2
0010
1101
0001
----1110
0100
1110
----0010
This gives the correct answer, the carry bit being ignored.
For a 4 bit word, the full range of numbers from -8 to +7 are shown in Table 13.1
2's Complement
Binary
0111
0110
0101
0100
0011
0010
0001
0000
1111
1110
1101
1100
1011
1010
1001
1000
Decimal
7
6
5
4
3
2
1
0
-1
-2
-3
-4
-5
-6
-7
-8
The binary mode of the windows calculator can be used to practice 2's
complement binary arithmetic but remember that the calculator works with a 32
bit word.
163
CA06
Curriculum Manual
13.4 Arithmetic
The main arithmetic operations required are subtraction to calculate the error
signal and multiplication to perform the gain. Addition and subtraction are
straightforward operations in a microprocessor.
Multiplication to perform gain calculations present more of a difficulty. When two
16 bit numbers are multiplied, the result is a 32 bit number. Also, how is the gain
represented within the computer? A gain of 5 might be represented by
0000000000000101 but how is a gain of 5.5 represented? If the gain can be set to
3 decimal places, gain calculations must be done in two parts. 5.500 is stored as
5500 (1010101111100). The variable is multiplied by this amount forming a 32 bit
word. This 32 bit number is then divided by 1000 (1111101000) to form the 16 bit
result. With a gain of 5.5, any error signal greater than 5.12/5.5 volts will cause
the result to be bigger than full scale. The multiplication routine must ensure that
results greater than the range are limited to the maximum or minimum of the range
before the higher 16 bits of the 32 bit result are discarded.
13.4a
164
00101111
d 11010000
CA06
Curriculum Manual
13.4b
If the ADC and DAC in a system both have 12 bit resolution and the
computer has a word length of 16 bits, which of the 16 bits would the
conversion words occupy?
b bottom 12.
a top 12.
c
13.4c
middle 12.
A proportional control system has a range from -2.048 to + 2.047 volts. The
input reading is 1 volt and the output reading is 0 volts and the gain is 4.
What is the drive voltage?
b 2.047 V
c -2.048 V
d -4 V
a 4V
13.5 Integration
In PID control there is a requirement to integrate the error. How is this done? With
an analog signal, integration is the area under the curve as shown in Fig 13.1.
165
CA06
Curriculum Manual
There are a number of mathematical rules for calculating the area under the curve,
the easiest being to keep a running total of all the incoming signal samples.
However, the sampling interval must be taken into account, especially if it can be
changed.
So, it would appear that the integral is:
I n = (Sn T) + I n 1
Eqn 13.1
where Sn is the nth sample, T is the interval between samples, In is the new integral
value and In-1 is the previous integral value.
Two things to be considered with this approach. From Fig 13.1, it can be seen that
assuming the signal is constant during a sample interval does give an error. A
more correct integration will result if it is assumed that the signal is a straight line
between one sample and the next. The calculation would then be:
S S n1
I n = (S n1 T) + n
T + I n1
Eqn 13.2
The first term is the rectangular area and the second is the triangular area. In a
computer it is easy to remember the last sample so there is no difficulty in
performing this calculation. This equation can be simplified to:
S + S n1
S
S
T + I n1
I n = (S n1 T) n1 T + n T + I n1 = n
2
2
2
Eqn 13.3
The second problem with this calculation is not so obvious. Take the case where
we are using a 16 bit word, the ADC has a 12 bit resolution (each bit representing
2.5 mV) and the sampling period is 1/64th of a second. A 1 bit error would then be
stored as 0000000000010000. Multiplying this by 1/64 shifts the word right by 6
bits giving the result 0000000000000000. Nothing is integrated so the integrator
cannot correct for a 2.5 mV error. It takes an error 4 times greater than this, i.e.
10 mV, before anything is added to the integrator total. The integral action would
not then be doing its proper job of eliminating steady state error.
166
CA06
Curriculum Manual
The solution to this is to store the sum of the samples and do the multiplication
after the addition i.e.:
I n = A n T where A n =
S n + S n1
+ A n 1
2
Eqn 13.4
Example
13.5a
13.5b
13.5c
Enter these values into your workbook. There will be a small difference between
answers a and b. Answers b and c should be the same.
To illustrate the effects of word length, calculations can be made with integers
only, i.e. the fractions of each calculation are dropped. This is the decimal
equivalent to working with a fixed word length. To maintain the integer approach,
multiplying by T = 0.01 can be regarded as dividing by 100.
13.5d
Using equation 13.3 working with integers only gives an integral value of?
13.5e
Using equation 13.4 working with integers only gives an integral value of?
167
CA06
Curriculum Manual
Enter these values into your workbook. When working with restricted word
lengths, the order of computation can be important. Equations 13.3 and 13.4 give
the same answer when there is no word length restriction but equation 13.4 is
much more accurate when the word length is restricted.
When writing computer programs for real time control using fixed word lengths,
care must be taken with the word size and the order in which calculations are
performed.
Another problem with the digital integral element in PID control occurs if the
integral goes off-scale. The integral value must be held at the maximum positive
or negative values and not allowed to 'wrap round'.
13.6 Differentiation
An approximation to differentiation is also easily performed but again care must
be taken with the computation. Fig 13.2 shows a signal for which the digital
differentiation is required. Differentiation is the rate of change of the signal so can
be approximated by the difference between samples.
However, from Fig 13.2, it can be seen that the difference depends on the sample
rate. The difference must be divided by the sample interval.
168
CA06
Curriculum Manual
S n S n1
T
13.6a
If the sample rate of a digital differentiator is too fast, the result will be:
a the difference between successive measurements will be too small to be
significant.
significant change in signal may be missed.
169
13.6b
CA06
Curriculum Manual
If the sample rate of a digital differentiator is too slow, the result will be:
a the difference between successive measurements will be too small to be
significant.
significant change in signal may be missed.
( K A ) + ( K B) = K (A + B) = (A + B) K
However, when working with fixed word lengths, the order can matter. Fig 13.3
shows two versions of the block diagram of a PI controller. Under the rules of
block diagrams and of normal arithmetic, both diagrams should give the same
output. However, if the proportional gain is greater than 1, the output of the
proportional element can easily reach the limits of the range which results in
errors in the integral and differential calculations. If the gain is less that 1,
resolution is lost when calculating the integral and derivative. So, with fixed word
length, the lower configuration is usually used in digital implementation of PID.
Error
Proportional
Integral
Drive
Derivative
Error
Integral
Derivative
170
Proportional
Drive
CA06
Curriculum Manual
Controller
PID
Step
50%
0%
10 msec
Internal
0
Plant
MS15 Analog
Graph
1 Input
ON
3 Error
4 Velocity
ON
ON
Output Potentiometer
Command Potentiometer
Display
Graph
5 Drive
Off
6 Proportional Off
7 Integral
Off
8 Derivative Off
Disengage
180
171
CA06
Curriculum Manual
Stability
As the time between samples increases, the system damping decreases evident by
increasing overshoot. Eventually the sampling rate is too slow to maintain control
of the system and it begins to oscillate.
13.9a
172
CA06
Curriculum Manual
13.9b
13.10 Summary
Microcomputers with analog interfacing are now fast enough and inexpensive
enough to be used as controllers without worrying too much about the effects of
digitization except in very fast or very accurate situations.
The use of a microcomputer system gives a number of other advantages owing to
the ease with which the processor can communicate with other processors. This
allows the implementation of SCADA systems and effective tuning using more
powerful processors.
Digital systems also allow more ergonomic displays and setup procedures.
173
CA06
Curriculum Manual
Student Assessment 13
1.
A proportional control system has a range from -2.048 to + 2.047 volts. The input
reading is 1 volt, the output reading is 1.5 volts and the gain is 4. What is the drive
voltage?
2.
5.
174
-2
d -2.048
eqn 13.1.
eqn 13.2.
eqn 13.3.
d eqn 13.4.
4.
When working with a fixed word length, which equation would be used to calculate the
integral of error?
3.
2.047
0.015
0.133
d 66.67
aliasing.
no errors at all.
instability.
reduction of overshoot.
CA06
Curriculum Manual
Chapter 14
Digital Interfacing
Objectives of
this Chapter
Having completed this chapter you will be able to:
Equipment
Required for
this Chapter
175
CA06
Curriculum Manual
176
CA06
Curriculum Manual
+12V
5V, 1A
POWER
0V
-12V
JL
D. C . M OT OR C ON TR OL M OD U LE
+ 5V
-12 V
0V
A N ALOG C ON T RO L
M OT OR DR I VE
Vi n
E
0V
TAC H O
GE NER ATO R
OU T PU T
PO TEN T IO ME T ER
OU T PU T
Vou t
0V
Vout
0V
+5 V
Vout
Ea
0V
P. W .M . I N PU T
ANALOG
DRIVE
DAC
Cab le To
Par allel P ort
Vel
Po s
R ef
D I GI TAL C ON TR OL
0V
ANALOG
MEASUREMENT
ADC
0V
Pw
E
0V
Pw
Ed
PWM
DRIVE
0V
GR AY C OD E
D0
D1
D2
Vin
D3
Pw
0V
D0
D1
D2
GRAY
CODE
D3
0V
Vo ut
L oad
SLOT T ED
DI SC
Po
P0
0V
0V
SLOTTED
DISC
JL
CLIO
177
CA06
Curriculum Manual
full power
3/4 power
half power
1/4 power
178
CA06
Curriculum Manual
Thyristors used in this way normally contain circuitry to ensure that power is
always switched when the voltage is zero. This minimizes the electrical noise
produced by the switching action.
In bang-bang control, the application decides the length of the ON period and the
length of the OFF period. However, it was realized from this that the power to a
plant could be controlled by varying the ON/OFF ratio of a signal. This has led to
the use of Pulse Width Modulation.
Pulse Width Modulation - PWM
The average value of a periodic two level signal depends on its ON/OFF ratio as
shown in Fig 14.3. When the pulse train is averaged using an analog filter or the
filter action of the plant itself, the average value goes from full ON to OFF (or full
ON in negative direction) as the ON time is reduced. For many processes, such as
the DC Motor or an oven, such a pulse train will be averaged by the process itself
so that the power drive can be an efficient logic power switch rather than an
inefficient analog power amplifier.
179
CA06
Curriculum Manual
This technique works well provided the processor can provide the timing
accuracy. Many processors have special registers which will provide PWM
outputs with accurate timing.
For the DC Motor plant being used, an update rate of 10 milliseconds (0.01
seconds) has been used. To obtain the equivalence of 12 bit resolution, the ON and
OFF times have to be controlled to 0.01/4000 seconds, i.e. 2.5 millionths of a
second 2.5s). This is well within the capabilities of many modern processors.
PWM outputs are available on some microprocessors and integrated circuits are
available to drive DC motors. These take a low power logic signal and convert it
to a high power PWM drive to the motor coils.
Stepper Motors
A stepper motor is a variant of the DC motor designed in such a way that the
armature is stable at a number of fixed angles. A voltage pulse on the drive coils
moves the armature to the next stable position, i.e. it steps to the next position.
The drive coils can be arranged so that movement can be in either direction.
Stepper motors are normally designed to move by 7.5 or 15.
A computer can easily drive a stepper motor - special power drive chips are
available. One logic line specifies the direction of rotation and another is pulsed to
rotate the rotor by one step. Since the power drive is a switch, this arrangement is
power efficient.
Stepper motors are used when a mechanism has to be positioned without the use
of a feedback system. Such a system requires that the starting position (zero
datum) is known. Positioning the print head in a laser printer is a typical example.
Many machine tools use stepper motors for positioning the tool and work-piece.
180
CA06
Curriculum Manual
stopped
clockwise
counter clockwise
1 1.5 2
milliseconds
approx 20ms
A 1 ms pulse will cause the output shaft to rotate at full speed clockwise. A 2 ms
pulse will cause full speed counter-clockwise rotation and a 1.5 ms pulse is the
stopped condition. This pulse should be repeated at intervals.
The timing of the pulse width gives a resolution about half that of the DAC, i.e.
the PWM resolution is approximately 1 in 2000.
Start the VCL software and load CA06PE14
File
CA06PE14
Signal Generator
Signal
Level
Offset
Rate
Reference
DC Motor
Brake
Controller Plant
Open-Loop MS15 Digital
Logic Display
DC Level
PWM
0%
0%
10 msec
Internal
Output Potentiometer
0
Command Potentiometer
Display
Event
Disengage
180
Notice that the Plant is now MS15-Digital indicating that the digital sections of
the DC Motor controls and the CLIO interface are being used.
The PWM signal appears on the Pw socket in the PWM Drive area of the CLIO
module and should be connected to the Pw input on the MS15 module. To select
PWM drive rather than analog drive, the Motor Drive selector switch at the
bottom of the MS15 unit must be in the PWM position.
181
CA06
Curriculum Manual
PWM Drive
The PWM mode of the event display should be selected. This shows the waveform
being sent to the motor drive circuit. The width of the pulse (in milliseconds), and
the speed of the motor (in volts) as measured by the tachometer, are shown as
numerical values.
With the input Offset = 0%, the display should show a 1.5 ms pulse and the motor
should not be rotating.
Increase the Offset in 10% steps and note that the motor rotates counter clockwise.
At 100% Offset, the pulse width should be 2 ms and the motor is running at full
speed. Enter the results in Table 14.1 of your workbook and plot the resultant
graph in Fig 14.5.
Offset %
0
10
20
30
40
50
60
70
80
90
100
Pulse Interval
1.5
Table 14.1 Relationship between PWM drive input and velocity output
Compare this curve with the one obtained in chapter 2, Fig 2.1. As shown in
Fig 14.5, they should be very similar. Pulse width modulation, requiring only a
single logic output from the computer, can be used to generate the drive for the
DC motor.
Disable the drive.
182
CA06
Curriculum Manual
183
CA06
Curriculum Manual
14.3a
A Bang-bang system switches on power when the output is less than the set
point and switches it off when the output is more than the set point.
Yes or No
14.3b
14.3c
Was the measured PWM drive curve close to that obtained for analog drive?
Yes or No
184
CA06
Curriculum Manual
start
finish
185
CA06
Curriculum Manual
count
A detectors
B
direction
A
B - counter clockwise
B - clockwise
Fig 14.7 Measuring change of position using a cog wheel
This is a useful technique but there is a limit to the number of notches which can
be detected on a cog. Gearing can overcome this to some extent but mechanical
techniques like this do not give very accurate measurement.
Optical techniques are used for accurate position measurement in machine tool
control and metrology. Fig 14.8 shows how this works.
Position 0mm
0.5mm
186
1mm
1.5mm
CA06
Curriculum Manual
Two optical gratings are produced photographically. One has a series of vertical
lines uniformly spaced. The other has the same set of lines but these are angled
slightly. In Fig 14.8, the lines are 1 mm thick and 2 mm apart. The second set is
angled so that the bottom of the line is 2 mm to the right of the top of the line.
When the two gratings are placed on top of each other, a fringe pattern can be
seen. This is called a Moir Fringe.
One long grating is fixed to the bed of the machine and another short grating is
fixed to the moving platform. As the platform moves, the black band moves up or
down. One band will move past the detect head each time the platform moves by
the pitch of the grating. The bands are counted to determine the distance moved.
Since very fine gratings can be produced, at a price, this technique is used for very
accurate measurement. Small movements of the platform are magnified into large
movements of the black bar. Machine tool inspection stations generally use this
technique.
Absolute Position Measurements
Absolute position measurement is based on coded discs as shown in Fig 14.9. A
digital pattern is screened onto a clear disc so that a digital pattern dependent on
the angle of rotation can be picked up by the photo-detectors.
11
12
13
10
14
15
photo detectors
1
5
2
4
187
CA06
Curriculum Manual
Looking at the disc in Fig 14.9, you will see that it is not a binary code that is
used. The code used, called a Gray code, is given in Table 14.2. This is the disc
used on the MS15 module.
Position
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Angle
0 22.5
22.5 45
45 67.5
67.5 90
90 112.5
112.5 135
135 155.5
155.5 180
180 202.5
202.5 225
225 245.5
245.5 270
270 295.5
295.5 315
315 337.5
337.5 360
D3
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
D2
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
D1
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
D0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
Change
D3
D0
D1
D0
D2
D0
D1
D0
D3
D0
D1
D0
D2
D0
D1
D0
The main reason for using the Gray code is that, at every change of code, only one
digit changes. This makes the alignment of the optical sensors much less critical.
If a binary code was used, on the change from 7 to 8, all four digits change. If D3
were mis-aligned so that it changed before the others, the computer would detect a
change of position from 7 to 15 then to 8. Use of the Gray code eliminates such
glitches. Gray code is also used because there is a logical relationship between
Gray code and binary code which makes program writing easier.
To detect the code using LEDs, the tracks must be relatively wide. This makes it
difficult to make high resolution discs especially if they have to rotate at high
speed. Electronics or computer technology can be used to overcome some of these
deficiencies but high resolution coded discs are expensive to produce.
188
CA06
Curriculum Manual
14.5a
189
14.5b
CA06
Curriculum Manual
it is inexpensive.
14.5c
A Gray coded disc returns the binary pattern 0101. What range of angles of
the shaft does this represent?
a 0 to 40
b 0 to 22.5
c 135 to 155.5
d 270 to 295.5
14.5d
If the disc is rotating clockwise, what will be the next code returned?
RPM
There is a 9:1 gearing between the motor and the output shaft so the speed of the
motor shaft is 9 times this figure.
Maximum motor shaft speed =
RPM
Disable the drive and make a note of these figures in your workbook.
190
CA06
Curriculum Manual
Frequency Measurement
The motor should be rotating at around 2000 RPM. The resolution obtained from
the Tacho + ADC system was 1 in 2000. With one pulse per revolution as
provided, the pulses would have to be counted for one minute before the
measurement could be used. But, to control speed or position, the measurements
are required every 10 milliseconds.
We could put more slots on the disc.
2000RPM is the same as 2000/60 = 33.3 revolutions per second
Therefore one revolution takes 1/33.3 seconds = 30 milliseconds.
In 10 ms the shaft revolves by 1/3 of a revolution.
To measure 2000 counts in 10 milliseconds would require a wheel with 6000 slots.
Period Measurement
Rather than measure the number of pulses in a given time, the time between pulses
could be measured. At maximum speed, only 3 slots are required for one to come
past every 10 ms but at a speed of 1 RPM, 2000 x 3 = 6000 slots would be
required for a slot to pass every 10 ms.
Also, since the period is the inverse of frequency, the period measurement requires
to be inverted before being used. This requires a division operation within the
processor which can take up time.
Practical Systems
Many applications do not require the rotational speed, the accuracy or the update
rate of the servo system. In many applications, a multi-slot disc, possibly speeded
up via gearing, can be used.
A 30 slot disc geared to run 10 times faster than the motor shaft would give a 1%
resolution when sampled every 10 ms or 1 in 2000 resolution if sampled every
200 ms. Problems with this are that, at maximum speed, the disc would be rotating
at 20000RPM. This is fast for a mechanical system. Also the inertia of the disc
would be reflected to the motor by the gear ratio, i.e. 10 times, so would add
significantly to the motor inertia.
191
CA06
Curriculum Manual
As with the position measurement by slotted disc, the direction can be determined
by using two sensors placed 1/4 of a cycle apart.
Slotted discs using optical, magnetic or other proximity detection techniques are
used in many applications but not in those where fast sampling is required. ABS
braking is one such example.
Measurement by Computer
Microprocessor timer inputs can be configured for either frequency or period
measurement. Frequency is easier to implement as the results do not depend upon
the clock frequency of the timer used in the period measurement. Also, frequency
is proportional to speed whereas period is inversely proportional which
necessitates an extra division operation.
For fast sampling of speed as required by the servomotor example, a tachometer
with analog to digital conversion is the most suitable combination. Many
microprocessors have built in ADCs but, if not, it is now easy to interface one to a
microprocessor - see section 14.7 below.
14.6a
14.6b
192
The technique used on the test rig to obtain a digital measurement of speed is:
a frequency measurement from toothed wheel sensors.
b
CA06
Curriculum Manual
193
clock
data out
data in
3-wire SPI
Microprocessor 1
chip
selects
2
3
4
CA06
Curriculum Manual
ADC
Analog Out
DAC
Logic In
GRAY
Logic Out
PWM
194
CA06
Curriculum Manual
Set the proportional gain Kc to 5 and adjust the velocity feedback Kv to give a
system with just a little overshoot. Enter the velocity feedback used into your
workbook.
Kv for optimal response =
Compare this with the value obtained in chapter 8 with analog measurement and
drive. There should not be much difference between the two figures.
Change to Display | Event | Gray. This shows the Gray code of the position being
measured. Change to PWM and the pulse width of the drive is shown.
Digital measurement and drive has not made any significant difference to the
performance of the system although the lack of resolution in the position
measurement is evident.
In some instances, like PWM, digital techniques offer an advantage, in others,
analog sensors followed by analog to digital conversion give better performance.
Most modern controllers are now microprocessor based using a combination of
analog and digital interfacing techniques.
The PC as a digital controller
The PC does not have the special PWM, timer or Microwire registers that can be
found on some microprocessors. As a result, the experiments using the digital
peripherals may have given poorer performance than would have been obtained
using a dedicated microprocessor. The PC performs better with the analog
peripherals. The PC, however, does excel in providing the graphic display and
easy to use operator interface.
In industry, the process control function and the plant operating function would
normally be provided by separate computers, the fast closed loop control being
provided by a microprocessor based system and the system display and control
provided by a machine with the interactive graphic power of the PC.
14.8a
Compared with analog interfacing, did the system with digital interfacing
perform:
a better.
b as good as.
c
195
14.8b
CA06
Curriculum Manual
Student Assessment 14
1.
2.
3.
4.
196
5 milliseconds
500 microseconds
50 microseconds
5 microseconds
The most common digital interfacing technique for the input and output of signals in
real time control measurements is:
a
connection as memory.
CAN.
I2C.
Microwire.
The 'real' world is predominately analog in nature. Are the control systems used now:
a
all analog.
all digital.