A & B. Modeling and Control Design (Week 1)
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
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.
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.
The angular position about the outer gray frame (Body A), i.e., the yaw angle , is controlled by changing the angular position, the roll angle , of the blue gimbal (Body C), with the torque generated by motor 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 with the gyroscope system at rest, i.e., roll , pitch and yaw equal zero. In our experiment, we will lock the the rotation of the red gimbal, i.e., , 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., , and after neglecting the small amount of bearing friction associated with gimbal and frame rotations can be obtained as
where is the change in disc speed from its steady state value of , is the disc mass moment of inertia about its spin axis, 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), 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.
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
where is the current-to-torque constant of the motor, is the current applied to motor 1, and is the current applied to motor 2.
The disc is rotated at a fixed, steady-state speed of . Given this and applying Laplace transforms to Equations (1) to (3) we arrive at the following transfer function models:
A state-space model representation of Equations (2-3) with the state vector as can be written as
The gyroscope system parameters are provided in Table 1:
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
The objective is to design a controller for regulation and control of the outer frame (gray frame) angular position using the inner gimbal (blue gimbal) torque . This mimics the following problem: Given a spacecraft with a momentum gyro, we would like to regulate and control the spacecraft yaw angle using the tilting of a high-speed spinning disk mounted in the spacecraft. In this lab, the rotation about the z-axis, , is controlled by torque applied about the x-axis through motor 2.
Specification 1: All closed-loop poles must be in the left half of the complex plane.
Specification 2: The peak time in response to a step command must be less than 0.45 seconds.
Specification 3: The 2% settling time to a step command input must be less than 0.50 seconds.
Specification 4: Control current must not saturate (see Table 1 for max current input).
Specification 5: For the outer loop, and .
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 , 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 . The selected control logic is summarized in Figure 5.
The transfer functions and 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.
Open the script gyro_sim_week1.mlx and run the first section to initialize symbolic system parameters.
At the second section of the script, generate the transfer functions and using the given parameters. Note that has a negative sign in the numerator.
Obtain the overall transfer function from to , which will be your plant (see Figure 5) for the outer loop PD controller design. Remember to close the loop for .
Select a nominal value for the inner loop rate feedback gain , for example
Based on the symbolic G function from step 3, generate a numeric transfer function from to that you will use for the controlSystemDesigner window. This function should not contain any symbols. Note: Check your with your TA before proceeding.
Initialize C = 1, then open controlSystemDesigner(G,C) in MATLAB.
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:
Select some arbitrary negative values (within the limits of Specification 5) for both (C1 in Figure 6) and (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 and as needed to meet the given set of specifications. If needed, readjust the value of the inner loop, which is positive.
Save the controlSystemDesigner window plots, and your final gains Note: Check your final gains with your TA before proceeding.
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.
To the model created in step 10, add the following:
A scope for the commanded input to the system.
A saturation block before to limit the torque 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, (after the saturation block).
A scope between and that measures the gyro angle, .
A scope at the final output, . Note: Check your final Simulink diagram with your TA before proceeding.
Run the Simulink diagram for a reference angle of . 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 .
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 and a lower value of 0.
Verify if the Simulink diagram output is similar to the controlSystemDesigner step-input plot.
Check if the Simulink response satisfies all the given specifications (not on controlSystemDesigner). If not, further tune your and values (and if required) till all requirements are met. Note: Check your final gains with your TA before proceeding.
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.
General principle used to obtain equations of motion for the gyroscope.
The three time-domain linearized equations of motion for the experiment.
(both symbolic and numerical forms).
(both symbolic and numerical forms).
Brief description of control design objective.
The closed-loop transfer function for using rate feedback.
, the transfer function from to (both symbolic and numerical forms).
Gain values from controlSystemDesigner (Step 10).
Control System Designer plots (root locus plots for C1 and C2 and step response plot with peak time, settling time and steady-state values indicated).
Simulink model (Step 12).
Simulink response plots (to be generated using MATLAB, not Scope).
Validation of control design specifications being met or not.
Final tuned gain values from Simulink (Step 15).
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.
Briefly explain the need for the inner loop rate () feedback.