Specifications

85
Appendix C – Software design procedure
MOBILE MANOEUVRING ROBOT SOFTWARE DESIGN
Objectives: To control the mechanical hardware of a two drive-wheel robot in order to
avoid collision with obstacles. The software must be able to control the unit to travel in
a straight line between objects and is based on assembly level language of the Motorola
68HC12 microcontroller.
Obstacle avoiding
While driving do the following:
Read the odometer sensors and increment odometer counters
o Check odometer counters and adjust speed for straight driving
Watch obstacle sensors in a tight loop act accordingly when sensors
triggered.
o If left is clear, turn left otherwise turn right
If left and right blocked reverse
Continue on a straight path
Output data through serial port for debugging purposes
Repeat process continuously
User Information:
The code has five sensors that input to the software. Three of these are obstacle
avoidance sensors read in as data through port A and the other two are concerned with
odometer readings read in as interrupts through port G. The program starts at $0400
with data starting at $0200. The stack pointer must be set in a clear location such as
$0700 and the program counter to $0400 to start the procedure.
When run, the program will output through the serial port the status of the odometer
readings and also controls the speed and direction of both motors to achieve the desired
performance. The program loops continuously to give real time control the mechanical
components