1. Trang chủ
  2. » Luận Văn - Báo Cáo

Senior design i report design an automatically obstacle avoiding robot with three wheels

46 1 0

Đ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

Nội dung

Senior Design I THAI NGUYEN UNIVERSITY OF TECHNOLOGY FACULTY OF INTERNATIONAL TRAINING SENIOR DESIGN I REPORT DESIGN AN AUTOMATICALLY OBSTACLE-AVOIDING ROBOT WITH THREE WHEELS SUPERVISOR : Dr NGUYỄN MINH Ý STUDENT : NGUYỄN THỊ BÍCH NGỌC ID : K175905228022 CLASS : K53APE This report has been approved by the: Supervisor: Dr Nguyen Minh Y Page | Senior Design I Supervisor: Dr Nguyen Minh Y Signed: ………………….………………… Date: ………………….………………… Head of the Division: Dr Vu Quoc Dong Signed: ………………….………………… Date: ………………….………………… Faculty Dean: Dr Nguyen Tien Hung Signed ………………….………………… Date: ………………….………………… Composition of the committee (optional): Prof Dr…………… Thainguyen University of Technology Prof Dr…………… Thainguyen University of Technology Prof Dr…………… Thainguyen University of Technology Prof Dr…………… Thainguyen University of Technology Prof Dr…………… Thainguyen University of Technology Supervisor: Dr Nguyen Minh Y Page | Senior Design I Acknowledgements First of all, we would like to thank my supervisor Dr Nguyen Minh Y Despite of his busy schedules, he always accompanies with us to finish this project He had planned for our meeting once a week for asking any questions that we have faced in the process of doing research He has much knowledge about control algorithms, dynamic, programing and power systems etc He had provided us basic senses about electrical sciences, control methods and taught us how to use the Math lab software, arduino to simulate things related to our project He also helped me very much to accomplish this thesis, directed me how to write some difficult parts Simply, I could not look forward to a better and more enthusiastic supervisor Besides our supervisor, we would like to thank other teachers for supporting me to finish this project Last but not least, we would like to thank our family, our friends for always supporting me spiritually Content Supervisor: Dr Nguyen Minh Y Page | Senior Design I CHAPTER 1: INTRODUCTION 1.1 Motivation 1.2 Contribution CHAPTER 2: BACKGROUND 2.1 DC Motor .7 2.1.1 Structures 2.1.2 Windings 2.1.3 Armature mmf 2.1.4 Electrical power generated by DC machine 2.2 H-Bridge 2.3 Pulse Width Modulation(PWM) .10 CHAPTER 3: SYSTEM AND CONTROL DESIGN 12 3.1 Hardware components 12 3.1.1 Arduino UNO (R3) 12 3.1.2 L298N Dual H-bridge Stepper Motor Driver Module 19 3.1.3 HC-SR04 Ultrasonic Sensor 23 3.1.4 SG90 RC Servo Motor 26 3.2 Circuit Explanation 30 3.2.2 Flow chart 31 3.2.3 Obstacle-avoiding Robot Schematic Diagram 32 CHAPTER 4: RESULTS AND APPLICATIONS 33 4.1 Algorithm to the code: 33 4.2 Applications 34 CONCLUSION 35 REFERENCE 36 APPENDIX 37 Supervisor: Dr Nguyen Minh Y Page | Senior Design I LIST OF FIGURES Figure 1: DC Motor Structure Figure 2: A two-pole DC machine .8 Figure 3: H-bridge circuit Diagram Figure 4: Q1 and Q4 is on Figure 5: Q2 and Q3 is on 10 Figure 6: Q1 and Q2 is on 10 Figure 7: Pulse width modulation 11 Figure 8: Hardware components 12 Figure 9: Types of Arduino 13 Figure 10: Arduino UNO 14 Figure 11: Board of an Arduino .16 Figure 12: L298N Dual H-Bridge Motor Driver Module 20 Figure 13: L298N Circuit 20 Figure 14: L298N’s specifications 21 Figure 15: L298N schematic 22 Figure 16: HC-SR04 Ultrasonic Sensor 23 Figure 17: The ultrasonic wave transmission by ultrasonic sensor 25 Figure 18: SG90 RC Servo Motor 26 Figure 19: PWM Period in motor 27 Figure 20: DC Gear Motor 27 Figure 21: Robot breadboard with wheels .28 Figure 22: Schematic Diagram Error! Bookmark not defined Figure 23: Automatic vacuum cleaner .34 Figure 24: Robot navigation 34 Supervisor: Dr Nguyen Minh Y Page | Senior Design I Abstracts: In Industrial Age as today, robots are increasingly widely used not only in the production but also in the human life They are the important part which can help modern humans in general and workers in particular in every aspect of life such as in construction, in delivery, in transport, etc Robots can work in severe weather conditions and full of obstacles terrain where humans work difficultly This project describes about an obstacle-avoiding robot which can detect obstacles by an ultrasonic sensor The robot is made using ultrasonic sensor and it is controlled by Arduino microcontroller Ultrasonic sensor fixed in front portion of the robot vehicle The Servo Motor scans the angle from to 180 degree, simultaneously the ultrasonic sensor detecting the obstacle ahead It gets the data from surrounding area through mounted sensors on the robot and is sense the obstacles and deviate its path to choose an obstacle free path The sensor will be sent the data to the controller to decide the movement of the robot wheel After receiving the signal from ultrasonic sensor, Arduino microcontroller will calculate the distance from the robot to the obstacles and transmit the signal to the L298N Motor Module to change the movement of the robot and avoid the obstacles In the future, this project’s application will be developed in much equipment such as line detection vehicles, automatic vacuum, a fire truck using a fire detector, etc Supervisor: Dr Nguyen Minh Y Page | Senior Design I CHAPTER 1: INTRODUCTION 1.1 Motivation The project is designed to build an obstacle avoidance robotic vehicle using ultrasonic sensors for its movement An Arduino Uno is used to achieve the desired operation A robot is a machine that can perform task automatically Robotics is generally a combination of computational intelligence and physical machines (motors) Computational intelligence involves the programmed instructions The project proposes robotic vehicle that has an intelligence built in it such that it guides itself whenever an obstacle comes ahead of it This robotic vehicle is built, using an Arduino Uno An ultrasonic sensor is used to detect any obstacle ahead of it and sends a command to the Arduino In today’s world robotics is a fast growing and interesting field Robot has sufficient intelligence to cover the maximum area of provided space Automatically obstacleavoiding Robots are robots that can perform desired tasks in unstructured environments without continuous human guidance The obstacle detection is primary requirement of this autonomous robot The robot gets the information from surrounding area through mounted sensors on the robot 1.2 Contribution In this topic, I design an automatically obstacle-avoiding robot with three wheels in industrial areas The topic has many applications such as: tracking, delivering goods, applying in automatic vacuum, bringing many benefits to people - Solving problems in delivering goods in industrial area - Calculate, design and write algorithms for avoiding obstacles - Help students apply the knowledge learned in the training program to scientific research and work with real systems; improve professional knowledge and skills; the ability to proficiently use tools, components and software supporting specialized electrical engineering Supervisor: Dr Nguyen Minh Y Page | Senior Design I CHAPTER 2: BACKGROUND 2.1 DC Motor A DC motor is a machine that converts electrical energy into mechanical energy The most common types rely on the forces produced by magnetic fields DC motors were the first type widely used, since they could be powered from existing direct-current lighting power distribution systems A DC motor's speed can be controlled over a wide range, we can change the speed and the direction of the motor by using other electronic devices with pulse width modulation method (PWM), actually we control the pulse-width of the voltage apply on the motor The DC machine is a versatile electromechanical energy conversion device characterized by superior torque characteristics and a wide range of speed Its efficiency is very good over its speed range DC currents are required for both its field winding, located on the stator, and its armature winding on the rotor The DC machine is more costly than comparable AC machines, and its maintenance osts are also higher Because of their costs, DC machines are not widely used in industry Their use is limited to tough jobs, such as in steel mills and paper mills They are also used as motors for control purposes 2.1.1 Structures  Stator: Electrical or permanent magnets Provided magnetic field  Rotor: Coils (winding) mounted on the shaft  Commutator: Brushes (carbon) 2.1.2 Windings Figure 1: DC Motor Structure DC machines have windings: Field windings: on the stator Supervisor: Dr Nguyen Minh Y two sets of electrical Page | Senior Design I Armature windings: on the rotor Figure 2: A two-pole DC machine 2.1.3 Armature mmf  The axis of the armature mmf is 900 from the axis of the field winding The stator (field) winding mmf: Fs The rotor (armature) winding mmf: Fr 2.1.4 Electrical power generated by DC machine If the losses of the DC machine are neglected, from the energy conservation principle, the electrical power is equal to the mechanical power: = electrical power = mechanical power At steady state, the mechanical torque Tm is equal to the electromagnetic torque Te 2.2 H-Bridge An H bridge is an electronic circuit that enables a voltage to be applied across a motor in either direction These circuits are often used in robotics and other applications to allow DC motors to run forwards or backwards In general an H-bridge is a rather simple circuit, containing four switching element The switching elements (S1, S2, S3, S4) can be relay, BJT or MOSFET The diodes (D1, D2, D3, D4) are called catch diodes, with the load at the center, in an H-like configuration: Supervisor: Dr Nguyen Minh Y Page | Senior Design I Figure 3: H-bridge circuit Diagram The top-end of the bridge is connected to a power supply (battery for example) and the bottom-end is grounded In generally all four switching elements can be turned on and off independently, though there are some obvious restrictions Though the load can in theory be anything you want, by far the most pervasive application if H-bridges is with a brushed DC or bipolar stepper motor (steppers need two H-bridges per motor) load In the following I will concentrate on applications as a brushed DC motor driver • Static Operation If Q1 and Q4 are turned on, the left lead of the motor will be connected to the power supply, while the right lead is connected to ground Current starts flowing through the motor which energizes the motor in the forward direction and the motor shaft starts spinning Figure 4: Q1 and Q4 is on If Q2 and Q3 are turned on, the reverse will happen, the motor gets energized in the reverse direction, and the shaft will start spinning backwards Supervisor: Dr Nguyen Minh Y Page | 10 Senior Design I 3.2.2 Flow chart Start Initialize Ultrasonic sensor, Servo Motor, Motor Drive Read distance Stop moving Yes If distance = Left distance Supervisor: Dr Nguyen Minh Y Yes Turn right Page | 32 Senior Design I No Turn left 3.2.3 Obstacle-avoiding Robot Schematic Diagram Figure 22: Schematic Diagram Supervisor: Dr Nguyen Minh Y Page | 33 Senior Design I CHAPTER 4: RESULTS AND APPLICATIONS 4.1 Algorithm to the code: Initialize Ultrasonic sensor, Servo Motor, Motor Drive The robot is always moving straight Servo Motor scans the angles from to 180 degrees The ultrasonic sensor reads the signal continuously When any angle of the servo where the sensor reads less than 20cm, the controller will process the reading and give the best solution to limit the collision with an obstacle during the movement The robot will move to the right or left direction unless there is any obstacle Repeat the previous steps to complete the loop Supervisor: Dr Nguyen Minh Y Page | 34 Senior Design I 4.2 Applications  Obstacle avoiding robots can be used in almost all mobile robot navigation systems  Development of line detection vehicles using line detection sensors  A fire truck use a fire detector  They can be used for household work like automatic vacuum  They can also be used in dangerous environments, where human penetration could be fatal Supervisor: Dr Nguyen Minh Y Page | 35 Senior Design I Figure 23: Automatic vacuum cleaner Figure 24: Robot navigation Supervisor: Dr Nguyen Minh Y Page | 36 Senior Design I CONCLUSION This paper presented a simple, cost effective obstacle detection and avoidance system for an unmanned land mover Two pairs of heterogonous sensors were employed to detect obstacles along the path of the mobile robot A degree of accuracy and minimum probability of failure were obtained The evaluation on the autonomous system shows that it is capable of avoiding obstacles, ability to avoid collision and change its position It is evident that, with this design more functionality can be Supervisor: Dr Nguyen Minh Y Page | 37 Senior Design I added to this design to perform various functions with little or no intervention of humans Finally, the robot was made to be remote controlled using an IR receiver and a remote controller This project will be helpful in hostile environment, defense and security sectors of the country This paper presented a simple, cost effective obstacle detection and avoidance system for an unmanned land mover Two pairs of heterogonous sensors were employed to detect obstacles along the path of the mobile Supervisor: Dr Nguyen Minh Y Page | 38 Senior Design I robot A degree of accuracy and minimum probability of failure were obtained The evaluation on the autonomous system shows that it is capable of avoiding obstacles, ability to avoid collision and change its position It is evident that, with this design more functionality can be added to this design to perform various functions with little or no intervention of humans Finally, the robot was made to be remote controlled using an IR receiver and a remote controller This project will be helpful in hostile Supervisor: Dr Nguyen Minh Y Page | 39 Senior Design I environment, defense and security sectors of the country This project presented a simple, cost effective obstacle-avoiding robot for an unmanned land mover Two pairs of heterogonous sensors were employed to detect obstacles along the path of the mobile robot A degree of accuracy and minimum probability of failure were obtained The evaluation on the autonomous system shows that it is capable of avoiding obstacles, ability to avoid collision and change its position It is evident that, with this design more functionality can be added to this design to perform various functions with little or no intervention of humans Finally, the robot was made to be remote controlled using L298N Drive Module and Ultrasonic Sensor This project will be helpful in hostile environment, defense and security sectors of the country Supervisor: Dr Nguyen Minh Y Page | 40 Senior Design I REFERENCE [1]https://www.theengineeringprojects.com/2018/03/introduction-tomicrocontrollers.html [2] http://engineerexperiences.com/advantages-and-disadvatages.html [3] https://www.etechnophiles.com/l298n-motor-driver-pin-diagram/ [4] https://components101.com/ultrasonic-sensor-working-pinout-datasheet [5] https://components101.com/servo-motor-basics-pinout-datasheet [6] https://askinglot.com/what-is-dc-geared-motor [7] https://www.irjet.net/archives/V5/i2/IRJET-V5I2457.pdf Supervisor: Dr Nguyen Minh Y Page | 41 Senior Design I APPENDIX #include #define trig #define echo uint8_t speed_robot=100; int distance; Servo srf05; #define inA1 10 #define inA2 11 #define inB1 12 #define inB2 13 void setup() { pinMode(inA1, OUTPUT); pinMode(inA2, OUTPUT); pinMode(inB1, OUTPUT); pinMode(inB2, OUTPUT); pinMode(5,1); pinMode(6,1); pinMode(trig,OUTPUT); pinMode(echo,INPUT); Serial.begin(9600); srf05.attach(9); } void loop() { objectAvoider (inA1, inA2, inB1, inB2,30, 1000); } int objectDistance_cm (byte angle) { srf05.write(angle); delay(500); Supervisor: Dr Nguyen Minh Y Page | 42 Senior Design I unsigned long duration; digitalWrite(trig,0); delayMicroseconds(2); digitalWrite(trig,1); delayMicroseconds(5); digitalWrite(trig,0); duration = pulseIn(echo,HIGH); distance = int(duration/2/29.412); // Serial.print(distance); //Serial.println("cm"); // delay(200); return distance; } void robotMover (byte inR1, byte inR2, byte inL1, byte inL2, byte action) { analogWrite(6,speed_robot); analogWrite(5,100); switch (action) { case 0:// không di chuyển motorControlNoSpeed(inR1, inR2, 0); motorControlNoSpeed(inL1, inL2, 0); break; case 1://đi thẳng motorControlNoSpeed(inR1, inR2, 1); motorControlNoSpeed(inL1, inL2, 1); break; case 2:// lùi lại motorControlNoSpeed(inR1, inR2, 2); motorControlNoSpeed(inL1, inL2, 2); break; case 3:// quay trái motorControlNoSpeed(inR1, inR2, 1); Supervisor: Dr Nguyen Minh Y Page | 43 Senior Design I motorControlNoSpeed(inL1, inL2, 2); break; case 4:// quay phải motorControlNoSpeed(inR1, inR2, 2); motorControlNoSpeed(inL1, inL2, 1); break; case 5:// rẽ trái motorControlNoSpeed(inR1, inR2, 1); motorControlNoSpeed(inL1, inL2, 0); break; case 6:// rẽ phải motorControlNoSpeed(inR1, inR2, 0); motorControlNoSpeed(inL1, inL2, 1); break; case 7:// rẽ lùi trái motorControlNoSpeed(inR1, inR2, 2); motorControlNoSpeed(inL1, inL2, 0); break; case 8:// rẽ lùi phải motorControlNoSpeed(inR1, inR2, 0); motorControlNoSpeed(inL1, inL2, 2); break; default: action = 0; } } void motorControlNoSpeed (byte in1,byte in2, byte direct) { switch (direct) { case 0:// Dừng không quay digitalWrite(in1,LOW); digitalWrite(in2,LOW); break; case 1:// Quay chiều thứ digitalWrite(in1,HIGH); Supervisor: Dr Nguyen Minh Y Page | 44 Senior Design I digitalWrite(in2,LOW); break; case 2:// Quay chiều thứ digitalWrite(in1,LOW); digitalWrite(in2,HIGH); break; //default: } } void objectAvoider (byte inR1, byte inR2, byte inL1, byte inL2, byte allow_distance, int turn_back_time) { robotMover(inR1,inR2,inL1,inL2,1); //Serial.println("Tiến"); //delay(10); int front_distance=objectDistance_cm (90); int left_distance; int right_distance; int max_distance; if (front_distance > allow_distance) { robotMover(inR1,inR2,inL1,inL2,1); Serial.println("Tiến"); delay(10); } if (front_distance

Ngày đăng: 18/07/2023, 18:04

w