Research of Two-axis Food Production High Speed Dashing Controller for Agricultural Development in China

Food production is an intelligent robot which is designed to find the shortest path from the start to the destination in an unknown maze. Food production based on MCS-51 cannot meets requirements of high speed dashing. In order to make the mouse memory the complex maze information automatically in dashing, different sensors were used to calibrate the position of food production based on STM32; In order to dash with the shortest time, curves of turning right and turning left were decomposed into four different parts, different velocities and accelerations were used to track these trajectories. Experiments results show that through these methods can ensure the correctness of food production high-speed dashing in complex maze.


INTRODUCTION
Food production is an intelligent walking robot, in which embedded technology is used, under the help of sensors and motors can solve an unknown maze, it can find its way from a predetermined starting position to the central area of the maze unaided (Juing-Huei et al., 2011;Swati and Pankaj, 2008).Once reaches the destination, the food production will typically perform additional searches of the maze until it has found an optimal route from the start point to the centre (Kiblcr et al., 2011;Xiong et al., 2011;Yu and Ji-Min, 2011;Yi-Min and Jun-Hua, 2010;Shao-Bo and Ke-Hui, 2012).There are few domestic research institutions or teams engage in researching and designing it, principle of designed food production based on MCS-51 as shown in Fig. 1.After a long time operation, many problems are found: • Ultrasonic sensors are used in the system; highspeed food production often makes a mistake about maze information and easily hits the front wall.• Stepper motor is used in the food production micro-mouse, which often encounters the problem of missing drive signals and leads to the mouse cannot find the dashing destination.• Due to relatively low level algorithm is used to solve maze, which takes much more time in the optimal maze calculation and dashing route.Generally, one whole dashing needs taking 15~30 sec and the food production cannot win in the real contest.
• The food production has a poor anti-interference ability.Due to the surrounding environment is not stable, especially the disturbance of surrounding light, which makes the controller often appear abnormal and causes the food production lose controlling.• Due to MCS-51 chip has a limited capacity, maze information can't be stored and the information of maze will be disappeared when power of the food production is off, which makes the food production cannot finish the whole searching and dashing process.
Therefore, the existing food production controller based on MCS-51 needs to improve.

METHODOLOGY
A new type improved food production micro-mouse: STM32 is a microcontroller that is manufactured by STM company.The STM32F family is specifically designed for embedded applications.It is a 32-bits flash microcontroller based on ARM Cortex-M3 core.It has a low enough cost to challenge traditional 8 and 16-bit microcontrollers.The STM32F microcontrollers combine high performance with first-class peripherals and low-power, low-voltage operation (Xiu-Wei and Hua, 2012;En and Yuanyuan, 2011;Zhil et al., 2013).L298N is the product of SGS company, the common package is power SO20, the chip including 4 drive circuits and can drive two DC motors.The level of L298N's OUT1, OUT2, OUT3 and OUT4 can be changed by processor, which can make a motor run in positive rotation or reverse rotation.
In order to overcome problems of a food production based on MCS-51, a new control mode based on STM32 was researched and developed, principle of the design as shown in Fig. 2.
STM32 plays an important role in the system, which is used not only to handle data, judge maze, output online, storage data and control I/O port, but also to enable or disable L298N.L298N is connected with STM32, as shown in Fig. 3.

PRINCIPLE OF HIGH SPEED DASHING
Before the food production receives the dashing command, it will generally be placed in the starting coordinates (0, 0), waiting for the controller sends out dashing command.Once the dashing start command is received, it will dash with a high speed to the destination (7, 7), (7, 8), (8, 7), (8, 8) along a dashing path, as shown in Fig. 4. When the food production dashes forward, if there are walls in the front and left, but no wall in right, the controller will store the now coordinate (X, Y) and food production will track the curve as shown in Fig. 5.
In the right turning dashing, firstly, controller makes the food production walk along a short straight distance DashTurn_R90_Leading, according to different dashing commands, various dashing velocity and acceleration, PWM control signals are generated by STM32 and sent to L298N, which are used to control left and right motor.After food production reaches the set position, front sensor compensation reference R90_FrontWallRef begins to work, which can prevent interference and does error compensation.After error compensation, controller adjusts speeds of X motor and Y motor to DashTurn_R90_VelX1 and DashTurn_R90_VelY1 respectively, the curve trajectory of DashTurn_R90_Arc1 will be transferred to STM32, according to different dashing commands, various dashing velocity and acceleration, STM32 generates PWM control signals to make food production track the curve DashTurn_R90_Arc1; When it reaches the goal, controller immediately adjusts speeds of X motor and Y motor to DashTurn_R90_VelX2 and DashTurn_R90_VelY2.Then the curve DashTurn_R90_Arc2 will be transferred to STM32, according to different dashing commands, various dashing velocity and acceleration, STM32 generates PWM control signals to make food production track the curve DashTurn_R90_Arc2.When it reaches the goal, the controller will make the food production dashing a straight short distance DashTurn_R90_Passing to calibrate its position, according to different dashing commands, various dashing velocity and acceleration, STM32 generates PWM control signals to make food production move the short distance DashTurn_R90_Passing. Through this method, the food production realizes the turning right dashing in a high speed.Then it will update its coordinates to (X+1, Y), the controller judges the reached coordinate, if real-time coordinate is one of (7, 7), (7, 8), (8, 7), (8, 8), the controller will stop food production micro-mouse's dashing, because the food production has found its target, then the return flag is set to 1 and dash flag is 0, food production begins to back to start position.
When the food production dashes forward, if there are walls in the front and right, but no wall in left, the food production will make a turning left dashing.The principle of turning left is same as turning right, the whole curve also is decomposed into four different parts: DashTurn_L90_Leading, DashTurn_L90_Arc1, DashTurn_L90_Arc2, DashTurn_L90_Passing.

Software of design:
As shown in Fig. 6, the food production dashing control system is divided into two parts: the host system and motion control system.The host system to realize the function of maze reading, coordinate positioning, online output; motion control system mainly to realize servo control of food production in dashing.
In order to realize food production fast dashing with right maze information, right sensors S2, S3 and left sensors S4, S5 always detect walls and posts of the maze, which can help the food production realize position correction.
In the food production dashing process, if there is a disturbance in the system, STM32 controller will regulate current and PID parameters of DC motors, through fast adjustment of current loop to realize online compensation, which makes the system stable again quickly.

EXPERIMENT
The designed food production based on STM32 as shown in Fig. 7.
In simulation test, set PWM frequency 500 Hz, the motor can be smoothly rotated.With a digital oscilloscope, PWM waveform at duty cycle of 30% as shown in Fig. 8.
PWM waveform at duty cycle of 50% as shown in Fig. 9.
Can be seen from Fig. 8 and 9, the duty cycle can be changed.Because the motor speed is proportional to duty cycle, the DC motor speed also can be changed, which can meet the high speed food production dashing requirement.In a special maze layout, picture of food production dashes out the maze as shown in Fig. 10.
As can be seen from the graph, under the help of sensors, the food production is completely in the centre of maze and the direction of the food production is completely vertical to the front navigation maze wall.
In the process of food production dashing in straight way, a disturbance to torque was added, can be seen from Fig. 11, torque of motor didn't changed.Because torque of motor can be identified on-line, compensation can be realized in real time, which can reduce the influence of motor torque disturbance to high speed dashing.

CONCLUSION
• The controller uses STM32 to solve maze judgment and dashing algorithm, which can effectively prevent the software "run away", the anti-interference ability of the system is greatly enhanced.• In the process of food production dashing, torque of motor can be identified on-line; Torque compensation is added into the software, which can reduce the influence of motor torque disturbance to high speed dashing.• Curves of dashing turning right or left were decomposed into four different parts, which makes the food production easily to realize curves turning.

Fig. 6 :
Fig. 6: Principle of food production dashing control system