(TIỂU LUẬN) line following robot STUDENT REPORT in this project, we develop the line following robot

28 1 0
(TIỂU LUẬN) line following robot STUDENT REPORT in this project, we develop the line following robot

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Ho Chi Minh City University of Technology and Education Faculty for High Quality Training Automation and Control Engineering Technology Line Following Robot STUDENT REPORT Supervisor Assoc.Prof Le My Ha Submitted by Le Tran Vu Hoang Nguyen Quoc Vinh La Gia Bao Hoang Duong Trinh Nguyen Anh Hao January 6th; 2021 Contents Abstract List of Figures List of Tables Assignment of work Overview 1.1 1.2 1.3 1.4 Introducing of line f Objective of Study General operating Application of line f Hardware design and software design 2.1 2.2 Results 3.1 Hardware design 2.1.1 2.1.2 2.1.3 2.1.4 Software design 2.2.1 2.2.2 2.2.3 2.2.4 Robot 3.2 Running results and revie 3.2.1 3.2.2 Discussion 4.1 4.2 4.3 Advantage Disadvantage Future work Reference i Abstract In this project, we develop the line following robot Module L298N is chosen as the main controller.Arduino uno R3 is the brain which control the robot.We use Closed Loop control and PID control for this project.Dynamic PID control algorithm has been proposed to improve the navigation reliability of the wheeled mobile robot which uses differential drive locomotion system The experimental results show that the dynamic PID algorithm can be performed under the system real-time requirements ii List of Figures 2.1 Line following car 2.2 Arduino Uno R3 2.3 Module L298N 2.4 Sensor 2.5 Motor V1 2.6 Wheel 2.7 Li-po battery 2.8 Block diagram 2.9 Working principle of sensor 2.10 Working principle of line following robot 3.1 Our line following car iii List of Tables 2.1 Parameter of Arduino Uno R3 2.2 Parameter of module L298N 2.3 Parameter of sensor 2.4 Parameter of motor V1 2.5 Parameter of Wheel V1 2.6 Parameter of li-po battery 2.7 Details of Price of components 2.8 Table of Circuit Diagram iv Assignment of work Member Nguyen Quoc Vinh La Gia Bao Le Tran Vu Hoang Trinh Nguyen Anh Hao Hoang Duong v Chapter Overview 1.1 Introducing of line following robot Automation is a combination of many fields such as mechanics, control, information technology and mechatronics These fields come together into systems that automate and, moreover, automate the entire manufacturing process Automation companies play an increasingly important and essential role to meet economic development goals, especially in today’s fastmoving work process It asks a highly qualified human resource to operate In the world today, there are many types of robots: Large-scale such as: Machine arms in production lines, automatic production systems In addition are robots capable of moving, doing dangerous jobs to replace humans, robots to help the elderly, sales robots etc In this project I the line of detection robots, compared to the above robots Just a small, simple robot, but this is the foundation for me to make air conditioners, more useful in the process of learning and doing of me after this A line follower robot is basically a robot designed to follow a line or path already pre determined by the user This line or path may be as simple as a physical black straight line on the floor or complex line: circle, the round number eight,zigzag In order to detect these lines, we use sensor system, it can be individual sensors connected together or expansive vision systems with many sensors The choice of these schemes is the key to decide the speed, the accuracy in line detection 1.2 Objective of Study We looked up reference on the internet And they did complete this project better than us We tried to a robot must be capable of following a line: • The robot must be capable of following a line • It must be multitasking ,should be capable of taking various degrees of turns • The robot must also be capable of following a line even if it has breaks • It must allow calibration of the line’s darkness threshold • The robot must be insensitive to environmental factors such as lighting and noise 1.3 General operating principles The robot moves in a predetermined trajectory thanks to a guide, the two-wheel system is driven by two DC electric motors through a control circuit and a power circuit Often the guides will have a different color from the background color of the moving trajectory In order for the robot to move on the right orbit, it is necessary to have a sensor, which is re-sponsible for distinguishing the guide line and the background color of the moving trajectory In order for the robot to move in the right trajectory, it is necessary to have a sensor, which is responsible for distinguishing the guide line and the background color, bringing the corre-sponding electrical signal to the control circuit The control circuit is responsible for receiving feedback from the sensor, thereby controlling the speed and direction of rotation of two DC electric motors so that the car always sticks and moves according to the guide.[1] 1.4 Application of line following robot It is applied in technology detection lines such as automatic movement during transportation From the industrial point of view, line following robot has been implemented in semi to fully autonomous plants In this environment, these robots functions as materials carrier to deliver products from one manufacturing point to another where rail, conveyor and gantry solutions are not possible Apart from line following capabilities, these robots should also have the capability to navigate junctions and decide on which junction to turn and which junction ignore This would require the robot to have 90 degree turn and also junction counting capabilities To add on to the complexity of the problem, sensor positioning also plays a role in optimizing the robots performance for the tasks mentioned earlier Line-following robots with pick- andplacement capabilities are commonly used in manufacturing plants These move on a specified path to pick the components from specified locations and place them on desired locations The control principle is still inertia, but the robot path is detected Sensor We decided used sensors We began with TCRT5000 but it is difficult because one TCRT5000 has one sensor Then we used The 5-leds bar line detector It is very convenient It is designed to detect black and white lines On the sensor bar there are infrared sensors pointing to the ground to detect the line Table 2.3: Parameter of sensor This is a picture which we used Solidworks to draw model sensor Figure 2.4: Sensor Motor We discussed between motor V1 and motor GA25 12V620RPM Motor GA25 12V620RPM make from metal so it is better than motor V1 but it is more expensive than motor V1 We reference on the internet and motor V1 is not bad It is very suitable for this project So we decided to use motor V1 because this line following car is simple Table 2.4: Parameter of motor V1 Operating voltage Electrical current consumption Transmission ratio When 3VDC When 5VDC Moment This is a picture which we used Solidworks to draw model Motor Figure 2.5: Motor V1 Wheel In this project, we used types: wheel V1 and multi-purpose wheel Because our design needs from wheels to wheels to balance so we used wheels If we used wheels V1, it would be difficult to code Using wheels is easy It is the same as wheels Table 2.5: Parameter of Wheel V1 Diameter of wheel Tire thickness Width wheels Axle of vehicle Width vacant of axle These are two picture which we used Solidworks to draw model wheel (a) Wheel V1 (b) Multi-purpose wheel Figure 2.6: Wheel Battery According assistant Mr Cuong, Li – po battery ( lithium polymer battery ) is very good They are light weight and have improved safety It can refresh so we just buy one time We used batteries for this project Table 2.6: Parameter of li-po battery This is a picture which we used Solidworks to draw model battery Figure 2.7: Li-po battery 2.1.3 Cost estimation The details of price of components used in project is given below Table 2.7: Details of Price of components S.N 2.1.4 Circuit Diagram We reference on the internet and then we assembled electronic appliances completely This is our circuit diagram Table 2.8: Table of Circuit Diagram 10 2.2 Software design 2.2.1 A algorithm idea When the vehicle is operating, the sensor will collect information and convert it into an elec-trical signal to the microcontroller The received value will be compared with the preset value Based on the value of the sensor sent, determine the relative deviation between the orbit of the robot and the desired trajectory, then compare that deviation into levels Based on the devia-tion levels, adjust the speed of the left and right wheels to return the robot to the fund religion Specifically, to turn left the robot’s right wheel speed is one value faster than the left one correspond to the deviation levels (need to test many times), and vice versa This method is simple, but the robot runs unstable, sometimes very fast, sometimes slowly, Stability is highly dependent on the robot’s motor and mechanical construction To overcome this drawback, by applying a position controller PID mind robot Figure 2.8: Block diagram 11 2.2.2 Working principle of Sensor One sensor head will emit infrared rays If there are no obstacles, the infrared will continue The other end is the receiver that won’t get anything, it will return -1 In the case of an obstacle, the infrared rays are reflected back, the receiver will obtain and return the value In the case of a dark surface, the infrared rays will absorb all the returned infrared rays enough so the receiver returns (a) Principle sensor (b) Value sensor Figure 2.9: Working principle of sensor 2.2.3 Working principle of Line following robot If line is centered in front of robot, line following robot goes forward When the center sensor is high and the remaining sensor is low the center sensor is will always be on the line and as line is black in color If line is right of center, the robot turns right When the right sensor is high, the remaining sensor is low and the center sensor is will always be on the line and as line is black in color If no line is detected, circle unit is found 12 If line is left of center, beside of the robot, it turns left When the left sensor is high and the remaining sensor is low the center sensor is will always be on the line and as line is black in color Figure 2.10: Working principle of line following robot 2.2.4 Code float Kp = 40, Ki = 0, Kd =160; float error = 0, P = , I = , D = 0, PID_value = 0; float previous_error = 0; int sensor[6] = {0, 0, 0, 0, 0}; int gia_tri_ban_dau = 150; int PID_phai, PID_trai; #define In1 #define In2 #define In3 #define In4 10 #define ENA 13 #define ENB 11 void read_sensor_values(void); // doc gia tri cam bien void calculate_pid(void); // tinh PID void motor_control(void); // kiem soat dong co void dung(); void chay_thang(); void setup() { pinMode (ENA, OUTPUT); pinMode (ENB, OUTPUT); pinMode (In1, OUTPUT); pinMode (In2, OUTPUT); pinMode (In3, OUTPUT); pinMode (In4, OUTPUT); Serial.begin(9600); } void loop() { read_sensor_values(); 14 calculate_pid(); motor_control(); } void read_sensor_values() { sensor[1] = digitalRead(A0); sensor[2] = digitalRead(A1); sensor[3] = digitalRead(A2); sensor[4] = digitalRead(A3); sensor[5] = digitalRead(A4); if (( sensor[1] == 0) && (sensor[2] == 0) & (sensor[3] == 0) && (sensor[4] == 0) && (sensor[5] == 1)) // trai error = -4; else if (( sensor[1] == 0) && (sensor[2] == 0) & (sensor[3] == 0) && (sensor[4] == 1) && (sensor[5] == 1)) error = -3; else if (( sensor[1] == 0) && (sensor[2] == 0) && (sensor[3] == 1) & (sensor[4] == 1) & (sensor[5] == 1)) error = -2; else if (( sensor[1] == 0) && (sensor[2] == 0) && (sensor[3] == 1) 15 & (sensor[4] == 1) && (sensor[5] == 0)) error = -1; else if (( sensor[1] == 0) && (sensor[2] == 0) && (sensor[3] == 1) && (sensor[4] == 0) && (sensor[5] == 0)) // giua line error = 0; else if (( sensor[1] == 0) && (sensor[2] == 1) & (sensor[3] == 1) && (sensor[4] == 0) & (sensor[5] == 0)) error = 1; else if (( sensor[1] == 1) && (sensor[2] == 1) & (sensor[3] == 1) && (sensor[4] == 0) && (sensor[5] == 0)) error = 2; else if (( sensor[1] == 1) && (sensor[2] == 1) & (sensor[3] == 0) && (sensor[4] == 0) && (sensor[5] == 0)) error = 3; else if (( sensor[1] == 1) && (sensor[2] == 0) & (sensor[3] == 0) && (sensor[4] == 0) && (sensor[5] == 0)) error = 4; } void calculate_pid() { P = error; I = I + error; // sai so truoc cong sai so hien tai D = error - previous_error; // sai so hien tai tru sai so truoc PID_value = (Kp * P) + (Ki * I) + (Kd * D); previous_error = error; 16 } void motor_control() { digitalWrite(In1, LOW); digitalWrite(In2, HIGH); digitalWrite(In3, LOW); digitalWrite(In4, HIGH); PID_phai = gia_tri_ban_dau + PID_value; PID_trai = gia_tri_ban_dau - PID_value; PID_phai = constrain(gia_tri_ban_dau - PID_value, 0, 170); PID_trai = constrain(gia_tri_ban_dau + PID_value, 0, 170); analogWrite(ENA, PID_phai); analogWrite(ENB, PID_trai); } 17 Chapter Results 3.1 Robot Although there are many controversies and disagreements, we did completely this project Robot completed on schedule Rugged and safe hardware during heavy travel The circuit inspection part still had errors, but was promptly corrected During the project, we had trou-bles Firstly,when finished assembling the parts together and loading the code The car was on, but the wheels were not working Secondly, Vehicle was not stable, has much fluctuation But we fixed it The idea of making a hybrid robot car was inspired by the team from F1 racing And we did it complete Many groups in class buy frame in the store but we designed it We can control speed by using code Figure 3.1: Our line following car 18 3.2 Running results and review 3.2.1 Running results We used black electrical tape to test the robot.The result is that divine into two parts.Before using the PID control, the car moved unstable and sometimes ran out of the line When we tested on the circle road, the car can’t follow line.Then we tested on the straight road, it ran but it didn’t run straightly After using PID control the robot runs on the black road, runs according to the required algorithm, completes the task well Demonstrates the fully automatic ability of the robot tracing model It runs better than before It can run straightly on the straight road If we didn’t use PID control, the car still follow line but it is very slow It is not good for race 3.2.2 Review Complicated circuit design, assembly, and repair process takes a lot of time We had many troubles Many times, we didn’t know we wrong until the car didn’t operate And we didn’t know why we wrong? And thanks to tutor Mr Cuong, we fixed it We used PID control for the code Adjusting PID parameters still takes a long time due to manual change of numbers (test many times) We tried to understand nature of PID control but we couldn’t understand So we don’t reach desired values Because of reason so the car is not perfect And our design is not beautiful Our code is not good.The car ran badly on the circle road 19 Chapter Discussion 4.1 Advantage We learned a lot of things when we did completely this project We knew how to use Solid-works to simulate electronic appliances, use LaTeX to write report, use program Arduino IDE to code and skill teamwork About the car, we know how to assemble it We know about write basic code Arduino My frame of car is different many groups.The car has followed the line This is the first time, we have had a model which we did by hand And special, we know how to real teamwork 4.2 Disadvantage Our design is not really beautiful The car is still unstable, still slightly shaking The speed of the car is not fast During the assembly process, there are still many errors leading to many changes compared to the intended Teamwork still has many problems, leading to poor work 4.3 Future work In the future, we will make frame better than it We will improve code to make the robot smarter, follow line better, more stable and run fast We will try to add more function when the robot is stability Following line is very important We can develop it to make highly application robots And we will improve skills about code and teamwork 20 Chapter Reference Bibliography [1] Chu Quang Thao - Trinh Tai Tuan - Phan Cao Khanh, Report about line following robot with PID control, in: Institute of Military Technology, 4, Slideshare- Education, 2015 [2] Bac 2, Tho Ho, 2018, Instruction about line following robot with PID, Part in Youtube: https://www.youtube.com/watch? fbclid=IwAR2CsVMciYk6WYGPg-7myLxzFQSRB5O2CKpT0_ uyMbeVEWqj92b856suEDE&v=l3uJ-5UvjE4&feature=youtu.be [3] Sujeet Kumar Jha - Saurab Dulal - Manish Karn - Ahmed Raja Khan, Report line fol-lowing Robot, in: KATHMANDU UNIVERSITY, 2016 [4] ANUSHA, tronics How to make Arduino Hub,20/5/2017, line followe robot, in: Elec- https://www.electronicshub.org/ arduino-line-follower-robot/ [5] Do Choi STEM, 32 Xe line - Khoa hcc Xe robot lap trinh arduino, in: Youtube, 31/12/2019, https://www.youtube.com/watch?v=hcpMSw-y81g&t=194s [6] Khin Khin Saw - Lae Yin Mon, Design and Construction of Line Following Robot us-ing Arduino, in: International Journal of Trend in Scientific Research and Development (IJTSRD), 940-941, 2019 [7] https://icdayroi.com/ 21 ... 2.2.3 Working principle of Line following robot If line is centered in front of robot, line following robot goes forward When the center sensor is high and the remaining sensor is low the center... us We tried to a robot must be capable of following a line: • The robot must be capable of following a line • It must be multitasking ,should be capable of taking various degrees of turns • The. .. we develop the line following robot Module L298N is chosen as the main controller.Arduino uno R3 is the brain which control the robot. We use Closed Loop control and PID control for this project.Dynamic

Ngày đăng: 11/12/2022, 04:39

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan