14 |
Alwan, Green, Noori & Aldair
PID controller is tuned by using PSO algorithm. The control
action depends on the collected data from IR sensors.
Figure
6 shows the description of the line follower algorithm.
As shown in the Fig. 6 the AMR is located at the center of
black line and the five IR sensors is represented by blue dots.
In this case, just the IR2 reads logic 0 (black background)
and the rest of IR sensors read white logic 1 (white
background).
Each sensor has weight value, as
shown in
Fig. 6, with higher values to the extreme ones providing
higher control signals when higher deviation is detected. The
weighted Current Location (CL) of the AMR is computed as
follow:
𝐶𝐿 =
∑
( 𝑟𝑒𝑎𝑑𝑖𝑛𝑔 𝑜𝑓 𝑖
𝑡ℎ
𝑠𝑒𝑛𝑠𝑜𝑟 ∗ 𝑤𝑒𝑖𝑔ℎ𝑡 𝑜𝑓 𝑖
𝑡ℎ
𝑠𝑒𝑛𝑠𝑜𝑟)
4
𝑖=0
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑒𝑛𝑠𝑜𝑟𝑠 𝑟𝑒𝑎𝑑𝑖𝑛𝑔 0
(1)
According to the reading of IR sensors, the microcontroller
generates the PWM control signal
to the motor drive to
control the steering angle of the AMR as shown in Table 2:
TABLE 2
Different conditions for movement of AMR
IR sensor
reading
Command
Motion of
Left
Motor
Motion of
Right Motor
10001
Straight
Forward
Forward
11011
Straight
Forward
Forward
11111
Straight
Forward
Forward
10000
Turn Right
Forward
Backward
11000
Turn Right
Forward
Backward
11100
Turn Right
Forward
Backward
11110
Turn Right
Forward
Backward
00001
Turn Left
Backward
Forward
00011
Turn Left
Backward
Forward
00111
Turn Left
Backward
Forward
01111
Turn Left
Backward
Forward
Chia sẻ với bạn bè của bạn: