AE4610
  • Welcome
  • Experiments
  • Lab 0: MATLAB & SIMULINK
  • Lab 1: Rotary Servo Base
    • A. Integration (Week 1)
    • B. Modeling (Week 1)
    • C. Control Design (Week 2)
    • D. Controller Implementation & Evaluation (Week 3)
  • Lab 2: 3 DOF Gyroscope
    • A & B. Modeling and Control Design (Week 1)
    • C. Controller Implementation (Week 2)
  • Lab 3: Rotary Flexible Link
    • A. System Identification (Week 1)
    • B & C. Control Design and Controller Implementation (Week 2)
  • Lab 4: Rotary Inverted Pendulum
    • A & B. Modeling and Balance Control
    • C. Swing-up Control (Demo)
  • Final Project
  • Archive
    • Old Lab 1 Model Validation
    • Problem Set
    • DC Motor
    • Lab 1: Rotary Servo Base (Older Version)
      • A. Integration (Week 1)
      • B. Modelling (Week 1)
      • C. Position Control (Week 2)
    • Quadcopter
    • Gyroscope
    • Inverted Pendulum
    • 3DOF Helicopter
    • Torsional Pendulum
    • Aero LQR
      • A. System Identification
      • A. System Identification (Week 1) last check
      • B. Control Design & Implementation (Week 2)
    • Rotary Gyro
      • Rotary Gyro
    • 2 DOF AERO
      • A. System Identification
      • B. Control Design
      • C. Controller Implementation
    • Copy of Lab 4: Rotary Inverted Pendulum
      • Week 1
      • Week 2
Powered by GitBook
On this page
  • Objective
  • Design Specifications
  • Refer to the lecture note on control design.
  • Download Matlab Script
  • Controller Design
  • Simulation Modelling and Evaluation
  • Decoupled Dynamics with Decoupled Controller
  • Coupled Dynamics without Feedforward Controller
  • Coupled Dynamics with Feedforward Controller
  • Results for Report
  • (A) Simulation Modelling
  • (B) Simulation Evaluation
  • Questions for Report

Was this helpful?

Export as PDF
  1. Archive
  2. 2 DOF AERO

B. Control Design

PreviousA. System IdentificationNextC. Controller Implementation

Last updated 1 year ago

Was this helpful?

Objective

The objective of this experiment is to design a position control system for the Quanser Aero system in the 2 DOF configuration. The angular position controller should meet the following specifications:

Design Specifications

  1. Steady-state error to a step command input: (a) ess,pitche_{ss, pitch}ess,pitch​ = 0 deg (b) ess,yawe_{ss, yaw}ess,yaw​ = 0 deg

  2. Peak time of response to a step command input: (a) tp,pitcht_{p, pitch}tp,pitch​≤ 2s (b) tp,yawt_{p, yaw}tp,yaw​≤ 2s

  3. Percent Overshoot of response to a step command input: (a) POpitchPO_{pitch}POpitch​≤ 7.5% (b) POyawPO_{yaw}POyaw​ ≤ 7.5%

  4. No actuator saturation: (a) ∣Vθ∣|V_\theta|∣Vθ​∣≤ 24V (b) ∣Vψ∣|V_\psi|∣Vψ​∣≤ 24V

Refer to the lecture note on control design.

Download Matlab Script

Download the setup aero file below and fill in the system parameters, control parameters and other necessary values to store in the MATLAB workspace. Use these variables in building Simulink so it is easier for you to put values. Make sure to check your values with TAs before running Simulink.

Controller Design

We will start our controller design by considering first the decoupled system. In this case, the Multiple-Input Multiple-Output (MIMO) system is represented as two separate Single-Input Single-Output (SISO) systems.

