Rotary Gyro

Introduction

The objective of this experiment is to design a controller that maintains the direction of the gyroscope module while the top base plate is rotated relative to the bottom base plate. While the disk spins, the SRV02 is used to apply the correct amount of counter torque and maintain the gyroscope heading in the event of disturbances (i.e., rotation of the bottom support plate).

Figure 0.1: Rotary Gyro Experiment

Gyroscopes are used in many different platforms, e.g., airplanes, large marine ships, submarines, and satellites.

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. To do so, however, we need some preliminaries on angular momentum and the gyroscopic effect.

Part 0: Preliminaries

Angular Momentum

Let's consider an rigid body BB of mass mm, moving with any general motion in space. Assume that the axes x-y-z are attached to the body with origin at its center of mass GG. Now, let dm\mathrm{d}m be a mass element of the body situated by position vector ρ\bm{\rho} with respect to the center of mass GG.

Figure 0.2: Angular Momentum

Given the body's linear velocity v\bm{v} (i.e., the velocity of its center of mass) and its angular velocity ω\bm{\omega}, the total angular momentum of the body with respect to the center of mass GG is given as

L=v×Bρdm+Bρ×(ω×ρ)dm.\bm{L} = \bm{v}\times \int_B \bm{\rho}\mathrm{d}m + \int_{B} \bm{\rho} \times \left(\bm{\omega}\times\bm{\rho}\right)\mathrm{d}m.

The first term is 0\bm{0} since the integral Bρdm=0\int_B \bm{\rho}\, \mathrm{d}m = \bm{0} by definition of the center of mass. By using the triple product rule for the cross product in the second term, it can be shown that

L=Bρ×(ω×ρ)dm=B(ρρI3ρρ)dmω=Jω\bm{L} = \int_{B} \bm{\rho} \times \left(\bm{\omega}\times\bm{\rho}\right)\mathrm{d}m = \int_{B} (\bm{\rho}^\top \bm{\rho} \mathrm{I}_3 -\bm{\rho}\bm{\rho}^\top) \mathrm{d}m \, \bm{\omega} = \bm{J}\bm{\omega}

where JJ is the 3×33\times3 inertia tensor of the body about the center of mass GG.

Time Rate of Change of Angular Momentum

Now, since the body's reference frame is rotating, the derivative of the total angular momentum about the center of mass GG can be written as

ddt(L)=L˙+ω×L\frac{\mathrm{d}}{\mathrm{d}t} \left(\bm{L}\right) = \dot{\bm{L}} + \bm{\omega} \times \bm{L}

where L˙\dot{\bm{L}} is the time derivative of the angular momentum as seen in the rotating x-y-z frame. We can view the term L˙\dot{\bm{L}} as the part due to the change in magnitude of L\bm{L} and the second term ω×L\bm{\omega}\times\bm{L}as the part due to the change in direction of L\bm{L}. By virtue of the Newton-Euler equation, we have

τ=ddt(L)=L˙+ω×L\bm{\tau} = \frac{\mathrm{d}}{\mathrm{d}t}\left(\bm{L}\right) = \dot{\bm{L}} + \bm{\omega} \times \bm{L}

and we notice that either a change in magnitude of the angular moment or a change in direction of the angular momentum generates a torque. Inversely, a torque can generate a change in either magnitude or direction of the angular momentum, depending about which axis it is applied.

Gimbaling Gyroscope

Assume now that the total angular momentum of the gimbaling gyroscope is given by

L=(Jg+Jf)ωg+Jfωf\bm{L} = (\bm{J}_g + \bm{J}_f) \bm{\omega}_g + \bm{J}_f \bm{\omega}_f

where ωg \bm{\omega}_g is the angular velocity of the gyro module and ωf \bm{\omega}_f ​ is the angular velocity of the flywheel, Jg \bm{J}_g is the inertia tensor of the gyro module - without the flywheel - and Jf \bm{J}_f ​ is the inertia tensor of the flywheel.

Figure 0.3: Coordinate Frame and Angle Definitions

Assuming that the deflection of the flywheel gimbal axis is small and slow, we now have that, when expressed in the rotating frame of the flywheel gimbal coordinates,

ωg=[00ωb+θ˙l]\bm{\omega}_g = \begin{bmatrix}0\\ 0 \\ \omega_b + \dot{\theta}_l\end{bmatrix}

and

ωf=[ωf00].\bm{\omega}_f = \begin{bmatrix}\omega_f \\ 0 \\ 0\end{bmatrix}.

