Shop OBEX P1 Docs P2 Docs Learn Events
RE: Gyroscope Question — Parallax Forums

RE: Gyroscope Question

schwiegjcschwiegjc Posts: 41
edited 2009-10-23 18:28 in Propeller 1
I recently purchased LISY300 Gyroscope. I downloaded the Propeller Demo Code and attached the sensor. It seems to work fine. I notice that the sensor output has a slight drift just resting on the table. Is that expected? It did accurately track the movement of the sensor.

Comments

  • mctriviamctrivia Posts: 3,772
    edited 2009-10-20 14:47
    i have never used a gyroscope but I have read there data sheets and they all have a rating of drift/hour at rest

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • Kit MortonKit Morton Posts: 39
    edited 2009-10-20 14:57
    The example code on the Parallax web site automatically calibrates the gyro every time the program starts. If the gyroscope is moving at all during this calibration, which happens very soon after the prop turns on, you will have a larger amount of drift that you would normally get from the gyroscope.

    It is however true that you can get a little bit of drift even if you calibrate correctly, but in my experience you shouldn't be able to notice that kind of drift unless you watch it for more than a few minuet.

    -Kit

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PHRED, FIRST Team 847, Member
    Go -> PHRED
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-20 19:18
    Solid state gyros measure the angular velocity.· The angular position is computed by integrating the velocity.· The zero-velocity voltage will change over time, and integrating this voltage offset will cause the angle to increase or decrease even if the gyro is not moving.

    The rate of angular drift depends on the zero-velocity error and on how fast the velocity is integrated.· The drift will be 10 times higher if integrated at 100 times/second versus 10 times/second.· However, the integration rate must be high enough to track the·bandwidth of the motion that is occurring.
  • HughHugh Posts: 362
    edited 2009-10-21 10:08
    I'm happy that solid-state gyros work well on something such as a helicopter: on a fixed-wing platform flying a perfectly co-ordinated turn, will these devices provide absolute roll/pitch information (as measured by an outside observer), or zero pitch / roll information (as perceived by a passenger with a glass of water on their seat-tray)?

    I think its the latter, but my head hurts to even start thinking about it...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Hugh - the thinking woman's Geoffrey Pyke.
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-21 14:59
    I used a 2D gyro chip in a rocket with a gimballed motor mount.· It flew pretty well.· My webpage on the rocket is located at http://home.swbell.net/davehein/ModX/quadpod_ii.html .· I didn't have to worry about drift because the motor only burns for 7 seconds.· However, I did notice the gyros drifting in static tests.· After a minute the motor mount would be tilted all the way to one of the limits.

    The rotations in each dimension do interact with each other.· Try rotating a box by 90 degrees in one dimension, and then another.· Then reverse the rotations.· If you reverse the rotations in a LIFO (last-in-first-out) order the box will return back to its original orientation.· However, if you reverse the rotations in a FIFO order the box will end up in a different orientation.· I didn't have to worry about the interaction of the rotations in my rocket because the angles were fairly small, and it did not rotate around the vertical axis.

    In general, the interaction among the three dimensions needs to be considered.· Each time the angles are updated it needs to be done relative to the current angular reference and not from the orginal reference.· Yes, it hurts my head to think about this also.smile.gif

    Dave
  • Mark SwannMark Swann Posts: 124
    edited 2009-10-21 19:19
    I am not a gyroscope expert, but wouldn't you normally expect a gyroscope sitting on a table top to drift just due to the earth's rotation?
  • James LongJames Long Posts: 1,181
    edited 2009-10-21 19:39
    Mark Swann said...
    I am not a gyroscope expert, but wouldn't you normally expect a gyroscope sitting on a table top to drift just due to the earth's rotation?

    I do not think Solid state gyro drift due to the earth's rotation. It is more of a heating issue. The chips heats slightly causing the output to vary to some degree. This is the drift which can kill a system with only rate gyros.

    We must remember that solid state gyros are only rate gyros, and do not have a spinning mass for reference. So they only give rotational movement information.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-22 14:53
    Mark Swann said...

    ·I am not a gyroscope expert, but wouldn't you normally expect a gyroscope sitting on a table top to drift just due to the earth's rotation?

    Look up the Foucault Pendulum -- http://en.wikipedia.org/wiki/Foucault_Pendulum·.· This is a very long pendulum with low friction and air resistance hanging from a swivel connection.· The apparent swing direction of the pendulum slowly rotates around due to the earth's rotation.· The effect depends on the latitude, and is the strongest at the poles.· Of course, even at the poles it would take a full day to rotate 360 degrees.

    The drift of MEMS gyros is much faster than this.· One problem I encountered in my implementation is the digital resolution of the gyro signal.· I used a 12-bit A/D, which would seem to be a sufficient resolution.· The digitizing error at 12 bits is around 0.01 percent, which is quite samll.· I calibrate the gyro by computing the average DC value over a period of several seconds.· If the DC value has an error of 0.01%, and I integrate at 100 times per second, then the error grows by 1% per second.· In 10 seconds the accumulated error is 10%.· I was able to reduce the drift somewhat by computing the DC value to 16 bits of resolution, and I use 24 bits for the accumulation.

    Dave
  • HughHugh Posts: 362
    edited 2009-10-22 20:13
    This is why the 5DOF IMU is so effective: accelerometers are good at measuring angles with low rates of change nut not quickly changing angles; rate gyros are better at measuring rates of change of angle but are not so good at low rates of change. Put these different characteristics through the Kalman filters and you have a pretty darn good measurement system with minimal calibration requirements and minimal drift.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Hugh - the thinking woman's Geoffrey Pyke.
  • James LongJames Long Posts: 1,181
    edited 2009-10-22 20:46
    Hugh said...
    This is why the 5DOF IMU is so effective: accelerometers are good at measuring angles with low rates of change nut not quickly changing angles; rate gyros are better at measuring rates of change of angle but are not so good at low rates of change. Put these different characteristics through the Kalman filters and you have a pretty darn good measurement system with minimal calibration requirements and minimal drift.

    I wish I understood the Kalman filter better. I basically understand what it is doing...but the math is a little over my head.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.

    Post Edited (James Long) : 10/22/2009 8:52:41 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-22 21:30
    Here is a good reference for Kalman filtering

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-22 21:53
    The example in the referenced paper is useful if you can rely on the accelerometers to give you tilt measuremets.· This is not so useful for an object traveling freely in 3D space.· However, there are other sensors, such as horizon detectors that can be used to calibrate·the gyros.

    The concept of Kaulman filtering is definitely a good thing if you have multiple ways of measuring a value.

    Dave
  • hover1hover1 Posts: 1,929
    edited 2009-10-22 21:54
    Thanks Beau,

    Very good reading.

    Jim
    Beau Schwabe (Parallax) said...
    Here is a good reference for Kalman filtering

  • James LongJames Long Posts: 1,181
    edited 2009-10-22 22:04
    Beau Schwabe (Parallax) said...
    Here is a good reference for Kalman filtering

    ???????? yea.....sure. I would need to discuss that with a living person for me to understand that.

    All those big words....and is that math???

    confused.gif

    But I am humble. smilewinkgrin.gif

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
  • heaterheater Posts: 3,370
    edited 2009-10-22 22:05
    I like the ending "..Good luck"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-22 22:14
    James,

    Mostly matrix multiplication ... the hard part is implementing that on a micro. Not impossible.


    Heater,

    lol

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • SRLMSRLM Posts: 5,045
    edited 2009-10-22 22:47
    I found this article that seems to explain the Kalman filter pretty well, without making too many assumptions on the reader's math skills.

    academic.csuohio.edu/simond/courses/eec644/kalman.pdf
  • James LongJames Long Posts: 1,181
    edited 2009-10-23 00:04
    SRLM said...
    I found this article that seems to explain the Kalman filter pretty well, without making too many assumptions on the reader's math skills.

    academic.csuohio.edu/simond/courses/eec644/kalman.pdf

    I'll take a look at it...and let you know if my eyes cross or not. smilewinkgrin.gif

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
  • James LongJames Long Posts: 1,181
    edited 2009-10-23 00:42
    Beau Schwabe (Parallax) said...
    James,

    Mostly matrix multiplication ... the hard part is implementing that on a micro. Not impossible.


    Heater,

    lol

    Ok.....so it took me a few times of reading that.....but I think I get it. Thanks for the reference.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
  • James LongJames Long Posts: 1,181
    edited 2009-10-23 03:48
    I've read SRLM's reference (actually saved it to re-read it again later.......

    I do not have a clue how that would be implemented on a micro-controller. Is pretty neat....but I would probably use a pre-made filter (OBEX) and tune it for the system I used.

    The reading was very interesting.........

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • TimmooreTimmoore Posts: 1,031
    edited 2009-10-23 04:17
    Take a look at http://forums.parallax.com/forums/default.aspx?f=25&m=367325
    Its a 6DOF IMU that uses kalman, the device handling for accel/gyro/compass is external to the imu. It also uses fixed point maths rather than float for speed.
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-23 14:45
    Timmoore said...
    Take a look at http://forums.parallax.com/forums/default.aspx?f=25&m=367325
    Its a 6DOF IMU that uses kalman, the device handling for accel/gyro/compass is external to the imu. It also uses fixed point maths rather than float for speed.
    Tim,

    I looked at the code and that's great stuff.· I can see that the Kalman filter is useful when the gyro and accelerometer data is strongly correlated, such as in a balancing robot.· How are periods of acceleration handled when the robot moves from a fixed position to a constant velocity in one direction?· Does the Kalman filter automatically·filter out·the brief acceleration, or does it cause an error in the angle for a short period of time?

    Dave
  • James LongJames Long Posts: 1,181
    edited 2009-10-23 15:32
    My issue with all the filters I've seen so far, are they deal with items (or partially) that are analog.

    Is it a good idea to go with digital output sensors?? I just figured the less analog, the less noise.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • TimmooreTimmoore Posts: 1,031
    edited 2009-10-23 16:37
    Dave, the current software ignores acceleration so it works for a bot where the acc is low but for other systems e.g. rockets with large/continous acceleration you will need to extend the filters. I haven't done it from from what I have read you can extend the filters to handle some parts, but there are some parts that are difficult - e.g. the accelerometers are used to 'remove' the gyro drift by assuming hte acceleration that the accelerometers measure is g and its static. You can remove that assumption but then its difficult to know when to remove gyro drift.

    James, the software runs digital, many sensors are analog with an external A2D but not all. But if you look at the sensors that are digital all the ones I have found have a A2D built in so the main thing you are fixing is any noise issues between the sensor and A2D.
  • James LongJames Long Posts: 1,181
    edited 2009-10-23 16:44
    Timmoore said...
    Dave, the current software ignores acceleration so it works for a bot where the acc is low but for other systems e.g. rockets with large/continous acceleration you will need to extend the filters. I haven't done it from from what I have read you can extend the filters to handle some parts, but there are some parts that are difficult - e.g. the accelerometers are used to 'remove' the gyro drift by assuming hte acceleration that the accelerometers measure is g and its static. You can remove that assumption but then its difficult to know when to remove gyro drift.

    James, the software runs digital, many sensors are analog with an external A2D but not all. But if you look at the sensors that are digital all the ones I have found have a A2D built in so the main thing you are fixing is any noise issues between the sensor and A2D.

    That is true. The only difference I see is where the ADC is located. Either in the chip, or outside the chip. I just figured the less parts the better.

    I can not find a gyro with more than one axis which is digital. I have a LIS3LV02DQ accelerometer, which I really like. Now to fine a suitable rate gyro....preferably a set of dual axis, maybe paired with a MCP3208 ADC. That should give enough axis to be able to do an INU with an extended Kalman filter.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-23 18:01
    There is no corellation between rotation and accelleration in free space.· Once a rocket leaves the ground an accelerometer cannot be used to reduce drift in the gyro.· However, magnetic field sensors and horizon detectors could be used.

    Kalman filters can produce the optimal prediction of a value in a theorectical sense.· However, it seems to require a lot of compute.· For a balancing robot, I wonder if a simple noise filter on the accelerometer's tilt value would be just as effective at reducing drift.· The angle would be a sum of the high-pass output of the gyro plus the low-pass output of the accelerometer.· I'm sure this is all the Kalman filter is doing, but with a lot more compute.

    Dave
  • TimmooreTimmoore Posts: 1,031
    edited 2009-10-23 18:01
    Analog devices have some but they are expensive. I have used the lis3lv02dq but for the IMU I took a breakout board from sparkfun and mounted on top of a board with a tlv2553 A2D on it with the pins directly connected. There are a couple of boards with x,y,z accelerator and gyro as 6pins next to each other so they connect to 6pins directly beneath it on a tlv2553 board. What I also did with the tlv2553 board is to disconnect the ref- and ref+ pins and connected them to SCL/SDA for a HMC5843. So I have a small module 1.2'x0.6"x1" with 9 axis. The latest board from sparkfun would reduce that to about 0.3" high. So I have a 20pin breakout board that uses I2C and SPI but gives 3x gyro, 3x acc and 3x compass. I dont have a picture of the IMU standalone but if you look at the top/middle of the attached picture you can see it.
    1824 x 1368 - 728K
  • James LongJames Long Posts: 1,181
    edited 2009-10-23 18:17
    Dave Hein said...
    There is no corellation between rotation and accelleration in free space. Once a rocket leaves the ground an accelerometer cannot be used to reduce drift in the gyro. However, magnetic field sensors and horizon detectors could be used.


    Kalman filters can produce the optimal prediction of a value in a theorectical sense. However, it seems to require a lot of compute. For a balancing robot, I wonder if a simple noise filter on the accelerometer's tilt value would be just as effective at reducing drift. The angle would be a sum of the high-pass output of the gyro plus the low-pass output of the accelerometer. I'm sure this is all the Kalman filter is doing, but with a lot more compute.



    Dave

    The only issue I have with that, is the horizon sensors. If going high enough....the horizon sensors could be confused. This does depend on what type of horizon sensors are being used. If you make your own, then you could calculate for when only the earth's curvature is seen (not that many people fly rockets that high.......but it is getting more common).

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • TimmooreTimmoore Posts: 1,031
    edited 2009-10-23 18:28
    Dave,
    I agree in space this method wouldn't work though it would work off the ground but at low altitiude. Compass has a similar problem in free space the magnetic field changes again at low altitude it will still work. Horizonal sensors - depends on how they work - IR sensor will only work at low altitude.
    J. Borenstein did some work on combining gyro/acc not using Kalman filters, if I remember correctly he had a threshold on the sensors and switched between the sensors depending on the sensor values but I didn't have much success trying this method.
Sign In or Register to comment.