Title: Controls Lab
1Controls Lab
Objectives
1. Create and validate a first-order model of a
brushless DC motor. 2. Measure nonlinearities of
the motor to use for nonlinear model 3.
Qualitatively observe the effects of the P, I,
and D gains. 4. Use model parameters to design a
P, PD, and PID controllers for the motor.
2 Apparatus
- PC
- Quanser Data Acquisition
- Amplifier
- Motor and Flywheel
- Encoder
3Background
Motor differential equation (1)? W
here T is the torque on the rotor Kt is the
motor coefficient, if is the field current, vf
is the field voltage, Rf is the field
resistance, J is the moment of inertia, ? is the
rotating speed and B is the friction
coefficient. Motor dynamics in the Laplace
domain (2)?
4For a step voltage input, the Laplace transform
of the velocity response is (3)?
Time domain velocity response (4)?
To identify the motor constant Km , recognize
that the steady state speed equals the product
Vin Km. Also note that the time constant Tm can
be readily identified by finding the time
required for the velocity to reach 63.2 (1-e-1)
of the steady state speed.
5Procedure Motor Parameter Data Collection
- Open WINCON and start SIMULINK from that.
- Open Control_Template1.mdl as shown on figure
1. - 3. Specify vin (e.g. vin 0.8)
- 4. Build model.
- 5. Plot -gt New -gt Scope....
- Hit START.
- Hit STOP
- Save plots as M-files.
- Repeat...
6Figure 1. SIMULINK/Quanser System to Implement
Parameter Identification Experiment
7From Simulink Source
Parameters
Step time 0
Initial value 0
From Quanser Library
Quanser Consulting
Final value vin
Quanser Consulting MQ3 Series
Step
MQ3 DAC
(leave parameters as default)
Sample time 0
Analog Output
From Quanser Library
Quanser Consulting
Quanser Consulting MQ3 Series
MQ3 ENC
(leave parameters as default)
Encoder Input
From Simulink Sinks
Scope
From Quanser Library
Quanser Consulting MQ3 Series
Quanser Consulting
From Simulink Continuous
(leave parameters as default)
MQ3 Timer
25s
Parameters
s25
Numerator 25 0
Time-Base
Denominator 1 25
Transfer Fcn
From Simulink Math
Parameter
-K-
Gain 1/2000
From Simulink Signals Systems
(leave the rest as default)?
Gain
Terminator
Figure 2. SIMULINK and Quanser System blocks
8Procedure Nonlinearity Data Collection
1. Use Control_Template_1. 2. Specify a positive
value for vin. 3. Reduce vin until motor stops
turning. (Find vin to two decimal places
e.g.0.54V)? 4. Repeat, starting with negative vin
to find negative deadzone. 5. Enter values in
Table 1 below.
Table 1 Deadzone/Saturation Limits
Positive limit
Negative limit
Deadzone
Saturation
10 V
-10 V
9Procedure Parameter Identification
- 1.Open M file. (Type name of the file without the
.m extension in the command window.) - 2. Find the steady-state speed ?ss by inspection.
- 3. Calculate the motor gain Km according to the
formula - (5)?
- 4. Calculate the characteristic speed of the
motor ? - (6)?
- 5. By inspection of the graph, determine the time
constant Tm . - 6. Repeat the steps above to find the constants
corresponding to each step input voltage Vin. - 7. Enter values in Table 2.
10 Table 2. Experimentally Determined System
Parameters
11Procedure Model Verification
1.Create the Simulink model shown in Figure 3.
2. Use experimental 1.0 Volt parameters for Tm
and Km. 3. Run the simulation. 4. Plot the data
in the Matlab command window and overlay it with
the experimental data. (See Figure 4.)?
Figure 3. SIMULINK Model Used to Verify Parameter
Identification
12?
Tm
Figure 4. Comparison of Experimental Data (solid
line) with Simulation Model (broken line)? Steady
state velocity is 7.35 rev/sec for 1.0 volt
input. Characteristic speed is 4.65 rev/sec at
0.945 sec.
13Procedure Qualitative Observations
1. Use Control_Qualitative.mdl as shown on
Figure 5. 3. Specify gains (Kp,Ki,Kd) for P
controller. 4. Build model and hit START. 5. For
each controller turn the flywheel with your hand
(1) quickly, (2) slowly, and (3) turn and hold in
position. 6. What aspect is the restoring force
sensitive to? Record your observations in your
lab notebook. 7. Repeat for I and D controllers.
14Quanser Consulting
Quanser Consulting
Transfer Fcn
Figure 5. SIMULINK Model for Qualitative
Observations
15Simulink and Quanser Blocks
From Quanser Library Quanser Consulting MQ3
Series
From Quanser Library Quanser Consulting MQ3
Series
(leave parameters as default)
(leave parameters as default)
From Quanser Library Quanser Consulting MQ3
Series
(leave parameters as default)
From Simulink Continuous
From Simulink Math
Parameters
Parameters
Gain 1/2000
Numerator 25 0
Denominator 1 25
From Simulink Source
Parameters
Constant Value 0
From Simulink Math
Parameters
List of signs
List of signs
Figure 6. SIMULINK and Quanser System blocks
16Controller Gain Calculations
These gains, calculated by the Pole-Placement
Method, are to be used in the next part of the
Controls lab. NOTE CONTROLLER GAINS SHOULD BE
CALCULATED VIA MATLAB
1. P (Proportional) Controller (MpXX)?
The damping ratio, ?, can be determined from the
fractional overshoot, Mp (XX) from the
relationship
(7)?
The proportional gain (8)?
2. PD (Proportional plus Derivative) Controller
(MpXX) and (tdsY.Ysec)?
The desired natural frequency can
be determined from the following
relationship
(9)?
17(10)?
(11)?
3. PID Controller (MpXX) and (tsY.Ysec)?
(12)?
(13)?
(14)?
(15)?
18Table 3 Calculated Controller GainsFor
specified Maximum Overshoot XX and specified
Settling Time Y.Y sec
(nn1)?
(nn2)?
(nn3)?
Note values of n1, n2, and n3 change each
semester