The pitch dynamics of the 2D Aero system is a Type 0 system, i.e., no pole at the origin. As such, we will select the PID controller structure for the pitch control design, which will meet the specification of zero steady-state error to a step command input. The yaw dynamics of the 2D Aero system is a Type 1 system, i.e., there is one pole at the origin. As such, we will select the PD controller structure for the yaw control design, which will meet the specification of zero steady-state error to a step command input.

  1. Choose appropriate values for POPOPO and tpt_ptp​ in both pitch and yaw axes satisfying the design specifications.

  2. For these selected values of POPOPO and tpt_ptp​ within the design specs, compute the desired values of damping ratio ζ\zetaζ and natural frequency ωn\omega_nωn​ using the following equations: PO=(e−ζπ1−ζ2)∗100%PO = \left(e^{ \frac{-\zeta \pi}{\sqrt{1 - \zeta^2}}}\right)*100\%PO=(e1−ζ2​−ζπ​)∗100% tp=πωdt_p = \displaystyle \frac{\pi}{\omega_d}tp​=ωd​π​ ωd=ωn1−ζ2\omega_d = \omega_n \sqrt{1 - \zeta^2}ωd​=ωn​1−ζ2​

  3. Using the aforementioned desired values of ζ\zetaζ and ωn\omega_nωn​ and the system parameters calculated in part A, compute the proportional gain KpK_pKp​ and the derivative gain KdK_dKd​ individually for pitch and yaw controllers as follows: Note: Let subscript op\text{op}op represent open-loop (actual system parameters), and subscript cp\text{cp}cp represent closed-loop (desired parameters). Pitch: Kp=ωncl2−ωnop2K‾θθK_p = \displaystyle \frac{\omega_{n_\text{cl}}^2 - \omega_{n_\text{op}}^2}{\overline{K}_{\theta \theta}}Kp​=Kθθ​ωncl​2​−ωnop​2​​ Kd=2ζclωncl−2ζopωnopK‾θθK_d = \displaystyle \frac{2 \zeta_{\text{cl}} \omega_{n_\text{cl}} - 2 \zeta_{\text{op}} \omega_{n_\text{op}}}{\overline{K}_{\theta \theta}}Kd​=Kθθ​2ζcl​ωncl​​−2ζop​ωnop​​​ Yaw: Kp=ωncl2K‾ψψK_p = \displaystyle \frac{\omega_{n_\text{cl}}^2}{\overline{K}_{\psi \psi}}Kp​=Kψψ​ωncl​2​​ Kd=2ζclωncl−1τopK‾ψψK_d = \displaystyle \frac{2 \zeta_{\text{cl}} \omega_{n_\text{cl}} - \displaystyle \frac{1}{\tau_{\text{op}}}}{\overline{K}_{\psi \psi}}Kd​=Kψψ​2ζcl​ωncl​​−τop​1​​ Note: In the above calculations, use the normalized thrust gains obtained using the steady-state method.

  4. Add an integral term, KiK_iKi​, to the pitch controller. Choose KiK_iKi​ to be a value in the range 1%−10%1\%-10\%1%−10% of KpK_pKp​. Caution: Integral feedback, while improving steady-state response, introduces lag. Large values of integral gain, while reducing damping, can lead to loss of stability of the closed loop system.

  5. Initially, set the feedforward gains (Kθ−to−ψK_{\theta-to-\psi}Kθ−to−ψ​ and Kψ−to−θK_{\psi-to-\theta}Kψ−to−θ​) to 0, i.e., ff_py = 0 and ff_yp = 0 in the MATLAB code. Eventually, you will choose appropriate values for the feedforward gains such that the coupling effect is minimized. For example, choose Kθ−to−ψK_{\theta-to-\psi}Kθ−to−ψ​ in Figure 1, to cancel the torque from the pitch rotor, i.e. , Kθ−to−ψ=−K‾ψθK‾ψψ(1)K_{\theta-to-\psi} = \displaystyle - \frac{\overline{K}_{\psi\theta}}{\overline{K}_{\psi\psi}} \qquad \qquad (1)Kθ−to−ψ​=−Kψψ​Kψθ​​(1) Likewise, choose Kψ−to−θK_{\psi-to-\theta}Kψ−to−θ​ to cancel the torque from the yaw rotor, i.e. , Kψ−to−θ=−K‾θψK‾θθ(2)K_{\psi-to-\theta} = \displaystyle - \frac{\overline{K}_{\theta\psi}}{\overline{K}_{\theta\theta}} \qquad \qquad (2)Kψ−to−θ​=−Kθθ​Kθψ​​(2) Feedforward controller minimizes the coupling effects. Use Figure 1 as a reference for how to add the two feedforward paths.

