dc_motor_controller_report
dc_motor_controller_report
Abstract—This paper will present multiple controller designs encoders of all kinds), and were based on estimating the
for both speed and position control of a direct-current motor, required states.
while abiding to requirements set in order to control an engrav-
ing laser. For both speed and position control, proportional, PID, Thomas et al. worked on designing a position controller
lag-lead, and full-state feedback controllers are investigated, and of a DC motor by tuning a PID controller using a genetic
experimental results from a Quanser Qube Servo that nearly algorithm. The DC motor model is considered a third order
matches the mathematical model are compared with simulation model, thus no approximations have been made to have more
results from that model. The PID controller design in both
systems meets the requirements with the least error and is thus
DOFs. Aside from tuning the PID controller using a genetic
chosen as the final design. algorithm, the paper also discussed designing the controller
using the Ziegler-Nichols method. The second method has
I. I NTRODUCTION shown to be inferior to the genetic algorithm tuner, which is
expected since ZN provides a first guess of the parameters
The Direct Current motor is one of the most widely
needed, and the stochastic nature of genetic algorithms works
used motors in industries worldwide. Even though they are
on minimizing the error between the actual response and
more costly to maintain over induction motors, they are still
desired response. Another advantage of the genetic algorithm
preferred due to excellent speed control characteristics[NT09].
tuning technique is that is could be applied to higher order
In addition to this, speed and position controllers are widely
systems as well, making it a modular multi-purpose algorithm.
available for DC motors of all sizes and power, from toy
motors to industrial grade motors. But even with all these Praesomboon et al. [SP09] proposed a sensorless DC motor
favorable qualities, simply applying constant power to a DC speed controller using a Kalman filter. With the end goal being
motor will not maintain the desired speed[Awa10]. Distur- a system output of estimated speed, this was achieved by
bances taking place at any point inside the motor, whether designing the Kalman filter to reject noise. The error between
a varying load torque on the shaft or electrical noise on the the estimated speed and reference speed is then fed back to the
input, will guarantee that the motor speed drifts away from system and driven to zero by a linear amplifier (proportional
that which is desired. There exists several types of DC motors gain). This method of senseless control based on estimating
such as a stepper motor, a permanent magnet DC motor, states seems to have been popular since the 1970s.
PCB motors, ... Each has its advantages and disadvantages In 1978, Rajaram et al. wrote about a new approach to
over the others, but for the purpose of this laser engraver sensing a DC motor speed without the use of any additional
application, a brushed DC motor will be used. DC motor circuitry, cutting costs and increasing compactness without
shaft rotation speed and position (angle) are mainly measured affecting weight. They aimed to avoid traditional sensing
using encoders, which could be of many types (optical, rotary, methods that involve external additional hardware along with
magnetic, ...). Then encoders issue a stream of pulses with mechanical coupling by basing their measurement on the back
variable frequency according to the motor speed, hence have a EMF of the motor, in addition to a sensing resistor in series
unit of Pulses-Per-Revolution (PPR). [ySEAH03] The encoder with the armature and some simple circuitry. That results in an
in use in the experimental section of this paper is an optical amplifier output that is proportional to the speed of the motor,
encoder mounted on the shaft of the brushed motor. and thus can be used as a sensor measurement [Raj78].
Another intelligent DC motor position controller designed
II. L ITERATURE R EVIEW
by Ohishi et al. is a load insensitive controller, which works
The main purpose of this paper is to investigate the fitness by estimating the load torque [ea02]. By estimating this
of different controllers meeting set requirements for DC motor torque the controller can adjust the torque needed to drive the
speed and position control. The most widespread DC motor system to the required position without any steady state error.
driving method is PWM or Pulse Width Modulation, which This is similar to having a variable parameter mathematical
works by alternating the applied voltage from high to low model, but instead of the controller being affected by each
and vice-versa. This delivery of energy through a succession parameter change, a state estimation is invoked to take away
of pulses allows for speed control by varying the duty cycle of that complexity and overhead in processing.
this alternating signal[SSU16]. The fast switching is seen by
the motor as a Vrms < Vsupply , which allows for voltage
variation digitally, without the use of varying resistances.
Most of the literature focuses on controlling DC motors with III. M ODEL
simple feedback loops, using tunable compensators, and mod-
ern research investigates advanced tuning techniques relating
to artificial intelligence and optimization algorithms. Other The DC Motor dynamics used are based on the motor
interesting control techniques are independent of sensors (i.e. model in Fig. [1]. The derivation
0 −JR−Lb
x1 1 x 0
JL 2
= −Rb−K ∗ 1 + K ∗ u(t)
x02 JL
0 x2 JL
x
y(t) = 1 0 ∗ 1
x2
Figure 1. Circuit model of a DC Motor.
IV. A NALYSIS
The equations for the internal generated voltage and the The speed control system is a second order elec-
induced torque developed by the DC Motor are given by: tromechanical system having two poles at s1 =
[J.C12] −7399 and s2 = −16.2. It is seen that the pole
Tind = Kφ IA s2 , which corresponds to the mechanical system
dominates the electro-mechanical system’s response
ea = Kφ ωm because of a difference by a factor of 456 from
the pole s1 , which corresponds to the electrical
Applying Kirchoff’s law and Newton’s law to system.Henceforth, since the factor of difference is
system in Fig.[1]. The following is obtained: greater than five, the system could be approximated
by a first order mechanical system, since the me-
d2 θ dθ chanical response and second order response are
J 2
+ b = Ki
dt dt exactly alike as seen in the following figure.
di dθ
L + Ri = V − K
dt dt
Applying the Laplace transform, the transfer
function Gspeed (s) is obtained, assuming Kb = Km .
K
Gspeed (s) =
JLs2 + (JR + Lb)s + (Rb + K 2 )
2
it at 1rd/s which is 60 degrees per second. This 2) Frequency Domain Analysis: It was verified upon
torque obviously cannot be achieved by a motor simulation via MATLAB that the system’s speed
running at 10-24V with around 2A of current is stable. This is verified with infinite gain margin
and without a gearbox. and a safe phase margin in both the open loop and
• Quanser Qube Servo parameters are similar to closed loop systems. The bandwidth of the closed
the provided parameters in all aspects but the loop system exceeds that of the open loop speed
viscous friction coefficient, which differs by 6 system by a factor of 21.6; which clarifies that the
orders of magnitude. closed loop response is of a better response.
• The proportional gain, which translates into Speed open loop: Phase margin: 90.4648 degrees
voltage required to drive the motor, needed to Gain Margin: Inf dB
track a step response (i.e. 1rd/s) is over 7000. Bandwidth: 16.1278 rad/s
A 7000V input to the motor is impossible
knowing that it operates on 10-24V.
Figure 4. Comparison between open loop speed response and closed loop
speed response.
Figure 6. Bode plot of the closed loop speed system.
It is seen that the closed loop system is better to
meet the speed requirements since it is near 1 at The system is
3) Controllability and Observability:
steady state whereas the open loop is near 20 at composed of two controllable and observable
steady state. states which means that the speed system is both
For open loop, the peak is 19.7 so it is an completely controllable and completely observable
undesired response. However for the closed loop, .Therefore, all states in the system can be modified
the overshoot is 0, the steady state error is 4.8%, to reach a certain desired response, and can all
and the settling time is 0.0113 sec. be sensed, measured, using sensors to know the
estimators for the input of a system.
3
Controllability matrix of the speed system: loop system increases as a ramp nonstop, which
seems logical since an integrator was added which
1 −7.4176e3 aggravated stability, so it is definitely not desired
0 1 as a system response. However, the feedback in the
closed loop system made the response settle to 1
Uncontrollable states = 0 instead of increasing infinitely which is desired. For
the closed loop, the maximum overshoot is 20%, the
Observability matrix of the speed system: settling time is 0.468 seconds, and a steady state
error of 0.
0 2.3529e6
2.3529e6 0
Figure 8. Closed loop position step response. Phase margin: 49.3 Degrees
Position closed loop:
Gain Margin: 51.5 dB
Applying the step for both open loop and closed Bandwidth: 23.5968 rad/s
loop position systems, it is seen that the open
4
From this requirement, it can be deduced that
the maximum overshoot is 100rpm/ωmax =
100rpm/2000rpm = 0.05 which translates to 5%.
1) Proportional Controller:
Uncontrollable states = 0
Figure 11. Comparing Speed Closed Loop and Proportional Step Responses
5
4) Full state feedback controller: In designing the full
state feedback controller, it is assumed that all states
of this system are measurable and available for
feedback. In order to design the full state feedback
controller, it is crucial at first to check if the system
is fully state controllable. As checked before, the
speed system is fully state controllable. The speed
system is known to have the following state space
representation:
0
x1 −7415.2 1 x1 0
= ∗ + ∗u(t)
x02 −119614.1 0 x2 2352941.176
x1
y(t) = 1 0 ∗
x2
Figure 12. Comparing Speed Closed Loop and PID Step Responses The state controller will be placed such that to
make the control signal u=-[K]x+k1 r. The gain
matrix [K] will be decided with respect to the
location of the desired closed loop poles of the
3) Compensator Design with Root Locus: system. The specifications for the speed system is to
track the input without exceeding ±100 rpm, so the
It is seen that by simply adjusting the gain (as desired closed loop pole locations will be chosen
done in the preceding proportional controller), the to be s1 = −189 + j169 and s2 = −189 − j169
requirements can be met and thus no lag or lead in order to meet these specifications. Using the
compensator is necessary. To further prove this function place in Matlab we get the gain matrix
point consider the following: to be:
The transient response of the system settles after [K] = 22.16 −0.003
11.3 ms at a value of 0.952 rad/s when it responds
to a unit step response, which means that the system −7415.2 1
A − BK =
response is quick enough. Hence, the transient −5.225e7 7038.2
response does not need modification. This is Using u= -[K]x + k1 r and x0 = Ax + Bu so x0 =
verified by the two real closed loop poles that yield (A-BK)x + Bk1 r which will become:
an angle deficiency of zero degrees. Therefore,
any pole-zero placement would not have any effect 0
x1 −7415.2 1 x1 0
on the transient response. Moreover, because it = ∗ + ∗r
x02 −5.225e7 7038.2 x2 5.214e7
lacks an integrator, it is a type 0 system. This
means that for a given step input, the response
x1
will yields a steady state error that decreases with y(t) = 1 0 ∗
x2
an increase in K, proportional gain. Therefore,
B. Position Controller
with the current system, a lag compensator would
not decrease the steady state error because of the In designing the position controller, the transfer
absence of complex closed loop poles. In addition function Gposition (s) is used. The four controllers
to this, the response has two closed loop real poles that will be designed are a proportional controller,
that are large enough to cancel the effect of the a proportional-integral-derivative controller, a lead-
near origin pole-zero. Hence, the overall angle that lag controller using root-locus, and a full state
would result is zero which means that we don’t feedback controller. The requirements to be met are
have a lagging compensator. With such criteria, the following:
the design of a lag-lead system would not give the • Maximum overshoot and steady state error of
desired response. Hence, the better solution is to 1◦ in order for the laser engraving to be legible
◦
use a proportional gain that decreases the system’s • Ability to travel 50 in 0.5 seconds
steady state error, or a PID compensator that drives The first requirement is clear, while the second must
this error to zero. be met with simulation/implementation and accord-
ing adjustments since the relationship between the
6
degrees turned and the time taken by the motor to
settle is not linear and is slightly complex to derive.
7
Because the complex conjugate poles are complex 4) Full state feedback controller: In designing the full
conjugates, therefore, the zeta and the natural fre- state feedback controller, it is assumed that all states
quency were found as: of this system are measurable and available for
feedback. In order to design the full state feedback
ζ = 0.452
controller, it is crucial at first to check if the sys-
ωn = 17.83rad/s tem is fully state controllable. As checked before,
the position system is fully state controllable. The
Since, the system’s zeta is not in the desired range position system is known to have the following state
[0.7796-0.8831] that corresponds to the intended space representation:
50 degrees and a safe margin of 360 degrees
respectively; The average of both was selected, 0
x1 −214370 1 0 x1 0
0.83. Therefore the new complex conjugate poles 0
x2 = −345684.8 0 1∗x2 + 0 ∗u(t)
change to:
x03 0 0 0 x3 6.8e6
s = −14.82 + j9.9 x1
y(t) = 1 0 0 ∗ x2
s = −14.82 − j9.9 x3
The state controller will be placed such that to
The compensator was designed using the angle make the control signal u=-[K]x+k1 r. The gain ma-
deficiency method with an angle of deficiency of trix [K] will be decided with respect to the location
64.26 degrees that relies on one lead compensator of the desired closed loop poles of the system. The
because the angle is strictly less than 65 degrees. specifications for the position system is to track the
This method yields the chosen zero and pole of the input of 50◦ in 0.5 sec without exceeding ±1◦ ,
compensator as follows: so the desired closed loop pole locations will be
z = −11.85; p = −25.8 chosen to be s1 = −10 + j6.7, s2 = −10 − j6.7,
and s3 = −100. A second order approximation was
Moreover, the gain was calculated to be K = used using the fact that the complex conjugate poles
47.03e6 which is unrealistic and drives the response are dominant with a factor of 10 difference from
to instability as shown in Fig.[16]. the third pole, to meet the required specifications.
Using the function place in Matlab we get the gain
matrix to be:
[K] = −1.44e9 6754 3.151e− 3
−2.14370e5 1 0
A − BK = −3.456e5 0 1
1
9.84e 5 4.59e 0 2.14e5
1
8
VI. F INAL D ESIGN in the desired infinite value in the denominator
Relying on the experimental validation, the PID that drives the system’s disturbance to zero. The
controller is chosen to be the final controller design. difference between both PI and PID controllers
For both speed and position, the PID controller was the time each controller’s system would need
showed rejection to any time of noise applied while to eliminate the error. PID controllers’ settling time
meeting the specified criteria for both speed and was less than that of the PI controller by a factor
position control systems. The PID compensated that increased as we increase the magnitude of the
system, is distinguished by a fast transient with disturbance as MATLAB verifies such argument.
a small settling time while maintaining the spec- The maximum value of the response to a unit step
ified maximum overshoot. While on the contrary, disturbance is:
any other controller as P, PI, full state feedback
controllers, reach the desired specifications but the • Speed Response: 7.57rd/s at t=0.00196s. This
difference is best shown in disturbance rejection. value decays exponentially until zero at 0.12s.
The P controller, minimizes the error to zero if • Position Response : 394rd at t=0.201s. This
the proportional gain was large enough but doesn’t value decays exponentially until zero at 2.5s.
respond fast to any disturbance. The PI controller These values are found by observing the step
rejects quite well, but compared to the PID, the PID response to the disturbance transfer function in
controller is better in increasing stiffness against MATLAB Fig.[17].
noise. The lead compensator showed nonlinearity
that corresponds to a large gain in position control
while on the other hand, it was not used in speed
control because, the system consists of two real
roots. The lag compensator increased overshoot
beyond the limit and increased the position’s re-
sponse’s settling time while on the other hand, the
lag compensator was not applied in speed control
because of the two real roots that broke the rule
of thumb that relates to the angle criterion. Full
state feedback controllers, responded well in speed
control, reached specifications, and competed with
the PID controller a lot. But, in position control, the
full state feedback controller showed nonlinearity
because, the system had massive gains within its
state space representation. The thing that makes Figure 17. Position System Response to a Step Disturbance
such system more expensive than a PID controller
whose value is not as high as large actuators. B. Tracking
Henceforth, PID controller met all desired specifi- The PID corrected system lags the the ramp
cations in both speed and position control systems. input by a magnitude of 0.03 and tends to correct
A. Disturbance Rejection its behavior as time increases to ideally track the
input response. The PID controller was designed to
The disturbance to output transfer function can
surpass the given specifications, as the experimental
be represented as follows:
validation proved. No oscillations are shown versus
Ls + R a ramp input. The system is sufficiently damped
Gdisturbance (s) = 2
(Ls + R)(Js + b) + C ∗ K + K so that both control systems meet the maximum
overshoot criteria that limits zeta to a certain range
where C stands for the compensator’s transfer to assure a margin for safety purposes.
function.
VII. E XPERIMENTAL R ESULTS
From the transfer function, it can be noticed that if
we have an infinite value in the denominator then, To simulate the numerical model, MATLAB’s
the output due to the disturbance would converge Simulink is used. Important things to note are the
to zero in steady state. To meet such specification, following:
it was found that the PID controller induces a pole • The process of converting the input from de-
at the origin in its transfer function which results grees to radians (in the case of position) and
9
from RPM to radians per second (in the case of
speed) is done by inserting a scaling gain block
RPM2RDS right after the input, and another
RDS2RPM right before the output. This way,
the system isn’t affected by what the input
unit is, and runs according to its base SI units
which are radians and radians per second. The
conversion provides an interface for the user
to input more familiar units, and observe more
familiar outputs.
By trial and error, in an attempt to minimize
the difference between the mathematical model and
the physical DC motor setup, it is derived that
the damping friction coefficient is b = 20.88e-5
N ·m·s/rad. Using this damping friction coefficient
Figure 18. 1rd/s Step Response of Speed Proportional Controller w/ Kp =
allows the mathematical model responses to most 8.381
precisely match the physical model responses. This
is found after analyzing and designing the above 2) PID Controller:
controllers, so this change in b is not made. All
results will be based on b=6.88e-5N · m · s/rad. Using the parameters derived for the numerical
model, the Quanser Qube produces very fast speed
A. Speed Control changes, which nearly damages the motor. This
is caused by the Kd 0.0006, so it is increased
In speed control, it is important to note that even to 0.5 to stop this destructive behavior. Kp andKi
though the step inputs are speeds of 1 rd/s, the error are the same as the ones derived in our numerical
requirement of 5% will result in this requirement model. This results in the step response observed
being met for any speed from 0 rpm to 2000 rpm, in Fig.[19]. This response doesn’t meet the re-
which is the range of operation of the motor. Thus quirement either, but with some different tuning
step responses of 1 rd/s meeting the 5% error definitely could, at the cost of response time. As
criterion are sure to meeting the requirement for is seen in the figure, the motor takes around 0.5
higher speeds; the unscaled step response is enough seconds to settle, which is arguably large in speed
to portray the behavior of the motor for all operating controlling this motor compared to the responses
speeds. acquired with MATLAB using the mathematical
1) Proportional Controller: model.
10
proportional controller, mainly due to the fact that it
contains an integral term and can drive the error to
zero. Perturbing the shaft with external objects, con-
stant pressure is applied, and the motor increases
its torque to drive its speed towards the desired
speed. This error minimization is not possible using
a simple gain factor.
B. Position Control
11
responses to maximum overshoot and a desired set-
tling time for phase, angle shift and speed control.
The PID, PI, and full state feedback controllers
competed against each other’s characteristics, as
they all drove the error to zero, met the required
specifications, and met the desired responses upon
simulation and experimentation. The PID controller
was a better design because of its immediate re-
sponse to any kind of disturbance, faster transient
response even though by a difference of 0.05 sec-
onds from its closest competitor,full state feedback,
and relative cost compared to other controllers that
rely on a big budget to satisfy the large gained
control signals by means of large actuators.
N OMENCLATURE
θ̇ Angular Speed in rd · s−1
ω Angular Speed in rd · s−1
ωnom Motor Nominal Angular Speed in rd · s−1
θ Angle in rd
b Motor Viscous Friction Coefficient in N · m ·
s · rd−1
J Moment of Inertia in kg · m2
Km , Kb Motor Constant in N · m · A−1
La Armature Electric Inductance in H
Ra Armature Electric Resistance in ω
T Torque in N · m
Tnom Motor Nominal Torque in N · m
Vrms Root Mean Square Voltage in V
R EFERENCES
[Awa10] Mohd Amir Fikri Bin Awang. DC Motor Speed Controller. BS
dissertation, Universiti Malaysia Pahang, 2010.
[ea02] Kiyoshi Ohishi et al. Microprocessor-Controlled DC Motor for
Load-Insensitive Position Servo System. IEEE Transactions on
Industrial Electronics, 49(2):462 – 473, 2002.
[J.C12] Stephen J.Chapman. Electric Machinery Fundamentals. Mc-
Graw Hill, 1221 Avenue of the Americas, New York, NY 10020,
2012.
[NT09] Dr. P. Poongodi Neenu Thomas. Position Control of DC Motor
using Genetic Algorithm Based PID Controller. Proceedings of
the World Congress on Engineering, 2, 2009.
[Raj78] S. Rajaram. A New Method for Speed Measurement/Control
of DC Motors. IEEE Transactions on Instrumentation and
Measurement, 27(1):99 – 102, 1978.
[SP09] et al. S. Praesomboon, S. Athaphaisal. Sensorless speed control
of DC servo motor using Kalman filter. 7th International Con-
ference on Information, Communications and Signal Processing,
pages 1–5, 2009.
[SSU16] Dinesh Patil Sarita S. Umadi1. DC Motor Speed Control
Using Microcontroller. International Journal of Engineering
and Techniques, 2(6), 2016.
[ySEAH03] S. M. Uashi y. S. E. Ali, S. B. M. Noor and M. K Hassan.
Microcontroller Performance for DC Motor Speed Control Sys-
tem. National Power and Energy Conference Proceedings, pages
104–109, 2003.
12