You are on page 1of 4

Mechanical Engineering Lab - PID Control Experiment

0 sanchefa | My Wikis | Help | Sign Out

Mechanical Engineering Lab


Home Safety Material Safety Equipment Software Lab 1 Lab 3 Skills Charts Clubs Cool Sites Glossary Lost and Found Physical Computing

PID Control Experiment


Torsional Control Experiment

Edit

31

For your experiment, you will be measuring the behavior of an open loop driven torsional pendulum, modelling it in MATLAB, applying that model to a closed loop simulation, and testing that model on the torsional plant: Open Loop > Model > Closed Loop You will need your lecture notes on PID control systems and knowledge of transfer functions to successfully complete this lab. Calculating the Spring Constant (K) Using your knowledge of solid mechanics, derive the spring constant of the torsional pendulum. 1) With weights attached, loop the provided string around one mass. 2) Using the digital pull scale, measure the force required to deflect the disk an arbitrary displacement. DO NOT EXCEED 2LBS OF FORCE. Record both the force and displacement. Note that the force applied to the system must be perpendicular to the radius of the disk for an accurate measurement. Calculating the Damping Coefficient (B) The equations for solving for B can be found in your notes. Always consider the offset when measuring your amplitudes. It is recommended that you take the average zeta of the first 3 pairs (Y0 and Y1, Y1 and Y2, and Y2 and Y3). Calculating the Moment of Inertia (I) With the balance and rulers provided, measure the mass and radius of the masses and the disk, as well as the final positions of the masses attached to the disk. Both the spring constant and moment of inertia will be necessary to complete this lab experiment. Torsional Plant Operation The PC for this experiment should already be powered on. If the motor controller pictured below is off, power it on only when the PC has been booted up fully.

Search Wiki

Wiki Home Recent Changes Pages and Files Members Manage Wiki

1/4

10/29/12 Mechanical Engineering Lab - PID Control Experiment On the Desktop, open the program titled "ECP32" Open Loop - Trajectory 1) All trajectories for this lab will be a Step function. On the ECP32 tool bar click Command > Trajectory 2) Select Step then click Setup Select Open Loop Step Set to 0.5V Dwell time = 4000 msec Number Of Reps = 1 3) Click Data > Setup Data Acquisition...

Sample Period should be set to 1. Selected items should include: Commanded Position Encoder 1 Position 4) The software is now ready to implement an Open Loop trajectory. Click Command > Execute... 5) Select Normal Data Sampling and then click Run. The motor will actuate a step trajectory for 4 seconds at 0.5 volts. 6) Select Data > Export Raw Data. Save the data as a *.txt file. 7) To view your data in ECP32, select Data > Upload Data followed by select Plotting > Setup Plot

Open Loop - Simulink 1) Import your data into MATLAB using Import Data... Title each column with an appropriate name (index, time, data, etc). 2) Use the p l o tfunction and its Data Cursor tool to determine the peaks of one of the waveforms. You'll need these values in you computation of the damping coefficient, B. 3) In the MATLAB Console, store your values of I , Band K , from your derivations. Ensure that values of K p , K d , and K iare all set to zero for the first part of this analysis. The size of the step function (0.5 volts) should be entered into the variable c m d . The so-called hardware gain, G 1 , of the system is comprised of the product: melab.wikischolars.columbia.edu/PID+Control+Experiment 2/4

10/29/12 Mechanical Engineering Lab - PID Control Experiment The so-called hardware gain, G 1 , of the system is comprised of the product:

G 1 = kc * ka * kt * kr * ke * ks kc, the DAC gain, = 10V / 32,768 DAC counts ka, the Servo Amp gain, = approx. 2 (amp/V) kt, the Servo Motor Torque constant = approx. 0.1 (N-m/amp) kr, the Drive Pulley ratio = 3 (N-m @ disk / N-m @ Motor) ke, the Encoder gain, = 16,000 pulses / 2 radians ks, the Controller Software gain, = 32 (controller counts / encoder or ref input counts)

(Dr Om Agrawal, Southern Illinois University Carbondale) 4) Open the Simulink model "TorsionControl.mdl" and ensure that the switches visible are set to Open Loop. This configuration should not contain an iterative loop and follow from Input straight to Output. 5) Press the Play button to begin the simulation. 6) P l o t the Output Variable and compare the waveform with your experiment. How do they differ? Make small adjustments to your model parameters (I,B,K) to create a better fit with experiment. Make note in your lab report what changes you made and any explanation for them. Closed Loop - Simulink This portion of experiment will use the transfer function and each of the gains K p , K d , and K i . Your goal will be to neutralize the oscillation produced from the disturbance. 1) Close the switches in the Simulink model so that it forms a closed loop. 2) In the MATLAB Console, begin with an estimate for K p from your derivations, while keeping K dand K i at zero. After it is entered in, press Play on the Simulink, and p l o tthe Output once more. How has the model changed? 3) Continue this process through multiple K pvalues and then repeat this process with K dand K i . Consider your various errors, like steady state error. When you are satisfied with your model, return to the ECP32 program. Closed Loop - Trajectory 1) In ECP32, select Setup > Control Algorithm. Select Continuous Time followed by Setup Algorithm...

melab.wikischolars.columbia.edu/PID+Control+Experiment

3/4

10/29/12 Mechanical Engineering Lab - PID Control Experiment

2) Set your desired control gains and click OK. It is recommended that you enter the gains one at a time to see the effect on the pendulum.

3) To save your gains, YOU MUST SELECT IMPLEMENT ALGORITHM. It is a frequently forgotten step and is cause for a lot of frustration. 4) As before, select Command > Trajectory. This time, change from Open Loop to Closed Loop. This also has the effect that it changes the format from volts to whatever the User Defined Units are. It is recommended that you stay with Counts or Radians, depending on what you chose earlier. Execute the trajectory with Normal Data Sampling. 5) Plot and save your data for use in analysis. Here, you may have to adjust the gains to fit the real world behavior. Explain why they would be different from the transfer function model.

Files

References Javier A. Kypuros. One Disk Torsion Plant System: Second Order Resonse . The University of Texas - Pan American, 10 Feb 2011. Web. 20 July 2012. Dr. Om Agrawal. Experiment 2: Torsional Dynamic System, System Parameter Identification and Control . Southern Illinois University Carbondale. Web. 20 July 2012. Stefan B. Williams. Lab 2 - Proportional and PD Control Torsional Plant . University of Sydney, April 2010. Web 20 July 2012

melab.wikischolars.columbia.edu/PID+Control+Experiment

4/4

You might also like