Controller Design
Linear State-Space Representation
Given the linear state-space equations: and , we define the state for the
Quanser Aero Experiment as
the output vector as
and the control variables as
where and are the pitch and yaw angles, respectively, and and are the motor voltages applied to the pitch and yaw rotors (i.e. the main and tail rotors). Using the equations of motion in Equations (1) and (2), the state-space matrices are
In this section, a state-feedback controller is designed to regulate the pitch and yaw angles of the Quanser Aero Experiment to desired angles. Using the previous state-space model, we can find a control gain based on the coupled dynamics to stabilize the system. The control gains are computed using Linear-Quadratic Regulator (LQR) theory. The general state-feedback control is illustrated in Figure 11. The state-feedback controller is defined
where is the state defined in Equation (38)
is the reference command (or setpoint) state with the desired pitch and yaw angles, and , and
is the control input where is the front/pitch motor voltage and is the tail/yaw motor voltage.
Linear Quadratic Regulator (LQR) optimization can be used for finding the control gain parameters
of the Quanser Aero Experiment flight control. Given the state-space representation, the LQR algorithm
computes a control law to minimize the performance criterion or cost function:
The design matrices and hold the penalties on the deviations of state variables from their setpoint and
the control actions, respectively. When an element of is increased, therefore, the cost function increases
the penalty associated with any deviations from the desired setpoint of that state variable, and thus the
specific control gain will be larger. When the values of the matrix are increased, a larger penalty is
applied to the aggressiveness of the control action, and the control gains are uniformly decreased.
Since there are four states , , and two control variables, . The setpoint, (Equation 43) is given
above the control strategy used to minimize cost function J is thus given by
Designing an LQR Controller
Various control software already has LQR optimization routines that can be used to generate the state feedback control gain . In order for the closed-loop response to satisfy certain time-domain specifications,
the closed-loop system is typically simulated using its dynamic model, in software, first. This is an iterative
process. By adjusting the weighting matrices and and then running the simulation, we can find a control that satisfies the user's requirements. Further, we must ensure that the control signal is smooth
(i.e. does not chatter) and does not surpass the limits of the actuator.
LQR Control Design and Simulation
LQR is used to find the state-feedback control gain ( is matrix) that will stabilize the Quanser Aero Experiment to the user's desired pitch and yaw angles. Our desired closed-loop response should match the following specifications. Use MATLAB command K = lqr(A,B,Q,R) to obtain gain, , matrix.
Desired closed-loop response specifications for pitch
Steady-state error: pitch ≤ 2 , yaw ≤ 2 .
The state-space matrices derived in Equation (41) are entered in the State-Space block in SIMULINK and the control gain is set to the MATLAB variable K.
Running the closed-loop state-feedback LQR simulation
Using parameters from Part A, obtain state-space matrices of the system neglecting coupling effect.
Design , and . To start with try with following , and .
Q = diag([200 75 0 0 ]);
R = 0.01*eye(2,2);
K = lqr(A,B,Q,R)
Things to check
What happened when you neglect the coupling effect?
Is there any systematic way to design and ?
Controller Implementation
In this section, the state-feedback control is implemented on the Quanser Aero Experiment using the q_aero_2dof_lqr_control SIMULINK diagram shown in Figure 12 with QUARC.
Download the file into the quanser_aero folder that was used for Week 1.
Desired Closed-Loop Response Specifications
Steady-state error: pitch ≤ 2 , yaw ≤ 2 .
Percent Overshoot: ≤ 7.5%.
Running the closed-loop state-feedback LQR simulation
Neglecting Coupling Effect
Pitch Command Only
Unlock both pitch and yaw axes to enable the full 2 DOF motion.
Open q_aero_2dof_lqr_control SIMULINK file.
Use the gain obtained in Part B. neglecting the coupling effect.
Yaw Command Only
Use a yaw command (45 deg) only by changing Amp_p to zero.
Copy aero_lqr_rsp.mat to your own folder and rename it as nocouple_yaw_only.
Both Yaw and Pitch
Use both pitch and yaw command
Copy aerolqrrsp.mat to your own folder and rename it as nocouple_pitch_yaw.
With Coupling Effect
Use the gain obtained in Part B. with the coupling effect.
Repeat above Pitch Only, Yaw Only and both Yaw and Pitch runs and rename the files as couple_####_###.
Close the Simulink. DO NOT SAVE THE CHANGE!
Analysis Question
Did your controller successfully meet the specs? If not, why?
How does the coupling affect the performance of the controller?
How can we improve the controller?