APP下载

Research on Intelligent Robot

2021-03-17

中阿科技论坛(中英文) 2021年2期

(Beijing Jiaotong University-Weihai,Weihai 264401)

Abstract:In order to further promote the popularization of intelligent robot technology,related research has been carried out.Starting with the study of four conventional tasks,this paper completes the research tasks from the aspects of scheme design,path calculation,control circuit design,simulation design,program design,circuit board design and functional simulation and optimization.The prototype has fulfilled the four task requirements of the project.

Key words:Intelligent robot;Tracking line;Motor drive control

1 Introduction

This project combines part of communication technology and mechanical principle,which aims to make an intelligent robot.To meet the requirements of the challenge,the robot must complete the following four tasks sequentially.

TASK 1:Move following the guide lines:The robot can recognize black and white lines and move following the guide lines.The guide lines are composed of a 25mm wide white tape stuck to an 80mm wide black tape on the floor (See Figure 1).

TASK 2:Stop at the TERMINAL ZONE:The TERMINAL ZONE is a rectangular area of the size of 30×20cm which takes the end of the guide line as its center,beside a wall (See Figure 2).The robot should automatically stop at the TERMINAL ZONE after moving following the lines,at least one of the two drive wheels is in this area when stopping.

TASK 3:Display the length of the guide lines:The length of the guide lines from the START POINT to the end is roughly 5 -20m.The real-time length of the guide line from the START POINT should be displayed on a display device on the robot and be held until the START BUTTON is pressed again.

TASK 4:Search for the BEACON and park at the PARKING ZONE:The PARKING ZONE consists of five concentric circular areas,named CIRCLE 1,CIRCLE 2,… CIRCLE 5.A BEACON is settled at the center of the PARKING ZONE (See Figure 3).The robot should search and move towards the BEACON as fast as possible,and park as close as possible to the center of the PARKING ZONE,then beep for 2s to indicate that TASK 4 is completed.When parked,the robot MUST be completely in at least one of the circular area of the PARKING ZONE.

2 Design and Calculation

Figure 1 the robot testing area

Infrared tube and white line can receive infrared signal,while black line cannot receive infrared signal.Arduino is programmed through digital signal formed by voltage comparator,and motor is jointly driven to achieve the purpose of line tracking.Through the connection between L298N and Arduino,the motor controls the input and output of L298N.The input is connected to Arduino,and the output is connected to the motor.Through the programming of Arduino,the forward rotation,reverse rotation and rotation speed of the motor are controlled to control the car's straight driving,speed,turning and other operations.The ranging is completed by code disk and the display screen.Input pulses to arduino by measuring the number of grating,and the number of pulses is displayed on the display screen.Then,the distance of the wheel is determined by calculating the diameter of the wheel.The ultrasonic module is installed at the front of the car.The distance from the obstacles in front is judged by the transmitted and received pulses,so as to realize parking function in the parking area.

The position of the beacon can be specifically confirmed by using two infrared receiving tubes.The difference between the analog signals received by the two infrared receiving tubes can determine the left and right positions of the beacon relative to the cart,and then the change of the analog signal can be used to detect whether it is close to the beacon.For example,the value of the signal changes from small to large proves that the robot is approaching the beacon,and then if the signal is getting smaller,it proves that the robot is away from the beacon.Through the above method and two infrared receivers the navigation function can be realized.

The structure of the robot is divided into mechanical part,programming part and circuit part.The mechanical parts can be further divided into body,wheel,motor,screw and copper column,backing plate,etc.The programming part includes the motor rotation process,infrared module determination process,signal reception test,ranging programming,navigation programming,etc.The circuit part includes drive circuit board,infrared circuit board,Arduino and extension board,ultrasonic circuit board,voltage stabilizing circuit board and so on.In the mechanical part,due to the limitations of the robot's body shape and weight,the selection of materials to be used and the placement of various modules,PCB boards and Arduino positions should be considered when making the trolley.In the programming section,it is not only necessary to ensure that the program used by each module can work properly,but also to ensure that all programs can work properly after all the code integration.The assembly language of Arduino is used in the whole programming process.Through a series of application procedures,such as defining pins,declaring variables,setting initial values,setting judgment conditions and loops,subfunction definitions,program reading and writing,setting delay,etc.,the robot can follow the line and navigate under specific conditions.In the circuit board part,all circuit boards are designed by lichuang,and are handed over to the manufacturer to make PCB board.All four corners of the PCB board should have space for drilling,and the different components should be named to make it easier to identify.

Figure 2 Tracking line chart

Figure 3 Navigation and parking chart

2.1 Calculation

(1) About the calculation of infrared tube emitter:according to the device manual,the forward voltage drop of the emitter of infrared tube ST188 is 1.2V and the limited current is 50mA.The voltage difference between the emitter ends is:5V-1.2V=3.8v.Therefore,a current-limiting resistor needs to be added to the emitter circuit.The smallest resistor value should be as follows:3.8 V/ 0.05 A=76 Ω.Use of resistance in this module size of 120 Ω,clearly meet the requirements.

