LI Shi-guang, YANG Xiao-lei
(College of Electrical Engineering and Automation,Shandong University of Science and Technology,Qingdao 266590,China)
Intelligent line-tracking robot is a kind of robot system that can achieve autonomic movements and realize certain functions through perceiving the surroundings and its own conditions by sensors[1]. On the background of automotive electronics,design of the system consists of several creative modules,such as machinery,electronic technology,sensor technology and control.
The STM32 chip is adopted in this intelligent line-tracking chess robot as the main control chip,which owns advanced kernel configuration,excellent control of power consumption and good performance. The infrared sensors are adopted to collect the ground information and the robot is driven by rear wheel motors[2]. The travel direction of the robot is determined by the steering engine of the front wheel so that the automatic line-tracking function of the robot is achieved in a fast and stable way. Moreover,the manipulator of the robot is controlled by another steering engine and the chessmen can be moved steadily and accurately by the robot.
The control system of the intelligent line-tracking robot is shown in Fig.1,which mainly consists of detection circuit,master control circuit,motor drive circuit,steering engine drive circuit and power module.
Fig.1 The structure diagram of control system
The course of action of the intelligent robot can be divided into 8 steps: walk,rotation,line-tracking,the positioning of rotation,arming,start button,state selection and power supply. Three-roller bodies are adopted in the design of the robot and a manipulator is installed in the front of the robot to seize and move chessmen,the opening angle of which is controlled by steering engine. Seven infrared sensors are installed in the front of the robot in the direction towards the ground and other five infrared sensors are also installed on both sides of the robot in the direction towards the ground respectively. In this way,the travel condition of the robot can be detected rapidly and accurately.
The robot should start to move within the stipulated time,then successively takes chessmen of “Ju”,“Pao”,“Ma” to the position of “Shuai” according to the related chess regulations. Chessman of “Xiang” is immovable. The design of chessboard is shown in Fig.2.
Fig.2 Schematic diagram of chessboard
Two power supply modes are adopted in this system.
1) With respect to the power supply of STM32,4.2 V lithium battery is used,and it can be adjusted to 3.3 V by the chip of HT7333. In this way,the constant power supply of STM32 can be achieved[3].
2) The DC motors are used to drive the rear wheels,and a low-dropout regulator SPX29302 is adopted to achieve the constant power supply of rear wheel motors and two steering engines.
In the intelligent robot system,the infrared photoelectric sensors are adopted to detect and conduct line-tracking movement of the line-tracking circuit. When the intelligent robot conducts the line-tracking,the output signal is very weak and the black line is irradiated by output signal of the infrared transmitting tube. The robot can be detected whether it runs along the guiding line according to the detected voltage level of the signal. If the robot doesn’t run along the guiding line,the motors can be driven to rotate to a right direction according to the signal sent by the sensors,so the robot can run along the right track.
Compared with the fuzzy PID algorithm[4],self-adaption PID algorithm,expertise PID algorithm and other advanced PID algorithms,the traditional PID algorithm can not only meet the practical requirements but also be good in instantaneity,easy and convenient to achieve and suitable to be used in the intelligent car competition[5].
In this design,the sensor on the left is defined to be the first sensor and the rest can be done in the same manner. When the seventh sensor is valid,it means that the car is swaying to the left and needs to be adjusted to the right. When the first three sensors are valid,it means the car is swaying to the right and needs to be adjusted to the left[6]. Furthermore,if the first three sensors are valid simultaneously,the intelligent car should be stopped according to the designated program.
Fig.3 Line-tracking detection circuit
Classic PID control algorithm is adopted in the design,wherein the PID control is adopted which can generate a fast and advanced control effect and improve the dynamic performance index of the system significantly. The servo turning control block diagram is shown in Fig.4. The PID control is adopted in the motor speed control. The PID control is a relatively ideal control[7],wherein the integration element is adopted on the basis of the proportional element and the residual error can be eliminated. Besides,the differentiation is that the element is further adopted and the stability of the system is improved. The motor speed control block diagram is shown in Fig.5.
Fig.4 Block diagram of servo turning control
Fig.5 Block diagram of motor speed control
The intelligent line-tracking robot is driven by the rear wheel motors,and the direct current H-bridge driven circuit is used to control the double movement of the motors[8]. Two pairs of H-bridge circuits are employed to drive two motors. The positive and negative motion of motors can be achieved by adjusting the conducting state of audion,and the rotation rate of the motors can be controlled by regulating the pulse-width modulation (PWM) of the input H-bridge circuit.
The steering engine is a kind of position (or angle) servo driver,suitable for those control systems in which the angle may be stable but needs to be changed constantly. The working principle is that the control signal is transmitted to signal modulation chip through the tunnel of the receiver so that the DC offset voltage can be obtained[9]. There is the reference circuit inside the steering engine which may generate the reference signal with the period of 20 ms and the width of 1.5 ms[10]. Comparing the DC offset voltage acquired with the voltage of potentiometer,the difference of output voltage may be obtained.
A time base pulse with the width of 20 ms is often required in the control of steering engine,and the high level part of the pulse is the part controlled by the angle within 0.5 ms to 2.5 ms. The position of the robot may be acquired through detection circuit and the adjusting angle of steering engine can be controlled by suitable PWM and be output by STM32. The control circuit of steering engine is shown in Fig.6.
Fig.6 Diagram of steering engine control circuit
Given that the chess robot may veer off the runway as affected by surrounding factors (such as light intensity,ground evenness degree and the attrition rate of the site) during the travel process,the robot cannot finish the whole course at the same time,but it is allowed to go on next task only after finishing one periodic task. In view of this problem,the dial switch[11]is used in this design,and there are three working modes. They are as follows.
1) The robot starts from the “start point”,and successively moves the chessmen of “Ju”,“Pao”,“Ma” to the position of “Shuai”. We set the dial switch 1 as “ON” and reset dial switch 2,dial switch 3 and dial switch 4.
2) If the robot veers off the chessboard after moving the chessman of “Ju” to the position of “Shuai”,the robot should be back to the “start point” and its body should be put vertically at this time. Then,it starts from the “start point” again,and successively moves the chessmen of “Pao” and “Ma” to the position of “Shuai” and comes back to the “start point” finally. We set the dial switch 2 as “ON” and reset dial switch 1,dial switch 3 and dial switch 4.
3) If the robot veers off the chessboard after successively moving the chessmen of “Ju” and “Pao” to the position of “Shuai”,the robot should be back to the “start point” and moves the chessman of “Ma” to the position of “Shuai”,then comes back to the “start point” again. We set the dial switch 3 as “ON” and reset dial switch 1,dial switch 2 and dial switch 4.
Given that the travel process of the chess robot is relatively complicated,the software flow pattern of moving the chessman of “Ju” to the position of “Shuai” is only shown in this paper. As shown in Fig.7.
Fig.7 The software flow pattern of moving the chessman of “Ju” to the position of “Shuai”
The test of the intelligent chess robot is carried out on the chessboard (1 600×1 800 mm2),and the experimental data shows that the intelligent robot can achieve the automatic line-tracking function well. It can seize the chessmen quickly and accurately during the travel process and move each chessman to the corresponding position respectively. The designs of hardware and software of the intelligent line-tracking robot are described in this paper which provide a reliable direction control strategy for this intelligent line-tracking robot and the whole system has a relatively good stability.
[1] LEI Zhen-yong,XIE Guang-yi. Control design and achievement of Freescale intelligent car steering engine and velocity measurement. Electronic Engineering Design,2010: 91.
[2] LI Qing-zhong,GU Wei-kang,YE Xiu-qing. The research on the intelligent pre-screening control method of the route tracking of the mobile robot. Robot,2002,(3): 156-159.
[3] WANG Shui-hong,XU Wei,HAO Li-ping. The principle and practice of the STM32 series ARM Cortex * M3 Microcontroller. Beijing: Beijing University of Aeronautics and Astronautics Press,2008.
[4] LI Hua. MCS-51 series SCM practical interface technology. Beijing: Beijing University of Aeronauuics and Astronautics press,2002.
[5] Micro-Power(50uA),Zero-Drift. Rail-to-Rail out instrumentation amplifier INA333.Da11as: Texas Instruments,2008.
[6] ARM Cortex-M3 Processor. The architecture for the digital world. [2006-06-01]. http:∥www. Arm. com/zh/products /processors/cortex-m/cortex-m3.php.
[7] REN Zhe,PAN Shu-lin,FANG Hong-zheng. Embedded operation system basis and Linux. Beijing: Beijing University of Aeronautics and Astronautics Press,2006.
[8] WANG Fu-rui. MCU monitoring and control system design. Beijing: Beijing University of Aeronautics and Astronautics Press,1999.
[9] XIONG Ming. MCS-51 single-chip microcomputer principle and application. Beijing: Tsinghua University Press,2004.
[10] ZHANG Yong-bin. Photoelectric sensor CCD and CMOS principle and application. International Electronic Elements,2001(12): 46-48.
[11] ZHU Yi-bin. Automatic line-tracking robot design. Modern Commercial Industry,2008,(22): 318-338.
Journal of Measurement Science and Instrumentation2014年2期