Fast and precise positioning control of stepper motor by PLC - News - Global IC Trade Starts Here Free Join

Single chip microcomputer STM32L151CCU6
KT2520K26000DCW28QAS import spot
RF cable can be customized for other specifications
Photocoupler

A stepper motor is an actuator that converts electrical pulses into angular displacement. When the stepper driver receives a pulse signal, it drives the stepper motor to rotate in a set direction by a fixed angle (called "step angle"), and its rotation runs at a fixed angle. The angular displacement can be controlled by the number of control pulses to achieve accurate positioning. At the same time, the speed and acceleration of the motor can be controlled by controlling the pulse frequency to achieve the purpose of speed regulation. As a special motor for control, stepper motor is widely used in various open-loop control because it has no accumulated error (100% accuracy).
1 Positioning principle and scheme 1.1 Stepping motor acceleration and deceleration control principle When the stepper motor drive actuator moves from one position to another, it will experience the speed increase, constant speed and deceleration process. When the running frequency of the stepping motor is lower than its own starting frequency, it can be started directly with the running frequency and run at this frequency. When it needs to stop, it can be directly reduced from the operating frequency to zero speed. When the stepping motor running frequency fb>fa (starting frequency when starting the load), if the frequency is started directly with the fb frequency, the stepping motor will be out of step or even blocked. Also, when suddenly stopping at the fb frequency, the stepping motor will overshoot due to the inertia, which affects the positioning accuracy. If the speed is very slow, the stepper motor will not cause out-of-step and overshoot, but it will affect the efficiency of the actuator. Therefore, the stepping motor acceleration and deceleration must be guaranteed to move to the specified position with the fastest speed (or the shortest time) without losing the step and overshoot.
There are two kinds of commonly used lifting frequency control methods for stepping motors: linear lifting frequency (Fig. 1) and exponential curve lifting frequency (Fig. 2). The exponential curve method has strong tracking ability, but the balance is poor when the speed changes greatly. The straight line method has good smoothness and is suitable for fast positioning methods with large speed changes. With a constant acceleration and lowering, the law is concise, and it is relatively simple to implement with software. This method is adopted in this paper.

1.2 Positioning scheme To ensure the positioning accuracy of the system, the pulse equivalent, that is, the distance moved by the stepping motor to a step angle can not be too large, and the stepping motor should be slow to prevent the occurrence of out-of-step or overshoot. But these two factors together bring up a prominent problem: the positioning time is too long, affecting the efficiency of the actuator. Therefore, in order to obtain a high positioning speed and at the same time to ensure the positioning accuracy, the entire positioning process can be divided into two stages: a coarse positioning stage and a fine positioning stage. In the coarse positioning stage, a larger pulse equivalent is used, such as 0.1 mm/step or 1 mm/step, or even higher. In the fine positioning stage, in order to ensure the positioning accuracy, a smaller pulse equivalent is used, such as 0.01 mm/step. Although the pulse equivalent becomes small, since the fine positioning stroke is short (can be set to about one-fifth of the full stroke), the positioning speed is not affected. To achieve this, the mechanical aspects can be achieved by using different shifting mechanisms.
Industrial machine tool control plays an important role in industrial automation control, and positioning drilling is a common step. Set the tool or workbench to move from point A to point C, known as AC=200mm, divide AC into two sections AB and BC, AB=196mm, BC=4mm, AB section is coarse positioning stroke, adopt 0.1mm/step The pulse equivalent is rapidly moved according to the linear lifting frequency law, and the BC segment is a fine positioning stroke. The pulse equivalent of 0.01 mm/step is used to accurately position the low-frequency constant velocity movement at point B. At the same time as the coarse positioning ends and the fine positioning is completed, the plc automatically realizes the replacement of the shifting mechanism.
2 positioning program design 2.1 PLC pulse output command The current advanced PLC not only has the basic logic instructions to meet the sequence control requirements, but also provides a wealth of functional instructions. The PLUS command of the Siemens S7-200 series PLC outputs PTO or PWM high-speed pulses at Q0.0 and Q0.1 with a maximum output frequency of 20KHz. The pulse train (PTO) provides a square wave output (50% duty cycle), user control period and number of pulses. Pulse Width Modulated (PWM) ketones provide continuous, variable duty cycle output, user control period and pulse width. In this paper, the multi-stage pipeline working mode of PTO is used to realize coarse positioning, and the single-stage pipeline mode of PTO realizes fine positioning.
In the above example, it is assumed that the starting and ending frequencies of the motor are 2 kHz and the maximum pulse frequency is 10 kHz. In the coarse positioning process, the up-conversion acceleration is completed with 200 pulses, and the down-conversion is completed with 400 pulses. When using the PTO multi-segment pipeline pulse output of the PLC, use the following formula to calculate the pulse increment value during the ramp-up process.
Cycle increment for a given segment = (ECT - ICT) / Q
Where: ECT = the end cycle time of the segment ICT = the initial cycle time of the segment Using this formula, the acceleration portion (1st segment) cycle increment is 2, and the deceleration portion (3rd segment) cycle increment is 1. Since the second segment is the constant velocity portion, the cycle increment is zero. If the PTO envelope table is stored from VB500, Table 1 is the envelope table value of the above example.
2.2 source program / / main program LD SM0.1 / / first scan is 1
R Q0.0,1 //Reset image register bit CALL 0 //Invoke subroutine 0, initialize the coarse positioning related parameter LD M0.0 //Rough positioning complete R Q0.0,1
CALL 1 //call subroutine 1, initialize fine positioning related parameters // subroutine 0, coarse positioning LD SM0.0
MOVB 16#A0, SMB67 //Set control word: Allow PTO operation, select ms increment, select multi-stage operation MOVW 500, SMW168 //Specify the starting address of the envelope table as V500
MOVB 3, VB500 //Set the number of envelope segments to be 3
MOVW 500, VW501 //Set the initial period of the first segment to 500ms
MOVW -2, VD503 //Set the first period increment to -2ms
MOVD 200, VD505 //Set the number of pulses in the first segment to 200
MOVW 100, VW509 //Set the initial period of the second segment to 100ms
MOVW 0, VD511 //Set the second period increment to 0ms
MOVD 1360, VD513 //Set the number of pulses in the second segment to 1360
MOVW 100, VW517 //Set the initial period of the third segment to 100ms
MOVW 1, VD519 //Set the third period increment to 1ms
MOVD 400, VD521 //Set the number of pulses in the third segment to 400
ATCH 2,19 //Define interrupt program 2Process PTO completion interrupt ENI //Allow interrupt PLS 0 //Start PTO operation ///Procedure 1, fine positioning LD SM0.0 //First scan is 1
MOVB 16#8D, SMB67 //Allow PTO function, select ms increment, set pulse number and period MOVW 500, SMW68 //Set fine positioning period to 500ms
MOVD 400, SMD72 //Set the number of pulses to 400
ATCH 3,19 //Define interrupt program 3Process PTO completion interrupt ENI //Allow interrupt PLS 0 //Start PTO operation // interrupt program 2
LD SM0.0 //Always 1
= M0.0 //Start fine positioning//interrupt program 3
LD SM0.0 //Always 1
= M0.1 //implement other functions

CBD Products

Cbd Vape Products Oem,D8 Vape Pen Oem,Cbd Disposable Vape Pen Oem,China Cbd Vape Products Oem

Shenzhen MASON VAP Technology Co., Ltd. , https://www.disposablevapepenfactory.com