Further assuming that the rotary base motor has achieved steady-state (θ˙l=0 \dot{\theta}_l = 0 , θ¨l=0 \ddot{\theta}_l = 0 ), and that the flywheel's velocity is constant (i.e. ω˙f=0 \dot{\omega}_f = 0), we have that

τ=(Jg+Jf)ω˙g+ωg×(Jg+Jf)ωg+ωg×Jfωf\bm{\tau} = (\bm{J}_g + \bm{J}_f)\dot{\bm{\omega}}_g + \bm{\omega}_g\times (\bm{J}_g + \bm{J}_f)\bm{\omega}_g + \bm{\omega}_g \times \bm{J}_f \bm{\omega_f}

Assuming that the gimbal frame is aligned with the principal axes of he gyro module assembly and ignoring the contribution of the wheel inertia to the principal moment of inertia about the vertical axis of the gyro module, then the second term is 0, and we are left with the equations

τ2=ωbJfωf\tau_2 = \omega_bJ_f\omega_f
τ3=Jgω˙b\tau_3 = J_g \dot{\omega}_b

τ2 \tau_2 corresponds to the torque due to the gyroscopic effect and will be hereon denoted as τg \tau_g ​. We will further neglect the second equation pertaining to the vertical axis torque by assuming that ω˙b0 \dot{\omega}_b\approx 0 is typically small.

Part 1: Modeling

1.1 Servo Model

The Servo Base Unit (SRV02) open-loop transfer function is given by

P(s)=Θl(s)Vm(s)=Ks(τs+1)(1.1)P(s) = \frac{\Theta_l(s)}{V_m(s)}=\frac{K}{s(\tau s + 1)}\qquad\qquad \tag{1.1}

where Θl(s)=L[θl(t)]\Theta_l(s) = \mathcal{L}[\theta_l(t)] is the load gear position and​Vm(s)=L[vm(t)]V_m(s) = \mathcal{L}[v_m(t)] is the applied motor voltage. The system steady-state gain and time constant are given by:

K=1.53rad/s/VK=1.53\, \mathrm{rad/s/V}

​and

τ=0.0486s.\tau = 0.0486 \, \mathrm{s}.

1.2 Gyroscope Gain

Consider the simplified model shown in Figure 1.1.

Figure 1.1: Simplified rotary gyroscope model.

The inertial disc, flywheel, spins at a relatively constant velocity, ωf \omega_f . When the base rotates at a speed of ωb \omega_b , the resulting gyroscopic torque about the sensitive axis is​

τg=ωbLf(1.2)\tau_g=\omega_b L_f\qquad \qquad \tag{1.2}

where Lf=Jfωf L_f=J_f\omega_f ​​is the angular momentum of the flywheel and Jf J_f ​ is its moment of inertia. The springs mounted on the gyroscope counteract the gyroscopic torque, τg \tau_g ​, by the following amount

τs=Krα(1.3)\tau_s = K_r \alpha \qquad \qquad \tag{1.3}

​where Kr K_r ​is the rotational stiffness of the springs.

Given that the spring torque equals the gyroscopic torque, τs=τg \tau_s = \tau_g ​, we can equate equations (1.2) and (1.3) to obtain the expression

Krα=ωbJfωf.(1.4)K_r \alpha = \omega_b J_f \omega_f. \qquad \qquad \tag{1.4}

Assume that the base speed is proportional to the deflection angle through the gain Gg G_g ​, then

ωb=Ggα.(1.5)\omega_b = G_g \alpha. \qquad \qquad \tag{1.5}

By examining equations (1.4) and (1.5), we find the gyroscopic sensitivity gain is given by

Gg=ωbα=KrJfωf.(1.6)G_g = \frac{\omega_b}{\alpha} = \frac{K_r}{J_f \omega_f}. \qquad \qquad \tag{1.6}

Thus, the deflection angle α\alpha can be used to measure ωb \omega_b , the rotation rate of the platform relative to the base, without a direct measurement.​ NOTE: the dynamics in the sensitive axis (i.e., deflection axis) are ignored. A more complete model would include these dynamics as the transfer function α(s)/ωb(s) \alpha (s) / \omega_b (s) ​.

1.3 Joint Stiffness

The two springs affecting the sensitive axis are shown in Figure 1.2. The stiffness at the axis of rotation is derived in the following fashion. Assume the springs have a spring constant KsK_s ​and an un-stretched length LuL_u ​. The length of the springs at the normal position, i.e. α=0 \alpha = 0​, is given by LL​. If the axis is rotated by an angle α \alpha ​, then the two forces about the sensitive axis are given by (for a small α \alpha ​)

F1=KsΔL1=Ks(LLuαR)F_1 = K_s \Delta L_1 = K_s (L-L_u - \alpha R)

