User:Cmcarreras/ENES-100/project 3

=Week 1 Narrative=
 * 0/0/0 .. nothing to grade --1sfoerster (discuss • contribs) 16:33, 21 April 2014 (UTC)

=Week 2 Narrative=
 * 0/0/0 .. nothing to grade --1sfoerster (discuss • contribs) 15:48, 22 April 2014 (UTC)

=Week 3 Narrative= Task was to attach an accelerometer to an arduino and record/document the readings when positioning the accelerometer and different angles/pitches

Above are the different readings I got while positioning the sensor at Zero/0°, Vertical/90°, Counter-Zero/180°, and Counter-Vertical/270°. NOTE All positions except for Zero were held by hand and should be considered approximate.

Next Steps:

In the future these readings would be used to have the tribot balance itself atop a ball. What next needs to be done is to wire the motors to spin in certain directions depending on what values are being read from the sensor. It should also be of note that only half of the capability of this sensor was utilized in these readings. The sensor also has a gyroscope which can measure pitch/roll and could also assist in keeping the tribot balanced atop a ball.


 * Very good. 10/10/30 ... next step is to activate the pitch/roll and compare with the x-y-z ... pitch and roll are capturing an angular acceleration. Need to separate out gravity from robot falling off the ball from the x-y-z. Start drawing block diagrams of how the software would work to do this. Or find PID software and connect this sensor to that software. --1sfoerster (discuss • contribs) 15:38, 29 April 2014 (UTC)

=Week 4 Narrative=

This week I worked to introduce the gyroscope from the IMU chip into the circuit from last week. I had numerous jumper cables on hand to make it happen.

In this video I was documenting a roadblock I had stumbled upon when suddenly... I solved my problem on camera.

Click here for video.

Connections AFTER fixing issue:

//Analog Accerometer w Serial //by Amanda Ghassaei //Modified by Chris Carreras //http://www.instructables.com/id/Use-an-Accelerometer-and-Gyroscope-with-Arduino/ //August 2012 /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or  * (at your option) any later version. * */

//setup accelerometer variables int xAcc; int yAcc; int zAcc; int accZero = 322; //setup gyro variables int xRate; int yRate; //int Vref; This was causing issues

//see the comment below for calculating this with your own    board. void setup{ Serial.begin(9600);//set up serial } void loop{ //read values xAcc = analogRead(A0); yAcc = analogRead(A1); zAcc = analogRead(A2); //Vref = analogRead(A3); This was causing issues yRate = analogRead(A4); xRate = analogRead(A3); //changed this to A3 from A5, was not working when reading from A5  /** if you want to determine the zero point value of your board, comment out the last eight lines of this loop and uncomment the lines below. Hold the board parallel to the ground and watch the serial monitor, the xAcc and yAcc values will hover around a common value, this is your "zero" value. Change the value of the variable "zero" above. **/  //print values Serial.print("xAcc "); Serial.println(xAcc - accZero); Serial.print("yAcc "); Serial.println(yAcc - accZero); Serial.print("zAcc "); Serial.println(zAcc - accZero); //Serial.print("IGNORE ME");     These two commented out lines are legacy from when I was having issues //Serial.println(xRate);         This was trying to read in xRate from A5... was not working at all Serial.print("yRate:"); Serial.println(yRate); Serial.print("xRate");          // This was formerly "Vref" but it was causing issues, or possibly pin A5 was causing issues Serial.println(xRate);          // This used to print in Vref, but I've made changes since then and now this sketch should work Serial.println(" "); delay(500);//wait }

NEXT STEPS

Using the above fixes-- anyone in the ENES classes should now have a traceable way of getting this specific Accelerometer/Gyroscope working with whatever project they may be working on. All that's left is coming up with a clever way of utilizing the numbers printed in from the IMU chip. Also, as I mentioned in the video, it is a MUST for someone to implement some sort of "zero-calibration" in the code that may be activated by a button press. The "zero" of the unit is not fixed and changes when the arduino is plugged into different USB ports, computers, etc.


 * wow 10/10/80 ... can really use this ... --1sfoerster (discuss • contribs) 13:30, 6 May 2014 (UTC)