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
  • Introduction
  • Description of Quanser Gyroscope system
  • A. Modeling
  • B. Control Design
  • Controller Specifications:
  • Controller Design Procedure:
  • Results and Questions for Report
  • Modeling
  • Control Design

Was this helpful?

Export as PDF
  1. Lab 2: 3 DOF Gyroscope

A & B. Modeling and Control Design (Week 1)

PreviousLab 2: 3 DOF GyroscopeNextC. Controller Implementation (Week 2)

Last updated 3 months ago

Was this helpful?

Objective

The purpose of this experiment is to design a controller that maintains the direction of a gyroscope under base excitation. The controller can also be used to rotate the gyro platform to a desired orientation using the gyroscopic principle.

Introduction

Gyroscopes have become of great practical interest as they are used in control and guidance systems for air, sea, and space vehicles. One of their biggest advantages is that they can generate a large output (orientation change of an entire spacecraft) using a small input (torque input tilting a rotating disk) through torque amplification.

Description of Quanser Gyroscope system

The Quanser 3 DOF Gyroscope system (see Figure 1) can be actuated about all of its frames using the mounted motors while encoders measure the angle about each axis. In addition, the rotor itself is actuated and measured in the same manner.

The gyroscope setup is shown in Figure 2, and its components are provided in a table in Figure 3. The outer rectangular gray frame, the outer red gimbal and the inner blue gimbal are designed such that they can be individually fixed in place upon desire. This allows the users to perform a variety of different experiments using the device.

In this experiment, the gyroscopic effect will be employed to control the angle of the gray frame by applying the control command about the blue gimbal. The red outer gimbal will be fixed. In order to do this, the rotor has to have acquired enough angular momentum (RPM) for the gyroscopic effect to take place. Therefore, a controller is required to control the angular speed of the disk while another is required to control the blue gimbal angle.

In the next sections, we will develop a model of the gyroscope device from first principles in order to obtain a transfer function of the plant, which we will later use in a control scheme.

A. Modeling

Equation (1) is for the disc spinning about its own axis. Equation (2) is for the motion about the roll/blue x-axis that is driven by the torque applied from motor 2 and the gyroscopic reaction torque. Equation (3) is for the motion about the yaw/gray frame that is driven exclusively by the gyroscopic reaction torque.

The Quanser 3 DOF Gyroscope is driven by a current-controller amplifier. The relation between the torque outputs of motors 1 and 2 and their respective current inputs are

The gyroscope system parameters are provided in Table 1:

Parameter Name
Parameter Symbol
Value
Unit

Rotor mass

1.907

kg

Rotor radius

0.0762

m

MOI of disk about spin axis

0.0055

kg

MOI about x-axis/blue gimbal (disc rotor + blue gimbal)

0.00388552

kgm^2

MOI about y-axis/red gimbal (disc rotor + blue gimbal + red gimbal)

0.02344554

kgm^2

MOI about z-axis/gray gimbal, i.e., disc and blue, red, gray frames

0.06632120

kgm^2

Gimbal motor current-torque constant

0.115

Nm/A

Disc motor current-torque constant

0.0704

Nm/A

Max current

3

A

Max torque

0.3450

Nm

Disk rotor steady-state speed

78.5398

rad/s

B. Control Design

Controller Specifications:

Specification 1: All closed-loop poles must be in the left half of the complex plane.

Specification 4: Control current must not saturate (see Table 1 for max current input).

Controller Design Procedure:

  1. Open the script gyro_sim_week1.mlx and run the first section to initialize symbolic system parameters.

  2. Initialize C = 1, then open controlSystemDesigner(G,C) in MATLAB.

  3. The control architecture shown in Figure 5 is different from the default architecture that opens in controlSystemDesigner. To account for this change, on the Control System Designer window, select CONTROL SYSTEM > Edit Architecture, and select the following architecture:

  4. Use Figure 5 as a guide to create the SImulink diagram for this experiment. Adjust the step size to be a fixed-step size of 0.002 under model settings.

  5. To the model created in step 10, add the following:

    • A scope for the commanded input to the system.

  6. Verify if the Simulink diagram output is similar to the controlSystemDesigner step-input plot.

