Revised: 09 July 2021



tải về 1.13 Mb.
Chế độ xem pdf
trang5/7
Chuyển đổi dữ liệu28.05.2022
Kích1.13 Mb.
#52150
1   2   3   4   5   6   7
Design and Implementation of Line Follower Arduino

SA 
SB 
SC 
IR sensor NO. 




















(a) 
(b) 
Fig. (3) (a) The Control Board, (b) The Motor Board 
Desired 
location 


PID 
Controller 
Motors 
IR sensors 
Location
calculation 
AMR 
Fig. (4) the mechanism of line follower for the AMR 
IR0 
IR1 
IR2 
IR3 
IR4 
Multiplexer 
INA 
SA 
SB 
SC 
ATmega32u4 
Microcontroller 
Fig. (5) the connection of the IR sensors and ATmega32u4 
controller via multiplexer 


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 

tải về 1.13 Mb.

Chia sẻ với bạn bè của bạn:
1   2   3   4   5   6   7




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương