Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
DC Motor Control Design
Given a model of a DC motor as a set of differential equations, we want to obtain both the transfer function and the state space model of the system. Then, we want to use the state space model to design a LQR controller and study the effect the R parameter in the LQR control design has on the controlled performance of the system.
System Definition
Parameters
Variables
System Models
Differential Equation Model
Transfer Function Model
State Space Model
Model Analysis
LQR Control Design
Step Responses
How varying R affects the System Response
A DC motor converts electrical signals (voltage and current) into mechanical motion. The electrical and mechanical characteristics can be illustrated by a circuit diagram and a free body diagram respectively (shown in the diagram above).
Define the Variables and the Parameters that describe the system.
Name
Value
Units
Moment of inertia of the motor ()
Damping of the mechanical system ()
Electromotive force constant ()
Motor coil resistance ()
Motor coil inductance ()
Description
Input Variables
Applied Voltage
Output Variables
Motor Shaft Angular Position
Motor Current
To derive the model of the system, first, we apply Kirchhoff's voltage law around the circuit. The back EMF is proportional to the angular velocity of the motor shaft. Using the command we get:
Second, we model the mechanical component of the motor as a second order differential system with moment of inertia and damping ratio of . The torque is proportional to the current driving the motor.
The overall differential equation model in terms of the voltage, , and angular position, , is:
To obtain the transfer function model of our system, we convert the overall differential equation model ( into a transfer function model using command. is the open loop transfer function for the angular position from the input and is defined as:
The state space model of a system is defined as follows:
System input signal, p × 1 vector
System output signal, m × 1 vector
System state vector, n × 1 vector
A
System matrix, n × n matrix
B
Input matrix, n × p matrix
C
Output Matrix, m × n matrix
D
Direct through matrix, m × p matrix
For the case of the DC motor, the states , and represent current, , angular position, , and angular velocity, , respectively.
To obtain the state space model of our system, we convert the overall differential equation model ( into a state space model using command.
The command can be used to plot the angular position with parameter set, , initial conditions, and input voltage signal, defined below:
The system can also be analyzed in the frequency domain. Substituting the parameter values into the open loop transfer function in (2.2.1)results in:
The above transfer function can be plotted as a magnitude plot and a phase plot.
# LQR procedure
Our objective is to be able to rotate the shaft position, , of the motor to specified desired positions. In control terms, this translates to minimizing the motor shaft position error. As such, we put higher weighting on the position state, , in the Q matrix in our LQR controller design.
The controller gain for the full state feedback LQR controller is then computed using the custom procedure LQR( ). With the Q matrix defined in (3.1.2)and the result is the gain vector given by:
The numeric solution can now be obtained for the step response of the open loop (uncontrolled) and closed loop (controlled) cases.
Open loop (uncontrolled) response
Closed loop (controlled) response
Input functions used examine the open loop and closed loop response are defined as:
Determine the open loop Differential Equation Model in terms of the State Space variables , and .
The open loop response is defined as:
The closed loop response is defined as:
The plot of the open loop state response is:
The plot of the closed loop state response is:
The plot of the closed loop angular position step response is:
In the controlled case, the shaft position of the DC motor follows the step change in the desired position (defined by the step input) and settles into the desired steady state value as expected.
We want to vary the weighting factor R for the LQR controller to see how it affects the system output response.
The R factor is the weighting coefficient for the input signal. By increasing R, we are putting more penalty on the control signal.
As such, the resulting controller will try to minimize the control efforts used to achieve the desired output.
Consider the results obtained earlier for R = 0.1.
Step response
Control Effort
First, recall the system step response output for the case R=0.1 developed previously. This will serve as our benchmark for comparison.
For comparison, we define an energy-like quantity (square of the input voltage) to give us an idea of the cost or the control effort required in operating the DC motor. Here, we show the control effort over time for the case R = 0.1.
Next, we generate the controller and the corresponding step time response for each value of R from 0.1 to 2. To compare the performance of each of the controllers, we define the control effort of the controller as the square of the input signal, summed over time. This associated control effort (or energy-like) value for each controller is the total cost in operating the individual controllers.
The following plot illustrates the total cost (integral of the energy like control function) for different values of R.
To see the effect of varying R, you can drag the slider to select different values of R and observe the resulting step response and the control effort.
Max R
Min R
R =
Download Help Document