Image

Our robot has two front wheels driven by two motors and an omnidirectional wheel at the back of the robot body for easy turning. A trailer with a gyro-sensor is attached to the back. The trailer was placed far away from the motors to allow the motors to correct the direction of the trailer more quickly. The motor speeds of the two front wheels were adjusted with a proportional control.

Image Image

Driving in a straight line:

The robot drives forward for a few seconds to straighten out the trailer and calibrate the gyro-sensor before backing up in a straight line. The trailer was tapped and kicked off course to demonstrate how the robot can adjust.

Code for reversing in a straight line:

Image

Backing up in a circle:

We programmed our robot to drive backward in a small circle in an angle of 40 degrees and a large circle with an angle of 10 degrees. Once again, we programmed our robot to drive forward to calibrate the gyro-sensors before it starts circling. The ratio between the speeds of the two wheels needed to move at a certain angle was calculated and used as the motor speeds for when the angle error equaled zero. From there, the motor speeds were adjusted with a proportional control.

Code - Backing Up in a Circle

Image