Study on the motion design and control algorithm of the tortoise robot

Turtle robot is a four-legged robot based on bionic concept. There are many researches on quadruped robots in the world, and many domestic and foreign research institutions have also developed prototypes and conducted relevant researches. If the traditional control system of the quadruped robot is used, it is difficult to obtain ideal results. At the same time, the robot’s feet are easily affected by the external environment, and how to keep the robot moving in a coordinated and balanced manner makes the problem more complicated. Starting from the control problem of the four-legged robot, this paper takes the action controller of the tortoise robot as the research object, studies the control method of one leg, establishes the four-legged eight-joint control system of the tortoise robot, designs the motion and control algorithm, and uses the infrared wireless module for remote wireless control.


Introduction
About 50 percent of nature's terrain is unreachable by wheeled or tracked vehicles. These places, such as forests, grasslands, wetlands, and mountain forests, have huge resources. In order to detect and utilize these resources, it is necessary to destroy the environment as little as possible, and foot robot becomes the first choice of field detection with its inherent mobile way. In addition, such as seafloor and polar exploration, the foot robot also has obvious advantages. Therefore, foot robot has been paid much attention to in the world. The research of quadruped robot has strong practical value. Its technical research is the hot spot in the world at present. It integrates the disciplines of electronics, machinery, automatic control, SCM software and hardware, biomechanics, etc., and is also an inevitable trend of current scientific and technological development. The mechanical structure of the four-legged robot directly determines the kinematics characteristics of the robot and its performance directly determines the performance of the robot. Although the quadruped robot technology has made great progress, many problems still exist to restrain the further development and popularization of the quadruped robot [1].
Turtle robot is a simple four-legged robot based on bionic design concept. Taking turtle as biological prototype, the simplified two-joint two-degree of freedom is adopted as the single-foot degree of freedom of the turtle robot, and one degree of freedom is given to the head for motion design. This paper takes turtle robot as the research object, builds the development platform, makes tortoise robot real object, and on this basis carries on the motion design and the control algorithm writing and the research. A black aluminum frame is chosen to use as a whole frame and the HuiSheng MG996R steering engine is used for joint drive. The STA12C5A60S2 MCU and multi-steering engine control board with MCU are used as control core and carrying platform. The lithium battery of 7.4 V and 1300mah is used as a power supply and the wireless infrared module and remote controller based on NEC protocol are used for wireless control [2][3][4].
This paper mainly studies the problem of motion design and control algorithm of turtle robot, and the overall design idea is as follows: Step 1: study and design the motion of the tortoise robot. After observing and analyzing the mechanism of the coordination of the quadruped movement of the tortoise, design and improve the motion of the tortoise robot, so that it can meet the coordination motion of the two joints of the quadruped.
Step 2: after a lot of data search and multiple attempts, it is determined to use C language and Keil uVision4 software to write and debug the algorithm, and to write the designed motion-control algorithm for the turtle robot.
Step 3: integrate the infrared wireless control program and all designed motion control algorithms into one program to complete the whole algorithm.

Action design
The various actions of tortoise are coordinated with each other by the four foot movement, and realize the overall movement effect, by observing the tortoise crawling mechanism of action and research its 4 foot joint movement, design a turtle crawling movement, including forward, backward, turn left, turn right, down, stand up, then designed a three dance moves.
When a turtle robot crawls, each foot moves according to certain rules, which is called gait. In order to maintain overall balance, one side of the front foot and the other side of the back foot to maintain the same state of motion can make the four-legged robot movement more stable, namely the two-legged gait. In actual design, to make the action seem more natural, on the basis of the biped gait control under foot joints as on the foot joint movement and movement, on both sides that the joint foot forward or backward movement at the same time lift the foot, reduce friction with the ground, then, when on the foot joint movement in place then put down the foot joints, increase friction, to restore to the original state, make robot step forward or backward movement, repeat the above steps, can meet the design effect makes the robot forward or backward movement. When moving to the left or right, the same principle as moving forward and backward, turn the joint of the upper foot into a reverse direction to move to the left and right [5-6].
The gait of the tortoise robot is shown in the figure 1 -figure 4 (simplified at the foot joint).

Control algorithm and Programming
Compared with assembly, C language has obvious advantages in function, structure, readability and maintainability, so the program is written in C language. Programs use Keil uVision4 Software compiling and debugging, Keil uVision4 Software is compatible with Keil Software companies in the United States released 51 series microcontroller C language Software development system, it has a flexible window management system, the type of the browser window display equipment peripherals register information, can debug view, create and save multiple debug window layout and simplify the project workspace, the Keil C51 to generate the target code efficiency is very high, easy to understand, and therefore is widely used in the microcontroller programming.
Program design general idea is to use STC12C5A60S2 single chip microcomputer as control core, control produce PWM wave all the way, make use of the timer, interrupt, points, nine output PWM control signals, control the turtle shape of the robot head and 8 joints, a total of 9 nine degrees of freedom of steering gear, using time delay function delay output, to control the order of the joint action [7]. The design is as follows: writing the program to control a steering gear, defining a PWM output port, counting 1ms by timer timing as a basic unit and outputing PWM wave with timing and interrupt. The output time of one cycle of PWM wave is 2500ms, and the high level is output for the first 500ms, and then the proportion of high and low level PWM wave to 2000ms is determined according to the rotation Angle of the joint, which is distributed to 2000ms in proportion. When programming, using 2500 1 ms basic unit minus the high level of basic unit count is low level of basic unit of output, using interrupt with delay to delay, delay function in multidimensional ways on group 1 assignment 1 a PWM high value as a steering gear parameters, different position in a while and PWM output function for statement cycle. Then expanded to nine steering gear control, define 9 PWM wave output, extending the timer interrupt to control PWM output wavelength division 9 mouth, will break extension to 9 road PWM wave output, extended to the multidimensional array 9 road, with code register store large amounts of array, used to record nine different location parameter, the steering gear with a while statement cycle output, let the operating cycle, the flow chart shown in figure 5.

Programmed and integrated infrared wireless modules
Different types of infrared wireless modules have different communication protocols. By learning relevant principles and consulting materials, we choose to use the infrared wireless module based on NEC protocol. Firstly, the 2-digit hexadecimal coding of the required keys is determined through infrared remote reception and serial port communication, and then the programming is carried out on this basis [8]. The design idea of the program is to carry out the infrared and PWM wave output interrupts by using different interrupts and priority of interrupts. The priority of infrared interrupt is higher than that of PWM wave output interrupt to prevent mutual interference. Infrared interrupt by delay time delay and the if statement to distinguish and receive signals from the infrared remote control, and stored to eight 2 into an array, and then converted into two hexadecimal, then use the switch case function to judge received coding, infrared and then received the code to make use of the switch case function judgment, to receive different code to perform the corresponding different statements, control joints with different actions to achieve the purpose of the quadruped robot control infrared remote controller. The infrared control program flow chart is shown in figure 6.

Summary
In this paper, the motion design and control algorithm of the turtle robot are studied. Then by studying the movement gait and the operation of the joint space and joint control, design a turtle robot forward, backward, turn left and right of action, to achieve the turtle shape robot movement coordination, the effect of control of each joint is relatively stable, on the basis of the writing and debugging of algorithm, from the software implementation of the turtle form the robot's motion control. In the end, the software program is rewritten by adding the infrared wireless module, and the mobile control of the tortoise robot is realized by using the remote control, which has a certain practical value.