180 7. EMBEDDED SYSTEMS DESIGN
(ten_thousandths_place*10000))/1000);
thousandths_place_char = (char)(thousandths_place+48);
putchar(thousandths_place_char);
//100th place
hundreths_place = (int)((total_integer_value -
(ten_thousandths_place*10000)-
(thousandths_place*1000))/100);
hundreths_place_char = (char)(hundreths_place + 48);
putchar(hundreths_place_char);
//10th place
tens_place = (int)((total_integer_value -(ten_thousandths_place*
10000)-
(thousandths_place*1000)-(hundreths_place*100))/10);
tens_place_char=(char)(tens_place+48); //convert to ASCII
putchar(tens_place_char); //print to LCD
//isolate ones place
ones_place = (int)((total_integer_value -(ten_thousandths_place*
10000)-
(thousandths_place*1000)-(hundreths_place*100))
ones_place_char=(char)(ones_place+48); //convert to ASCII
putchar(ones_place_char); //print to LCD
}
//***************************************************************
//end of file: flight_sim.c
//***************************************************************
7.4 AUTONOMOUS MAZE NAVIGATING ROBOTS
In the next two sections we investigate two different autonomous navigating robot designs. Before
delving into these designs, it would be helpful to review the fundamentals of robot steering and
motor control. F igure 7.6 illustrates the fundamental concepts. Robot steer ing is dependent upon the
number of powered wheels and whether the wheels are equipped with unidirectional or bidirectional
control. Additional robot steering configurations are possible.
Recall from the previous chapter that an H-bridge is typically required for bidirectional control
of a DC motor. An H-bridge configured for controlling a single motor is provided in Figure 7.7 a).
The H-bridge has two inputs: one for controlling motor direction and one for controlling motor
speed via a pulse width modulated signal. Provided in Figure 7.7b) is a motor control system for a
two motor robot.
7.4. AUTONOMOUS MAZE NAVIGATING ROBOTS 181
pivot
point
a) two-wheel, forward motor control
pivot
point
b) two-wheel, bi-directional motor control
c) two-wheel, forward motor control,
front wheel drive
pivot
point
d) two-wheel, forward motor control,
rear wheel drive
pivot
point
e) four-wheel, bi-directional motor control
pivot
point
Figure 7.6: Robot control configurations.
182 7. EMBEDDED SYSTEMS DESIGN
11DQ06
200
470
TIP31
TIP32
TIP31
11DQ06
7.5 VDC
M
200
TIP31
TIP31
TIP32
470
11DQ06
11DQ06
1000μF
7408
7404
7408
left motor PWM
right motor PWM
right motor forward/reverse
left motor H-bridge
left motor forward/reverse
11DQ06
200
470
TIP31
TIP32
TIP31
11DQ06
7.5 VDC
M
200
TIP31
TIP31
TIP32
470
11DQ06
11DQ06
1000μF
7408
7404
7408
right motor H-bridge
11DQ06
200
470
TIP31
TIP32
TIP31
11DQ06
7.5 VDC
M
200
TIP31
TIP31
TIP32
470
11DQ06
11DQ06
1000μF
7408
7404
7408
motor PWM
motor forward/reverse
a) bi-directional motor control
b) two-wheel, bi-directional motor control
Figure 7.7: Robot motor control.

Get Atmel AVR Microcontroller Primer, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.