Sunday, August 4, 2013

Part 4: Sensors (reading in raw data, applying calibration)

List of parts to blog:
Part 1: Quadcopter Design
Part 2: Integrating rc Transmitter and Receiver with Arduino
Part 3: ESC and motors (wiring and code)
Part 4: Sensors (reading in raw data and applying calibration)
Part 5: IMU - Kalman Filter Orientation Estimator
Part 6: Discussion on Arduino (boards and oddities)
Part 7: Designing a shield for the Due
Part 8: Control Laws!!!!!


Part 4: Sensors (reading in raw data, applying calibration)
Just a warning, this section is going to be long. And post Part 4 is only half of it. This part only covers getting the sensor up and running and then applying a calibration to the sensor data. Part 5 will then be on how to use that data to determine which way the quadcopter is pointing.

Originally I had wanted to use the ATmega328 on the 9dof IMU razor board to offload the arduino and do all of the sensor data processing there, but that was when I was planning to use an Arduino mega. Now that I already bought the thing and am using an Arduino due, I want to do all the heavy lifting on the due side. All the ATmega needs to do is query each sensor and then send that data to the Arduino. Pretty lame I know, i might use the ATmega328 to do some filtering of the data, but for now its just a pass through. In reality I should have bought this chip for 25 dollars less:https://www.sparkfun.com/products/10724
 I recommend anyone reading this planning to use a Due to get this rather than the 9dof imu razor. Just cut out the middle man ATmega328. Let the Due query the sensors for data itself. But it is what it is. If you do go this way you can take most of my code that I put on the ATmega328 and just put it on the Due instead. It should be EXACTLY the same, then you can delete all the junk I had to make to set up serial communication between the Due and the ATmega328. Or if you just want to use my code without having to modify it, just go with the 9dof Razor... The last section in this part, Part 4C is important though, the data must be calibrated before you use it, and the calibration process is nontrivial.

Part 4A: i2c communication to each individual sensor chip, ftdi programming ATmega328

Part 4B: Getting data to the arduino (setting up serail comm between ATmega328 and Arduino)

Part 4C: Calibration of sensor data

Part 4D: Final code

No comments:

Post a Comment