ESE406_2009_HW01

ESE406_2009_HW01 - ESE 406 - SPRING 2010 - HOMEWORK #1...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ESE 406 - SPRING 2010 - HOMEWORK #1 Introduction to MATLAB / SIMULINK DUE 20-Jan-2010 In this homework, we will use Matlab and Simulink to conduct simulations of the “Ping Pong Poise” in class demonstration. We will start with “Case 2” which is the nominal PID controller we discussed in class. Take a moment to watch the video “Case2.wmv”, which shows a capture sequence. The following graph shows the captured position measurements (in counts from the analog to digital converter) for this event: KD=$A0 : KP = $30 : KI = $A0 0 50 100 150 200 250 600 650 700 750 800 850 900 950 1000 Time [38-ms Frames] Ball Position [Counts] Note that initially, the ball is to the left (in the video) of the center, which is outside of the active sensor range. The ball comes into range between frames 650 and 700. The target position is 127. Go through the steps below to get some experience working with Matlab andeven more experience with Simulink. The last page has some suggestions for what you might submit to complete the homework. 1. Launch Matlab (From a Penn PC, Start Æ Programs Æ Mathematics Æ MatlabR2009b). 2. Using the “Current Directory” tab of the Matlab window, set the current directory to some convenient folder on the computer. I strongly recommend that you create a separate folder for each of homework assignment and save your work for the duration of the semester for reference. Place the PingPongPoise.mdl and PingPongPoiseParameters.m files that you download from Blackboard in the working directory you have chosen. We will use these files later. 3. In the Matlab Command Window, enter simulink . Hereafter, commands entered in the Matlab command Window will be specified with “>>”, as >> simulink
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
You should see the simulink library browser: 4. In Simulink, open a new model (Simulink Library Browser Æ File Æ New Model). 5. Open group in the Simulink Library Browser. Most of the system elements that we need to build our model of the PPP system are here. Let’s start by creating a very simple representation of the rocker arm, with the angle of the servo as an input and the position of the ball as an output. We said in class that we expect the acceleration of the ball to be proportional to the servo angle. Let’s call the constant of proportionality “A” for now. We’ll figure out a numerical value later. So, begin by dragging a node into your model. Double click on the node and in the text field labeled “Gain” enter “A”. 6. You should now save your model (Simulink Æ File Æ Save) in the working directory. You should save your model often while you are working, in case something crashes or goes wrong. This is a very good habit with Simulink; I always try to save my models before running the simulation. Call the model something like “HW01”. Your model should now look like this: To save space from here on, I won’t show the big white space in the model, just the nodes as you should have them connected.
Background image of page 2
7. Now, we need to integrate ball acceleration to get ball velocity and integrate ball velocity to get ball position. So, drag two
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/04/2010 for the course HOMEWORK ESE406 taught by Professor Bruekothman during the Spring '10 term at UPenn.

Page1 / 11

ESE406_2009_HW01 - ESE 406 - SPRING 2010 - HOMEWORK #1...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online