Different motion tasks can be completed by selecting different running modes, and selecting a suitable motion mode can make the debugging work more than half easier. When the PMC007CX motor controller drives the motor, it can use position mode, speed mode, pp mode, pv mode, pvt mode, analog positioning, analog speed regulation, synchronous positioning and other working modes. This article will introduce you to the setting methods of the previous working modes.
1.Position mode
In position mode, after setting the running speed and movement direction, give the corresponding running step number command, it will move to the specified movement position, so the parameters that need to be set are start speed, stop speed, acceleration coefficient, deceleration coefficient, maximum speed, Movement direction, step command (relative or absolute), start-stop speed and acceleration/deceleration coefficient have default values, and all parameters can be saved after power off.
Maximum speed, movement direction, step command (relative or absolute) need to be set for each movement. The movement accuracy of the position mode is high, and the acceleration and deceleration gears can be set to accelerate to the maximum speed in the way of 's' curve acceleration. Because the acceleration and deceleration are gear settings, the acceleration and deceleration cannot be precisely adjusted, so in the task of high-speed operation, there will be emergency stop and emergency start. It is necessary to debug the equipment or parameters according to the load situation to avoid the influence of errors caused by inertial jitter. When the motor is running, the controller will be in the busy state, and the running command will be ignored at this time. When the error state and other bits in the controller state (except the pvt status bit) are valid, they need to be cleared before starting. Step instruction.
2. Speed mode
After setting to the speed mode, set the running speed, unless the limit is triggered or the step command is stopped or the speed mode is exited, the motor will continue to rotate at the running speed. During the running, the running direction can be changed by setting the running speed (positive). The sign is positive, the negative sign is reverse) and the speed can be adjusted without pausing the movement.
The speed mode and the position mode share the parameter register, and the parameters to be set are start speed, stop speed, acceleration coefficient, deceleration coefficient, and maximum speed. Among them, the start-stop speed and acceleration and deceleration coefficients have default values, and the parameters can be saved after power off.
The speed mode is simple to set, stable in operation, and convenient for long-distance variable-speed movement. Because the acceleration and deceleration are gear settings, if the direction is directly changed during high-speed operation, it will cause a stall, and the speed setting needs to be adjusted according to the actual operation.
3. pp mode
The full name of PP mode is Profile Position Mode. This working mode adopts trapezoidal acceleration and deceleration (uniform acceleration to the maximum speed or uniform deceleration to 0).After the stepping motion task is set, the task startup mode is controlled by sending the control word. It can also send the control word during the movement to formulate the next task (the current task is completed and then start the next task) or directly execute the next task.
Therefore, the pp mode can make the task run more smoothly and smoothly, and can avoid entering the vulgar crawling area formed by the resonance of the motor.The control is also smoother when starting and stopping, so that there is no vibration (jitter) phenomenon of emergency stop and emergency start. The better the task parameters are set, the more complex stepping tasks can be performed.The operating parameters of the pp mode are different from the registers of the position mode, and the start speed, stop speed, acceleration, deceleration, running speed, target position, control word, and status word can be set independently. The acceleration and deceleration set here are all set in pps/s parameters, so the acceleration and deceleration can be set and adjusted by yourself, which can control the speed of start and stop, and the operation is smoother. The same as the position mode, the start and stop speed and acceleration and deceleration have default values, and the parameters can be saved after power off.Enter the maximum speed, the step command will set the current task, but the motor will not run after the step command is input, and the motor will only run after sending the control word to execute the current task.
The control word is 4 digits in hexadecimal, and each digit is 4 bits, which is represented by 8421 code. According to the function, the corresponding position is set to zero or 1, and then the command is written in hexadecimal.The left is the high bit and the right is the low bit, so there are 32 bits in total from left to right, counting from 0, the leftmost is the 15th bit, and the rightmost is the 0th bit.The 4th bit is the control to start the running task, its value is converted from 0 to 1, and the running task is executed.The 5th bit is to execute the task immediately, its value is converted from 0 to 1, the running task will be stopped, and the set current task will be executed immediately.The 6th bit is to control the absolute movement mode, its value is 0, the movement mode is relative operation, its value is 1, and the absolute operation command will be executed. Bits that do not have a function set in the manual default to 0.For example: set the current task as absolute displacement, this command only involves the value of the 4th and 6th bits, and all other bits are 0 by default, so bit0-3, bit8-11, bit12-15 are all 0000, which means the first The first, third, and fourth bits are all 0. Set the 4th and 6th bits to 1, and bit5 and bit7 to 0 according to the needs of the task, so the second bit is represented as 0101, that is, the control word command is 0050.If it is the immediate current task, it is relative motion. Then according to the requirements, it is the 4th bit, the 5th bit is set to 1, and the rest are 0, so the second bit is 0011, that is, 3, the first, third, and fourth bits are 0, so the control word command is 0030.
4. pv mode
The full name of pv mode is Profile Velocity Mode, which also uses trapezoidal acceleration and deceleration to run, and shares parameters such as start-stop speed, acceleration and deceleration, and running speed with pp mode.
After setting to enter the pv mode, set the running speed, unless the limit is triggered or the step command is stopped or the pv mode is exited, the motor will continue to rotate according to the running speed, and the running direction can be changed by setting the running speed during operation ( Positive sign forward, negative sign reverse) and adjust the speed, no need to pause the movement to set the parameters.
Because the acceleration and deceleration are controllable and the movement is uniform acceleration and deceleration, it is more convenient to calculate the running time, and changing the running direction during high-speed operation will not cause stalling.
Q: What is the difference between relative motion and absolute motion?
Answer: Both are based on the current position of the motor. Relative motion is based on the current position and then runs the specified number of steps. The absolute movement is to calculate the movement direction according to the current position and move to the specified positionQ: Why I set the parameters of pp mode, but the motor does not move?
Answer: In pp mode, in addition to the basic parameters, there are control words and status words to control the function of starting the motion task. Referring to the above explanation, it can be seen that the bits of the control word are set correctly.
Q: In the position mode setting, the operation is very slow, like crawling, what is the matter that does not match the setting parameters?
Answer: Slow crawling means that during the acceleration process of the motor, the acceleration just enters the resonance area of the motor, resulting in crawling. You can change the subdivision, acceleration coefficient, avoid accelerating to that area during acceleration, or choose pp mode, which can also be avoided by setting the acceleration value.
Q: The motion command I set is different from the actual one. Under the condition of 32 microstepping, running 40000 is 10 laps, isn't it only 6.25 laps?
Answer: According to different accessories, the precision of motor operation is different. In the case of open loop, only the controller, then the precision is influenced by the subdivision and the step foot, and the two-phase motor with 32 subdivisions is 6400 pulses per revolution. The closed loop is calculated according to the accuracy of the encoder. If a closed-loop incremental integrated stepper motor is used and a 1000-line encoder is used, then it is 4000 pulses per turn. Similarly, if it is a single-multi-turn integrated machine, it is also determined according to the accuracy of the single-multi-turn encoder. If it is 12 bits, it is 2^12 or 4096 pulses per turn.