Abstract: This paper discusses in detail the working principle and characteristics of stepper motors and PLC-based motion control technology, focusing on the method of using PLC to achieve single and dual-axis motion control of stepper motors. The results of the system operation are verified through actual tests to demonstrate its reliability, feasibility, and effectiveness.
Keywords: stepper motor; PLC; ladder diagram; drive circuit
Achievement to the motion control on of the single-two axis stepper motor based on PLC CHEN Chan-juan, XUE Kai, CHANG Mei-rong, LI Chun-yi
Abstract: It introduces the principle and characteristics of the step motor and the motion control technology based on PLC. The main of said that the motion control of the single- two axis Step motor based on PLC, and measured prove that it is reliable, feasible and effective.
Key words: Step motor; PLC; Ladder diagram; Driving circuit
1 Introduction
Stepper motors, due to their low rotor inertia, high positioning accuracy, lack of cumulative error, and simple control, have become one of the main actuators in the field of motion control. Stepper motors are key products in mechatronics and are widely used in various automated control systems and mechatronic equipment. With the development of microelectronics and computer technology, the demand for stepper motors is increasing daily, and they will have wide applications in control fields across various industries. PLCs, as industrial control computers, feature modular structures, flexible configurations, high-speed processing, and precise data processing capabilities. PLCs also have excellent control capabilities over stepper motors; by utilizing their high-speed pulse output or motion control functions, stepper motor control can be achieved.
For specific equipment where the movement distance and speed are fixed during operation, using a PLC to control the stepper motor via a driver is an ideal technical solution. This example illustrates the method of using a PLC to control a stepper motor.
2. Working principle and characteristics
A stepper motor is an actuator controlled by electrical pulse signals, which convert these pulses into corresponding angular or linear displacements. Because it is controlled by pulses, the rotor's angular displacement and speed are strictly proportional to the number and frequency of the input pulses. By controlling the number of pulses, the angular displacement is controlled, achieving accurate positioning; by controlling the pulse frequency, the motor's speed and acceleration are controlled, achieving speed regulation; and by changing the energizing sequence, the motor's rotation direction is changed. There are many types of stepper motors. Based on structure, they can be divided into three categories: reactive stepper motors, permanent magnet stepper motors, and hybrid stepper motors. Based on the number of phases, they can be divided into single-phase, two-phase, and multi-phase stepper motors.
2.1 Characteristics of Stepper Motors
(1) The angular displacement of the stepper motor is strictly proportional to the number of input pulses. There is no cumulative error after the motor runs one revolution, and it has good tracking performance.
(2) An open-loop digital control system consisting of a stepper motor and a driver circuit is very simple, inexpensive, and highly reliable. At the same time, it can also be combined with an angle feedback circuit to form a high-performance closed-loop digital control system.
(3) Stepper motors have fast dynamic response and are easy to start, stop, reverse and speed change.
(4) The speed can be smoothly adjusted within a fairly wide range, and large torque can still be obtained at low speeds.
(5) Stepper motors can only operate by being powered by pulse power supply; they cannot be powered by AC or DC power supply directly.
2.2 Control Principles
The highest stepping frequency at which a stepper motor can respond without losing steps is called the "starting frequency." Similarly, the "stopping frequency" refers to the highest stepping frequency at which the stepper motor will not overshoot the target position if the system control signal is suddenly turned off. The motor's starting frequency, stopping frequency, and output torque must all be adapted to the load's rotational inertia. With this data, the stepper motor can be effectively controlled for speed variations.
When using a PLC to control a stepper motor, the system's pulse equivalent, upper limit of pulse frequency, and maximum number of pulses should be calculated using the following formulas to select the appropriate PLC and its corresponding functional modules. The pulse frequency determines the frequency required for high-speed pulse output by the PLC, and the number of pulses determines the PLC's bit width. Pulse equivalent = (stepper motor step angle × pitch) / (360 × transmission speed ratio); Upper limit of pulse frequency = (moving speed × stepper motor microstepping) / pulse equivalent; Maximum number of pulses = (moving distance × stepper motor microstepping) / pulse equivalent.
3. PLC control for single and dual-axis stepper motor motion
3.1 Establishment of the control coordinate system
The first step in controlling a stepper motor using a PLC is to establish a coordinate system, which can be either a relative or absolute coordinate system. The coordinate system is set in the DM6629 word array; bits 00-03 correspond to pulse output 0, and bits 04-07 correspond to pulse output 1. Setting it to 0 indicates a relative coordinate system; setting it to 1 indicates an absolute coordinate system.
3.1.1 For single-phase pulse output without acceleration or deceleration
When the PLC control coordinate system is set to a relative coordinate system, pulses can be output from port 0 and port 1 in an incremental form. The count value of the output pulses is recorded in channels SR229 and SR228 for port 0 and in channels SR231 and SR230 for port 1.
If the output pulse count is set to 00000100, 100 pulses will be output from the port. The pulse count will start from 0 and go up to 100. Pulses can continue to be output from this port, allowing for incremental pulse output. Each time a pulse is output, the pulse count restarts from 0 until the set value is reached. When set to an absolute coordinate system, the output pulse count can be set to a positive number, such as 00000100 (equivalent to the motor rotating 100 steps forward), or a negative number, such as 80000100 (the highest bit is "1" indicating a negative number, equivalent to the motor rotating 100 steps backward). However, since it is a single-phase pulse output, a direction control signal must be added. Output terminals such as 01002 can be used for the direction signal output.
In the absolute coordinate system, the coordinate values are recorded in channels SR229 and SR228 (port 0) and channels SR231 and SR230 (port 1). The number of output pulses each time is the difference between the pulse setting value and the current coordinate value. For example, if the current coordinate value is 0, the output value is set to 00000100, and 100 pulses are output (positive output signal is valid). If the output value is set to 00000100 again, no more pulses are output. If the output value is set to 80000100 again, 200 pulses are output (reverse output signal is valid), and the coordinate value changes from 00000100 to 80000100.
3.1.2
For two-phase pulse output with acceleration and deceleration, incremental pulse output can also be achieved when set to a relative coordinate system. Since the two-phase pulse output can directly control the forward and reverse directions of the motor, the pulse output value can be set to a positive or negative number. The count value of the output pulses is recorded in channels SR229 and SR228 (port 0). For example, if the output pulse count is set to 00000100, the motor will rotate 100 steps in the forward direction, and the pulse count value will count from 00000000 to 00000100. If the output pulse count is then set to 80000100, the motor will rotate 100 steps in the reverse direction, and the pulse count value will count from 80000000 to 80000100. When set to an absolute coordinate system, the coordinate values are recorded in channels SR229 and SR228 (port 0). The coordinate changes are similar to those of a single-phase pulse output, but the forward/reverse pulse output or the pulse in ten directions is completed by the cooperation of ports 01000 and 01001.
3.2 Single-axis operation control
The control wiring and timing for single-axis forward and reverse rotation control with acceleration and deceleration are shown in Figures 1 and 2. Figure 1 uses a two-phase pulse output CW/CCW mode for control.
Control is achieved using a two-phase pulse output CW/CCW method. The PLC control program is shown in Figure 3. The parameters set in the ladder diagram are: DM0010 value 0001, corresponding to an acceleration/deceleration rate of 10Hz/10ms; DM0011 value 0050, corresponding to a target frequency of 500Hz; DM0012 value 0020, corresponding to a starting frequency of 200Hz.
3.3 Dual-axis operation control
3.3.1 Two-Axis Motion Control with Forward and Reverse Directions Two-axis motion control uses one PLC to control two drivers, which in turn drive two stepper motors. The wiring diagram for two-axis motion control with forward and reverse directions is shown in Figure 4.
The PLC control program is shown in Figure 5. In the ladder diagram, when 01002 and 01003 are ON, the motor rotates clockwise, and when they are OFF, the motor rotates counterclockwise.
3.3.2 Two-axis motion control without forward and reverse directions
The wiring diagram for dual-axis motion control without forward and reverse rotation is shown in Figure 6. When a pulse is output, the motor rotates counterclockwise. The difference between this method and Method 1 is that 01002 and 01003 are not used for direction control, as shown in Figure 6.
4. Conclusion
This design utilizes a PLC to implement single-axis and dual-axis motion control of a stepper motor, thus expanding the application of PLCs in stepper motor control. For example, in controlling single-axis and dual-axis motion, parameters such as movement distance, speed, and direction are set on the control panel. The PLC reads these settings, calculates and generates pulse and direction signals to control the stepper motor drive, achieving the purpose of controlling distance, speed, and direction. Practical testing has demonstrated the system's reliability, feasibility, and effectiveness.
References
1. Wang Xiaoming. Single-chip microcomputer control of electric motors [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002.
2 Liu Guangrui. A method for driving stepper motors using programmable logic controllers [J]. Electromechanical Product Development and Innovation, 2005
3 Xuan Caixin. PLC Pulse Control Stepper Motor Technology [J]. Locomotive and Rolling Stock Technology, 2002
4 Gao Qinhe. Programmable Logic Controller Application Technology and Design [J]. Beijing: Posts & Telecom Press, 2004.
5 Liao Changchu. Application Technology of Programmable Logic Controllers [J]. Chongqing: Chongqing University Press, 1998.
6 Wang Yulin, Wang Qiang. Speed Adjustment Method of Stepper Motor [M]. Motors and Control Applications, 2006
7 Wang Yulin. Software pulse distribution for stepper motors [J]. Manufacturing Technology & Machine Tool, 2006
8 He Lijun. MCS-51 System Microcontroller Application System Design [M]. Beijing: People's Posts and Telecommunications Press, 1993.