Gyro lag & performance issues

I’d appreciate any information the community can offer here. I’m a mentor of a new-ish team and we are trying to use the gyro sensor on our robot, mostly looking forward to next year. I have read nearly every VEX Forum post regarding the gyro and haven’t found anyone else discussing this exact problem. We are using EasyC.

  1. EasyC’s built-in gyro “wait-until” function is completely useless. Does anyone else have this experience? In every program we’ve written using this sensor, we have had to write our own while loop, because the built-in function simply does not work. Our while loop is very simple, but still, it’s annoying to have to do so:
while (gyro < target)
   motors on
   gyro = get gyro angle
---
motors off
  1. Gyro lag makes it unusable for dynamic (driver-controlled) situations.
  • We’re trying to write a function that turns the robot to a particular angle when a joystick button is pressed.
  • Our program contains nothing else other than this button; we manually turn the robot in our testing, to make sure there is no interference from other functions.
  • We always give the gyro sufficient time to initialize while sitting still (several seconds, to be sure)
  • We have an adjustment factor that we’ve determined experimentally to correct for gyro reading being consistently off from actual (for us, it’s about .94 – the gyro will read 957 when it should be 900 for a 90-degree turn)
  • We have not yet addressed the gyro drift issue, but the problem I’m dealing with is more basic than that.
  • In our testing, we’ve connected the gyro to our LCD screen so we can see the readout of the gyro values in real time.
  • We have tried lowering the deadband value to 1 from its default 3, with no effect.

Based on the readings from the LCD screen and the action of the robot, there is such a long delay in the gyro sensing the current angle that we cannot effectively connect motor action to it, as it constantly overshoots, even when the motors are set at very slow speeds. For example, we want it to turn to +7 degrees when the button is pressed. We turn the robot to, say, -85 degrees; the LCD readout shows the correct current angle and correct target angle. Press button. Robot turns, but way overshoots because in its while-looping, it thinks it hasn’t gone far enough yet. When the robot stops, it thinks it’s near the target (as evidenced by the LCD readout), but about a second after it stops, the reading will finally update itself to the real current angle, which is something like +20 degrees, not the intended +7.

  1. The documentation says that the sensor can keep track of a turning speed of 80 to 300 degrees per second, but I really can’t believe that is ever true. So if it’s not good at sensing its current heading quickly, and the built-in EasyC function of gyro-wait-until doesn’t work, then WHAT IS THE POINT OF THIS $40 SENSOR?

We would love to build more sophisticated driver-control functions to improve our aim, speed, and accuracy. I am wondering if anyone out there has used the gyro successfully in something other than autonomous programming? Thanks in advance for your help.

Leslie Peters, Mentor
Renegade Robotics, Team 1666

I mean in my experience…using RobotC the gyro has been pretty darn accurate except for vibrations causing it to count when I’m not moving…if I don’t have my flywheel on it turns to the same spot every time as long as I let in initialize correctly.