Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction
For this lab, there are two experiments, with Experiment 1 having two parts, and Experiment 2 have four parts. In Experiment 1, the sensor and actuator both exhibit nonlinear characteristics. To implement controllers, an estimation of the nonlinear behavior must first be known. The first part investigates the nonlinearity of the sensor, and the second part studies the nonlinearity due to the magnetic field. In the second experiment, a PD controller is implemented. In Experiment 2a, both the proportional and derivative gains are set to zero. In 2b, a small proportional gain is added and compared to the previous test. Next, a larger proportional gain is implemented that gives a nearly undamped response. Finally, the derivative gain is added and compared to the previous tests.
Hardware
The ECP Magnetic Leviation (MagLev) design (See Fig. 1) features two 7and high flux drive coils to provide more than 4 cm. of controlled levitation range. Laser sensors provide non-contacting position feedback and incorporate proprietary conditioning electronics for signal noise reduction and ambient light rejection. The MagLev apparatus may be quickly transformed into a variety of single input single output (SISO) and multiinput multi-output (MIMO) configurations. By using repulsive force from the lower coil to levitate a single magnet, a SISO system is created, which is our focus in this experiment.
Upper support arm Ruler clamp screw (2 pl.) Protective coil cover (2 pl.) Precision glass guide r od Laser Sensor (out of view , 2 pl.)
0 1 4
Glass rod clamp screw (2 pl.) Upper Drive Coil (Coil #2)
1 3
1 2
1 1
1 0
1 0
1 1
1 2
1 3
1 4
Lower support ar m
Side View
Front View
Safety
Read the safety information found in Appendix B on the course webpage Specific to this experiment: select Abort Control immediately after measuring magnet height to minimize heat buildup in the coil and servo amplifiers.
2.
3.
4.
5.
does not move during the measurement. Any movement can lead to inaccurate results. Further enhancement in the accuracy of results of this and the next section may be obtained by taping a ruler (cm./mm. graduations) alongside of the upper and lower sensor/coil support arms with the ruled edge very close to the magnet travel zone. In this way the magnet height may be more reliably read. 3) When the magnet is at the close end of travel relative to the sensor (at the bottom for sensor #1, at the top for sensor #2) rotate it and find the clocking position where the sensor output is approximately the average of the highest and lowest values. There may be as much as 1000 counts difference between the highest and lowest values (if there is more than this, clean the white surface). This amounts to an equivalent position measurement error of less than 1 mm and becomes much less for positions further away from the coil. Try to maintain this approximate clocking for the remainder of the magnet positions when taking sensor data in Step 4 (e.g. keep the magnet polarity N label pointed in the same direction). There will be some noise in the sensor reading; so visually average the values displayed. The student need only read the sensor to three significant digits for the purposes here.
Use the following table for calibration data: Table 1-1 Sensor Calibration/Linearization Data Magnet Position for Sensor #1 (cm) Y1 raw (Sensor 1, Counts) 0.00 0.50 1.00 2.00 3.00 4.00 5.00 6.00 Plot the data points of sensor counts vs. magnet position in MATLAB. From the plot, determine a reasonably simple polynomial function y = f(x) that accurately fit the data points. Add this polynomial to your plot. (A first or second order polynomial will be sufficient) The lab report must include a plot of sensor counts vs. magnet position with the polynomial fit shown over the data. Also include the fitted polynomial equation including the coefficients found from MATLAB.
The final report is expected to include: Using Figure 1 above, label the following: Sensor Actuator Describe the following in terms of the physical meaning of each: Actuator Output System Output Reference Input One (1) MATLAB Plot along with titles, labels and the fitted polynomial equation printed on the plot - Plot of Magnet position (x axis) and Sensor 1 (y axis) One (1) Excel table of the original data - Table 1-1 of Magnet Position and Sensor 1 data For all the questions highlighted, the questions should be copied and pasted into the students lab report and explicitly answered immediately thereafter.
Procedure 1. Input the code. Write a simple real-time algorithm to activate actuator coil #1 (i.e. put control effort values on the DAC) with a constant
control effort of 5000 counts. 1 Review the algorithm with the instructor or laboratory supervisor before proceeding to the next step. 2. Implement this algorithm using the following steps: a) b) Enter Setup Control Algorithm via the Setup menu and select Edit Algorithm. If the editor contains any text select New under File. Type in algorithm. Select Save As and choose an appropriate name and directory to save this algorithm in. Close the editor by either selecting Save Changes and Quit or simply clicking on the upper right hand button. Stay well clear of the apparatus when initially performing the next step. Select Implement Algorithm to begin immediate execution of the algorithm. The magnet should levitate roughly 1 cm.
c)
3.
Record the height of the magnet corresponding to 5000 counts in a table similar to Table 1-2. Spin the magnet (again touching only its edge) to reduce the effects of friction so that the true equilibrium height is observed. Re-enter the algorithm editor via Edit Algorithm, reduce the control effort to 4000 counts, select Save Changes and Quit, and then Implement Algorithm. Notice the magnet height becomes lower. Record the magnet height. Repeat step 4 to find the control effort value at which the magnet is lifted only a very slight amount above the support pads (i.e. the 0+ position). Again, spin the magnet to reduce the effects of friction. Repeat step 4 for the remaining control effort values of Table 1-2. Select Abort Control immediately after measuring magnet height to minimize heat build-up in the coil and servo amplifiers during exposure to the higher control effort values (those greater than 10,000 counts) Do not exceed 22,000 counts of control effort
4.
5.
6.
These counts are converted to a voltage via a digital-to-analog converter (DAC), then to a current via the servo amplifier, to a magnetic field via the coil, and finally to a force by repulsion of the magnets magnetic field. The scaling of all of these transformations affects the system gain and will be examined in more detail in the sections that follow. See also Chapter 4 for a description of the control hardware and software functionality.
The final report is expected to include: One (1) MATLAB Plot along with titles, labels and the polynomial fit on the plot - Plot of Magnet position (y axis) and Control Effort (x axis) One (1) Excel table of the original data - Table 1-2, Magnet Position and Control Effort Briefly describe the trend of the nonlinear behavior of the magnet position as the control effort increases. In the text of the report, briefly describe possible reasons why the system is nonlinear (what are the physical dynamics causing the nonlinearity?) For all the questions highlighted, the questions should be copied and pasted into the students lab report and explicitly answered immediately thereafter.
and modify according to various steps of the experiment. Note that the student needs to determine a value for the variable, y1rawo, in the program. ;******************DECLARE VARIABLES******************* #define y1cal q2 #define y1rawo q3 #define kp q4 #define kd q5 #define kdd q6 #define Ts q7 #define y1str q8 #define pos_last q15 #define u1str q16 #define u1o q17 #define u1 q18 ;************************INITIALIZE*********************** Ts = 0.000884 ;must also set Ts in dialog box. control_effort1 = 0 control_effort2 = 0 ;Specify Parameters u1o = 5000 ;gravity feedforward (u_bar in linearization analysis) y1rawo = ##### ;sensor#1 value at static equilibrium corresponding to u10 value above (y_bar in linearization analysis). You need to fill this in before implementing control. ;Figure out a value of the sensor counts above using ;the magnet position in Table 6.1-2 along with y = f(x) obtained from Table 6.1-1 data. kp = 0 ;proportional control gain kd = 0 ;derivative control gain kdd = kd/Ts ;*************BEGIN REAL-TIME ALGORITHM************** begin y1str = y1rawo- sensor1_pos ;position error u1str = -kp*(y1str) -kdd*(y1str-pos_last) ;CONTROL LAW pos_last = y1str u1 = u1str + u1o ;add gravity offset control_effort1 = u1 q10 = -y1str ;reverse polarity for plotting q11 = -cmd_pos ;reverse polarity for plotting end
Experiment 2a: kp = kd = 0
In this first experiment, there are no gains used to control the system and thus the control effort is set to zero. Procedure: 1. Set kp and kd to zero and control effort u1o to 5000 in the program. Run the program to observe the disk to reach its equilibrium position. Press the disk down to the bottom (or raise it up) and then let go a couple of time to feel and observe how the system responds. Fill the observed equilibrium position in at the spot provided in the algorithm code above. 2. Rotate the magnetic disk slightly to free it up from possible static friction that may prevent it from reaching its equilibrium. Then take the following readings from the PC and include it in the report: a. Use the data acquisition of the PC system to record and plot two seconds of the motion of the disk with the disk pressed down against the bottom plate to begin with: b. To set the data acquisition, go to Data and then Setup Data Acquisition. Select Sensor 1 Position. Click okay. Then, go to Command, Trajectory 1. Select Step, and input a step of 0 counts, dwell time of 2000 ms, and 1 rep. Click Okay twice. c. Use MATLAB to create the plots and to accurately determine the settling time and frequency response. Hint; use the Data cursor tool in the plot window in MATLAB The final report is expected to include: One (1) MATLAB Plot along with titles and labels. Be sure to include Data Cursor points if determining the frequency. - Plot of the disk response Calculations or clearly indicate for the following quantities. Be sure to include units for ALL values: - Disk equilibrium position from the top of the plate - Disk equilibrium Sensor 1 Counts - Disk equilibrium Control effort 1 voltage - Time to settle into equilibrium - Frequency of the response
down (or lifted up) and let go. You should observe that, for any perturbation, the system will vibrate up and down at the same amplitude indefinitely. A system that exhibits this type of behavior is said to be displaying a limit cycle. A larger kp than this would make the system unstable, which causes the disk rapidly striking the bottom plate (light hits are OK). In this setting, since there in inevitably a damping coefficient from the friction between the disk and the glass tube a perfectly undamped system is unachievable. The students should instead look for a kp value that causes the disk to steadily oscillate for at least 8 seconds. Use the data acquisition of the PC system to record two seconds of the free vibration with the disk pressed down against the bottom plate to begin with. ' k p k sy s 1+k 1 n = m
k dk sy s 1 2m n
Where Ksys1 = 100 N/m, K1 = 0.053, and m = 120 g as given by ECP. Use MATLAB to create the plots and to accurately determine the frequency of the response. Hint, use the Data cursor tool in the plot window in MATLAB. In the lab report, you will need to derive the equations above for the natural frequency and damping ratio above. To start, you have a nonlinear system represented by the following:
Fw
The force out of the actuator is nonlinear, hence the dotted line showing that y enters the equation, but does not multiply through the equation. The force equation for the magnetic field nonlinearity is given by:
10
By linearizing the above equation in terms of perturbations in u and y, show that the above diagram simplifies to the diagram below. You need to show the linearization process from an FBD of the puck all the way to the final, linear differential equation.
) u* 1 (s kp
ksy s
1 m s 2+ k '1
L in e a r iz e d P la n t
kds
Using block diagram algebra, show that the above simplifies to:
And from this, show that the damping ratio equations and natural frequency equations above are correct. Calculate the frequency of the response based on the equation above and using your plot from Matlab. Compare the two results. The final report is expected to include: One (1) MATLAB Plot along with titles and labels. Be sure to include Data Cursor points if determining the frequency. - Plot of the undamped response Calculations or clearly indicate for the following quantities. Be sure to include units for ALL values: - Experimental value of kp used - Experimental value of the frequency
11
Procedure: Finally, explore how the addition of the derivative control component may stabilize and damp out the free vibration observed in the last step of proportional control alone. Try a small positive value for kd such as 0.0001 to begin with and observe its effect on the free vibration when the students press down or raise up the disk. Then increase the kd value to a point where the free vibration will damp out most quickly and reach the equilibrium fairly fast. If too large a kd value is used, it would cause the control effort to go over the limit. Experiment this and determine the best kd value for the stabilization. Your goal should be to have the fastest possible settling time. Use data acquisition to record the damped response with the disk pressed down against the bottom plate to begin with. Determine the damping gain necessary to achieve an optimal damping ratio of 0.707. Compare the response associated with this Kd value to the response obtained from your guess above. Extra Credit: 0.707 is not the damping ratio that gives the fastest settling time, even though it is often considered optimal damping. Calculate the damping ratio that achieves a 5% maximum overshoot, and implement the resulting Kd value. If you show this calculation and get a correct answer, you will receive 5 extra credit points. Use MATLAB to create the plots and to accurately determine the settling time and frequency response. Hint; use the Data cursor tool in the plot window in MATLAB
Note the difference of the settling time from that in Experiment 2a: Does it take more or less time to settle. Why? Explain the difference of the frequency from that in Experiment 2c. Is it higher, lower or no change? Why? The final report is expected to include: Two (2) MATLAB Plot along with titles and labels. Be sure to include Data Cursor points if determining the frequency. - Plot of the damped response by guessing - Plot of the damped response by calculations Calculations or clearly indicate for the following quantities. Be sure to include units for ALL values: - Guessed value of kd - If measurable, the frequency from the plots - Settling time for both plots
13
For all the questions highlighted, the questions should be copied and pasted into the students lab report and explicitly answered immediately thereafter.
14