Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
luvocean1
PostPosted: Apr 19, 2012 - 12:06 PM
Posting Freak


Joined: Dec 26, 2006
Posts: 1407
Location: Sydney, Australia

Got me a IMU3000 to play with...but it seems I should go back to high school Sad

I am finding it difficult to figure out how to work out the direction of the ADXL accelerometer and the IMU3000 gyro...

Please take a look at the attached pic and let me know if it seems ok....I found it on the net but it makes no sense...

If pic shows the directions for ADXL correctly as per ADXL datasheet. But how it relates to IMU3000 chip I dont understand...

For gyro the rate of angle change is Around an axis...whereas for a accelerometer the change of angle is to the direction of axis... how do u relate the x axis of one to the other?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
smkipus
PostPosted: Apr 19, 2012 - 06:48 PM
Hangaround


Joined: Jun 13, 2009
Posts: 307
Location: Ann Arbor, MI

How do you want to relate them to eachother? You can find the 3x3 position matrix based on Euler Angles at http://en.wikipedia.org/wiki/Rotation_matrix which would be sort of be useful if you were making a device that wants to know how its location is changing in space. To apply that matrix, you need to do the dead reckoning integration of your acceleration one time to get velocity. Two integrations for the Accelerometer for linear position, one integration on the Gyros to go from angular velocity to angular position.

If you just are wondering how they relate, I'm pretty sure a Z axis rotation would mean you are spinning your board counterclockwise the way you are picturing it, you'd register an acceleration off the X and Y accelerometer. Those X and Y signals would be quadratic to the signal you'd get out of your gyro. If its spinning twice as fast, you'd have 4 times the acceleration.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
luvocean1
PostPosted: Apr 20, 2012 - 01:00 AM
Posting Freak


Joined: Dec 26, 2006
Posts: 1407
Location: Sydney, Australia

hhm...well I assumed the above photo is correct and implemented a Complimentary filter last night and I seem to be getting useful things from x and y axis now...

I print the x y and z angles outputed from the complementary filter on hyperterminal as I sway the board. It seems if I hold the board midway upright and then do a reset, thus allowing a recalculation of offsets etc...after that if I sway the board to the left (almost virtical) I get my x axis angles approach almost zero (more like 3 to 6 deg) and then if I go back to midway I get 90 deg and then if I sway to the right side (almost vertical) I get (177 to 180ish deg).

I repeat the above for the supposedly y axis direction and I get similar results for y axis...

For Z axis the process does not make sense. The z axis of accelerometer represents acceleration in vertical direction...whereas for gyro this is a rotation around the vertical axis (yaw).

I think the above information is enough to come up with a quadcopter...dont you think? Do i really need z axis?

The other thing is... what happens when the device is falling and the micro does a reboot...the offset calculations etc from the accelerometer will be useless...of if the device was at an inclined position when the micro starts...it will get the wrong accelerometer information and set the offsets accordingly....all future results will be screwed... Sad
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
bobgardner
PostPosted: Apr 20, 2012 - 03:03 AM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21276
Location: Orlando Florida

Its possible to link in a file with some assembler variables that are declared in their own 'section' that is not in the Block Storage Section. This section will not be cleared on reset. So you store a magic number in there after power on, then if the magic number is there at the top of main, you are in a restart and dont need to reinit those vars. Or save the offsets etc in eeprom.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
smkipus
PostPosted: Apr 20, 2012 - 06:33 PM
Hangaround


Joined: Jun 13, 2009
Posts: 307
Location: Ann Arbor, MI

Quote:
For Z axis the process does not make sense. The z axis of accelerometer represents acceleration in vertical direction...whereas for gyro this is a rotation around the vertical axis (yaw).


Z will measure Yaw like you say, try turning your board on its left side and then rotating, I bet you'll get the same results as you did for X and Y. You will want the Z axis, after all, how will you know when you are turning? Although I'd imagine a compass would probably do a better job than a gyro for giving you your heading. Also consider the frame transformation that will have to be performed when your helicopter is banking or not flying with the body fixed frame alined with the earth fixed frame. Great application btw, I worked on this sort of thing in my schooling days =)
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits