Announcement

Collapse
No announcement yet.

Gyro Sensor Accuracy

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: Gyro Sensor Accuracy

    That's pretty cool, I didn't know it was there (I'm a linux guy except for the lego stuff)

    Comment


    • #17
      Re: Gyro Sensor Accuracy

      Dean, yes, I think that tracks exactly what we've been seeing. It may be that the "correct" way to use the gyro block is to use it exactly once in some looping thread which stuffs the rate and angle into variables that are used elsewhere. I'm not sure using the block multiple times in multiple modes will produce entirely predictable results. Especially if the integrator that runs to go from "rate" to "angle" gets switched off if you use the block in rate-only mode.
      Team M
      Coach

      Comment


      • #18
        Re: Gyro Sensor Accuracy

        Originally posted by Zain View Post
        It may be that the "correct" way to use the gyro block is to use it exactly once in some looping thread which stuffs the rate and angle into variables that are used elsewhere.
        I decided to give this a try. I put the gyro block in a loop that runs parallel to the main task. I ignore the angle measurement and integrate the rate myself. When motors are off (measured current power = 0) I adjust the rate offset. The rate, angle and offset are stored in variables. A second MyBlock is used by the program to access the rate and angle. In has a Reset to set the angle back to zero.

        This worked pretty well and I was getting really good 90 degree turns on a carpeted floor with lots of wheel slip. Whoo-hoo!! But then I picked up the robot and somehow introduced a huge offset in the gyro sensor rate and everything was a mess again.

        More experimentation required.

        Comment


        • #19
          Re: Gyro Sensor Accuracy

          Well, if your reset happened to run when you were picking up the robot it may have nulled it's rate at an in opportune time - like when you were Turing the robot. (?)

          I think that the kids will want to have the robot totally still, push a button that executes a reset, and beeps when the robot is clear to touch again. Like during set up time. After that rate should be correct, and angle will be good within some small drift. Rather than "resetting" the sensor every time angle needs to go back to zero it would probably be better to record a current angle at reference moments (like up against a wall) and then subtract it from measured angle in order to null out any remaining drift from time to time during operation.
          Team M
          Coach

          Comment


          • #20
            Re: Gyro Sensor Accuracy

            Originally posted by Zain View Post
            Well, if your reset happened to run when you were picking up the robot it may have nulled it's rate at an in opportune time - like when you were Turing the robot. (?)

            I think that the kids will want to have the robot totally still, push a button that executes a reset, and beeps when the robot is clear to touch again. Like during set up time. After that rate should be correct, and angle will be good within some small drift. Rather than "resetting" the sensor every time angle needs to go back to zero it would probably be better to record a current angle at reference moments (like up against a wall) and then subtract it from measured angle in order to null out any remaining drift from time to time during operation.
            Instead of resetting the gyro sensor my gyro block resets the angle I calculate (integrated rate). The gyro is only reset once at the beginning of the program, and that probably isn't needed. When I picked up the robot the gyro sensor rate took on a big offset. A handling test may be in order. Run a program that displays the rate and see what happens when it is handled.

            Comment

            Working...
            X