3 DOF Gyroscope Courseware Sample For MATLAB Users
3 DOF Gyroscope Courseware Sample For MATLAB Users
(2.1)
where
J
y
= 0.0036 kgm
2
J
z
= 0.0226 kgm
2
h = 0.44 kgm
2
/s
The moment of inertia about the y-axis angle, , is J
y
and the moment of inertia about the z-axis angle (red
gimbal), , is denoted as J
z
. The constant h is calculated based on the moment of inertia of the gyroscope
rotor about its own axis and its velocity. Because the outer gray rectangular frame is fixed, the only actuated
axis is the y-axis. The control input in the single-input single-output (SISO) system is the torque applied in
the y-axis,
y
.
Linear State-Space Model
The linear state-space equations are
(2.2)
and
(2.3)
where x is the state, u is the control input, A, B, C, and D are state-space matrices.
For this system, the state and output are defined
(2.4)
and
Solving for the acceleration terms in the linear equations of motion given in Equation 2.1 we get
Substituting the state in , we obtain the following state-space matrices:
and
4. LAB EXPERIMENTS SECTION - SAMPLE
Simulation
In this section we will use the Simulink diagram shown in Figure 3.1 to simulate the closed-loop control of
the 3 DOF Gyroscope system. The system is simulated using the model summarized in Section 2.1. The
Simulink model uses the state-feedback control described in Section 2.2.4. The feedback gain K is found
using the Matlab LQR command (LQR is described briefly in Section 2.2.3).
Table 3.1: Simulink model used to simulate the 3 DOF Gyroscope.
IMPORTANT: Before you can conduct these experiments, you need to make sure that the lab files are
configured according to your setup. If they have not been configured already, then you need to go to
Section 4 to configure the lab files first.
Procedure
Follow these steps to simulate the 3 DOF Gyroscope:
1. Make sure the LQR weighting matrices in setup_3dgyro.m are set to
and R=5
2. Run the script to generate the gain
Remark: When tuning the LQR, Q(2; 2) effects the red gimbal proportional gain while Q(1; 1) effects the
red gimbal derivative gain (which reduces the overshoot). Q(4; 4) affects the red gimbal integral gain
which is used to minimize the steady state error.
3. Open the red gimbal position scope, Psi (deg), the torque scope, Torque (N.m).
4. Start the simulation. The scopes should be displaying responses similar to Figure 3.2.
Figure 3.2: Simulated closed-loop response.
Implementation
The q_3dgyro_lqr Simulink diagram shown in Figure 3.3 is used to perform the red gimbal position control
on the 3 DOF Gyroscope. The HIL Interfacing subsystem contains drivers that interface with the DC motor
and sensors of the 3 DOF Gyroscope system.
Figure 3.3: Simulink model used to run controller on the 3 DOF Gyroscope.
IMPORTANT: Before you can conduct these experiments, you need to make sure that the lab files are
configured according to your setup. If they have not been configured already, then you need to go to
Section 4 to configure the lab files first.
Solutions for teaching and research. Made in Canada.
I NFO@QUANSER. COM +1- 905- 940- 3575 QUANSER. COM
Full range of robotic and mechatronic control plants
for teaching and research
Omni Bundle 2 DOF Planar Robot
Hexapod* IMDU Base Unit IMDU-Web Winding
IMDU-Multi DOF Torsion
3 DOF Gyroscope
Active Suspension
* Please note: The Hexapod is not available for purchase in North America, Japan and Taiwan.
Choose from eight plants to create experiments for teaching or research related to robotics, haptics,
mechatronics, aerospace, or process control. For more information please contact info@quanser.com
2013 Quanser Inc. All rights reserved.