About the design of a new bionic robot with four legs for competition

In order to solve the stable walking and tracking of the bionic mammalian four-legged mechanical dog, the paper introduces the mechanical structure and robot control, adopts the tandem rod structure and the new vision processing algorithm, and realizes the stable movement of the robot. The recognition and processing technology of track information image is improved, so that the four-legged bionic robot moves forward accurately along the given track, and the tracking function of the four-legged bionic mechanical dog is realized.


Introduction
Small quadruped bionic robots with small volume, strong adaptability to environment and the characteristics of action is more flexible and can be widely used in entertainment, adventure and other daily activities to meet the material and spiritual needs of people, also can be used to rescue zone, its simple and relatively low price and even in the military field, play an important role in such fields as aerospace field. Therefore, the development and research of quadruped bionic robot is also an important subject. This paper introduces the mechanical structure design and new visual recognition program of a small four-legged bionic robot with tracing function.

Mechanical structure 2.1 Leg structure
Different structures can achieve different functions. The overall structure of the leg of this mechanical dog is based on the link mechanism to control its movement. The steering gear located in the thigh drives the driving shaft to rotate, which drives the driven wheel to rotate through the eccentric wheel. This structure is mainly based on the mechanical connecting rod mechanism to control the movement and walking of the joint. The motor drives the drive shaft to rotate, and the drive shaft drives the driven wheel to rotate through the eccentric wheel, which leads to the stability of its mechanical structure due to its small freedom. The degree of freedom of the joints of the legs of quadruped robot determines the flexibility of the legs. The higher the degree of freedom of the joints, the more complex the structure of the legs is. In order to reduce the cost and control difficulty, the robot dog leg joint freedom design altogether two. There are two degrees of freedom of pitch of the hip joint connected with the thigh to ensure that the leg can bear more weight of the robot, and the degree of freedom of pitch of the knee joint between the thigh and the calf is the degree of freedom of driven motion.
In terms of thigh structure, the steering gear located on the trunk drives the rotation of the thigh; A steering gear at the base of the thigh drives the drive shaft. The steering gear driving the drive shaft should be as close to the steering gear of the trunk as possible without obstructing the movement of the legs, so as to reduce the pressure of the steering gear of the trunk, distribute more torque to the calves, and reduce the possibility of burning out the steering gear. In order to enhance the friction with the ground, the foot gap is filled with large friction coefficient material. Through a lot of observation of the movement form of dogs, the foot end adopts the arc design. In the joint structure, the knee joint and the leg part are covered with baffle bearings, fixed with screws in the middle.

Head structure
The robot's head is set at a height of 4.5cm higher than the trunk level. After testing, it is decided to place the visual recognition module (camera) on a platform with a downward tilt of 45°, so as to achieve the best visual recognition effect of the robot.

Body structure
It is composed of two independent plates fixed by screws in the middle and strip plates on both sides. The purpose of placing various control modules and batteries of the robot is achieved, so that the center of gravity of the trunk is located in the middle plane of the front and rear mechanical legs, so as to make the robot dog more stable in operation.   The controller selects stM32 as the steering gear control board of the main control chip. Stm32 series is based on the ARM Cortex-M3 kernel specially designed for embedded applications requiring high performance, low cost and low power consumption. The enhanced series clock frequency reaches 72MHz, which is the product with the highest performance among similar products. The basic model clock frequency is 36MHz, and the performance of the 16-bit product is greatly improved at the price of the 16-bit product, making it the best choice for 32-bit product users. Its peripherals are rich, there are multiple timers, output multi-channel PWM pulse signal, and have IIC communication interface at the same time. The control module mainly processes the returned data detected by the sensor. The control board is the core of the operation of the whole module, which controls the operation of each sensor. Therefore, we have adopted the steering gear control board with comprehensive functions, suitable price and fast running speed, with STM32 chip as the core. The steering gear control board is used to control the joint of the four-legged mammal machine dog, which enables the robot dog to complete a series of racing actions.

Visual Recognition module
The visual module uses OpenMV to realize the necessary tracking function. OpenMV is an open source, low-cost, powerful machine vision module. With STM32F427CPU as the core, OV7725 camera chip is integrated. On the compact hardware module, the core machine vision algorithm is efficiently implemented with C language, and Python programming interface is provided. The new experimental algorithm of this machine can realize the core machine vision algorithm and provide the robot with the ability to perceive the surrounding environment.

Recognition algorithm
Each ROI (x, y, w, h) gets coordinate range and weight. Formula Σ w [n] is used to calculate the ROI area weight, each ROI line detection algorithm will try to find the largest spot centroid. The x position of the center of mass is then averaged using different weights, with the largest weight assigned to ROI near the bottom of the image, the smaller weight assigned to the next ROI, and so on.
The target LAB value is preset and a rectangle is drawn around the Blob by looking for the index of the Blob with the most pixels.
Center of mass coordinates Center_pos determines the centerline by statements (1) (2) (3). In this algorithm, we use a nonlinear operation, so that the further away from the line, the stronger the response. centroid_sum += blobs [largest_blob].cx() * r [4] (1) weight_sum += r [4] (2) center_pos = (centroid_sum / weight_sum) According to ROIS, we set the whole area to be a rectangle with a width of 160 and a height of 120, so 80 is half of X and 60 is half of Y. The Angle of the triangle is calculated by the following equation, where the other side of the triangle is the deviation from the center, and the adjacent side is half of the Y Res. This will limit the angular output to about -45 to 45 degrees. (Not quite -45 to 45 degrees.) deflection_angle = -math.atan((center_pos-80)/60) deflection_angle = math.degrees(deflection_angle) From the above equation, an Angle can be obtained to know how much the robot rotates, so that the part closest to the robot and the part farther away from the robot can be combined together to achieve better prediction. Make the robot better realize line patrol.

Motion module
The rotation of each joint is realized by means of steering gear. Implementation of action group: The leg part of the machine is base segment for the main body. Coxa connects the body platform, including various joints are connected by a thick shaft, motor driver drive shaft rotation, drive shaft with mechanical linkage through axial movement, to ensure every movement, there are two supporting feet and the ground contact, in order to ensure the stability of the machine in motion process. In the turning design, by changing the speed of the legs on both sides, to achieve the purpose of turning.

Conclusion
To sum up, the four-legged bionic robot with tandem rod structure has the characteristics of stable structure and easy control, and has a very broad development prospect. Its flexible and maneuverable type can better adapt to various complex environments. Secondly, the visual recognition system based on Python can improve the accuracy and stability of its tracking, so that the four-legged robot dog can have a greater speed.