DC MOTOR CONTROL
Roger Aarenstrup
roger.aarenstrup@mathworks.com
2
C O N T E N T S
Introduction ...............................................................................3
The dc motor model .................................................................4
Speed control with pid..............................................................6
Continuous control..........................................................................6
Discrete Control .............................................................................7
Choosing parameters.......................................................................9
Hand Code testing .......................................................................10
Using Simulink Control Design Products.....................................10
Rapid Prototyping ........................................................................10
Fixed Point .................................................................................11
Production Code Generation.........................................................11
Position control using state feedback pole placement.......12
Attempt 1 - state feedback and static gain ....................................12
Attempt 2 – integral action..........................................................12
Attempt 3 – Observer..................................................................13
Attempt4 – The servo case ...........................................................13
Considerations .........................................................................14
Bandwidth ...................................................................................14
Sample rate..................................................................................16
References.................................................................................17
3
INT R ODU C TIO N
This example describes how to develop speed and position control systems for a DC motor
with a load. Various methods are used and the focus is on how to model and implement the
various parts and not of parameter tuning. An important thing to note is that
a good controller
is not just a text book implementation but requires a number of additional parts to work
properly.
It is a good idea to go through this text together with the models and some control
design literature that gives more details about the theory. Please see the references chapter for
some suitable books.
This text and models come with absolutely no guarantee if you find anything incorrect please
let me know:
Roger.aarenstrup@mathworks.com
4
THE DC M OTO R MO D E L
The models used here can be downloaded from matlab central with the link;
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11829&objectType=file
The model is a quite simple linear DC motor model with a flexible load. In the library there
are MATLAB files describing a state-space representation of the model. How to derive them is
described in many control system books and also in the control system toolbox documentation:
http://www.mathworks.com/access/helpdesk/help/toolbox/control/getstart/buildmo4.html
The model described there doesn’t include the flexible load how to add that is described here
and in the models included.
I have found that a linear model is good enough for many control systems with DC motors.
Modeling is not about making the most detailed model but to make a model good enough for the
task.
There are a few things worth to notice. I have taken the dc motor parameters from the
maxon motors product catalog.
In the future I hope that it is possible to download models
directly from their web page
, just like it now is possible to download CAD models over the
mechanics. In the catalog there is no specific value for the mechanical damping. Using the
common expression for the mechanical time constant, Tm = bm/Jm, where bm is the
mechanical damping and Jm is the rotor inertia doesn’t give the correct no-load-current. This
might be due to non-linear parts here. I used simulations to estimate a mechanical damping that
gives a close match for the mechanical rise time and no-load-current. If you know more about
this, please let me know.
The figure below presents the DC motor model and load. The load is represented by a
double integrator with inertia. Since it is coupled with the motor rotor through a somewhat
flexible link there will be a spring action if the positions of the rotor and the load differ. The
difference in position (angle) is thus feed back as a counter torque multiplied by the spring
constant. The same is true for the damping. The difference in velocities between the two bodies
will damp the system. For details, please see the real model.
5
we
Figure, DC motor model with flexible load.
评论4