This manual documents the modeling of a 2-DOF torsional pendulum, followed by the design of a collocated PD controller, and finally the controller implementation and evaluation on the hardware setup.
The objectives of this laboratory experiment are as follows:
Identify the parameters of a multi-degree-of-freedom system.
Demonstrate some key concepts associated with proportional plus derivative control for a two degree-of-freedom torsional mechanism.
Implement a PD controller on a 2-disk (2 DOF) system where the feedback is based on the angular displacement of the lower disk. Such a scheme is referred to as collocated since the sensor output is directly coupled to the actuator input.
Implementing a suitable controller on a 2-disk (2 DOF) system, where the feedback is based on the angular displacement of the upper disk is referred to as non-collocated since the sensor output and the actuator input are at different locations. The addition of the spring and the second inertia to the rigid body single DOF increases the plant order by two and adds an oscillatory mode to the plant dynamics. This may be thought of, in a sense, as a dynamic disturbance to the rigid body plant (single DOF).
This part of the experiment involves the first phase – system identification and modeling of the torsional mechanism. This is performed by representing the mechanism as a combination of spring-mass-damper systems and determining the model parameters from the system response. The approach will be to indirectly measure the inertia, spring, and damping parameters by making measurements of the system response while set up in a pair of classical spring-mass configurations.
Consider a one-DOF underdamped system model given by the second-order scalar differential equation
We will use the logarithmic decrement to estimate the damping ratio of the system. The solution of (4.1) is given by
where
where
Since
it follows that
It follows then easily from (4.3) and (4.2) that
or that
Therefore
where
The previous two equations give that
or that
Finally,
Recall that
or that
From (4.7) and (4.2), the damping coefficient can be computed from
For model 205a, clamp the center disk using the 1/4” bolt, square nut, and clamp spacer as shown in Fig. 4.3. Only light torqueing on the bolt is necessary.
Secure four 500g masses on the upper and lower disks. Verify that the masses are secured properly and that centerline of each mass is at a distance of 9.0 cm from the shaft centerline.
Figure 4.3. Electromechanical plant model 205a
Enter the program by clicking on the shortcut to 3D Torsion on the desktop and turn on the torsional mechanism.
Enter File menu, choose Load Setting and select the file C:\Program Files (x86)\ECP Systems\cn\default.cfg.
Choose the correct personality file by going to Utility menu and clicking on Download Controller Personality File. Download the file C:\Program Files (x86)\ECPSystems\cn\M205di6.pmc. This will implement ‘CLOSED’ Loop by default. Click on Abort Control at the lower right of the screen to ‘OPEN’ the loop.
Enter the Control Algorithm box via the Setup menu and set Ts = 0.00442
second, then OK. Enter the Command menu, go to Trajectory and select Step, Setup. Select Open Loop Step and input a step size of 0 (zero), a duration of 4000 ms and 1 repetition. Exit to the Background Screen by consecutively selecting OK. This puts the controller board in a mode for acquiring 8 sec of data on command but without driving the actuator.
Under Data menu, go to Setup Data Acquisition and select Encoder #1 and Encoder #3 as data to acquire and specify data sampling every 2 (two) servo cycles, i.e. every 2 Ts's. Select OK to exit. Select Zero Position from the Utility menu to zero the encoder positions.
From the Command menu, select Execute. Prepare to manually displace the upper disk by approximately 20 deg. Exercise caution in displacing the inertia disk; displacements beyond 40 deg may damage and possibly break the flexible drive shaft. (Displacements beyond 25 deg will trip a software limit which disables the controller indicated by "Limit Exceeded" in the Controller Status box in the Background Screen. To reset, simply reselect Execute from the Command menu.) With the upper disk displaced approximately 20 deg (≤ 1000 encoder counts as read on the Background Screen display) in either direction, select Run from the Execute box and release the disk approximately 1 second later. The disk will oscillate and slowly attenuate while encoder data is collected to record this response. Select OK after data is uploaded.
Under the Plotting menu, select Setup Plot and choose Encoder #3 position, and then select Plot Data from the Plotting menu. You will see the upper disk time response.
Save the data by clicking on the Data menu and going to Export Raw Data.
Remove the four masses from the third (upper) disk and repeat steps 8 through 10 for the unloaded disk. If necessary, repeat step 6 to reduce the execution (data sampling) duration.
Repeat steps 8 through 11 for the lower disk, disk # 1. For the lower disk experiment, in step 9, you will need to remove Encoder #3 position and add Encoder #1 position to the plot set-up.
Remember to switch off the system when you are done with your experiments.
Mass (including bolt and nut): 500g (± 5g)
Diameter: 5.00 cm (± 0.02 cm)
Compare the damping ratios of the loaded and unloaded cases of upper and lower disks and report your observations.
This part of the experiment involves the second phase – the development of PD collocated control on the torsional mechanism. This is done by using the parameters determined from Part A to model the system and determining proportional and derivative gains for the controller using MATLAB based on the given design specifications.
The configuration of the torsional mechanism that will be used for controller design and evaluation is shown in Fig. 4.4.
In this configuration, the center disk is removed and two masses are added to both top and bottom disks.
This section provides time and Laplace domain expressions which are useful for linear control implementation and are used in the experiments described later. The most general form of the two degrees of freedom torsional system is shown in Fig. 4.5, where friction is idealized as being viscous.
where
where
These may be expressed in a state-space realization as
where
Taking the Laplace transfer of the above equations and assuming zero initial conditions, we may solve for the transfer functions
where
where
The addition of the spring and second inertia increases the plant order by two and adds an oscillatory mode to the plant dynamics. This may be thought of, in a sense, as a dynamic disturbance to the rigid body plant. The collocated PD control implemented here is the approach most commonly used in industry. It may be practically employed when there is flexibility between the actuator and some inertia, and the location of objective control being near the actuator. If the location of objective control is at the distant inertia, however, this method has its limitations.
The approach in this experiment will be to design the controller by interactively changing the PD gains and observing their effect on the physical system.
All closed-loop poles must be in the left half of the complex plane.
Develop a SIMULINK diagram using the block diagram shown in Fig. 4.8 as reference and save it.
The TAs will need to see: Transfer functions, Gains, controlSystemDesigner/rltool plots, Simulink diagram, and Simulink response to a step command (proving overshoot and rise time requirements are met).
You must have your work checked out by one of the TAs before leaving the lab to get credit for your work.
Safety Note 1: The system's safety functions must be verified before each operational session. The system must be checked visually to verify that the disks, masses and connecting shaft all appear to be undamaged and securely fastened.
Safety Note 2: In the event of an emergency, control effort should be immediately discontinued by pressing the red "OFF" button on the front of the control box.
Safety Note 3: Stay clear of and do not touch any part of the mechanism while it is moving, while a trajectory is being executed or before the active controller has been safety checked.
Safety Note 4: Verify that the masses and inertia disks are secured as per he instructions prior to powering up the Control Box.
Safety Note 5: Never leave the system unattended while the Control Box is powered on.
Set up the system with two masses on the upper and lower disk as shown in Fig. 4.9. Ensure that the two masses are located along the hub split line of the disks. Observe that the middle disk has been removed.
Enter the program by clicking on the shortcut to 3D Torsion on the desktop and turn on the torsional mechanism.
Figure 4.9. Electromechanical plant model 205a configured for closed loop experiments
Enter File menu, choose Load Setting and select the file C:\Program Files (x86)\ECP Systems\cn\default.cfg.
Choose the correct personality file by going to Utility menu and clicking on Download Controller Personality File. Download the file C:\Program Files (x86)\ECPSystems\cn\M205di6.pmc.
Enter the Control Algorithm box under Setup and ensure that the sample period, Ts, is 0.00442 second and select Continuous Time Control. Select Pl + Velocity Feedback (this is the return path derivative form) and Setup Algorithm. Enter the high gain values Kp and Kd determined earlier (Ki = 0) and select OK. Check the values with a TA before entering them. Do not input magnitude of Kp > 1.0 nor Kd > 0.2 and Kd < 0.02. Ts is located both on the control algorithm screen and in the program itself, so be sure that both values are correct. The algorithm can now be implemented by selecting Implement Algorithm, then OK.
First, displace the lower disk with a light, non-sharp object (e.g., a plastic ruler) to verify stability prior to touching the plant. Similarly, displace the upper disk and observe the response. Note the difference in their stiffness.
Go to the Data menu and click on Setup Data Acquisition. Check that data is gathered every 5 servo cycles. Be sure that the Commanded Position, Encoder 1 Position and Encoder 3 Position are all located in the Selected Items box. If they are not, add them to that list by selecting them in the Possible Choices box and then clicking on the Add Item button. When finished, hit OK to exit this menu.
Prepare the input for the system by selecting the Command menu and then Trajectory. Uncheck the box Unidirectional Moves. Select the Step -> Setup -> Closed loop Step Input. Enter the following parameters for this case: step size, 1000 counts; dwell time, 5000 ms; 1 repetition. When finished, hit OK, then OK again to leave the setup trajectory menus.
Go to the Utility menu and click Zero Position. Go to the Command menu and click Execute. Then click the Run button. The input trajectory will be run on the torsional mechanism now. When the box on the screen says Upload Complete, click on the OK button.
After data collection has finished, go to the Plotting menu and select Setup Plot. Set Command Position and Encoder 1 Position on the left axis. Click on the Plot Data button when finished. This will generate a plot of the data from the executed trajectory. If desired, zooming the plot can be accomplished by going to the Plotting menu and selecting Axis Scaling. Similarly, obtain the plot of Encoder 3 position.
Save the data by clicking on the Data menu and going to Export Raw Data.
Repeat Steps 5-11 using the low gain controller values determined in Part B. How does the physical stiffness of the setup compare with the high gain controller?
Remember to SWITCH OFF the system when you are done with your experiments.
Using controlSystemDesigner/rltool, determine the gain margin (GM) and phase margin (PM) of the closed-loop system of the controller for the high gain controller as well as the low gain controller.
A schematic of the plant interconnection with the control computer is shown in Fig. 4.1-(b). The plant is shown in Fig. 4.1-(a). It consists of three disks supported by a torsionally flexible shaft which is suspended vertically on anti-friction ball bearings. The shaft is driven by a brushless servo motor connected via a rigid belt and pulley system with a 3:1 speed reduction ratio. An encoder located on the motor is used for commutation. This is the process by which the current is distributed to the motor coils. In order to commutate the motor, a sensor connected to the motor shaft is used to feedback the instantaneous rotor position. The encoder on the base of the shaft measures the angular displacement (in counts) which is converted to an angle of the lower disk . The second disk is connected to its encoder, which measures , by a belt/pulley with a 1:1 pulley ratio and similarly the third disk is connected to its encoder (which measures ) by a rigid belt/pulley with a 1:1 pulley ratio.
The plant may be placed in a variety of free and clamped configurations with 1, 2, and 3 degrees of freedom. For 1 and 2 DOF plants, the torsional spring constant may be halved by the choice of disk location. Changing configuration often requires removing or replacing inertia disks. Although these operations are straightforward, it is recommended that they are performed with care. The user may change inertia values by changing the number of masses and/or their location on a given disk.
In the following experimental procedure, we will identify the plant parameters and , where is the mass moment of inertia, is the torsional spring constant, and is the damping coefficient.
The value of during two complete successive cycles is given by
Let the logarithmic decrement be given by
Finally, if is known, an estimate for is given by
The previous procedure can be repeated also for the case when measurements are taken over non-successive cycles. To this end, notice that (see Fig. 4.2) and more generally, that
Assume that the natural frequency of the loaded disk is and the corresponding damping ratio is . Therefore,
where is the damped natural frequency for the loaded disk case (denoted by subscript ‘'). Similarly, for the unloaded disk case (subscript '') one has
for the loaded and unloaded cases, respectively. Solving for and equating the resulting expressions yields
Determine the damped natural frequency (in rad/sec) of the upper disk from the plot obtained for the upper disk when it is loaded with the 4 masses by choosing several consecutive cycles (for example, 5 to 10) in the amplitude range between 100 and 1000 counts (much smaller amplitude responses become dominated by nonlinear friction effects and do not reflect the salient system dynamics). This damped frequency for the loaded upper disk, , is related to the natural frequency for the loaded upper disk, , according to Eqn. (4.6), where the subscript ‘’ denotes the upper loaded disk.
Measure the reduction from the initial cycle amplitude to the last cycle amplitude for the n cycles measured above. Using relationships associated with the logarithmic decrement and damping ratio, find the damping ratio and the natural frequency .
Determine the damped frequency for the unloaded upper disk from the corresponding unloaded upper disk response of the Experimental Procedure. Repeat steps 1 and 2 of the Analysis to calculate the damping ratio and the natural frequency of the unloaded upper disk, where the ‘’ subscript denotes the upper unloaded disk.
Obtain and from the plots of the lower disk response for the loaded and unloaded cases respectively, where the '' and '' subscripts denote loaded and unloaded disk cases respectively for the lower disk. How do these damping ratios compare with that for the upper disk?
Use the following information pertaining to each mass piece to calculate the portion of each disk’s inertia attributable to the masses for the ‘’ (upper disk - loaded) and '' (lower disk - loaded) cases.
Calling the total inertia from these masses about the shaft centerline as , use the following relationships to solve for the unloaded upper disk inertia , and upper torsional shaft spring .
Using and , find the damping coefficient with Eqn. 4.8.
Repeat the procedure to find the lower unloaded disk inertia (), the spring constant of the lower torsional shaft () and the damping of the lower disk (). (Take the inertia contribution of the motor, belt, and pulleys to be = 0.0005 kg.m).
It is important to note that the setup includes two small masses on each disk and the controller design will be done for this case. Hence, includes the mass moment of inertia of the lower disk (), the mass moment of inertia contribution from two masses () and the mass moment of inertia of the motor-belt-pulley system (), i.e., . Similarly, includes the mass moment of inertia of the upper disk () and the mass moment of inertia contribution from two masses (), i.e., . Additionally, is taken as while is taken as .
In Part A, represented the total mass moment of inertia contribution from four masses (added to each disk). In Part B and Part C, there is a contribution of mass moment of inertia from only two masses, so in this case, (as calculated in Part A) should be suitably modified and will be lower than earlier.
Using the free body diagram of the 2 DOF free-free case, shown in Fig. 4.6, and summing torques acting on , one obtains
= applied voltage
, gain that converts volts to torque in N-m, is calculated as follows (see Fig. 4.7):
, the Servo Amp gain = 2 amp/V
, the Servo Motor Torque constant = 0.1 N-m/amp
, the Drive Pulley ratio = 3 (N-m @ disk/N-m @ Motor)
Thus, substituting these values in (4.10), we obtain = 0.6 N-m/V. Similarly, summing torques acting on
In Figs. 4.5 and 4.6, is the resultant of the stiffness of the lower () and the upper () shaft in series. The values for the stiffness of the lower and the upper shaft are the stiffness parameters that you identified in Part A. Then, knowing that these shafts are in series, use the formula
to obtain the total stiffness. The block diagram of the closed-loop system with the PD controller is shown in Fig. 4.8. The gain is the hardware gain and is given by
, the DAC gain = 10V / 32,768 DAC counts
, the Servo Amp gain = approx. 2 (amp/V)
, the Servo Motor Torque constant = approx. 0.1 (N-m/amp)
, the Drive Pulley ratio = 3 (N-m @ Disc / N-m @ Motor)
, the Encoder gain = 16,000 pulses / 2π radians
, the Controller Software gain = 32 (controller counts / encoder or ref input counts)
The gains of the PD controller and are the free parameters that must be chosen to achieve specific performance objectives (rise time, overshoot, etc.). The plant transfer function
where is the lower disk displacement and is the input torque at the motor.
In this experiment, we consider PD control of a 2-disk system where the controlled output, , is of the lower disk. Such a scheme is referred to as collocated since the sensor output is rigidly coupled to the actuator input.
The rise time to a unit step command input must be less than 0.4 sec (for ).
The overshoot in response (for ) to a unit step command input must be less than 10% without excessive oscillation.
must be less than 1.0 and must be greater than 0.02 but less than 0.1.
Open a new m-file and compute the transfer function using Eqn. 4.13. Save your m-file.
Use controlSystemDesigner/rltool in MATLAB and select appropriate values for and to meet the given set of specifications. Start with an initial guess for the gains and adjust. You need to meet the requirements in controlSystemDesigner/rltool. Save the controlSystemDesigner/rltool figures and your gains. Make sure to use the consistent controller architecture in the controlSystemDesigner/rltool. This will be known as high gain controller.
Compute the transfer function using Eqns. 4.13 and 4.14.
Obtain the SIMULINK response of to a unit step command using the set of high gains (from Step 2) you have selected. Save the response, and make sure it proves you meet the requirements.
Using the gains from the high gain controller as starting points in SIMULINK, iteratively reduce gains, until you obtain a well-behaved step response of with ≤ 10% overshoot (without excessive oscillation) and as fast a rise time as possible. Save these gains as a different set, which will correspond to a low gain controller and will be tested in Part C.
Obtain the SIMULINK response of to a unit step command using the set of low gains (from Step 6) and compare it with the response from Step 5. Are the design specifications still satisfied?
Compare the steady-state error values of the high gain controller as well as low gain controller response of obtained in the experiment and explain any difference.
Simulate the system response for the same step command you have used in the lab experiment. Compare your simulated responses with the corresponding experimental results for both and . What is the rise time and % overshoot in the experiment and simulation responses to the step command used (only for )? Explain the cause for any difference.