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.
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.
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?