To check if your Simulink response meets Specification 2 and Specification 3, you can do one of the following approaches:

  • Place markers on the plot to manually check for peak time and 2% settling time.

  • Use stepinfo() command in MATLAB window to obtain the peak time and 2% settling time.

Results and Questions for Report

Modeling

Results

  1. General principle used to obtain equations of motion for the gyroscope.

  2. The three time-domain linearized equations of motion for the experiment.

Control Design

Results

  1. Brief description of control design objective.

  2. Control System Designer plots (root locus and bode plots for C1 and C2 and step response plot with peak time, settling time and steady-state values indicated).

  3. Simulink model (Step 12).

  4. Simulink response plots (to be generated using MATLAB, not Scope).

  5. Validation of control design specifications being met or not.

Questions

  1. How is the default Control System Designer control architecture different from the one used in this experiment? In your explanation, mention how the locations of the PD controller gains in Figure 5 are different from a traditional PD controller.

The angular position about the outer gray frame (Body A), i.e., the yaw angle ψ\psiψ, is controlled by changing the angular position, the roll angle ϕ\phiϕ, of the blue gimbal (Body C), with the torque generated by motor 2, τ2\tau_2τ2​ (see Figure 4). The red gimbal/y-axis (Body B) is locked in our experiment.

The rotational dynamics of rigid bodies can be modeled using the Newton-Euler equation, which states that the rate of change of angular momentum of a rigid body about its mass center equals the total external moment applied about its mass center. Using the Newton-Euler equation, one can derive the equations for rotational motion of individual gimbals and the outer frame. The resulting equations will be non-linear. They are linearized with the disk spinning at a constant high speed (Ω)(\Omega)(Ω)with the gyroscope system at rest, i.e., roll (ϕ)(\phi)(ϕ), pitch (θ)(\theta)(θ) and yaw (ψ)(\psi)(ψ) equal zero. In our experiment, we will lock the the rotation of the red gimbal, i.e., θ=0\theta=0θ=0, for all the time. Further, we will align the disk spin axis along the y-axis (see Figure 4).

The resulting linearized equations of motion when the red gimbal is locked, i.e., θ=0\theta=0θ=0, and after neglecting the small amount of bearing friction associated with gimbal and frame rotations can be obtained as

Jdω˙=τ1(1)J_d\dot{\omega}=\tau_1 \qquad \qquad \tag{1}Jd​ω˙=τ1​(1)
Jxϕ¨=τ2+JdΩψ˙(2)J_x\ddot{\phi}=\tau_2+J_d\Omega\dot{\psi}\qquad \qquad \tag{2}Jx​ϕ¨​=τ2​+Jd​Ωψ˙​(2)
Jzψ¨=−JdΩϕ˙(3)J_z \ddot{\psi}=-J_d\Omega\dot{\phi}\qquad \qquad \tag{3}Jz​ψ¨​=−Jd​Ωϕ˙​(3)

where ω\omegaω is the change in disc speed from its steady state value of Ω\OmegaΩ, JdJ_dJd​ is the disc mass moment of inertia about its spin axis, JxJ_xJx​ is the mass moment of inertia of the disk and motor 1 plus the blue gimbal and motor 2 about the x-axis (roll axis), JzJ_zJz​ is the mass moment of inertia of the entire system, i.e., including the disk, red and blue gimbals, motors 1 and 2 and the outer gray frame about the z-axis.

τ1=ktu1(4)\tau_1=k_tu_1\qquad \qquad \tag{4}τ1​=kt​u1​(4)
τ2=ktu2(5)\tau_2=k_tu_2\qquad \qquad \tag{5}τ2​=kt​u2​(5)

where ktk_tkt​ is the current-to-torque constant of the motor, u1u_1u1​ is the current applied to motor 1, and u2u_2u2​ is the current applied to motor 2.

The disc is rotated at a fixed, steady-state speed of Ω\OmegaΩ. Given this and applying Laplace transforms to Equations (1) to (3) we arrive at the following transfer function models:

