With the development of automation technology, servo motor is used more and more widely.
This paper designs a servo motor control device based on C8051F700. The hardware circuit design and software design of the device are introduced. It has basic control mode and circuit protection mode of general servo motor, and has certain application value. With the development of science and technology and the continuous improvement of automation technology, automated robots have become an indispensable part of production. The use of robots helps people get rid of heavy or simple repetitive work, and reduces the human work in dangerous environments. In order to ensure high precision in industrial production process, robots manufactured by servo motors are gradually used instead of robots manufactured by ordinary motors. In this way, servo motor has been widely used. This paper introduces a simple servo motor controller, which can control the servo motor simply. Mainly used for testing and repairing servo motors. The control system is mainly composed of MCU control system, LCD display module, keyboard input module, pulse drive circuit and 485 communication bus.
As shown in Figure 1. The minimum system of single-chip computer consists of four parts: reset circuit, clock circuit, power circuit and program firing interface circuit. The reset circuit of SCM consists of a capacitor of 10uF and a resistance of about 4.7K. The function of reset circuit is to make the SCM work back to its initial state.
Because C8051F700 MCU has internal clock circuit, there is no need to design clock circuit in this design. Stable power supply is the reliable guarantee of work. In the 5V power supply system of single chip microprocessor, there are not only 7805 voltage regulator chip, but also 400uF electrolytic capacitor added to the single chip microprocessor to stabilize voltage and 0.1uF polyester capacitor to remove interference. C8051F700 MCU uses JTAG interface burning program. Among all the interferences of single-chip computer, common ground interference is the main factor affecting all the work of single-chip computer.
In order to get rid of the common interference in the single-chip computer, it is necessary to make different circuits of the single-chip computer into different places, so as to avoid the interference between the control circuit of the single-chip computer and the drive circuit of the servo motor. Here, the ground is separated by optocoupler devices, and each other is controlled and fed back by light. Normally, interference is caused by insufficient current which causes the light emitting diodes to emit light, so the interference is suppressed. Because of its strong anti-interference ability, long service life, high transmission efficiency, complete isolation of input and output, the optocoupler realizes good protection of equipment. The driving interface circuit with servo motor adopts high-speed optocoupler 6N137 as the driving circuit. The optocoupler has good isolation and can meet the requirements of High-speed Servo motor. With the continuous development of LCD technology and the decreasing price, the LED digital tube display has been gradually replaced by LCD in the design and use of instruments. LCD has the advantages of large amount of display information, lower power consumption and light quality. Here, 12864 LCD is selected as the display output, and the driver chip is ST7920. There are two main ways of keyboard design in single chip computer: direct keyboard and matrix keyboard.
The direct key-press mode is to connect each key to an I/O interface of the single-chip computer separately. The matrix keyboard is judged by the row and column changes of the I/O interface, and multiple keyboards can be realized with fewer keyboards. The number of keys needed in this system is relatively small, thermostatic element and keys can be made into functional keys. So the direct button is adopted here. At the same time, the 485 interface for communication is reserved. If necessary, the extension module can be added in the future. The communication interface can be used to communicate with the host computer. In the software design of MCU, KEIL, as the software development tool of MCU, provides C language environment, and has high code efficiency and fast execution speed. Keil programming environment includes: compiler, assembler, real-time operation system development environment. The main function modules of the software are 12864 driver module, interface menu display module and key module. After the completion of each software module, the whole control process of the servo motor is compiled. In the process of compiling the software of this system, the LCD display is completed first, and after the LCD display is completed, the key program is compiled and debugged at the same time. After compiling the keyboard display program, the control input and output program and the output interface are compiled, mainly for the servo motor’s enablement, left and right limit reset, pulse output and direction output.
At the same time, the alarm signal of the servo motor is read through the optocoupler. The current state of the servo motor, the number of output pulses, whether there is an alarm and other related parameters are displayed on LCD.
The system is mainly composed of C8051F700 single chip computer and LCD display. It uses four keys to control the servo motor. The servo drive circuit consists of nine optocoupler circuits. Through testing, it can simply control the starting and stopping of servo motor, speed regulation and other functions.
The hardware circuit design of the system is simple, the single chip software can complete the control function, the control system is reliable, and has practical value and reference value.