Specifications

86
System Model
The following data flow diagram shows the basic flow of values through the system.
Process 1:
This is the main section of the program. It runs a tight loop checking for data from the
sensors on port A and also checking the odometer readings to initiate a compare
function to maintain straight line driving.
Process 2:
Process 2 is a large subroutine called every time a turn is needed. It accesses data from
port A. It checks sensors and turns relative to the status of them. After the motors have
been adjusted to gain desired performance the code returns to the main loop, process 1.
Process 3:
This is an interrupt service routine that determines which odometer sensor has triggered
and increments the respective counter. The counter is a byte stored in memory and is
cleared regularly to avoid overflow issues.
Process 4:
This process is a subroutine used to maintain straight line driving. It is called from the
main program loop and works by comparing the odometer counters and adjusting motor
speeds to maintain a constant even speed between the motors. This results in even
wheel speed hence straight driving.
PORT
A
Obstacle
Odometer
readings
Process 1
MOTOR
CONTROL
Process 3
Process 4
D1 = Signal of which direction to turn
D2 = odometer counters
D3 = motor information for turning
D4 = motor information for drive straight
D5 = jump to process 4 when required
D2
D4
PORT
G
sensors
sensors
Process 2
D1
D3
D5