ω(s)τ1(s)=1Jds(6)\frac{\omega(s)}{\tau_1 (s)}=\frac{1}{J_d s }\qquad \qquad \tag{6}τ1​(s)ω(s)​=Jd​s1​(6)
Φ(s)τ2(s)=JzJxJzs2+Jd2Ω2=P1(s)(7)\frac{Φ(s)}{τ_2 (s)}=\frac{J_z}{J_x J_z s^2+J_d^2 Ω^2}=P_1 (s)\qquad \qquad \tag{7}τ2​(s)Φ(s)​=Jx​Jz​s2+Jd2​Ω2Jz​​=P1​(s)(7)
Ψ(s)Φ(s)=−ΩJdJzs=P2(s)(8)\frac{Ψ(s)}{Φ(s)}=\frac{-ΩJ_d}{J_z s}=P_2 (s)\qquad \qquad \tag{8}Φ(s)Ψ(s)​=Jz​s−ΩJd​​=P2​(s)(8)

A state-space model representation of Equations (2-3) with the state vector as [ϕψϕ˙ψ˙]T[\phi \quad \psi \quad \dot{\phi} \quad \dot{\psi}]^T[ϕψϕ˙​ψ˙​]T can be written as

ddt[ϕψϕ˙ψ˙]=[00100001000JdΩ/Jx00−JdΩ/Jz0][ϕψϕ˙ψ˙]+[001/Jx0](9)\frac{d}{dt} \begin{bmatrix} \phi \\ \psi \\ \dot{\phi} \\ \dot{\psi} \\ \end{bmatrix} = \begin{bmatrix} 0& 0& 1& 0 \\ 0& 0& 0& 1 \\ 0& 0& 0& J_d\Omega/J_x \\ 0& 0& -J_d\Omega/J_z& 0 \end{bmatrix}\begin{bmatrix} \phi \\ \psi \\ \dot{\phi} \\ \dot{\psi} \\ \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ 1/J_x \\ 0 \\ \end{bmatrix}\qquad \qquad \tag{9}dtd​​ϕψϕ˙​ψ˙​​​=​0000​0000​100−Jd​Ω/Jz​​01Jd​Ω/Jx​0​​​ϕψϕ˙​ψ˙​​​+​001/Jx​0​​(9)

The objective is to design a controller for regulation and control of the outer frame (gray frame) angular position ψ\psiψ using the inner gimbal (blue gimbal) torque τ2\tau_2τ2​. This mimics the following problem: Given a spacecraft with a momentum gyro, we would like to regulate and control the spacecraft yaw angle ψ\psiψ using the tilting of a high-speed spinning disk mounted in the spacecraft. In this lab, the rotation about the z-axis, ψ\psiψ, is controlled by torque applied about the x-axis through motor 2.

Specification 2: The peak time in response to a 10°10\degree10° step command must be less than 0.45 seconds.

Specification 3: The 2% settling time to a 10°10\degree10° step command input must be less than 0.50 seconds.

Specification 5: For the outer loop, ∣kp∣<6|k_p|<6∣kp​∣<6 and ∣kd∣<0.4|k_d|<0.4∣kd​∣<0.4.

In order to meet the given controller specifications, we will make use of a technique known as successive loop closures. We will first design an inner loop rate feedback, i.e., feedback of ϕ˙\dot{\phi}ϕ˙​, to damp the rotation of the inner blue gimbal. Subsequently, an outer loop PD controller is used to control the outer frame (gray frame) rotation ψ\psiψ. The selected control logic is summarized in Figure 5.

The transfer functions P1(s)P_1(s)P1​(s) and P2(s)P_2(s)P2​(s) are previously obtained in the modeling section as Equations (7) and (8). In the following section, we will form the overall transfer function and do controller design.

At the second section of the script, generate the transfer functions P1(s)P_1(s)P1​(s) and P2(s)P_2(s)P2​(s) using the given parameters. Note that P2(s)P_2(s)P2​(s) has a negative sign in the numerator.

Obtain the overall transfer function from rir_iri​ to ψ\psiψ, which will be your plant G(s)G(s)G(s) (see Figure 5) for the outer loop PD controller design. Remember to close the loop for P1(s)P_1(s)P1​(s).

Select a nominal value for the inner loop rate feedback gain kvk_vkv​, for example kv=0.2k_v=0.2kv​=0.2

Based on the symbolic G function from step 3, generate a numeric transfer function G(s)G(s)G(s) from rir_iri​ to ψ\psiψ that you will use for the controlSystemDesigner window. This function should not contain any symbols. Note: Check your G(s)G(s)G(s) with your TA before proceeding.

Select some arbitrary negative values (within the limits of Specification 5) for both kpk_pkp​ (C1 in Figure 6) and kdk_dkd​ (C2 in Figure 6). Since C2 is a pure derivative gain, you need to add a differentiator in C2, not a real zero.

Tune the values for kpk_pkp​ and kdk_dkd​ as needed to meet the given set of specifications. If needed, readjust the kvk_vkv​ value of the inner loop, which is positive.

Save the controlSystemDesigner window plots, and your final gains kp, kd, kv.k_p, \, k_d, \, k_v.kp​,kd​,kv​. Note: Check your final gains with your TA before proceeding.

A saturation block before P1(s)P_1(s)P1​(s) to limit the torque τ2\tau_2τ2​ applied to the system. Note: Since we need to satisfy Specification 4 (current saturation), we should ensure torque saturation as torque and current are linearly related (see Equation (5)).

A scope to the torque applied to the system, τ2\tau_2τ2​ (after the saturation block).

A scope between P1(s)P_1(s)P1​(s) and P2(s)P_2(s)P2​(s) that measures the gyro angle, ϕ\phiϕ.

A scope at the final output, ψ\psiψ. Note: Check your final Simulink diagram with your TA before proceeding.

Run the Simulink diagram for a reference angle of ψref=10o\psi_{ref}=10^oψref​=10o. This can be accomplished in one of two ways:

Provide a step input of an initial value of 0 and a final value of 10. This will generate a step input of ψref=10o\psi_{ref}=10^oψref​=10o.

Provide a square wave of amplitude 5, frequency of 0.333 Hz and an offset of +5. This will generate a square wave of an upper value ψref=10o\psi_{ref}=10^oψref​=10o and a lower value of 0.

Check if the Simulink response satisfies all the given specifications (not on controlSystemDesigner). If not, further tune your kpk_pkp​ and kdk_dkd​ values (and kvk_vkv​ if required) till all requirements are met. Note: Check your final gains with your TA before proceeding.

P1(s)P_1(s)P1​(s) (both symbolic and numerical forms).

P2(s)P_2(s)P2​(s) (both symbolic and numerical forms).

The closed-loop transfer function for P1(s)P_1(s)P1​(s) using rate feedback.

G(s)G(s)G(s), the transfer function from rir_iri​ to ψ\psiψ (both symbolic and numerical forms).

Gain values kp, kd, kvk_p, \, k_d, \, k_vkp​,kd​,kv​ from controlSystemDesigner (Step 10).

Final tuned gain values kp, kd, kvk_p, \, k_d, \, k_vkp​,kd​,kv​ from Simulink (Step 15).

Briefly explain the need for the inner loop rate (ϕ˙\dot{\phi}ϕ˙​) feedback.

mdm_dmd​
rdr_drd​
JdJ_dJd​
JxJ_xJx​
JyJ_yJy​
JzJ_zJz​
ktk_tkt​
kt,diskk_{t,disk}kt,disk​
ImaxI_{max}Imax​
τmax\tau_{max}τmax​
Ω,  ωss\Omega, \,\, \omega_{ss}Ω,ωss​
4KB
gyro_sim_week1.mlx
Figure 1. Quanser 3-DOF Gyroscope
Figure 2. Gyroscope components figure
Figure 3. Gyroscope components table
Figure 4. Components of Quanser 3 DOF gyroscope
Figure 5. Gyroscope plant and control architecture
Figure 6. Gyroscope outer control loop architecture – Control System Designer
Figure 7. Simulation plots for ψref=10o\psi_{ref}=10^oψref​=10o square wave