Flattened finite state machine of the robot, with a central Drive state branching to reverse-and-turn obstacle avoidance states, uphill and downhill orientation correction states, and a final drive to stop.

Autonomous Obstacle Course Robot.

  • Embedded System Design
  • Team of 3
  • Kobuki and myRIO
  • LabVIEW Statecharts

A finite state machine that steers a Kobuki robot through a random obstacle course, straight up and down a ramp, and to a stop at the bottom, proven in simulation and then tuned on the real robot.

Reports

Highlights

Final LabVIEW statechart linking the Drive, Reverse, Turn, Drive temp and Straighten On Hill states with their guard conditions.

State Machine.

A hierarchical statechart in LabVIEW runs the robot. A default Drive state hands off to reverse-and-turn obstacle avoidance when a bump or cliff sensor fires, and to uphill or downhill correction when the accelerometer shows it is on the ramp, turning in small steps until it faces straight up or down. A corner counter flips the avoidance direction when the robot is boxed in, and a jump in the infrared cliff signal marks the bottom of the ramp, where it drives a short distance and stops.

CyberSim simulator scene of the Kobuki robot on a green field among building-shaped obstacles.

Simulation.

Obstacle navigation and the hill climb were first solved separately in the CyberSim simulator, then merged into one statechart around their shared Drive state. The real robot exposed what the simulator hides: wheel drift, turns overshooting 90° from rotational inertia, sensor delays that let the robot climb obstacles at speed, accelerometer axes that were swapped on the myRIO, and sensor offsets that were never zero.

LabVIEW dashboard of the Kobuki robot with a centre cliff reading of 1938 and accelerometer readings of -0.04, 0.02 and 0.98.

Calibration.

Every robot needed its own thresholds. The centre cliff sensor read about 1,940 on flat ground on assessment day against about 1,600 in some workshops, and the accelerometer bounds were shifted by 0.02 to 0.04 to cancel offsets. A moving average of the last three y-axis readings stopped the robot chattering on the ramp. On assessment day the robot completed the full course on its third of four attempts and climbed the hill cleanly every time; drift in the obstacle field caused the failures, which a heading guard or proportional heading control would fix.