Strange problem with gyro controlled turning


We have a turning function that’s been acting strangely every now and then. It’s been bothering my team for quite a while. We would really appreciate some help or suggestions.

*The Function:
Basically, it’s a function that turns the robot to 90 degrees when called by either the autopilot program or pressing a control button. To achieve more accurate result, we broke the turning into two stages, and make the robot to turn slower when it’s approaching the 90 degree angle (slowing down to 10% speed when approaching the [75 degree, 105 degree] area).

We do calibrate the gyro sensor at the starting of the program, and set the bot to wait 3 seconds before it can move… we usually wait more than that before moving the bot.
This function is called in about 2 seconds after the robot started moving.

*The Problem:
In about 1 out of 20 times, when this function is called after the robot has started moving for about 2 seconds, it makes the whole 90 degree turn in the reduced 10% speed – meaning it started the turn in slow motion even when it’s at 0 degree direction. And when this happens, it only happens with the first turn. We have never seen it happen in the later turns of the courses.

My speculation is the gyro sensor may have provided some misreading, but it’s correct enough to finish the turn at the right position, and the later turns will all function correctly.

My speculation is the gyro sensor provide faulty reading at the starting of the turn. However, the bot still finishes at the correct position, and all the later turns will be perfectly correct… Any ideas?




I switched on a new gyro sensor, but still see this problem every now and then.
Qualifications Standings.pdf (8 KB)
Robot Skills Results.pdf (6.39 KB)
Programming Skills Results.pdf (5.93 KB)
Qualifying final report.pdf (23.8 KB)
Eliminations results.pdf (8.29 KB)


I find debugging easier if I have it display sensor values/etc to the vex screen. Then just watch it. Or add in a beep or color led to alert you to values. This won’t solve your problem, but it will help you confirm it.