Tune an Electric Drive
This example shows how to tune an electric drive using a cascade control structure.
Cascade Control Structure
The figure shows a feedback control loop that uses a cascade control structure. The outer speed-control loop is slower acting than the inner current-control loop.
Equations for PI Tuning Using the Pole Placement Method
To satisfy the required control performance for a simple discrete plant model, Gf (z-1), use a closed loop PI control system GPI(z-1). The transient performance can be expressed in terms of the overshoot. The overshoot decreases relative to the damping factor:
σ is overshoot.
ξ is the damping factor.
The response time, tr, depends on the damping and the natural frequency, ωn, such that:
If ξ < 0.7,
If ξ ≥ 0.7,
The general workflow for designing a PI controller for a first-order system is:
Discretize the plant model using the zero-order hold (ZOH) discretization method. That is, given that the first-order equation representing the plant is
Km is the first-order gain.
Tm is time constant of the first-order system.
yields the discrete plant model,
whereTs is sample time for the discrete-time controller.
Write a discrete-time representation for the PI controller using the same transform. For
yields the discrete controller model,
Combining the discrete equations for the plant and the controller yields the closed loop transfer function for the system,
The denominator of the transfer function is the characteristic polynomial. That is,
The characteristic polynomial for achieving the required performance is defined as
To determine the controller parameters, set the characteristic polynomial for the system equal to the characteristic polynomial for the required performance. If
Solving for q0 and q1 yields
Therefore, the general equations for the proportional and integral control parameters for the first-order system are
Equations for DC Motor Controller Tuning
Assuming that, for the system in the example model, Kb = Kt, the simplified mathematical equations for voltage and torque of the DC motor are
va is the armature voltage.
ia is the armature current.
La is the armature inductance.
Ra is the armature resistance.
ω is the rotor angular velocity
Te is the motor torque.
Tload is the load torque.
Jm is the rotor moment of inertia.
Bmis the viscous friction coefficient.
Kb is a constant of proportionality.
To tune the current controller, assume that the model is linear, that is, that the back electromotive force, as represented by Kbω, is negligible. This assumption allows for an approximation of the plant model using this first-order Laplace equation:
Given the system requirements, you can now solve for KP and KI. The requirements for the current controller in the example model are:
Sample time, Ts= 1 ms.
Overshoot, σ = 5%.
Response time, tr = 0.11 s.
Therefore, the proportional and integral parameters for the current controller are:
To tune the speed controller, approximate the plant model with a simple model. First assume that the inner loop is much faster than the outer loop. Also assume that there is no steady-state error. These assumptions allow for the use a first-order system by considering a transfer function of 1 for the inner current loop.
To output rotational velocity in revolutions per minute, the transfer function is multiplied by a factor of 30/π. To take as control input the armature current instead of the motor torque, the transfer function is multiplied by the proportionality constant, Kb. The resulting approximation for the outer-loop plant model is
The speed controller has the same sample time and overshoot requirements as the current controller, but the response time is slower, such that:
Sample time Ts= 1 ms.
Overshoot σ = 5%.
Response time tr = 0.50 s.
Therefore, the proportional and integral parameters for the speed controller are:
Tune the Electric Drive in the Example Model
Explore the components of the DC motor and the cascaded controller.
Open the model. At the MATLAB® command prompt, enter
model = 'ee_dc_motor_control' open_system(model)
The Control subsystem contains the model of the cascaded control system built using blocks from the Simulink® library.
The Four Quadrant Chopper block represents a four-quadrant DC-DC chopper that contains two bridge arms, each of which has two IGBT (Ideal, Switching) blocks. When the input voltage exceeds the threshold of
0.5V, the IGBT (Ideal, Switching) blocks behave like linear diodes with a forward-voltage of
0.8 Vand a resistance of
1e-4ohm. When the threshold voltage is not exceeded, the IGBT (Ideal, Switching) blocks act like linear resistors with an off-state conductance of
Simulate the model.
View the results. Open the Scope block.
At 1.5 seconds, there is a load torque that results in a steady-state error.
Tune the DC motor controller. The
ee_getDCMotorFirstOrderPIParamsfunction calculates the proportional gain, KP, and the integral gain, KI, for the first-order system in this example.
The function syntax is
[Kp, Ki] = getParamPI(Km,Tm,Ts,sigma,tr).
The input arguments for the function are the system parameters and the requirements for the controller:
Kmis the first-order gain.
Tmis the time constant of the first-order system.
Tsis the sample time for the discrete-time controller.
sigmais the desired maximum overshoot, σ.
tris the desired response time.
To examine the equations in the function, enter
To calculate the controller parameters using the function, save these system parameters to the workspace:
Ra=4.67; % [Ohm] La=170e-3; % [H] Bm=47.3e-6; % [N*m/(rad/s)] Jm=42.6e-6; % [Kg*m^2] Kb=14.7e-3; % [V/(rad/s)] Tsc=1e-3; % [s]
Calculate the parameters for tuning the current controller as a function of the parameters and requirements for the inner controller:
[Kp_i, Ki_i] = ee_getDCMotorFirstOrderPIParams(1/Ra,La/Ra,Tsc,0.05,0.11)
Kp_i = 7.7099 Ki_i = 455.1491
The gain parameters for the current controller are saved to the workspace.
Calculate the parameters for tuning the speed controller based on the parameters and requirements for the outer controller:
[Kp_n, Ki_n] = ee_getDCMotorFirstOrderPIParams((Kb*(30/pi))/Bm,Jm/Bm,Tsc,0.05,0.5)
Kp_n = 0.0045 Ki_n = 0.0405
The gain parameters for the speed controller are saved to the workspace.
Simulate the model using the saved gain parameters for the speed and controllers.
View the results. Open the Scope block.
There is slightly more overshoot, however, the controller responds much faster to the load torque change.