MIT OpenCourseWare http://ocw.mit.edu 2.004 Dynamics and Control II Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Massachusetts Institute of Technology Department of Mechanical Engineering 2.004 Dynamics and Control II Lab Session 1: Lab Familiarization1 Preparation: • Problem Set 1 was designed to help you review the theory for this lab session. You should have completed the exercises, and bring them to the lab. • The handout ”Description of Laboratory Rotational Plant” describes the experimental plant for this session. • You should read this handout thoroughly before the first lab session. Purpose of the Lab: This first lab session will introduce you to the 2.004 lab, and familiarize you with the labo­ ratory equipment and software tools that you will be using throughout the term. You will then use these tools to study the frictional characteristics of the rotational plant that you will be using in future weeks. Preliminary Tasks: 1. You will work in groups of two. The lab instructors will organize you into pairs, and assign you to lab stations. 2. Each group will be assigned a 2.004 computer account on the ME domain. You should log-on to your account and set a password. Your home directory will appear as drive z:. You will be able to log on to your account, and access your files, from any computer within the ME domain. 3. Your lab instructor will spend some time describing the equipment and software that will be using throughout the term. This will include the function generator, and the data acquisition hardware and software. The first series of experiments in the lab will be concerned wit the design and implementation of velocity and position controllers for the rotational flywheel system. You will have a chance to explore this equipment. 4. You will learn how to use the “Chart Recorder” virtual instrument (VI), including how to capture data, select regions of interest from a data record, print the chart, and save it as a MATLAB “.m” file, or as an Excel “.xls” file for subsequent analysis. Appendix B describes the basic operation of the Chart Recorder. You will practice using the recorder with the function generator, and save and examine some data in both MATLAB and Excel. Your instructor will help you here. 1 February 5, 2008 1 Today’s Experiment: Your task for this first session is to study the frictional characteristics of the motor, gear train, and bearings in the flywheel system, and to estimate numerical values for the frictional coefficients. You will study the effects of the eddy-current damping by placing magnets under the rim of the copper flywheel. There will be four separate cases: no eddy-current damping magnet, and one, two and three magnets in place. You will monitor and record the “spin­ down” characteristic of the flywheel in each case. In Problem Set 1 you were asked to determine the angular velocity of a rotating mass as it spins down under coulomb or viscous friction. You will observe both friction characteristics here. You should be able to distinguish between them directly from the recorded data. Procedure: You will monitor the angular velocity profile using the ETach electronic tachometer that is attached to the rotary encoder on the flywheel shaft. It produces an analog voltage vo proportional to the shaft speed Ω vo = Kt Ω where the tachometer constant Kt is 0.016 volts/rpm. For each of the four cases you should (a) Spin the flywheel by hand, and record the angular velocity decay Ω(t), using the computer-based Chart Recorder Virtual Instrument (VI) - see Appendix B. (Remember to convert the Chart Recorder output to angular velocity.) (b) Save a relevant section of your data to a MATLAB file. (see Appendix B) (c) By observing the nature of the data records, you should decide for each case whether the friction is predominantly, viscous or coulomb in nature. If you were unable to solve the relevant parts of Problem Set 1, your lab instructor will help you here. (d) Estimate the appropriate frictional coefficient using your results from Problem Set 1. You will need the numerical value of the moment of inertia J. If, in a given case, you decide that the friction is predominately viscous, you should estimate the value of time-constant of the decay (see Appendix A) and use that value to calculate the viscous coefficient B. If you decide the friction is coulomb in nature, estimate the value of the friction coefficient Tc using several data points. Your Report: As well as handing in Problem Set 1 (individual) at the end of the lab, you should also hand in a brief report of your group’s work. You should include printed graphs of the data you recorded, and show the values you found for the frictional parameters, and the methods you used to estimate the coefficients. 2 Appendix A: Graphical Methods for Estimating the Time-Constant of an Exponential Decay. Consider an exponential decay of the form y(t) = Ae−t/τ where τ is the “time-constant”, and A is a constant (y(0) = A). Given a graph of y(t), the task is to estimate the value of τ . Here are two methods of doing this: (a) When t = τ we note that y(t) = Ae−1 = 0.368A. Furthermore, since y(0) = A, y(τ )/y(0) = 0.368. We may therefore estimate τ from the time at which the response has decayed to 0.368y(0). Example: On the following MATLAB plot we visually estimate that y(0) = A = 2.3. Then y(τ ) = 0.368 ∗ 2.3 = 0.846. By zooming in the the plot we can determine that the response is 0.846 when t ≈ 2.32 s. We therefore conclude that τ = 2.32 secs. First−order exponential decay 2.5 Response 2 1.5 1 0.5 0 0 2 4 6 8 10 Time (s) (b) The slope of the response curve is dy A = − e−t/τ , dt τ and at t = 0, the slope is dy/dt = −A/τ . Consider a straight line passing through the point (0,y(0)), with a slope −A/τ . This line will intersect the time axis at t = τ . Therefore to estimate τ we can draw a line tangent to the decay y(t) at time t = 0, and use the intersection with the time axis as an estimate of τ . In the above plot, if you take a ruler and draw a line tangent to the response at t = 0, you will find that it intercepts the horizontal axis at t ≈ 2.3 seconds. Show for yourself that these methods are independent of the time origin you choose. In other words, you can choose any point on a decaying exponential as the initial point. 3 Appendix B: The “Chart Recorder” Virtual Instrument The primary tool for data acquisition in 2.004 will be a computer-based Virtual Instrument (VI) that mimics a conventional paper strip-chart recorder. Ut is used to record and store multiple channels of data through the BNC connector box, and the A/D converter in the computer. The figure above shows the recorder as it appears on the computer screen. The features of this system are: • It allows simultaneous recording of up to 8 channels of data at sampling rates up to 20,000 samples/sec with 16 bit resolution. • It allows independent gains (voltage levels) to be assigned to each channel. • Sampling is started/stopped manually. • The entire data record may be reviewed after sampling is complete. The chart may be panned, and zoomed to select a region of interest. • The complete, or a partial, data record may be saved to a file in either MATLAB or Excel format Setting up the recorder for data acquisition: Before you record data you must set up the sampling parameters in the acquisition panel on the left. 4 (a) The sampling rate. This defines the number of samples the recorder will take each sec­ ond. You must choose a number high enough to capture the dynamics of the waveform you are monitoring, but you should also keep your data records to a reasonable size. Your lab instructor will help you here. (b) The channels you will sample. You may choose the individual channels you will record (the numbers (0 – 7) correspond with the top row of BNC connectors on the terminal box). To select multiple channels, hold down the CTRL key on the keyboard while selecting the channels by clicking the mouse. (c) Voltage Range. The maximum voltage range for each channel may be independently selected. We recommend that you leave all channels set to ±10 volts (the default), unless you are dealing with very small voltages. Starting/Stopping the data acquisition When you are ready to start recording, click on the “Start” button. The data will scroll across the screen as it is gathered. To stop sampling, simply click on the button again. Manipulating the display: By default the y-scale is set to auto-scale (that is adjust the minimum and maximum limits according to the data) as data is recorded. By right-clicking on the chart you can change many display settings, including turning off the auto-scale. You can fix the upper/lower voltage limits for the display by erasing the top and bottom values, and typing in the values you want. Examining the data record: The entire data record is stored in the computer. After the data acquisition is complete, if you click on the pan or zoom buttons above the top right corner of the chart, you will be able to scan the data record, and select any portion of the data record that may be of interest to you. Saving data to a file: You may save any portion of a record to a file, either as a MATLAB “.m” file or as a spreadsheet “.xls” file. By default data is saved to you home directory (drive z:). You may save data to a sub-directory by entering its name (no backslashes) into the appropriate box. You can name you file in the appropriate box, however when saving to MATLAB be careful to choose a name that does not conflict with MATLAB’s function names. You must also enter the initial data point that you want to save, and the number of data samples to save in the record. MATLAB File: Chart Recorder writes a “.m” file that creates data arrays in MATLAB, and plots the selected data records. The data arrays are named according to the file name you choose. For example, if you save the data in the file mydata.m the arrays will be named t mydata will be a column vector of the sampling times. v mydata will be an array with a column for the voltage data from each of the selected input channels. ch mydata will be a row vector identifying the channels used in the sampling, and the columns in v mydata. 5 fs mydata will be a scalar containing the sampling rate in samples/sec. The file contains an embedded MATLAB plot command, so that when invoked it loads the data and displays it immediately. Excel File: The Excel file stores informational headers, then the sampling times and data in a tab delimited text file. The easiest way to understand the format is to save a small file and examine it with Excel. 6