DC Motor PD Control To Specification
DC Motor PD Control To Specification
Specifications
This Workbook and the VIs provided are designed for the second generation black Quanser QNET
2.0 DC Motor Board for NI ELVIS II(+) . Second generation VIs can be identified by the small black
symbol in the upper right corner of the VI. These VIs will not work for blue first generation boards.
Topics Covered
• QNET DC Motor position control.
Prerequisits
• QNET DC Motor Qualitative PD Position Control laboratory experiment.
• Modeling and Qualitative PI Speed Control
The two-degree of freedom PID transfer function inside the PID block in Figure 1.1 is
∫ t
u = kp (bsp r(t) − y(t)) + ki (r(τ ) − y(τ ))dτ + kd (bsd ṙ(t) − ẏ(t)) , (1.1)
0
where kp is the position proportional control gain, kd is the derivative control gain, ki is the integral control gain, bsp
is the set-point weight on the reference position r(t), and bsd is the set-point weight on the velocity reference of r(t).
The dotted box labeled Motor in Figure 1.1 is the motor model in terms of the back-emf motor constant km , the
electrical motor armature resistance Rm , and the equivalent moment of inertia of the motor pivot Jeq . The direct
disturbance applied to the inertial wheel is represented by the disturbance torque variable Td and the simulated
disturbance voltage is denoted by the variable Vsd .
K (kp + bsd kd s)
Gθ,r (s) = . (1.4)
τ s2 + (1 + Kkd )s + Kkp
Similarly to PI speed control, the standard characteristic equation s2 + 2sζωn + ωn2 can be achieved by setting the
proportional gain to
ω2 τ
kp = 0 , (1.5)
K
and the derivative gain to
−1 + 2ζω0 τ
kd = . (1.6)
K
Y (s) ωn2
= 2 , (1.7)
R(s) s + 2ζωn s + ωn2
where ωn is the natural undamped frequency and ζ is the damping ratio. The properties of its response depend
on the values of the ωn and ζ parameters. Consider when a second-order system, as shown in Equation 1.7, is
subjected to a step input given by
R0
R(s) = (1.8)
s
with a step amplitude of R0 = 1.5. The system response to this input is shown in Figure 1.2, where the red trace is
the response (output) y(t) and the blue trace is the step input r(t).
The maximum value of the response is denoted by the variable ymax and it occurs at a time tmax . For a response
similar to Figure 1.2, the percent overshoot is found using
100 (ymax − R0 )
PO = . (1.9)
R0
In a second-order system, the amount of overshoot depends solely on the damping ratio parameter and it can be
calculated using the equation ( )
− √ πζ
1−ζ 2
P O = 100e . (1.10)
tp = tmax − t0 . (1.11)
This is called the peak time of the system and it depends on both the damping ratio and natural frequency of the
system. It can be derived analytically as
π
tp = √ . (1.12)
ωn 1 − ζ 2
Generally speaking, the damping ratio affects the shape of the response while the natural frequency affects the
speed of the response.
See Wikipedia for more information on motion control, control theory and PID.
• ζ = 0.60,
• ω0 = 25.0 rad/s.
Optional: You can also design a VI that simulates the DC motor first-order model with a PD control and have
it calculate the peak time and overshoot.
Answer 2.1
Outcome Solution
A-2 Substituting the ζ above in Equation 1.10 yields
P O = 9.45 %. (Ans.2.1)
Using Equation 1.12, the peak time equation with the ω0 and ζ given above equates to
You can also run the DCMC_Position_PD_CD_Instructor.vi to simulate the step response
and find the peak time and percentage overshoot.
2. A-2 Assuming the model steady-state gain is K = 26 V/rad and time constant is τ = 0.145 s, calculate the
proportional and derivative control gains kp and kd , respectively, to meet the specifications above.
Answer 2.2
Outcome Solution
A-2 Substituting the model parameters and natural frequency given above into Equation 1.5
generates the proportional control gain
The derivative control gain is obtained by applying the model parameters with the natural
frequency and damping ratio specifications to Equation 1.6
You can also run the DCMC_Speed_PI_CD_Instructor.vi to find the PI gains. It also
generates the set-point weight parameter.
3. Open the QNET DC Motor Position Control.vi. Make sure the correct Device is chosen.
4. Run the VI. You should see the DC motor rotating back and forth.
6. In the Control Parameters section, set the PD gains to the values found in Step 2. The PD controller is
implemented with bsd = 0.
Answer 2.3
Outcome Solution
B-5 If the experimental procedure is followed correctly, the measured QNET DC Motor
closed-loop position step response should be similar to Figure Ans.2.1.
K-2 The closed-loop position response when using the PD control gains Equation Ans.2.3 and
Equation Ans.2.4 with bsd = 0 is shown in Figure Ans.2.1.
8. K-1, B-9 Measure the peak time and percentage overshoot of the measured position response. Are the
specifications satisfied?
Answer 2.4
Outcome Solution
K-1 Looking at the two cycles in the response in Figure Ans.2.1, the peak of transient occurs
about 0.125 seconds after the rising edge of the step, thus
tp = 0.1 s. (Ans.2.5)
As shown in Figure Ans.2.1, when tracking the square reference the motor position does not
go over 0.52 rad, so the overshoot is approximately less than
P O = 2.0 %. (Ans.2.6)
Note that there is a steady-state error of ≈ 3 %. This is due to relatively small error signal
that results in an input voltage in the deadband of the DC Motor. Adding an integral gain
would increase the tracking performance, see the laboratory experiment on Tracking and
Disturbance Rejection.
B-9 The specifications computed in Equation Ans.2.1 and Equation Ans.2.2 are satisfied.
9. B-2 What effect does changing the specification zeta have on the measured position response and the
generated control gains?
10. B-2 What effect does changing the specification ω0 have on the measured position response and the
generated control gains?
Answer 2.6
Outcome Solution
B-2 Increasing the natural frequency ω0 decreases the peak time (i.e. the response becomes
faster) and has no major effect on the percent overshoot. In term of control gains, as ω0 goes
up both kp and kd increase.
Quanser Inc.
119 Spy Court
Markham, Ontario
L3R 5H6
Canada
info@quanser.com
Phone: 1-905-940-3575
Fax: 1-905-940-3576
For more information on the solutions Quanser Inc. offers, please visit the web site at:
http://www.quanser.com
This document and the software described in it are provided subject to a license agreement. Neither the software nor this document may be
used or copied except as specified under the terms of that license agreement. Quanser Inc. grants the following rights: a) The right to reproduce
the work, to incorporate the work into one or more collections, and to reproduce the work as incorporated in the collections, b) to create and
reproduce adaptations provided reasonable steps are taken to clearly identify the changes that were made to the original work, c) to distribute
and publically perform the work including as incorporated in collections, and d) to distribute and publicly perform adaptations. The above rights
may be exercised in all media and formats whether now known or hereafter devised. These rights are granted subject to and limited by the
following restrictions: a) You may not exercise any of the rights granted to You in above in any manner that is primarily intended for or directed
toward commercial advantage or private monetary compensation, and b) You must keep intact all copyright notices for the Work and provide the
name Quanser Inc. for attribution. These restrictions may not be waved without express prior written permission of Quanser Inc.