The software for the PIC microcontroller was written in PIC-C.  It was compiled and transferred onto the chip via a USB in circuit debugger module. The six legged walker had two modes, automatic and manual.  If the robot was set to manual mode the robot responds to user typed commands from the terminal window.  If automatic mode was selected the walker will walk forward until a bump sensor is activated.  When either bump sensor is activated, the robot will attempt to avoid the obstacle encountered by the active bump sensor. The main components of the software were the gait controller, command parsing and obstacle avoidance.  A block diagram of the software is below.  The source code of the robot controller can be found in the documents section.

Leg Movement
Tripod gait is the most popular gait for hexapods. The hexapod consists of two tripods.  The front-back legs on left side and the middle leg on the right side makes up one tripod and vice versa for the other side.   For each grouped tripod the legs are moved forward, up and back at the same time.  It uses the 2 tripods as a biped would use two legs for walking. An example of the tripod gait is shown below.

The gait controller consists of a PWM signal generator and a gait control FSM. The signal generator is required to output 12 independent channels each with a variable pulse width for RC servo control. Based on inputs from the other modules the FSM decides what the leg positions should be to produce desired motion.

Command Parsing
The command parsing module is only active when the mode is set to manual control. The built in hardware UART was used to communicate with the computer remote control.  The six legged walker acts as DCE and provides a prompt at the DTE.  Commands were received from the terminal and checked for correct syntax.  If the syntax is incorrect the user is shown an error message on the terminal and prompted again for a new command. If the command is correct it is executed and prompts for the next command.

Each command consists of two arguments. The first argument is a letter specifying direction and the second argument is a natural integer specifying the length of motion. The valid commands are outlined below.

Obstacle Avoidance
When the robot is operating in autonomous mode the obstacle avoidance module is active. The obstacle avoidance logic was designed as follows. The six legged walker will start by walking forward, if it encounters an obstacle it will backup and then turn away from the object before walking forward again in an attempt to avoid it. If at any point during avoidance the sensors indicate an obstacle the robot will backup and turn again. Once the avoidance algorithm is complete the robot begins walking forward again

[Home]  [Mechanics]  [Electronics]  [Software]  [Documents]  [Gallery]  [Links]  [Project Team]