Simulation Modelling and Evaluation

  1. Create a SIMULINK model of the system. (a) Create subsystem blocks representing the plant. Figure 2 shows separate pitch and yaw plants. Note: Plants account for coupling (see Figures 3(a) and 3(b)). (b) Create subsystem blocks representing the decoupled pitch and yaw controllers. Figure 2 shows the input/output structure of these blocks. (c) Using the completed subsystem blocks, finish the diagram of the closed-loop system. Make sure to include pitch and yaw inputs, saturation blocks, and appropriate outputs. Use scopes and To Workspace blocks so that reference, output, and response signals can be tracked. (Make sure to maintain consistency between deg and rad in SIMULINK) (d) Set the sampling time to Fixed-step of step-size 0.002s in Modeling -> Model Settings.

Decoupled Dynamics with Decoupled Controller

Coupled Dynamics without Feedforward Controller

Coupled Dynamics with Feedforward Controller

  1. Set the feedforward gains Kθ−to−ψK_{\theta-to-\psi}Kθ−to−ψ​ and Kψ−to−θK_{\psi-to-\theta}Kψ−to−θ​ based on Eqs. 1 and 2 (marked as ff_py and ff_yp in the MATLAB code). These gains are different from the normalized cross-thrust torque gains that you set to make the coupled dynamics.

  2. Simulate the closed-loop response of the system with pitch-only command: θd=10°\theta_d = 10 \degreeθd​=10°and ψd=0°\psi_d = 0 \degreeψd​=0°. Save the data.

  3. Simulate the closed-loop response of the system with yaw-only command: θd=0°\theta_d = 0 \degreeθd​=0°and ψd=30°\psi_d = 30 \degreeψd​=30°. Save the data.

  4. Simulate the closed-loop response of the system with simultaneous pitch and yaw commands: θd=10°\theta_d = 10 \degreeθd​=10°and ψd=30°\psi_d = 30 \degreeψd​=30°. Save the data.

Results for Report

(A) Simulation Modelling

Include a screenshot of the complete SIMULINK model (block diagram). In addition, include the following subsystem block diagram screenshots:

  • Pitch and Yaw plants

  • Pitch and Yaw controllers

(B) Simulation Evaluation

  1. Mention the final yaw PD gains (Step 3).

  2. Yaw-only command case: State if the design specifications were met, either including figures with design specs marked (Step 3) OR including a table with the POψPO_{\psi}POψ​, tpψt_{p_\psi}tpψ​​, essψe_{ss_\psi}essψ​​ and max⁡∣Vψ∣\max |V_\psi|max∣Vψ​∣values recorded from the response (Step 4).

  3. Mention the final tuned pitch PID gains (Step 7).

  4. Pitch-only command case: State if the design specifications were met, either including figures with design specs marked (Step 7) OR including a table with the POθPO_{\theta}POθ​, tpθt_{p_\theta}tpθ​​, essθe_{ss_\theta}essθ​​ and max⁡∣Vθ∣\max |V_\theta|max∣Vθ​∣values recorded from the response (Step 7).

  1. Pitch-only command case: Plot the pitch and yaw data (commanded angles, simulation responses and motor input voltages) for pitch-only command (Step 2) and check if the design specifications were met in pitch.

  2. Yaw-only command case: Plot the pitch and yaw data (commanded angles, simulation responses and motor input voltages) for yaw-only command (Step 3) and check if the design specifications were met in yaw.

  3. Pitch and yaw combined case: State if the design specifications were met, either including figures with design specs marked (Step 4) OR including a table with the POθPO_{\theta}POθ​, tpθt_{p_\theta}tpθ​​, essθe_{ss_\theta}essθ​​, max⁡∣Vθ∣\max |V_\theta|max∣Vθ​∣, POψPO_{\psi}POψ​, tpψt_{p_\psi}tpψ​​, essψe_{ss_\psi}essψ​​ and max⁡∣Vψ∣\max |V_\psi|max∣Vψ​∣values recorded from the responses (Step 4).

