The objective is to design a controller that allows rapid reorientation of the link with very little vibrations from the link flexibility. This analysis is a preliminary approach to containing structural vibrations in real-world applications like aircraft and spacecraft structures as well as robotic links/manipulators
The methodology used is to design the control law assuming full state feedback to meet a given set of specifications. This will be followed by studying the loss of controller performance with servo feedback alone. The method we will use for full state feedback is based on the linear quadratic regulator (LQR) theory, which requires the given system to be controllable.
The equations that describe the motions of the servo and the link with respect to the servo motor voltage are obtained using the Euler-Lagrange method and can be written as
Assuming the viscous damping of the link is negligible, i.e. = 0 and substituting the torque using the expression,
the EOM can be rearranged as
The various system parameters can be found in Table 2 of Part A: System Identification.
Equations 3 and 4 can be represented in state-space form
In the output equation, only the position of the servo and link angles are being measured.
As such, the velocities of the servo and link angles can be computed in the digital controller if required, e.g., by taking the derivative and filtering the result though a high-pass filter. Hence, with all the states of the system as outputs, the C and D matrices are
equals the number of states of the system,
Assuming the time-domain design specifications are
Then one can use the Bryson’s rule to choose the weighting matrices as
In our case,
The reference state is defined as
and the controller is
Note: The results from the following steps have to be included in the Analysis section of the report.
>> [K,S,E] = lqr(A,B,Q,R);
Using Figure 1 as a guide, develop a Simulink model of the system.
Make sure to include servo position command input, 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)
Check if all the given specifications are met.
Check your plots with the TA.
Check if the specifications are met (no need to tune Q and R matrices.)
In this experiment, the servo position is controlled while minimizing the link deflection using the LQR based control found. Measurements will then be taken to ensure that the specifications are satisfied.
Warning: In closed loop experiments, the link may swing around rather quickly. Stay clear of it during closed loop experiments.
Turn the amplifier power on.
Download the q_flex.zip and open the Simulink file q_flex for controller implementation. This is the block diagram for this part of the experiment. Make sure you have K gain variable in the MATLAB workspace. Note: The Smooth Signal Generator block generates a 0.33 Hz square wave (with amplitude of 1) that is passed through a Rate Limiter block to smooth the signal (Rising slew rate of 100 and falling slew rate of -100). The Amplitude (deg) gain block is used to change the desired servo position command. The state-feedback gain K is set in the LQR Control gain block and is read from the MATLAB workspace.
Align the flexible link along the 0 mark on the servo stand.
Double click on the scopes and open them.
Ensure that the manual switch is connected to the full state feedback.
A periodic square wave is given as input voltage to the servo motor, causing the link to move left and right alternately for 10 seconds.
Copy the response data to your group folder. The response data is saved in variables data_theta, data_alpha, and data_vm. DO NOT DELETE or SAVE THE SIMULINK MODEL.
Connect the manual switch to the partial state feedback and repeat steps 4-9 again. Make sure your files name is different from full state feedback.
Turn the power off.
Results
Include the results from the controller design procedure Steps 1-6.
Questions
Estimate the bandwidth for your full state and partial state feedback controllers.
Estimate the stability margins (gain and phase margins) of your full state and partial state feedback controllers.
Results
Plots of servo angle, link deflection angle and input voltage vs time for full state and partial state feedback. Compare the results and explain the differences.
Run the Simulink that you built in control design with the same command input used in the experiment. Compare the simulated response with the experimental response for both full state and partial state feedback and explain any differences between them. Note 1: Generate two sets of figures with one set containing the plots of simulation and experiment for full state feedback and the second set containing the plots of simulation and experiment for full state feedback. For each feedback case, the simulated response and corresponding experimental response must be on the same graph. Note 2: Average the first few seconds of the experimental data to obtain initial conditions for your state-space block in Simulink.
Questions
Explain why the link deflection angle goes opposite to servo rotation initially.
For a controllable system, can partial state feedback guarantee stability like full state feedback? Briefly explain.
with and, where
If the control input of a system can take each state variable, where, from an initial state to a final state in finite time, then the system is controllable, otherwise it is uncontrollable. The controllability of a system can be determined using the ‘Rank Test’. According to the Rank Test, the system is controllable if the rank of its controllability matrix
If (A,B) are controllable, then the Linear Quadratic Regular optimization method can be used to find full state feedback controller gains. Given the plant model in state-space form where represents the state vector, this technique finds a control input ‘’ that minimizes the cost function
where Q and R are the user-defined weighting matrices and . It is assumed that Q is positive semi-definite (all the eigenvalues of are non-negative) and is positive definite (all the eigenvalues of are positive). The weighting matrices affect how LQR minimizes the function and are, essentially, tuning variables. Here, is the state vector and is the servo motor voltage input .
Given the control law , the state-space of the closed loop system becomes
where is given by
is the controller gain vector. Note that the input voltage is scalar, and therefore, is also scalar. In practice, the weighting matrices and are chosen to be diagonal. A simple way for choosing and is using the Bryson's rule. This method works best when control design specifications regarding the system response and control input are given in terms of limits on excursions from equilibrium.
Further tuning of and may be required for improving the controller performance. Note that increasing means increasing the penalty on the control input (using less control effort). Similarly, increasing means increasing the penalty on the states (states reaching equilibrium position quickly and with less overshoot). Matrix sets the weight on the states and determines how will minimize (and hence how it generates gain ).
Substituting and in Eqn. 9 gives
where , , , ,
On observing Eq. 12, it can be seen that increasing causes control input to work harder to minimize state , which will predominately increase. If is increased, then will increase to compensate for the larger weight placed on state . Depending on the model, changing a single can affect multiple gains because each state is not independent. If is increased, then control input has to work less to minimize. In that case, LQR would generate a lower overall value of. A block diagram of the system with fill state feedback controller is shown in Figure 1.
The feedback control loop in Figure 1 is designed to stabilize the servo to a desired position,, while minimizing the deflection of the flexible link, where is the state column vector and is the gain row vector as shown earlier. Note that isidentity matrix and is column of zeros in Figure 1.
The following specifications in the time domain are to be met when the rotary arm is tracking a step change in its angular position.
Specification 1: Servo angle 2% settling time:
Specification 2: Servo angle percentage overshoot:
Specification 3: Maximum link angle deflection:
Specification 4: Maximum control effort (voltage):
Obtain the and matrices of the system using the parameters from Part A: System identification. Check your A and B matrices with the TA.
Using Bryson’s rule (Eq. 12-15) calculate and matrices, based on the following suggested maximum values of state and control excursions:
Check if and (by finding eigenvalues of the matrix).
Using the lqr
command in MATLAB, calculate the optimal feedback gain vector . The
lqr
command solves the Algebraic Riccati equation which is required to determine the gain vector is
where is the gain matrix, is the solution to the Riccati equation and E are closed loop system poles. Check your gain matrix K with the TA.
Note: SIMULINK references the current MATLAB workspace when setting variables. Use the variable names for the system matrices and and the control gain matrix from your MATLAB script file for the LQR design.
Using the controller gains found in step 3, simulate the closed loop system for a step servo position command of over a 10s duration.
Record (and plot for lab report) the servo angle () link angle () and voltage input .
If not, keep adjusting the and weighting matrices parameters, till all specifications are met. Record the final Q and R matrices, the servo angle (), link angle () and voltage input plots.
Study in simulation the degradation, if any, in closed loop system performance (in meeting the given specifications) using partial feedback. For partial feedback consider feedback of servo angle () and servo angle rate ().
This is easily done by retaining the gain value of the chosen feedback loops and zeroing out the remaining gains in the gain matrix used in your Simulink model.
Record (and plot for lab report) the servo angle () link angle () and voltage input
To build the model, click down arrow on Monitor & Tune under Hardware tab and then Build for monitoring . This generates the controller code.
Click Connect button under Monitor & Tune and then click Start
The purpose of this experiment is to understand the existence of vibrations in a rotary flexible link and the resulting mode shapes. Any beam-like structure exhibits vibrations either due to external changing loads or due to reorientation via actuators. The experiment deals with the modeling and identification of modal frequencies and mode shapes of free vibrations for a rotary flexible link. This analysis is particularly useful to understand structural vibrations and modes and how to contain them in real-world applications like aircraft and spacecraft structures as well as robotic links/manipulators.
This experiment involves system identification and modeling of the flexible link. The objective is to find the stiffness of the flexible link and conduct a frequency sweep across a range to determine the structural frequencies and mode shapes of the link.
This experiment is performed using the Quanser Rotary Flexible Link mounted on an SRV-02 servo motor. This system, shown in Fig. 1, consists of an electromechanical plant, where a flexible link is rotated using a servo motor. The base of the flexible link is mounted on the load gear of the servo motor system. The servo angle, , increases positively when it rotates counter-clockwise (CCW). The servo (and thus the link) turn in the CCW direction when the control voltage is positive, i.e., .
The main components of the setup are labeled in Figs. 2 and 3 and are listed in Table 1.
Table 1. Setup Components
No.
Component
1
SRV02 Plant (Servo motor)
2
FLEXGAGE Module
3
FLEXGAGE Link
4
Strain Gauge
5
Strain Gauge Circuit
6
Thumbscrews
7
Sensor Connector
8
OFFSET Potentiometer
9
GAIN Potentiometer
The FLEXGAGE module consists of the strain gauge, the strain gauge circuitry, and a sensor connector. The flexible link is attached to this module and the strain gauge is fixed at the root of the link. The module is mounted onto the servo motor, which is the actuator for this system. The strain gauge sensor produces an analog signal proportional to the deflection of the link tip.
The link can be schematically represented as shown in Fig. 4. The flexible link has a total length of , a mass of , and its moment of inertia about the pivoted end is . The deflection angle of the link is denoted as and increases positively when rotated CCW.
The complete flexible link system can be represented by the diagram shown in Fig. 5. The control variable is the input servo motor voltage, which is proportional to the angular rate of the servo motor. This generates a torque , at the load gear of the servo that rotates the base of the link, which is given by\tau=\displaystyle{\frac{\eta_g K_g\eta_mk_t(V_m-K_gk_m\dot{\theta})}{R_m}}=C_1V_m-C_2\dot{\theta} \qquad \qquad \qquad\tag{1.1}
where the various constants are SRV02 parameters which are mentioned in Table 2.
The viscous friction coefficient of the servo is denoted by . This is the friction that opposes the torque being applied at the servo load gear. represents the moment of inertia of the SRV02 when there is no load. The friction acting on the link is represented by the viscous damping coefficient . The flexible link is modeled as a linear spring with the stiffness and with moment of inertia .
Table 2. Setup Parameters
Mass of flexible link
Length of flexible link
Width or breadth of flexible link
Thickness of flexible link
Young’s modulus of flexible link
Area moment of inertia of link cross-section
High-gear viscous damping coefficient of SRV02
Equivalent high-gear moment of inertia of SRV02 (no load)
Motor armature resistance
Motor torque constant
Motor efficiency
Back-emf constant
High-gear total gearbox ratio
Gearbox efficiency
Viscous damping coefficient of flexible link
To be calculated
Moment of inertia of flexible link about pivoted end
To be calculated
Stiffness of flexible link
To be calculated
Mass per unit length of flexible link
To be calculated
The servo and the flexible link can be modeled as a lumped mass system separated by an equivalent spring and damper, which represent the stiffness and damping coefficient of the flexible link, respectively. The equations that describe the motion of the servo and the link with respect to the servo motor torque, i.e., the dynamics, can be obtained using free body diagram (FBD) analysis of the lumped mass moments of inertia ( and ).
The torque balance on yield Eq. (1.2) and the torque balance on yield Eq. (1.3).
On rearranging Eq. (1.3) to obtain an expression for and substituting it in Eq. (1.2), the equations of motion (EOM) for the rotary flexible link system can be obtained as
The stiffness of the flexible link can be determined from the free oscillation of the link using a second-order model. The free-oscillatory equation of motion of this second-order system is obtained by setting the term to zero in Eq. (1.5), i.e., by holding constant, which is shown in Fig. 6. The resulting equation will be
Assuming the initial conditions and , the Laplace transform of Eqn. 1.6 yields:
The prototype characteristic polynomial for a second-order system is defined as
where is the damping ratio and is the natural frequency. Equating this to the characteristic polynomial (denominator) in Eq. (1.7) yields
where represents the moment of inertia of the link about the pivot. This can be calculated approximately by considering the link as a rod rotating about a pivot at one edge . Equations (1.8) and (1.9) can be used to determine the stiffness and damping of the flexible link once the natural frequency and damping ratio are known.
The damping ratio of this second-order system can be found from its response (underdamped system) using the subsidence or decrement ratio given by
where is the peak of the first oscillation and is the peak of the nth oscillation. Note that , as this is a decaying response (positive damping).
The damping ratio is defined as
The period of oscillation in a system response can be found using the equation
where is the time of the oscillation, is the time of the first peak, and is the number of oscillations considered.
From this, the damped natural frequency (in rad/s) is
and the undamped natural frequency is
Mount the flexible link onto the calibration bench.
Download and open FlexLink_FreeOsc_Q2_USB.slx. This is the block diagram for this part of the experiment. Change the simulation time to 5-10 seconds.
Open the scope alpha.
Turn on the power supply.
Check you have good data and save the link deflection angle data for the free oscillation using the filename FreeOsc_1 to your folder.
Repeat the steps 7 and 8 two more times for different perturbation locations along the link (for example, around the middle and near the base) or different perturbation angles.
Plot the measured angular deflection of the link vs. time for each case. Select peaks that are smooth (focus on the region after initial transients) as shown in the figure below. Ensure that there are at least 4-5 peaks in between the two chosen peaks.
Option: Usage offindpeak
MATLAB function might be helpful, but not required. If you use this function, verify the peaks identified.
From the peaks selected, determine the time period of oscillation. Use this information to determine the damped frequency, the undamped frequency, the damping ratio, the stiffness, the viscous damping coefficient and the moment of inertia of the flexible link.
Average the stiffness and the viscous damping coefficient values of the link for the three sets of data to get a single value of the link stiffness and damping coefficient.
The flexible link can be considered as a thin continuous (uniform) cantilever beam anchored at one end and free at the other end. Using the Euler-Bernoulli beam theory, the equation of motion can be written as
where is the modulus of rigidity of beam material (assumed constant), is the area moment of inertia of the beam cross-section (assumed constant), is the displacement in direction at a distance from the fixed end at time , is the circular natural frequency, is the mass per unit length (, is the material density, is the cross-section area), is the distance measured from the fixed end and is the external applied force per unit length.
Also, the angle of deflection is related to the displacement as
The general solution to Eq. (1.15) can be obtained using separation of variables, as in Eq. (1.17) below.
Substituting (1.17) in (1.15), setting and rearranging gives
Equation (1.18) can be rewritten as
Since the left side of Eq. (1.19) is only a function of and the right side of Eq. (1.19) is only a function of , they both must equal a constant. Let this constant be . Thus, Eq. (1.19) can be written as the following two equations
The solution of Eq. (1.20) gives the displacement(as a function of), which will be of the form
where and are unknown constants. The general solution of Eq. (1.21) is given by
where , and are unknown constants.
The constants in Eq. (1.22) are determined from four boundary conditions, while the constants in Eq. (1.23) are determined from two initial conditions.
For a clamped-free or cantilever beam, the geometric boundary conditions are
and the natural boundary conditions are
where represents the bending moment and represents the shear force.
On substitution of the geometric boundary conditions at in Eq. (1.22) and its derivative, the following relations can be obtained
Hence, Eq. (1.22) becomes
On further substitution of the natural boundary conditions at in the derivatives of Eq. (1.24) yields
or
For a non-trivial solution, the determinant of the above matrix must be 0, i.e.
which gives the following characteristic equation
The above equation simplifies to
There are infinite solutions to this characteristic equation, which are given by
Thus, the mode shapes are
Since , the modal frequencies are given by
or
is mass per unit length
The mode shapes of a uniform cantilever beam are shown in Fig. 7.
In order to determine the modal frequencies and mode shapes, the corresponding frequencies can be excited by providing a sinusoidal input to the link via external means. When the frequency of the input coincides with either the fundamental frequency or higher frequency modes, the corresponding modes will be excited due to resonance and their mode shapes can be observed physically. Hence, the following experiment involves a frequency sweep across a range provided as input to the flexible link via the servo motor to identify the frequencies and observe the corresponding mode shapes.
Using the system parameters provided in Table 2, determine the mass per unit length of the beam .
Using Eqn. 1.26 and the values of necessary system parameters, calculate the first and second modal frequencies.
Mount the flexible link onto the rotary servo base.
Download and open FlexLink_ExciteMode.mdl
Open the scope alpha.
Turn on the power supply.
Ensure that the manual switch is connected to the Chirp signal input. This signal will provide a sinusoidal signal of fixed amplitude, with frequency increasing at a linear rate with time.
Open the Chirp signal command block and make sure that the Initial frequency is 0.1 Hz, the target time is 0.25 s and the Frequency at target time is 0.2 Hz. This will allow the frequency sweep to take place at a reasonable rate and ensure that the relevant frequencies are covered within the span of time.
Save the data using the format Osc_ChirpSignal into your folder.
Plot the measured angular deflection of the link vs. time. Using the time domain plot, perform frequency analysis using Fast Fourier Transform (FFT) [refer to the Appendix for the code] or a similar technique to identify the number of dominant frequencies and their magnitudes present in the signal.
Again, open the FlexLink_ExciteMode.mdl Simulink file used in part 2.
Open the scope alpha.
Turn on the power supply.
Connect the manual switch to the Sine wave signal input. This signal will provide a sinusoidal signal of fixed amplitude and fixed frequency.
Open the Sine wave signal command block and make sure that the Amplitude is 3 and Phase is 0 rad. Enter the first modal frequency determined from Q2 of the calculations in rad/sec.
Tune the frequency value by increasing or decreasing in steps of 1 rad/sec until the first mode shape is clearly visible.
Observe the corresponding mode in the link and note down the number of nodes and their locations with respect to length of the link.
Save the data using the file name Osc_Sineinput into your folder.
Repeat steps 6 to 10 for the second modal frequency also identified from Q2 of the calculations.
Plot the mode shapes using Eq. (1.25) in MATLAB (plot v(x) vs x/L) and record the node locations. Plot both theoretical shape and experiment shape. For theoretical, use and from and for experimental, use two mode frequencies from FFT and to find .
Record the number of nodes and their locations for each mode. Determine the locations as a ratio of the link length and compare them with the values obtained from the mode shape plots.
Plot of the measured angular deflection of the link vs. time with the chosen peaks marked for each dataset, i.e., three plots corresponding to three perturbation locations. Plot as three subplots in one figure.
Equations for time period of oscillation, damped frequency, undamped frequency, damping ratio, stiffness and viscous damping coefficient.
Values of the damped frequency , the undamped frequency , the damping ratio , the stiffness and the viscous damping coefficient of the link for each dataset, along with the corresponding average , , , and value. Use Table B.1 to document these values.
Calculation for mass per unit length of the link and moment of inertia of inertia of the link ()
Calculations and values for the theoretical first and second modal frequencies (calculated using Eqn. 1.26).
Plot of measured angular deflection of the link vs. time
Fast Fourier Transform (FFT) plot of link deflection with dominant frequencies and their magnitudes identified (either marked on plot or mentioned in writing).
Compare the first dominant frequency (from FFT) with the natural frequency of the flexible link and state your observations. Explain any similarities or differences observed and the reasons behind them.
Compare the first and second dominant frequencies obtained from the FFT with the corresponding calculated first and second modal frequencies (Result A.4) and explain your observation.
1st and 2nd Mode shapes (theoretical and experimental) plotted on the same graph with node locations marked. (plot v(x) vs x/L)
Number of nodes and their locations for each mode (theoretical and experimental). Use Table B.2 to document the values.
Comparison of experimental and theoretical mode shapes/node locations given and state the reason(s) for why they differ.
First
1
First
...
First
Second
1
Second
...
Second
Compare the damped and undamped frequencies of the link and report your observation. What does this signify with respect to the flexible link damping?
The following code performs FFT analysis on the flexible link angle response
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.
Press Connect button under Monitor & Tune and hold on to the base to prevent any rotation at the root.
Press Start and immediately perturb the flexible link (for example, at the tip). Keep holding the base until the data is collected for the complete run.
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.
Press the Connect button under Monitor & Tune and click on Start . Run the servo motor with the chirp input voltage for 60 seconds.
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.
Press Connect button under Monitor & Tune and Press Start . Run the servo motor with the sine wave for at least 20 seconds.