MAE 143c Fall 2012 Assignment 2 The purpose of this assignment is to get you started on assembling MyMip and to get you comfortable using the electronics. As you go through each step it is important to read every substep before you proceed. The reason for this step by step procedure is not just so that you can assemble MyMIP but also to help you understand how everything comes together. This understanding will help you when you run into problems as you will have the require knowledge to debug them. It is recommended that you go through each step carefully making sure that you understand what you are doing and that you also double check all your work. Part a) The first part of the assignment is to go through and read everything that is attached below. When you reach the Putting MyMIP Together section you are expected to follow the steps and begin assembling MyMIP as instructed. Note that you will not be completely assembling MyMIP in this assignment so DO NOT do more than instructed. Part b) Once you have your protoboard with the sensors wired up to the arduino you will be using the raw accelerometer data to measure the orientation (theta) of the board relative to the vertical as depicted in the figure below. Along with this assignment you should have received an accelerometer test code. Step 8 had/will have you upload this test code to the Arduino Nano. Open up the serial monitor in the IDE to view all the data coming from the arduino. The second and third to last columns are of the x and z axis outputs, respectively, from the accelerometer converted to units of g. The assignment for this part is to use these two values along with the atan2() function to calculate the values of theta. I am defining theta as the angle of the arm of your segway-like robot from the vertical as depicted in the figure above. You will need to set up the orientation of the accelerometers x and z output so that theta = 0 is the vertical. Note that this will require you to add some negative signs in the code to account for the orientation of the x output and z output and to correctly use the atan2() function. This does NOT mean unplug the
8
Embed
MAE 143c Fall 2012 Assignment 2 - University of California ...renaissance.ucsd.edu/courses/mae143c/mae143c_hw3_rev1.pdf · MAE 143c Fall 2012 Assignment 2 The purpose of this assignment
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
MAE 143c Fall 2012 Assignment 2
The purpose of this assignment is to get you started on assembling MyMip and to get you comfortable using the electronics. As you go through each step it is important to read every substep before you proceed. The reason for this step by step procedure is not just so that you can assemble MyMIP but also to help you understand how everything comes together. This understanding will help you when you run into problems as you will have the require knowledge to debug them. It is recommended that you go through each step carefully making sure that you understand what you are doing and that you also double check all your work. Part a) The first part of the assignment is to go through and read everything that is attached below. When you reach the Putting MyMIP Together section you are expected to follow the steps and begin assembling MyMIP as instructed. Note that you will not be completely assembling MyMIP in this assignment so DO NOT do more than instructed. Part b) Once you have your protoboard with the sensors wired up to the arduino you will be using the raw accelerometer data to measure the orientation (theta) of the board relative to the vertical as depicted in the figure below.
Along with this assignment you should have received an accelerometer test code. Step 8 had/will have you upload this test code to the Arduino Nano. Open up the serial monitor in the IDE to view all the data coming from the arduino. The second and third to last columns are of the x and z axis outputs, respectively, from the accelerometer converted to units of g. The assignment for this part is to use these two values along with the atan2() function to calculate the values of theta. I am defining theta as the angle of the arm of your segway-like robot from the vertical as depicted in the figure above. You will need to set up the orientation of the accelerometers x and z output so that theta = 0 is the vertical. Note that this will require you to add some negative signs in the code to account for the orientation of the x output and z output and to correctly use the atan2() function. This does NOT mean unplug the
accelerometer and turn it upside down so that the orientation matches that which is depicted in the figure. As proof that you've completed the assignment successfully I would like to see two plots created from the data that you got from a simple test that you will run. The test that you will run is:
1. Lay your assembled protoboard on the table. 2. Hookup your arduino and open up the serial monitor. 3. Now grab the end that is farthest away from the accelerometer and rotate it up to the vertical
and then continue rotating it till it is laying on its face. See figure below for clarification. Do this 3 to 4 times.
4. As soon as you are done with the test, unplug the arduino from the computer. DO NOT CLOSE THE SERIAL MONITOR!
5. Now use the data from the serial motor to make the following plots that you will turn in. Note the simplest way to plot the values is to copy and paste all the data from the serial monitor into excel and make the plots there.
a. The first plot will be of the x and z outputs in units of g depicting the test you just did b. The second plot will be of the theta values you got during this test in units of degrees. c. Below is an example of what I expect.
Summary of the assignment
Complete part a) of assignment o Read all attached information o Go through and complete all the listed steps in the sections below
Complete Part b) of assignment o Using the provided electronics get raw data from the accelerometer and convert it to
units of g (done for you in test code). o Set up the orientation of the accelerometers so that theta = 0 is the vertical. Note that
this will require you to account for the orientation of the x output and z output and to correctly use the atan2() function. This does NOT mean unplug the accelerometer and turn it upside down.
What to turn in?! o You are required to turn in only two plots. o The first plot will be of the x and z outputs in units of g depicting the test you do in part
b). o The second plot will be of the theta values you got during the part b) test in units of
degrees. o Do not turn any more information in like the raw data. I only expect two plots which
should amount to only 1 page. Anything more and I will take points off.
-0.5
0
0.5
1
1.5
2
1
11
21
31
41
51
61
71
81
91
10
1
11
1
12
1
13
1
14
1
15
1
16
1
17
1
18
1
19
1
20
1
21
1
22
1
23
1
24
1
25
1
g
Data Points
Converted X and Y signal from Acclerometer
X
Z
-50
0
50
100
150
1
11
21
31
41
51
61
71
81
91
10
1
11
1
12
1
13
1
14
1
15
1
16
1
17
1
18
1
19
1
20
1
21
1
22
1
23
1
24
1
25
1
Theta (degrees)
Data Points
Orientation Relative to Vertical
Inventory of Materials Provided in MyMIP Kit:
Take stock of your kit, make sure you have the following items in the large zip-lock bag: USB mini cable, Qty: 1 Jumper wire kit, Qty: 1 Solderless Breadboard, Qty: 1 Wheel, Qty: 2 Wire bag
o 12” M/M jumper cables, Qty: 2 diff colors o 12” M/F jumper cables, Qty: 4, 2 each of 2 diff colors, diff than 6” M/F o 6” M/M jumper cables, Qty: 2 diff colors o 6” M/F jumper cables, Qty: 4, 2 each of 2 diff colors o 9V Battery connector with leads, Qty: 1 o 9V alkaline battery, Qty: 1
Electronics Bag o Arduino nano, Qty: 1 o Accelerometer, Qty: 1 o Gyroscope, Qty: 1 o Motor Driver, Qty: 1 o Switch, Qty: 2 o Motor, Qty: 2
Mechanical Bag o Ski, 1/8” delrin Qty: 2 o Riser, 1/8” delrin, Qty: 1 o Motor Housing, 3D printed, Qty: 1 o 4-40 hex nut, Qty: 4 o 4-40 x 3/8” philips machine screw, Qty: 4 o Adhesive-backed Velcro, Qty: 7”
Encoder Bag o Encoder Insert, 1/8” delrin, Qty: 2 o Encoder disc, 3D printed, Qty: 2 o Male Header pins, Qty: 8 (as one strip) o Double-sided header pins, Qty: 2 (as one strip) o 100 Ohm 1/4W resistor (Brown/Black/Brown/Gold), Qty: 2 o 10k Ohm 1/8 W resistor (Brown/Black/Orange/Gold), Qty: 4 o IR Detector, Qty: 4 o Encoder PCB, Qty: 2 (with IC pre-soldered on)
Tools and Materials Needed: MyMIP Kit purchased from Nick
Wire Strippers
o Can use scissors if you don't have access to wire strippers. Note, that I assembled my
MyMIP using scissors to strip wires so it can be done and it isn't difficult.
Solder Iron
o Temperature controlled best
o Non-temperature controlled one should be around 25 to 30 Watt.