​and

F2=KsΔL2=Ks(LLu+αR)F_2 = K_s \Delta L_2 = K_s (L-L_u + \alpha R)
Figure 1.2: Forces due to springs.

The spring torque about the pivot due to the two forces is

τs=R(F2F1)=2R2Ksα\tau_s = R(F_2 - F_1) = 2 R^2 K_s \alpha

​The rotational stiffness is given by

Kr=τsα=2R2Ks.(1.7)K_r = \frac{\tau_s}{\alpha} = 2 R^2 K_s. \qquad \qquad \tag{1.7}

Part 2: Control design

2.1 Desired Position Control

The block diagram shown in Figure 2.1 is a general unity feedback compensator with compensator (controller) C(s) C(s) and a transfer function representing the plant​, P(s) P(s) . The measured output Y(s) Y(s) , is supposed to track the reference R(s) R(s) and the tracking has to match certain desired specifications.

Figure 2.1: Unity Feedback System.

The output of the system can be written as

Y(s)=C(s)P(s)(R(s)Y(s)).Y(s) = C(s)P(s)(R(s) - Y(s)).

By solving for Y(s) Y(s) ​ we get the closed-loop transfer function

Y(s)R(s)=C(s)P(s)1+C(s)P(s).\frac{Y(s)}{R(s)} = \frac{C(s)P(s)}{1 + C(s) P(s)}.

​When a second-order system is placed in series with a proportional compensator in the feedback loop as in Figure 1.2, the resulting closed-loop transfer function can be expressed as

Y(s)C(s)=ωn2s2+2ζωns+ωn2,(2.1)\frac{Y(s)}{C(s)} = \frac{\omega_n^2}{s^2+2\zeta\omega_n s+\omega_n^2}, \qquad \qquad \tag{2.1}

where ωn \omega_n ​ is the natural frequency and ζ \zeta ​ is the damping ratio. This is called the standard second order transfer function. Its response properties depend on the values of ωn \omega_n ​ and ζ \zeta ​.

2.2 Control Specifications

The desired time-domain specifications for stabilizing the gyroscope are:

ωn=6πrad/s(2.2)\omega_n = 6\pi \,\mathrm{rad/s} \qquad \qquad \tag{2.2}

or 3Hz, and

ζ=0.7.(2.3)\zeta = 0.7. \qquad \qquad \tag{2.3}

2.3 Gyro PD Controller

To stabilize the heading of the gyroscope, we will develop a Proportional-Derivative (PD) controller depicted in Figure 2.2.

Figure 2.2: Gyroscope PD Control Block Diagram

Assuming that the support plate (and servo) rotates relative to the base by the angle γ \gamma (not measured)​ and that the gyro module rotates relative to the servo module by the angle θl \theta_l (measured)​, the total rotation angle of the gyro module relative to the base plate can be expressed by

η=γ+θl(2.4)\eta = \gamma + \theta_l \qquad \qquad \tag{2.4}

​We want to design a controller that maintains the gyro heading, i.e. keeps η=0 \eta = 0 ​, independent of γ \gamma ​ and we can only use the measurement from the gyro sensor, α \alpha ​. In other terms, we want to stabilize the system such that η˙0\dot{\eta}\rightarrow 0 ​. Differentiating equation (2.4) gives

η˙=γ˙+θ˙l\dot{\eta} = \dot{\gamma} + \dot{\theta}_l

​Given that η˙=ωb \dot{\eta} = \omega_b ​ and the gyro gain definition in equation (1.5), this becomes

Ggα=γ˙+θ˙lG_g \alpha = \dot{\gamma} + \dot{\theta}_l

Taking the Laplace and solving for α(s)/s \alpha(s)/s ​, we get

α(s)s=1Gg(γ(s)+Θl(s))\frac{\alpha(s)}{s} = \frac{1}{G_g} ( \gamma(s) + \Theta_l (s))

Introducing the new variable ϵ(s) \epsilon (s) ​ such that

ϵ(s)=α(s)s\epsilon (s) = \frac{\alpha(s)}{s}

which is the integral of the deflection angle, the gyro transfer function can be changed into the form

ϵ(s)=1Gg(γ(s)+Θl(s))\epsilon(s) = \frac{1}{G_g} (\gamma(s) + \Theta_l(s))

Add the SRV02 dynamics given in Section 1.1 into Θl(s) \Theta_l(s) ​ to introduce our control variable Vm(s) V_m(s) to get

ϵ(s)=1Gg(γ(s)+Ks(sτ+1)Vm(s))(2.5)\epsilon (s) = \frac{1}{G_g}\left(\gamma(s) + \frac{K}{s(s\tau + 1) }V_m(s)\right)\qquad \qquad \tag{2.5}

