i am trying to built synthitic vision system EFIS to be used with real smal airplane.
am using sparkfun component 9 degree AHRS
connected to my laptop and gps RX
i Just got the component
1- 9 Degrees of Freedom - Razor IMU - AHRS Compatible
2- FTDI Basic Breakout - 3.3V
3- Single Row Break Away Pin Header – Straight
4- Polymer Lithium Ion Batteries - 860mAh 3.7V With JST Connector
5- LiPoly Charger - Single Cell 3.7-7V Input
6- USB- GPS reciver
i am searching for a right code to get real output from AHRS and then convert it to picture display same as aircraft instrument
I have used the 9DOF IMU connected to an arduino. First I flashed the IMU with the AHRS code from Google Code Archive - Long-term storage for Google Code Project Hosting. Then I just connected the tx and rx of the imu to the rx and tx pins of the arduino. Also connect the grounds together. I powered the imu on my breadboard with a separate regulated 3.3V supply. Then you can just read the imu serial data using the following code:
void setup()
char thisChar;
{
Serial.begin(57600);
}
void loop()
{
while (Serial.available() > 0) {
thisChar=Serial.read();
//do something with this value from the 9DOF imu
}
}
2). First of all i connected it with PC using FTDI breakout board (i.e. FTDI Basic Breakout - 3.3V - DEV-08772 - SparkFun Electronics) through USB miniCable. then i programmed on it DCM_AHRS code as given on the link provided by you or more specifically:
3). Then i connected the Rx and Tx of IMU with Tx and Rx of Arduino Duemilanove (ATMEGA168) and power (3.3v) and ground from arduino.
4). Finally i burned the small code posted by you on arduino to read serial data and print it in arduino Serial Monitor but i didn't get anything.
I have already tested the IMU by connecting it to PC through FTDI_USB breakout board and watching its output in X-CTU. It is working perfectly well as seen in X-CTU. There is one difference that its baud rate is 38400. I tried to change the baud rate in your code snippet but it didn't work either.
If you have any idea why its not working, please let me know.
I have recently acquired the same board. You won't see any output with the suggested code.
The first problem is that the code doesn't print() any information. I'm sure it's working fine but you, like I, want to see the numbers and know everything is working right.
Unfortunately Serial can only be used on a single serial connection at a time. The IMU - Arduino connection is one, but the PC - Arduino connection takes precendent. (citation needed)
I'm trying NewSoftSerial but so far no luck. I have not tried connecting directly to the IMU to see what data I get. I need to get an USB-FTDI plug so I can try it.
Can yo please guide me on how you interfaced the IMU to Arduino....i tried your code to read data but i got nothing.....thought the IMU is working with the arduino?
Unfortunately Serial can only be used on a single serial connection at a time. The IMU - Arduino connection is one, but the PC - Arduino connection takes precendent. (citation needed)
Have you tried connecting your gizmo to the standard tx/rx pins on the arduino, then monitoring the arduino/gizmo traffic using the arduino IDE serial monitor?
Regarding your raw output question...as far as i can understand it the first three values correspond to the accelerometer readings X, Y, Z and the other 3 correpond to gyro readings X, Y, Z...the last ones are for magnetometer...
I think we can use these values directly for stabilization purposes...i dont understand why you need the firmware from google?
I mean if you choose one of the 4 options by selecting 1or 2 or 3 or 4 by printing it on serial port then 1 corresponds to accelerometer readings i.e. what is the value of x-axis acceleration of board, y -axis acceleration of board and its z axis acceleration...in rest the z axis is either -260 or 260 depending on whether its face up or down....it correspond to acceleration due to gravity "g = 9.8m/sec" actually....
similarly if you print 2 then the IMU will give you Magnetometer data....if 3 it will give gyro i.e. gyro average position (i am not sure about it but its something like this)...if you tilt board in one direction its value increases in other direction its value decreases...its true for all 3 axis..
printing 4 will give you all this data together...so that you can code it easily getting all data you need at one place...its first three readings corresponds to x,y,x axis acceleration. next 3 readins corresponds to gyro and last three to the magnetomer....
I got it. I just wanted to confirm that the magnetometer and gyro data were yaw/pitch/roll. I didn't know that gravity was affecting the accelerometers. Interesting.
i can say that for gyro but in fact i don't know how magnetometer is helpful in determining yaw/pitch/roll...if you figure out or get some useful link do let me know...
i will keep you posted....rather let me know your email ID as well so that we can communicate otherwise...
Something is weird here...actually the data is not read by the arduino.....rather arduino is only used as a bridge here.....write no code in Arduino....even then the data is received.....
I read on Arduino that grounding the reset, reset micro-controller..
and we are here keeping it Gnd that is we are just bypassing micro-controller that is not desired.
That's not wierd at all. My goal is to get to the sensor, learn what it is doing, then write code to talk to it. When I have it working I can use Serial to talk to it while the PC is disconnected.