Pages: [1]   Go Down
Author Topic: Interfacing Atomic IMU 6DOF  (Read 1708 times)
0 Members and 1 Guest are viewing this topic.
India
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Electronics is clearly the winner of the day, Anyday and Everyday!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I made all the necessary connections between IMU and the arduino mega
I managed to connect the atomic IMU 6DOF to the mega and used the code(given below) to read the data. I am getting a set of distinct numbers that actually make no sense at all..

Code:
int imuData[9];
void setup() {
  Serial.begin(115200);
  Serial.println("#");
  Serial.println("-");
}
void loop() {
  for(int i=0; i<9; i++) {
    imuData[i]=Serial.read();
    Serial.print(imuData[i]);
    Serial.print("__");
}
Serial.println("");
delay(900);
}

Please help me with this.
-RaHL
Logged

 ∙•● яÁђนl ●•∙

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am getting a set of distinct numbers that actually make no sense at all..
You want to share that output, and explain your expectations?
Logged

India
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Electronics is clearly the winner of the day, Anyday and Everyday!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


this is what i am getting. Well, as far as i know these numbers dont make any sense. i am hoping to get some numbers pertaining to angles or speed of something, know what i am talking about?
Logged

 ∙•● яÁђนl ●•∙

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well, as far as i know these numbers dont make any sense. i am hoping to get some numbers pertaining to angles or speed of something, know what i am talking about?
The problem is that your expectations are unrealistic. What you are getting is the instantaneous acceleration data and orientation data. Since acceleration is the rate of change of velocity, you need to integrate that data to get speed. There are plenty of examples around for how to do this. Some even work.
Logged

India
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Electronics is clearly the winner of the day, Anyday and Everyday!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, after quite some research i found that the data from the IMU arrives in a bit mode distributed like this:-

8 bits      16bits      16bits      16bits      16bits      16bits      16bits      16bits      8bits
  'A'         Count       X accl      Y accl      Z accl      Roll          Pitch        Yaw         'Z'

So i use this code snippet
Code:
int imuVal[16];
for(int i=0; i<16; i++) {
     imuVal[i]= Serial.read();
}

This imuVal array will now contain the raw data, how do I convert it to something meaningful?
Logged

 ∙•● яÁђนl ●•∙

Pages: [1]   Go Up
Jump to: