III.
T
HE
L
INE
F
OLLOWER
A
LGORITHM
Figure 4 shows the mechanism of line follower for the AMR.
The current location of the mobile robot to the respect to the
center black line is recognized and calculated by the reading
of IR sensors to compute the error between the current
location and the desired path. Then the computed error is
used as input to the digital PID controller. The Pulse Width
Modulated (PWM) control signals are generated to control
and drive the motors connected to the Motor Board of AMR
to adjust the steering angle of the robot and to bring it back to
the center of the black line.
The Multiplexer logic circuit is used to interface between
ATmega32u4 Microcontroller of the Arduino board and the
five IR sensors to read just one data that come from IR
sensors set according to command signal sent from
ATmega32u4 controller. Figure 5 shows the connection of
the IR sensors and ATmega32u4 microcontroller via
multiplexer. The five IR sensors (IR0-IR4) are connected to
the inputs of multiplexer. The selectors of the multiplexer
named (SA, SB and SC) are connected to digital output pins
of
the
ATmega32u4
microcontroller.
Therefore,
microcontroller is read just one IR sensor at a time that is
applied to analog input pin INA. Table 1 shows the selected
IR sensor reading according to the selectors command.
TABLE (1)
The selected IR sensor reading according to the selectors
command
The connection of ATmega32u4 microcontroller with two
wheel motor via Motor Driver is shown in Figure (6). The
speed and direction of the left and right wheel are adjusted
by the motor drive. Four digital output pins (OA1, OA2,
OB1 and OB2) of the microcontroller are connected to
inputs of motor driver (INA1, INA2, INB1 and INB2). The
inputs INA1 and INB1 of the motor driver corresponds to the
forward movement of the left and right motor respectively.
INA2 and INB2 corresponds to the reverse movement of the
left and right motor respectively. A pulse width modulated
(PWM) signals are used to control the motors. A positive
input to the motor driver from the microcontroller
corresponds to forward movement of the motors, whereas a
negative input corresponds to reverse movement of the
motors. For forward movement of both the motors, you have
to apply the PWM signals to INA1 and INB1 and zero values
to INA2 and INB2. Similarly for reverse movement, you
have to apply the PWM signals only to INA2 and INB2 and
zero values to INA1 and INB1.
The line follower algorithm is constructed as closed loop
controlled system with PID controller. The parameters of
Chia sẻ với bạn bè của bạn: |