Note: It is possible that specifications are not met due to coupling between pitch and yaw dynamics.

  1. Mention the feedforward gain values.

  2. Pitch-only command case: Plot the pitch and yaw data (commanded angles, simulation responses and motor input voltages) for pitch-only command (Step 2) and check if the design specifications were met in pitch.

  3. Yaw-only command case: Plot the pitch and yaw data (commanded angles, simulation responses and motor input voltages) for yaw-only command (Step 3) and check if the design specifications were met in yaw.

  4. Pitch and yaw combined case: State if the design specifications were met, either including figures with design specs marked (Step 4) OR including a table with the POθPO_{\theta}POθ​, tpθt_{p_\theta}tpθ​​, essθe_{ss_\theta}essθ​​, max⁡∣Vθ∣\max |V_\theta|max∣Vθ​∣, POψPO_{\psi}POψ​, tpψt_{p_\psi}tpψ​​, essψe_{ss_\psi}essψ​​ and max⁡∣Vψ∣\max |V_\psi|max∣Vψ​∣values recorded from the responses (Step 4).

Questions for Report

  1. How does accounting for the coupling affect the performance of the controller? (a) What happens when you neglect the coupling effect (in simulation)? (b) What is a physical explanation for the coupling effect?

  2. Why a PID controller is used for the pitch and a PD controller for the yaw?

  3. Estimate gain and phase margins of the closed loop systems individually with your pitch and yaw controllers. Hint: Use the margin command in MATLAB. Gain and phase margins

First consider simulation validation of your controller using decoupled dynamics and decoupled controller (i.e., no feedforward between pitch and yaw channels). 1. Set the values of K‾θψ=0\overline{K}_{\theta\psi} = 0Kθψ​=0 in the pitch plant Simulink block and K‾ψθ=0\overline{K}_{\psi\theta} = 0Kψθ​=0 in the yaw plant Simulink block. This will remove the coupling effects between pitch and yaw dynamics. 2. Set the integral gain of the pitch controller Ki=0K_i = 0Ki​=0. 3. Simulate the closed loop system response with yaw-only command: θd=0°\theta_d = 0 \degreeθd​=0°and ψd=30°\psi_d = 30 \degreeψd​=30°. Save the data. 4. Check whether your controller meets the desired specifications for the yaw command. Since decoupled system dynamics are used in this step, you will likely see a close match between your simulation results and the desired specifications. 5. Set the integral gain of the pitch controller Ki≈1%−10%K_i \approx 1\% - 10\%Ki​≈1%−10% of KpK_pKp​ (refer to Step 4 of ). 6. Simulate the closed loop system response with pitch-only command: θd=10°\theta_d = 10 \degreeθd​=10°and ψd=0°\psi_d = 0 \degreeψd​=0°. Save the data. 7. Check if your pitch controller meets all the desired specifications. If it fails to meet the POPOPO and tpt_ptp​ specifications, relax the specifications and/or tune the pitch PID controller gains to try to meet the specifications. Save the tuned results.

Next, consider the simulation evaluation of the feedback controller for the system with coupled dynamics. 1. Set the values of K‾θψ\overline{K}_{\theta\psi} Kθψ​ in the pitch plant Simulink block and K‾ψθ\overline{K}_{\psi\theta}Kψθ​ in the yaw plant Simulink block to the . This accounts for the coupled dynamics. 2. Simulate the closed-loop response of the system with pitch-only command: θd=10°\theta_d = 10 \degreeθd​=10°and ψd=0°\psi_d = 0 \degreeψd​=0°. Save the data. 3. Simulate the closed-loop response of the system with yaw-only command: θd=0°\theta_d = 0 \degreeθd​=0°and ψd=30°\psi_d = 30 \degreeψd​=30°. Save the data. 4. Simulate the closed-loop response of the system with simultaneous pitch and yaw commands: θd=10°\theta_d = 10 \degreeθd​=10°and ψd=30°\psi_d = 30 \degreeψd​=30°. Save the data.

i)

Mention the chosen design specifications values (Step 1 of ).

ii)

ii)

Controller Design
Decoupled Dynamics with Decoupled Controller
Controller Design
Coupled Dynamics without Feedforward Controller
Coupled Dynamics with Feedforward Controller
928KB
Lab2 Lecture_2D AERO System ID and control.pdf
pdf
705B
setup_aero_ctrl_design.zip
archive
Figure 1: Feedforward controller architecture
Figure 2: Controller, saturation, and Plant blocks from the SIMULINK diagram.
Figure 3(a): Pitch plant Simulink block
Figure 3(b): Yaw plant Simulink block
estimated values from Part A: System Identification