SparkFun will be closed May 25, 2015 for Memorial Day. Orders placed after 2pm on Friday the 22nd will ship out on Tuesday. Thanks!
Frequently Asked Questions
Mon-Fri, 9am to 5pm
U.S. Mountain Time:
Chat With Us
December 5, 2009
News - According to Pete
about 4 years ago
combining GPS and accelerometers data…
ALSO, I hav juste realsed, it might be mor precise to use the magnetometer as the rough estimation source for the roll, pitch and yaw, since it will not suffer from translationnal movement. I had not tought of that initially, since I did not have one when I made that algorythm.
Sorry for the bad English, French is my native language.
I hope this helps you, and gets you started!
On short time intervals, the gyroscope will make sure the integrated angle reacts quicky and accurately; and the accelerometer produces neglegible effects. However, that correction ensures long ther fiability on the readings.
However, I am sorry, I don’t have any idea about a precise calculation of the confidence for this method…
Now, in your case, you can use this method with the two rotation axis parallel to the ground: each of these axis will have their own gyroscopes, and use two accelerometer axes. (They share z).
For the last axis, yaw, you can use the same method, but instead of the accelerometer, which would be useless, you use the magnetometer to provide the rough estimate of the orientation.
Now, I have NO idea how to get absolute lat/long/alt position of your robot; it is a similar yet different problem, and I have not had the occasion of working on it. However, as I know them, GPS can be really precises! (but under 1m, meaby you could use a similar methot for
… small error that piles up pretty fast, and you move away from the expected value. To correct this; after each iteration, you “correct” the integrated angle with the angle calculated from the accelerometer. We may not have a lot of trust in this calculated angle; but we know it cannot be THAT FAR from the true angle, so correcting the integrated angle with it prevents the drift from growing out of bound. The correction is pretty simple: basically, each iteration, you add to your integrated angle about 1/1000 (find the best value experimentally; depends on your sensors) of the difference between the integrated angle and the calculated angle. So it will move the integrated angle a bit nearer calculated angle from the acceleremoters. (So, for example, my integrated angle is 10,0010°, but now my accelerometer says 10,5000°. The difference is 0,4990°, 1/1000 of that is (about) 0,0005°, so the corected angle is 10,0015°)
That way, your integrated angle will be really near the true angle:
…but you cannot tell the proper absolute orientation. However, it produces really clean data, very sensitive and vast acting, and is not affected by translationnal movements.
The solution here consists of integrating over time the gyros measures: For example, you start with an estimation of your current orientation from the accelerometers data. (lets say; 10°) You wait (for example) 1 millisecond, then you read the gyro: You consider the returned angular speed (for example, 1°/s) as having been constant during that millisecond (which is pratically true since the time interval is small). Therefore, during that time, the robot orientation moved of 0,001° (1°/s * 0,001s); and it’s current orientation is now 10,001°. You repeat the process as fast as you can, to get the most precises measuremnts (the smallest the time interval, the most precises the measure).
However, as you noted, the suffers from drift: sincw you cannot reduce the time interval to zero, each iteration introduces a
I’m not Pete, but I tought I could help a bit since I was faced with a similar problem last year; and found a solution working prety well.
However, I only had a two axis accelerometer and a single axis gyro, but my solution can be extended pretty easyly.
I’m assuming here your accelerometer is fixed with the body of your robot; so it tilts with your robot.
So first of all, to get your robot inclinaison (roll and pitch), theorically, only an accelerometer would be sufficient: using the atan function and simple trigo, you sould be able tell the angle between the robot and the vertical. However; tis only worls when the robot is stationary; as soon as it moves, the accelerometers catches other things, which do not depend on your orientation, and it spoils your measure. Furthermore, it has a slow reaction time.
On the other hand, an gyroscope does not give orientation in space, but only angular speed: therefore, you can tell wether you are rotating, how fast, and in witch direction,
about 5 years ago
What is the difference between this Gyro and, say, ADXRS610 you sell too? Both measure +/- 300 ?/s.
This one is powered with 3.3V and ADXRS610 uses 5V. This is the only direct Difference I see, yet ADXRS610 is twice the price of LISY300AL! What explains that?
No public wish lists :(
Forgot your password?
No account? Register one!