1 Introduction
Robots designed and manufactured to imitate human form and behavior can be called humanoid robots. They generally have limbs and heads similar to humans separately or simultaneously. The research on humanoid robots integrates multiple sciences such as mechanics, electronics, computers, materials, sensors, and control technology, representing the high-tech development level of a country. Therefore, developed countries in the world have invested heavily in research and development. Gymnastics robots have obvious humanoid characteristics, with two arms and two legs that can operate independently, of which the arm part has no less than 3 degrees of freedom and the leg part has no less than 2 degrees of freedom. It can realize more complex gymnastics movements such as double-handed push-ups, handstand splits, left and right single-handed push-ups, left and right side rolls 360°, front and back rolls 360°, etc., which is the basis for studying humanoid robot technology.
2 Control circuit design of gymnastics robot
The control part of the gymnastics robot designed in this paper mainly uses the STC89C52RC microcontroller system as the control core. This type of microcontroller is a new generation of super anti-interference/high-speed/low-power microcontroller launched by Hongjing Technology. The instruction code is fully compatible with the traditional 8051 microcontroller. Its performance is as follows:
① 12 clocks/machine cycle and 6 clocks/machine cycle can be selected at will.
② Operating frequency range: 0-40MHz, the actual operating frequency can reach 48MHz.
③ Operating voltage: 5V-3.4V (5V microcontroller)/3.8-2.0V (3V microcontroller).
④ 1280 bytes/512 bytes RAM integrated on the chip.
⑤ General I/O port (32/36). P0 port is an open-drain output. When used as a bus extension, no pull-up resistor is required. When used as an I/O port, a pull-up resistor is required.
⑥ ISP (In-System Programmable)/IAP (In-Application Programmable), no special programmer/emulator is required, user programs can be directly downloaded through the serial port (P3.0/P3.1).
⑦ Operating temperature: 0-75℃/-40-+85℃. ⑧ Package: PDIP-40, PLCC-44, PQFP-44.
The PCB board design of the gymnastics robot control system is shown in Figure 1:
The joint drive motor of this gymnastic robot uses Huisheng MG996 universal servo. MG996 servo is Huisheng's latest high-torque standard metal gear servo. The speed, tension and accuracy have been improved accordingly, and it is one of the most cost-effective high-torque universal servos on the market. Its performance is as follows:
① Product net weight: 55g.
② Product size: 40.7×19.7×42.9mm.
③ Product tension: 10.5kg/cm(4.8V), 13kg/cm(6V).
④ Response speed: 0.20sec/60degree(4.8v), 0.17sec/60degree(6.0v).
⑤ Working voltage: 4.8-7.2V.
⑥ Working temperature: 0℃-55℃.
The driving mode of the MG996 servo is also PWM. Therefore, considering the use condition of maximum output torque when the driving voltage is 6V, a driving voltage amplifier circuit using a TLP521 photocoupler is designed. The circuit is shown in Figure 2:
[page]
3 Mechanical structure design of gymnastics robot
The mechanical structure design of gymnastics robot mainly considers the feasibility of the robot to complete various gymnastic movements, such as: completing double-handed push-ups, single-handed push-ups, side rolls, forward rolls, etc. Since this robot does not walk, no more degrees of freedom are added to the design of the legs. In the structural design of this gymnastics robot, Siemens' UG structural model design software is used to design all the structural parts of the robot. As shown in Figure 3:
The actual picture of the humanoid robot after it is made is shown in Figure 4:
4 Control Program Design of Humanoid Robot
4.1 Pulse Width Difference Control Algorithm
The basic method of multi-channel servo control is to sequentially output pulses to different servos, and use the high processing speed of the single-chip microcomputer to achieve multi-channel control. However, this type of control algorithm has a limit on the number of controlled servos, because the typical period of the PWM wave required to control the servo is 20ms, and the maximum positive pulse width required for each servo is 2.5ms, so at most only 8 servos can be controlled. There are 10 servos that need to be controlled in this system, so an improved control algorithm, the pulse width difference method, is selected.
The pulse width difference method control is divided into the following steps:
(1) Group sorting. Divide the multi-channel servo control data into a group of 8 channels, and sort each group of data (control pulse length) in order from small to large.
(2) Calculate the difference. Calculate the difference of the servo control data and save it. Calculate the difference between two adjacent data in each group (the difference between the larger number and the smaller number) and save it in the difference array. The difference array has 8 storage units. The first unit stores the minimum value of the control data of the servo group, and the difference of the servo control data is stored from the second unit.
(3) Data conversion. The data in the difference array is converted into the timing time (i.e., the control pulse width difference), and then further converted into the timing initial value and saved in the pulse width difference array.
(4) Servo control. When controlling a group of servos, first set a high level to all servos in the group (start the servos), and then assign the first data in the pulse width difference array to the timing register. When the timing interrupt occurs, first turn off the servo corresponding to the first data in the pulse width difference array, and then fill the second data in the pulse width difference array into the timing register. And so on, the control of all servos in the group can be completed. In a control cycle (20ms), the timer output pulse is used to control each group of servos in turn. After the control of the third group of servos is completed, the timing continues to use a low level to make up the remaining time to complete 20ms. The principle of the pulse width difference method is shown in Figure 5.
4.2 Program implementation of pulse width difference method
The implementation method introduced here is written in C language based on STC89C52 single chip microcomputer. [page]
Method 1: Use a timer plus software delay to implement.
Use a timer to time the 20ms servo cycle. The positive pulse width of 0.5ms to 2.5ms required by each servo is not implemented by a timer, but by a delay program. Define an unsigned integer for each servo to represent the different turning angles of the servo. Each time a 20ms interrupt is entered, all ports are set to "1" first, and then count is started. When the count value is equal to the given value of the servo, the corresponding port output is set to "0". In this way, changing the given value can change the duty cycle of the PWM wave, thereby controlling the rotation of the servo. This method only uses one timer, saves resources, and uses integers to replace the different turning angles of the servo, which is convenient for program writing.
void timer0() interrupt 1 using 1 //20ms to an interrupt, timer interrupt T0
{
TH0=0x70;
TL0=0x00;
P0=0xFF;
P1=0xFF;
PWM();
}
void PWM()
{
uint counter = 0;
while(counter < 130)
{
if(counter == num[0])
P10 = 0;
if(counter == num[1])
P11 = 0;
......
if(counter == num[9])
P07 = 0;
counter++;
}
}
Method 2: Use two timers to implement.
The advantage of the previous method is that the program is simple and takes up less resources. However, the software delay time is related to the crystal oscillator frequency of the microcontroller and the number of statements in the loop program, that is, the steering angle represented by the same value is not certain. The second method uses a timer with a 20ms period and another timer with a 100us period (which can be changed) to replace the loop timing program. This enhances the versatility of the program.
void timer1()interrupt3 using 2
{
static count;
count = count%25;
Count++;
if(count == num[0])
P00 = 0;
......
if(counter == num[9])
P07 = 0;
}
The servo control program adopts a modular design approach to enhance the readability and portability of the program. The program flow chart is shown in Figure 6.
5 Conclusion
In the design of the gymnastics robot system in this paper, the STC89C52 single-chip microcomputer system is used. This small system has the characteristics of strong versatility, low price and stable operation. By writing an improved pulse width difference control program, 10 servos can be controlled. In the 2011 China Robot Competition and Robocup Open held in Lanzhou, this type of robot performed stably and won the first prize in the national gymnastics robot group.
References:
[1] Wang Zhiliang, Competition Robot Manufacturing Technology [M]. Beijing: Machinery Industry Press, 2007.5.
[2] Wang Liquan, Robot Innovation Design and Manufacturing [M]. Beijing: Tsinghua University Press, 2007.6.
[3] Zhang Tao, Introduction to Robotics [M]. Beijing: Machinery Industry Press, 2010.4
[4] Xiong Youlun, Basics of Robot Technology [M]. Wuhan: Huazhong University of Science and Technology Press, 1996.8.
[5] Liu Guangrui, Robot Innovation Manufacturing [M]. Xi'an: Northwestern Polytechnical University Press, 2007.2.
Previous article:Design of a Simple Greenhouse Control System
Next article:Research on farmland water-saving irrigation system based on Internet of Things technology
Recommended ReadingLatest update time:2024-11-16 17:38
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Traffic Light Control System Based on Fuzzy Control (Single-Chip Microcomputer Implementation)
- Principles and Applications of Single Chip Microcomputers (Second Edition) (Wanlong)
- MCU Principles and C51 Programming Tutorial (2nd Edition)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Are there any recommended books for beginners in circuit development?
- MSP430 G2553 Launchpad implements capacitance measurement
- [GD32L233C-START Review] 12. Button - External Interrupt
- Design and implementation of image cropping circuit based on FPGA
- MSP430 Launchpad MSP430g2452 SHT10 Temperature and Humidity Sensor
- Establishment of RF chip/modem chip design team
- F28335 uses external SRAM for program simulation
- Looking for experts in Helmholtz coil magnetic field
- Do you know about the programmer and emulator of msp430?
- How to use the VGA_SYNC_N signal in the VGA of DE1-SOC?