PLC control servo motor accurate positioning method

In the process of automated production, processing and control, it is often necessary to accurately position and control the size of the processed workpiece or the distance moved by the mechanical equipment. This positioning control only requires the control object to enter the specified position according to the instruction, and there is no special requirement for the speed of the movement, such as point control during the production process (more typical such as horizontal boring machines, coordinate boring machines, CNC machine tools, etc. before cutting processing Tool positioning), positioning control of the conveyor belt in the storage system, axis positioning control of the manipulator, etc. Servo motors such as AC asynchronous motors or stepper motors are often used as drive or control elements in positioning control systems. The key to achieving positioning control is the control of the servo motor. As programmable controller (PLC) is an industrial control computer specially designed for application in industrial environment, it has obvious advantages such as strong anti-interference ability, extremely high reliability, small size, etc. It is the ideal control to achieve mechatronics Device. This article aims to explain the method of using PLC to control the servo motor to achieve accurate positioning, introduce some problems that need to be recognized and solved in the design and implementation of the control system, and give the control system reference plan and the design ideas of the hardware and software structure. For industrial production The realization of positioning control has high practical and reference value.

1 Using PLC's high-speed counter instructions and rotary encoder to control three-phase AC asynchronous motor to achieve accurate positioning

1.1 Working principle of the system

The coordinated use of PLC's high-speed counter instructions and encoders enables precise positioning and length measurement in modern industrial production automatic control. At present, most PLCs have high-speed counter functions. For example, Siemens S7-200 series CPU226 PLC has 6 high-speed counters. The high-speed counter can accurately count high-speed pulses with a pulse width less than the scan period of the PLC host, and can handle pulse signals with frequencies up to tens or hundreds of kHz without adding special functional units. The rotary encoder can convert the angular displacement on the motor shaft into a pulse value.

The precise positioning control system realized by using the PLC's high-speed counter instruction and encoder to control the three-phase AC asynchronous motor. Its principle is to convert the motor's angular displacement into a pulse value through a photoelectric rotary encoder coaxially connected to the motor. Via the PLC's high-speed counter To count the number of pulses sent by the encoder to achieve positioning control.

1.2 Design and implementation

Take the positioning control design of the transmission belt as an example. It is now necessary to use a conveyor belt to transport the goods. The distance from the starting point of the goods to the specified position (end point) is 10 cm. It is required that when the goods on the conveyor belt run 10 cm, the conveyor belt motor stops running. The system hardware settings mainly include Siemens S7-200CPU226 PLC, transmission belt motor (three-phase AC asynchronous motor), OMRON's E6A2-CW5W photoelectric rotary encoder, Panasonic VFO series BFV00042GK inverter, etc. The working principle of the system is to coaxially connect the mechanical shaft of the photoelectric encoder and the drive roller (drag by the three-phase AC asynchronous motor), drive the mechanical shaft of the photoelectric encoder through the drive roller to rotate, output pulse signals, and use the high-speed counter of the PLC The instruction counts the number of pulses (A-phase pulses) generated by the encoder. When the current value of the high-speed counter is equal to the preset value, an interrupt is generated, and the motor is stopped by the inverter control, thereby achieving accurate positioning control of the running distance of the conveyor belt. . Obviously, the key to achieving accurate positioning control in this control system is to set the preset value of the PLC's high-speed counter, which is the number of pulses generated by the photoelectric encoder when the conveyor belt runs 10 cm. The pulse value is related to parameters such as the running distance of the conveyor belt, the number of pulses per revolution of the photoelectric encoder, and the diameter of the driving roller. The number of pulses can be measured experimentally or calculated. The calculated pulse number corresponding to 10 cm of the conveyor belt is:

Number of pulses = [(diameter of drive roller (mm) & TImes; π ÷ (number of pulses / revolution)] & TImes; running distance of conveyor belt (mm)

The system calculates that the number of pulses is 100, and the preset value of the high-speed counter is 100. The reference program is shown in Figure 1.

In the subroutine, set the high-speed counter HSC0 to mode 1, which is a single pulse input up / down counter controlled by internal direction. No start input, use reset input. When the system starts to run, call the subroutine HSC_INIT, whose purpose is to initialize HSC0, set its control byte SMB37 data to 16 # F8, write the current value and preset value to the high-speed counter, and interrupt the event by interrupting the connection command ATCH 12 (that is, the current value of the high-speed counter is equal to the preset value interrupt) is connected to the interrupt service program COUNT_EQ, and executes the ENI instruction to globally open the interrupt. When the current value of the high-speed counter is equal to the preset value, execute the interrupt service routine, clear the value of SMD42, execute the HSC instruction again to rewrite the current value and the preset value to the high-speed counter, and at the same time set M0.0, the motor Stop running.

Shenzhen LINX Technology Co., Ltd, a headphone manufacturing and trading combo, owns many styles of Creative Headphones and fashionable headphones, and constantly provides the latest headphones, novelty headphones, creative headphones, support OEM and ODM customized headphones. If you need to customize creative wired headphones or wireless headphones, please feel free to contact us.

Creative Earphone

Creative Earphones

Headphones With Mic,Cartoon Earphone,Creative Headphones,Creative Earphones

Shenzhen Linx Technology Co., Ltd. , https://www.linxheadphone.com