Adding the PD control

Vm(s)=(kp+kds)ϵ(s)V_m(s) = - (k_p + k_d s)\epsilon (s)

​and solving for ϵ(s)/γ(s) \epsilon(s) / \gamma(s) we obtain the closed-loop transfer function

ϵ(s)γ(s)=s(sτ+1)Ggτs2+(Kkd+Gg)s+Kkp.(2.6)\frac{\epsilon (s)}{\gamma (s)} = \frac{s(s\tau +1)}{G_g \tau s^2 + (K k_d + G_g)s + K k_p}.\qquad \qquad \tag{2.6}

Pre-lab Questions

  1. Find the steady-state speed of the flywheel, ωf \omega_f ​, given the motor equation

vg,m=ig,mRg,m+kg,mωfv_{g,m}= i_{g,m}R_{g,m} + k_{g,m}\omega_f

​where ig,m=0.23A i_{g,m} = 0.23 \,\mathrm{A} is the nominal current, vg,m=12V v_{g,m} = 12 \, \mathrm{V} ​ is the nominal voltage, Rg,m=5.3Ω R_{g,m}=5.3 \, \mathrm{\Omega} ​ is the motor resistance, and kg,m=0.0235Vs/rad k_{g,m} = 0.0235 \, \mathrm{V\cdot s/rad}​ is the back-emf constant.

2. Find the value of the gyroscope sensitivity gain, GgG_g. The flywheel moment of inertia is Jf=12mfrf2=0.00103,Nms2/rad J_f=\frac{1}{2}m_fr_f^2=0.00103 ,\mathrm{Nms^2/rad} . The radius and spring stiffness parameters, are respectively R=0.0254m R = 0.0254 \, \mathrm{m} and Ks=1908.9N/m K_s = 1908.9 \, \mathrm{N/m} .

3. The closed-loop transfer function was found in equation (2.6). Find the PD control gains, kp k_p ​ and kd k_d ​, in terms of ωn \omega_n and ζ \zeta . (HINT: Remember the standard second-order system equation).

4. Based on the nominal SRV02 model parameters, K K and τ \tau ​ given in Section 1.1, calculate the control gains needed to satisfy the time-domain response requirements given in Section 2.2.

Part 3: Experiment Procedure

3.1 Control Implementation

In this section, the gyroscopic control developed in Section 2.3 is implemented on the actual system. The goal is to see if the gyro module can maintain its heading when a disturbance is added by the user, i.e., the base plate is rotated.

The q_gyro Simulink diagram shown in Figure 3.1 is used to run the PD control on the Quanser Rotary Gyroscope system. The SRV02 Gyroscope subsystem contains QUARC blocks that interface with the DC motor and sensors of the system.

Figure 3.1: q_gyro Simulink Diagram

0. Download the experiment files:

  1. Verify that the amplifier is turned ON and the disc is rotating. Ask TA if there's an issue.

  2. Run the setup_gyro.m script

  3. Open the q_gyro simulink diagram.

  4. Make sure the Manual Switch is set to downward position to enable the PD control.

  5. To build the model, click the down arrow on Monitor & Tune under the Hardware tab and then click Build for monitoring . This generates the controller code.

  6. Press Connect button under Monitor & Tune and Press Start .

  7. While the system is running, manually rotate the bottom base plate about 45 degrees. The GYRO module should be maintaining its heading. Verify your response by viewing the scopes in your experiment and comparing against the provided scope examples.

  8. Stop the controller once you have obtained a representative response.

  9. Plot the responses from the theta (deg), alpha (deg), and Vm (V) scopes in a MATLAB figure. The response data is saved in variables data_theta , data_alpha, data_vm.

  10. Start the controller again, but this time with the Manual Switch set in the upward position, which turns off the PD controller.

  11. Rotate the bottom base plate by the same amount as previously done, in an attempt to reproduce the motion as previously executed.

  12. Plot the responses.

  13. Examine how the GYRO module responds when you rotate the base plate. Does this make sense? Explain the result when the PD control is ON and OFF. Based on your observations, explain what the PD control is actually doing and how it relates to gyroscopes.

Directives for Report

  1. Briefly describe the main goal of the experiment

  2. Briefly describe the experimental procedure in steps 7 and 9 of section 3.

  3. Briefly describe the experimental procedure in step 11 and 12 of section 3.

  4. Provide results of plots for step 9 and step 12 of section 3.

  5. Explain the effect of having the PD control on and off.

  6. Briefly explain how does this relate to an actual gyroscope system?

Last updated

Was this helpful?