Are you getting frustrated with the inconsistent performance of your autonomous program for VEX IQ?
A couple of weeks ago, one of my competition teams spent 3 hours going through the pain of tweaking their autonomous program to get three basic goals in the “Rise Above” competition.
They made the following observations:
- When it was programmed to turn left 90 degrees, it went further than 90 degrees,
- When it was programmed to turn right 90 degrees, it went less than 90 degrees.
After multiple iterations of making one single incremental modification at a time, the team finally achieved success with programming every right angle left turn as 87 degrees.
Likewise, every right angle right turn needed to be programmed as 93 degrees.
This software hack (to address a repeatable hardware problem) seemed to work reasonably well for a couple of runs.
Having run overtime for the workshop and feeling satisfied that it was working, the student packed up for the day and went home. During the week, one student modified the program to obtain even more goals.
Returning to the next workshop, this student was excited about his progress and keen to see his robot succeed, but alas, it did not work. Now the robot was acting very inconsistent.
What could have gone wrong?
The students checked:
- The motors were still attached properly to the wheels.
- All pin connections on the robot were still in tack.
- The connections of the smart cables to the brain were ok.
- Battery charged.
There didn’t seem to be a reason why the robot was behaving inconsistently.
So not knowing the code behind the Drivetrain blocks, the team had to make a hypothesis about what was happening to cause the inconsistencies. It seemed that if the robot bumped into a wall or got caught momentarily on a riser or goal, then the robot would be off track for the remainder of the autonomous program execution. Is it possible then that the turn block does not use the gyro attached to the drive train? Is it possible that the brain is calculating how many revolutions that the left and right drive train motors have to complete to make a 90 degree turn and only performs that command without any validation of the robot’s orientation?
Further investigation found these two alternative methods of programming your robot to turn that does use information from the gyro.
The only difference between the two functions is that the “turn to heading” accepts a range between 0.00 and 359.99 degrees. Assume therefore that the “turn to rotation” block can allow multiple rotations to be programmed.
For improved accuracy include a gyro in your drive train and calibrate at the beginning of the program.