You are on page 1of 5

EE 461 Experiment #1

Digital Control of DC Servomotor

1 Objectives
The objective of this lab is to introduce to the students the design and implementation of
digital control. The digital control is implemented on a lab-scale DC Servomotor in the con-
trol systems laboratory. The performance of the resulted digital control system is compared
with the continuous-time control system performance. The effect of sampling period Ts (or
sampling frequency fs = T1s ) is studied.

When doing the lab, the software packages MATLAB with Control Systems Toolbox, and
the Simulink are used for the analysis and design of control systems.

2 Introduction
An important approach to digital controller (filter) design is to start with a well-designed ana-
log controller. The digital controller C(z) is then implemented by discretizing the continuous-
time controller C(s). This design method is also called design by emulation, which is
widely used by control engineers in practice. It is known that for a properly chosen sampling
period, this method can provide a useful digital controller with satisfactory performance. In
this lab, students are asked to implement the digital controllers, obtained by discretizing
a pre-specified analog controller using some common discretization methods. The effect of
sampling frequency is also studied by comparing different system responses with respect to fs .

In the last part of the experiment, the students are asked to implement a digital controller
designed directly for the discrete-time dc-motor model, and the system response is ob-
tained for comparison purpose.

1
3 Preparation
Before the lab begins, students are required to read and understand the Control System Lab-
oratory Manual for the hardware and software description. In addition, it is recommended
that the students complete the following pre-lab work.

The Quanser dc-servomotor in the control systems laboratory has the following model (with
20020
a low gear ratio and in the load free case): P(s) = s(s+42) . The analog control system can
be implemented by using a continuous-time controller C(s):

Figure 1: Analog Control System for a DC-Motor

In this lab, the analog controller is given as a lead compensator C(s) = 0.08s+0.08
s+3
, which can
generate a satisfactory transient and steady-state performance of the system step response.
By discretizing C(s), one can implement a digital control system:

Figure 2: Digital Control System for a DC-Motor

1. With the sampling interval chosen as Ts = 0.001, and Ts = 0.01, use the Bilinear
transformation (Tustin’s method) to obtain the discrete-time models of C(s), denoted
by C1 (z) and C2 (z), respectively. This can be done by using c2d command in Matlab.

Record down C(s), C1 (z), and C2 (z), and they will be used in the following experiment
procedure.

2
4 Experiment Procedure
1. Check and understand the wiring between the dc-motor, power module(UPM) and the
computer.

2. Start the MATLAB, and Simulink. It can be noticed that a Quanser toolbox is installed
in the Simulink, and it contains the blocks to interface with the real system setup.

4.1 Part 1. Implementation of Analog Control


3. Build a simulink model (use Simulink and Quanser toolbox) to implement the analog
control system in Figure 1, with C(s) given there. The motor shaft Encoder is used to
measure the angular position, and a calibration gain of -360/4096 needs to be added
to the encoder to convert the angular signal to ‘degree’. The reference input is set to
a step signal of 30 degrees.

4. Compile your program by going to ‘WinCon’ in the manual bar and clicking ‘Build’, a
WinCon interface window will then appear if there is no error in your simulink model.
Remember to adjust your motor shaft to zero position before start running the system
every time. You can also select scopes to monitor the signals in real-time. For example,
choose scopes to monitor the angular position Θ(t) and the control signal u(t)

5. Run the system by clicking ‘Start’, after 6 seconds (it can be seen from the scope),
stop the program by clicking ‘Stop’ and save the data for later analysis. Another way
to stop the program is to add the following timer in your Simulink model, which allows
the simulation to stop automatically.

Figure 3: Timer

3
4.2 Part 2. Implementation of Digital Control by Emulation
6. Implement the digital control system in Figure 2. Set the sampling time as Ts =
0.001 sec., then replace the analog controller in your Simulink model by the discretized
one C1 (z). Remember to set the same sampling time in the input block, and in the
‘Simulation > Parameters...’ (change simulation method to ‘discrete’, and set the fixed
step size as same as Ts ).

7. Repeat steps (4) and (5), and save the data

8. Set Ts = 0.01 sec., implement C2 (z). Repeat steps (6) and (7)

4.3 Part 3. Digital Control by Direct Design


In the following steps, we are going to implement a digital controller directly designed
based on the discretized plant (i.e. the ZOH equivalent model of P(s)), rather than
discretizing an analog controller. This method is referred to as ”direct design method”.

9. By setting Ts = 0.01 sec., a discrete-time compensator of the form C3 (z) = K( z−0.657


z−0.35
)
is chosen. Implement C3 (z) in your model, and repeat the steps (4) and (5). Observe
the system response and save the data. Note: The gain K in C3 (z), can be tuned to
get a good performance. ( Warning: the system is very sensitive to the selection of
K, too large K may result in instability, a suitable rang is [0.2, 0.05]), a suitable choice
is K = 0.12)

10. When changing the sampling interval to Ts = 0.1 (a rather slow sampling), one has to
z−0.6
re-design the discrete-time compensator, it is chosen as C4 (z) = 0.04( z−0.35 ). Imple-
ment C4 (z), and observe the system response.

Caution: during the experiment, the motor may run without control, such
as turning extremely fast and making unpleasant noises, in these cases, stop
the program immediately, and ask for assistance.

5 Analysis and Discussion


Finally, after all the trials, load the data into Matlab and plot the time responses of the dc-
motor angular position. Evaluate the performance by calculating the percent of overshoot
(P.O.), settling time (Ts , and steady-state error ess . It is recommended to plot the reference
input signal and the output signals that you want to compare in the same graph.

4
1. Compare the step responses of the dc-motor using the discretized controller C1 (z), and
C2 (z) with that of analog controller C(s), in terms of P.O., Ts , and ess . What can you
observe?

2. How does the sampling time affect the system responses in the experiment in Part 2?

3. Compare the system response by using C3 (z) in Part 3, step (9), with the system
response using C2 (z) in step (8), what can you say about the performance of these
two digital controllers? (remember that they are obtained by ”emulation” and ”direct
design”)

4. From all above procedures when trying different sampling intervals, make a discussion
on the effects of sampling time to the system performance.

6 Lab Report
Individual reports are required although the students may work in groups. The reports
should contain:

• The pre-lab work

• A brief introduction of the experiment.

• Printouts of Simulink models, and all the plots.

• Your discussions by answering the question in section 5.

• Any conclusions you would like to draw.

The lab report is due by 4pm on Feb. 14, 2011 for section H3 and 4pm on Feb. 28, 2011 for
section H4. Please drop your report into the box assigned to EE461 LAB outside the main
office at 2nd floor ECERF.

You might also like