(2) About yellow LED infrared module calculation:according to the rated current of the device manual to find out the LED0805 size of 5~ 8 mA,the pressure drop for 2V.Therefore the voltage difference on both ends of the resistor 2 v to 5 v=3 v.So the current limiting resistor value range should be 3 v/ 0.008~ 3 v/ 0.005=375 Ω Ω~600.So the size of the current limiting resistor should be greater than 600 Ω,used in the project size of 1 kΩ resistance.

Figure 4 Robot structure diagram

(3) About the calculation of the pull-up resistance in the infrared module:the resistance value of the pull-up resistance is determined according to the current of the device in the circuit,because when VCC=5V,the IC of LM393=1mA.So pull-up resistors value of size:5 v/ 0.001A=5 k Ω.So the size of the pull-up resistor should be greater than 5 k Ω,used in the project on the resistance of 10 k Ω resistance.

(4) About driver module in computing at the input light coupling parts:TL281-4 positive pressure drop at the input is 1.3 V,so the voltage at the ends of the resistor should be 5 V -1.3 V=3.7 V.And because of its current limiting IC=50 mA,we can calculate the size of the resistor:3.7 V/ 0.05 A=74 Ω.Therefore it should be greater than 74 Ω resistor.And the Arduino can accept current within 20 ma,the size of the current limiting resistor:3.7 V/ 0.02=185 Ω.To sum up,the input resistance should be greater than 185 Ω,actually used in the project size is 470 Ω resistor.

(5) As for the calculation of the output end of the optocoupler part of the drive module,the forward pressure drop of the output end of tl281-4 is 0.4v.So on both ends of the resistor voltage of 5 V to 0.4 V=4.6 V and the output rated current is 0.1 mA,therefore currentlimiting resistance should be greater than 4600 Ω,used in the experiments of the resistance of 4.7 K Ω.

(6) About the calculation of the voltage regulator module in the drive circuit:in the voltage regulator module,both capacitors play the role of power filter.The voltage withstand value of C1 (330nf) and C3 (100nf) is greater than 12V,and the current limit of 7805 voltage regulator module is 1A,so it can be directly used without adding current limit resistance.

(7) In the process of ranging,we measure that a grating wheel has twenty gratings,and there are 20 pulses in a circle.Then we measure the diameter of the wheel is 6.5 cm,and the circumference is 3.141*6.5=20.48 cm.So the circle is multiplied by 1.024,so that the distance can be measured accurately.

2.2 Electronics

2.2.1 Infrared Patrol Line

First,mark all ports in the upper right corner.This is for the purpose of avoiding the complicated connection and errors when drawing the schematic diagram.In the selection of components,the same specifications as those in the laboratory are also completely selected.It is noted that we chose LM393 from the user contributions,so we need to match the pins of the actual LM393 chip when encapsulating it (FIG.1 is the package of LM393).The patch specifications are selected in all components selection,so as to reduce the area of PCB board and make it easier to install the body of PCB board,and the range of PCB board can be placed wider.The disadvantage of this method is that it increases the difficulty of welding work.It also makes the process of circuit detection more difficult.

2.2.2 Motor Drive

P1 has four inputs to control the forward and reverse rotation of the left and right motors.H1 and H2 are right motor and left motor respectively.When the input is ‘10’,the output is ‘01’ and the motor is reversed.When the input is ‘01’,the output is ‘10’,and the motor is in positive rotation.H3 connects the ENA and ENB of Arduino and adjusts the speed of the motor by adjusting the duty cycle of the input.The ground of the whole circuit is connected to the ground of the battery,and the ground of Arduino does not participate in the whole motor-driven circuit.The 5V voltage in the right circuit is stabilized by the intervening 12V voltage of the battery through a regulated circuit.

2.2.3 Expansion Board

In the above figure,the Arduino port can be expanded through the PCB,and the terminals in the figure are connected with other PCBs to form the entire robot system.

2.3 Assembly

2.3.1 Assembly components

Photoelectric Sensor,Ultrasonic Sensor,Steering Gear,L298N Motor Drive Module,ARDUINO UNO Board,ARDUINO Expansion Board,Photoelectric Encoder,Bread Plate,OLED Screen,Power Switch,Battery,Motor,Encoder,Tire,Chassis,Universal Wheel,Screw and DuPont Wire.

2.3.2 Assembly

The three red modules in the front of the car are infrared tracking modules;the green modules in the left and right sides of the front of the car are infrared navigation modules;the black circular modules in the middle of the car are ultrasonic parking modules;the Yellow modules on the roof are motor-driven modules;the black modules on the motor-driven modules are single-chip microcomputer modules;the brown modules in the back half of the car are battery packs.

3 Programming

Figure 5 Program flow chart

3.1 Trace

Sub-functions include forward and backward driving,left and right turning,measuring distance and displaying distance on LED screen.In the tracking process,3 infrared sensors are used.The center of the infrared sensor is always on the white line,and the left and right sides are on the black line.When the right side of the infrared sensor is on the white line,the car will turn right.When the left side of the infrared sensor is on the white line,the car will turn left.When all the infrared sensors are on the white line,the car will stop.

3.2 Parking

The above sequence diagram shows that you only need to provide a pulse trigger signal of more than 10us,and the module will send out 8 40KHz periodic levels and detect the echo.Once the echo signal is detected,the echo signal is output.The pulse width of the echo signal is proportional to the distance measured.Thus,the distance can be calculated by the time interval between the transmitted signal and the received echo signal.

3.3 Formula

μS/ 58=cm

or μS/ 148=inch;

or:distance=high level time * sound speed (340m/ s)/ 2;

It is suggested that the measurement period should be more than 60ms to prevent the influence of the transmitted signal on the reverberation signal.

3.4 Ranging

The coaxial code disk of the motor has many grating.The encoder is equivalent to the photosensitive element.

Encoder as the car wheels movement turns,encoder (grating) will continue to keep OUT photosensitive element from the waves,at this time the encoder will be based on grating shade continuously produce square wave signal,square wave signal output from "OUT" pins,just continue testing "OUT" pins of the output,the gratings can be known.The wheel rotates on a circle with 20 gratings,then the distance=20* number of pulse/wheel circumference.

3.5 Navigation

The current signal received from the infrared receiving tube can reach a voltage signal of about 0~3V after two-stage amplification,and then input into the single-chip microcomputer to convert the analog signal to the digital signal to control the robot to approach the beacon,and finally achieve the function of navigation.

4 Trouble shooting

4.1 Infrared module

LM393 packaging error,should be set up error.Solution:redraw with the pin diagram

The LED light used as the indicator is directly connected to the output port and D0,and the highest working voltage of the LED is 2.2v.Easily burn out LED.

Solution:A pull up resistor at the output port leads to a branch for the LED lamp connection.

4.2 Motor drive module

A regulated circuit is needed to stabilize the 5V voltage by the 12V voltage of the battery.

At the first time,our group want to measure the power to achieve the function of navigation but the relationships between the distance and power is unknowable

4.3 Code

When displaying ARDUINO serial port monitor data on the OLED screen,it is necessary to pay attention to setting the font size,otherwise the correct data will not be displayed on the OLED screen.

4.4 PCB(or others)

In the ranging part,we wanted to convert the traveling distance by measuring the car speed at the beginning,but found it easier to measure the grating number later.

Ii.Initially connected the FOUR interfaces of OLED screen to ANALOG IN the extension board.We found that the OLED screen didn't light up.Later,we looked up information and learned that we needed to connect it to IIC port on the extension board.

5 Test and improvement

5.1 Test

The PWM wave that controls the input of the microcontroller to the circuit can realize the forward and reverse rotation of the motor

5.2 Improvement

Idea:Due to the excessive number of ports required for this project,the Arduino ports are not qualified for using.We then considered using an extension board to connect to Arduino to help reduce port usage.

Implementation:In this project,the robot USES the UNO expansion board.The UNO expansion board can greatly simplify complex circuits and connect sensors.

The accuracy of the trolley ranging can be accurate to millimeters or higher.

6 Summary

The goal of the project is to build a robot that can patrol lines,navigate and park cars.This project applied a variety of communication technologies,and programming technologies.In the circuit part,the circuit diagram involved can be divided into four parts:infrared module,circuit module,expansion board module and voltage regulator module.In the programming part,the code used in this project is the programming language of Arduino,and signals are processed through the Arduino microcontroller through logic control.The softwares involved in this project include:li chuang mall,Arduino programming,Multisim.The hardwares involved in this project include printed circuit boards,screws and nuts,Arduino and USB cables.

Reference:

[1]Kottmann,J.;Grob,U.;Rey,J.M.;Sigrist,M.W.Mid-Infrared Sensor for Applications.Sensors 2013,13,535-536.

Marc Raibert,Kevin Blankespoor,Gabriel Nelson,and etc.BigDog,the Rough-Terrain Tracking-line Robot.17th IFAC World Congress,Jul.2008,p.1002~1003.

[2]Yin S.,Ruffin P.B.,Yu F.T.S.(Eds.),Grating Range Sensors(second ed.),CRC Press,Taylor and Francis Group (2008),p.66~67

[3]Galiardi G.,Salza M.,Avino S.,Ferraro P.,De Natale P.Application of Ultrasound in Navigation Technology,330 (2010),pp.1081-1084

[4]Rottweiler,W.A.,(2013).Speed measurement and Application of optocoupler module.American Students Journal,55,60-63

[5]Henry,C.,&Wrong,T.(2015).OLED screen Applications.American Students Journal,137,20-25