Previously, Zheng Motion Technology shared with everyone the firmware upgrade of motion controllers, ZBasic program development, ZPLC program development, application of communication with touch screens and input/output IO, application of motion controller data and storage, use of motion controller ZCAN and EtherCAT bus, application of oscilloscopes, characteristics of multi-tasking operation, application of motion controller interrupts, use of USB flash drive interface, use of ZDevelop programming software, and basic axis parameters and basic motion control commands of motion controllers.
Today, we will explain the motion buffer of the positive motion technology motion controller.
Video Tutorial: Introduction to Motion Controller Motion Buffering
The following is a detailed explanation with pictures and text.
01 Material Preparation and Wiring Reference
02 Motion Cushioning
1. Principle of motion cushioning
To prevent program blocking when executing motion commands, the controller provides a buffer to store the motion buffer queue that enters the motion buffer. This function is called motion buffering, so that the program can scan downwards normally without blocking.
The ZMotion motion controller has multi-level motion buffers. When the motion buffer is enabled, when the program scans and recognizes the first motion command of the program task, it assigns the motion command to the motion buffer of the specified axis and the motor starts to move. At this time, the program continues to scan down to the second motion command and stores it in the motion buffer. While continuously scanning and storing motion commands, the program retrieves motion commands from the motion buffer in sequence for execution.
MTYPE and NTYPE are the currently running motion instruction and the first buffered motion instruction, respectively.
Any motion instruction in a program can enter the motion buffer of any axis, specified by the axis number.
Each axis's motion buffer is independent and does not interfere with others.
When buffering multiple motion instructions, to determine which instruction the current motion is executing, the `MOVE_MARK` instruction and the `MOVE_CURMARK` instruction for the current motion instruction are provided. The `MOVE_MARK` instruction is incremented by 1 for each motion instruction scanned; the `MOVE_CURMARK` instruction is the current motion instruction number, indicating which motion instruction the current motion is currently executing, and is decremented by 1 after all motion instructions are completed.
After the current motion is completed, the next motion in the motion buffer will be executed automatically. After all motion instructions have been executed, the motion buffer will be empty, or you can use the CANCEL/RAPIDSTOP command to clear the motion buffer.
SP commands are also motion commands. When using SP motion commands (such as MOVESP, MOVECIRCSP, etc., which are simply SP added after the motion command), the SP speeds FORCE_SPEED, ENDMOVE_SPEED, and STRATMOVE_SPEED will be written to the motion buffer along with the SP motion command.
The difference between SP motion commands and motion commands:
The speed of MOVE(100) is SPEED=100, and the speed of MOVESP(100) is FORCE_SPEED=200.
2. Motion buffer zone blockage
The motion buffer space for each axis is limited. When too many motion commands are scanned and placed into the motion buffer, the multi-level motion buffer will be completely filled. If the program continues to scan more motion commands, the program will also be blocked until the motion commands are completed and exited in sequence, and the motion buffer has space, at which point the motion commands will continue to enter the motion buffer.
For example, taking the V3.10 version emulator as an example, the default is 4096 motion buffers. The example program in the figure below shows that the motion buffer of this controller can store a maximum of 459 circular interpolation instructions. After downloading the program, the value of i is printed as 458, indicating that the current FOR loop has not been completed and the program is blocked.
In the diagram below, after some motion instructions are retrieved from the motion buffer and executed, the buffer has space. The FOR loop continues execution and stores motion instructions into the motion buffer. After the instruction execution exits the motion buffer, new motion instructions are stored into the motion buffer one by one, as long as there is enough space in the motion buffer.
Each axis's motion buffer is independent and does not interfere with others. The buffer sizes are the same. The number of remaining available buffers for a particular axis can be viewed using the command REMAIN_BUFFER(MTYPE) AXIS(n).
The ZMC4 series motion controllers support up to 4096 motion buffer segments per axis (the number of buffers varies between different controller models; please refer to the controller hardware manual or use ?*max to print for details). The LIMIT_BUFFERED motion buffer limit can be manually set.
Different motion commands require different amounts of buffer space; the more complex the motion, the more buffer space it requires.
For example:
The ZMC432 controller has a motion buffer size of 4096. The number of MOVE linear interpolation instructions and MOVECIRC circular interpolation instructions that can be buffered at one time are different.
The interpolation motion buffer is located in the motion buffer of the main axis.
3. Motion cushioning routine
RAPIDSTOP(2)
WAIT IDLE(0)
WAIT IDLE(1)
BASE(0,1)
ATYPE=1,1
UNITS=100,100
SPEED=100,100
ACCEL=1000,1000
DECEL=1000,1000
DPOS=0,0
MERGE=OFF 'Disable continuous interpolation'
TRIGGER
LIMIT_BUFFERED=3 'Sets the number of motion commands that the motion buffer on axis 0/1 can buffer to 3.
MOVE(60,40 'Enter MTYPE, Buffer0)
MOVE(70,50) 'Enter NTYPE, Buffer1
MOVE(50,40) 'Buffer2
MOVE(60,50) 'Buffer is full, do not enter for now'
"Current number of buffered instructions for axis 0=" MOVES_BUFFERED(0) 'Result 2
? "Number of remaining buffers for axis 0=" REMAIN_BUFFER(1) AXIS(0) 'Result 0
? "Number of remaining buffers for axis 1=" REMAIN_BUFFER(1) AXIS(1) 'Result 3
END
The number of motion commands that the axis's motion buffer can buffer is limited to 3. At this time, the motion buffer can hold a maximum of 3 linear interpolation commands.
There are a total of 4 linear interpolation instructions. MOVE(60,40) occupies the MTYPE of axis 0. Axis 0 can still buffer 2 motion instructions. The remaining buffer count of axis 0 is 0. There is also 1 linear instruction that has not yet entered the motion buffer because the motion buffer of the main spindle axis 0 is full.
Only after MOVE(60,40) completes its motion can MOVE(60,50) enter the motion buffer of axis 0.
The interpolation motion buffer is located in axis 0 of the main spindle, therefore the motion buffer for axis 1 has no instructions, leaving a buffer size of 3. Each MOVE instruction occupies one buffer space.
4. Difference between normal output and output in motion buffer
When a normal output instruction is detected by the program, it will be executed and output.
After the program scans, the output instruction in the motion buffer is stored in the motion buffer. The motion buffer retrieves instructions in a first-in-first-out order and executes them one by one. The output instruction will only be executed when it is retrieved.
RAPIDSTOP( 2 )
WAIT IDLE( 0 )
BASE( 0 ) 'Select axis 0'
DPOS=0
UNITS=100 'Pulse Equivalent'
SPEED = 100
ACCEL=1000 'Acceleration'
DECEL= 1000 'Deceleration'
TRIGGER 'Trigger Oscilloscope Sampling'
OP( 0 , 3 , $ 0 ) 'Close output ports 0-3
DELAY(1000) 'Delay'
MOVE( 100 )
MOVE_OP( 1 , ON) 'Output from motion buffer'
OP(0,ON) 'Normal output
Example execution result: After a 1-second delay, the program scans for the OP instruction, and output port 0 is immediately executed and output.
MOVE_OP fills the motion buffer with IO operation instructions, so output port 1 will only output after MOVE(100) has finished running.
03 Motion cushioning related instructions
1. MOVE_OP -- Buffered output
Syntax: MOVE_OP (output number, output status)
This instruction enters the motion buffer along with other motion instructions. It is only executed when the OP output is taken out of the motion buffer. It can control a single output port to output a signal, or it can output in batches without interrupting the continuity of the interpolation motion.
BASE(0)
ATYPE=1
UNITS=100
DPOS=0
SPEED=100
ACCEL=1000
DECEL=1000
MERGE=ON 'Enable continuous interpolation'
TRIGGER Auto Trigger Oscilloscope
OP(0,3,0) 'Close output ports 0-3'
MOVE(100)
MOVE_OP (0, ON) 'Wait for the previous motion to complete, then output a signal at OUT0.
MOVE(100)
MOVE_OP (0,OFF) 'Wait for the previous motion to complete, then turn off the OUT0 signal.'
MOVE_OP(1,3,5) 'Batch output, OUT1 and OUT3 output signals, OUT2 does not output, OUT5 corresponds to binary 101.
Example execution effect: The motion instructions in lines 11-15 are stored in the motion buffer and executed in a first-in-first-out order. After MOVE(100) finishes, MOVE_OP operation outputs OUT0, and the second MOVE(100) is executed. Then MOVE_OP operation closes OUT0, and then controls OUT1-3 to output in batches.
2. MOVE_OP2 -- Buffered output 2
Syntax: MOVE_OP2(output_number, output_status, number of milliseconds after output)
Add an output port operation to the BASE axis motion buffer, and the output state will be flipped after a specified time.
This instruction enters the motion buffer along with other motion instructions. It is only executed when the OP output is taken out of the motion buffer. The output is maintained for a certain period of time and then turned off.
Only one pulse output is supported per axis at a time. The second MOVE_OP2 instruction will automatically shut down the pulse of the previous instruction. This will not interrupt the continuity of the interpolation motion.
RAPIDSTOP(2)
WAIT IDLE(0)
BASE(0)
ATYPE=1
UNITS=100
DPOS=0
SPEED=200
ACCEL=1000
DECEL=1000
MERGE=ON 'Enable continuous interpolation'
OP(0,OFF) 'Close OUT0 port'
TRIGGER Auto Trigger Oscilloscope
MOVE(500)
MOVE_OP2 (0,ON,1000) 'Wait for the previous motion to complete. Output port 0 will remain open for 1 second and then close. Outputting will not hinder the execution of the next motion.
MOVE(-300)
3. MOVE_DELAY -- Buffer delay
Syntax: MOVE_DELAY(delay in milliseconds)
A delay is added to the BASE axis motion buffer.
This instruction buffer does not perform any movement during execution; it only delays for a specified time.
The delay causes the speed to automatically drop to zero when the preceding motion command ends, disrupting the continuity of the interpolated motion.
RAPIDSTOP( 2 )
WAIT IDLE( 0 )
BASE( 0 )
ATYPE = 1
UNITS = 100
SPEED= 100
ACCEL= 1000
DECEL= 1000
DPOS= 0
MERGE=ON 'Enable continuous interpolation'
TRIGGER Auto Trigger Oscilloscope
MOVE( 100 )
MOVE_DELAY( 500 ) 'Wait 500ms between two MOVEs.
MOVE(200)
4. MOVE_AOUT -- Buffered output analog signal
Syntax: MOVE_AOUT(DA_number, output_value)
Add an AOUT instruction to the BASE axis motion buffer.
This instruction buffer does not perform any movement during execution; it only modifies the AOUT value and does not interrupt the continuity of the interpolation movement.
// example
RAPIDSTOP(2)
WAIT IDLE(0)
BASE(0)
ATYPE=1
UNITS=100
SPEED=100
ACCEL=1000
DECEL=1000
DPOS=0
MERGE=ON 'Enable continuous interpolation'
AOUT(0)=0 'Assign a value of 0 to channel DA0'
TRIGGER Auto Trigger Oscilloscope
MOVE(200)
MOVE_AOUT(0, 30.5) 'After the first motion is completed, assign the value 30.5 to channel DA0.
MOVE(200)
5. MOVE_PAUSE — Movement pause
Pause axis movement is only effective during single-axis or multi-axis interpolation movement; when multiple axes are linked, all axes will pause.
You can use AXISSTATUS to check if there is a pause; the IDLE status of the paused axis is 0.
Calling this instruction will produce a warning output when the axis is paused or no longer in motion, but it will not affect program execution. Some motions do not support pausing, such as VMOVE and synchronous motion instructions.
Syntax: MOVE_PAUSE(mode value)
Example of mode value 0: The execution effect of MOVE_PAUSE(3) is similar to that of MOVE_PAUSE(0).
RAPIDSTOP(2)
WAIT IDLE(0)
BASE(0)
ATYPE=1
UNITS=100
SPEED=100
ACCEL=1000
DECEL=1000
DPOS=0
MERGE=ON 'Enable continuous interpolation'
MOVE(100) 'Current motion'
MOVE(200)
MOVE_PAUSE(0) 'Pause the current motion'
DELAY (1000)
?DPOS(0) 'Print result: 0, at this time the current motion only ran for a very short time, and stopped directly when MOVE_PAUSE was detected.
Example of mode value 1: Mode 2 has a similar effect to mode 1 when the motion label MOVE_MARK is automatically numbered, because the label of each motion is different. After a motion instruction is completed, the motion label changes, MOVE_MARK(2) takes effect, and the motion is immediately paused.
Mode 2 differs from Mode 1 only when MOVE_MARK is manually set.
RAPIDSTOP( 2 )
WAIT IDLE( 0 )
BASE( 0 )
ATYPE = 1
UNITS = 100
SPEED= 100
ACCEL= 1000
DECEL= 1000
DPOS= 0
MERGE=ON 'Enable continuous interpolation'
TRIGGER Auto Trigger Oscilloscope
MOVE( 100 ) 'Current motion'
MOVE( 200 )
MOVE_PAUSE(1) 'Pause after the current motion has finished running.'
DELAY ( 2000 )
?DPOS(0) 'Print result: 100
MOVE_PAUSE(1) or MOVE_PAUSE(2)
Example of mode value 2: Manually set MOVE_MARK, and pause at different boundaries of MARK using the MOVE_PAUSE(2) instruction.
BASE(0)
ATYPE=1
UNITS=100
DPOS=0
SPEED=100
ACCEL=1000
DECEL=1000
MERGE=ON
TRIGGER
MOVE_MARK = 1 'Set to label 1
MOVE(100)
MOVE_MARK = 1 'Set to label 1
MOVE(150)
MOVE_MARK = 2 'Set to label 2
MOVE(200)
MOVE_PAUSE (2) 'Pause when labels are different'
DELAY (5000)
?DPOS(0) 'Print result: 250
MOVE_PAUSE(2)
6. MOVE_RESUME -- Exercise Recovery
When the BASE axis pauses, it resumes motion from the pause point.
You can check if there is a pause using AXISSTATUS. If AXISSTATUS shows 800000h, it means that the axis has entered a paused state.
BASE( 0 )
ATYPE = 1
UNITS = 100
DPOS= 0
SPEED= 100
ACCEL= 1000
DECEL= 1000
MERGE=ON
TRIGGER
MOVE( 100 ) 'Current motion'
MOVE(200) 'Buffered motion'
MOVE_PAUSE( 1 ) 'Pause after the current motion is complete
DELAY(2000) 'Waiting for the current motion to complete'
?DPOS( 0 ) 'Print result: 100
MOVE_RESUME 'Continue running
WAIT IDLE( 0 )
?DPOS( 0 ) 'Print result: 300
7. MOVE_TABLE -- Buffered output TABLE
Add the BASE axis motion buffer to a TABLE.
The instruction buffer does not move during execution; it only modifies the TABLE and does not interrupt the continuity of the interpolation process.
Syntax: MOVE_TABLE(TABLE_number, value to be modified)
BASE(0)
ATYPE=1
UNITS=100
DPOS=0
SPEED=100
ACCEL=1000
DECEL=1000
MERGE=ON
TABLE(0)=0 'Initial value set to 0'
TRIGGER Auto Trigger Oscilloscope
MOVE(100)
MOVE_TABLE(0, 60) 'After the motion is complete, TABLE(0) is assigned the value 60.
MOVE(160)
WAIT IDLE(0)
?TABLE(0) 'Prints the modified value of TABLE(0). The output is 60.
After axis 0 moves 100, TABLE(0) is assigned the value 60.
8. MOVE_PARA -- Buffer parameter
Modify the parameters for BASE axis motion buffer.
This instruction buffer does not perform any movement during execution; it only modifies parameters and does not interrupt the continuity of the interpolation movement.
Syntax: MOVE_PARA(parameter name, parameter number, parameter value)
The parameter name must be a non-read-only parameter within the ?*set.
RAPIDSTOP(2)
WAIT IDLE(0)
BASE(0)
ATYPE=1
UNITS=100
SPEED=100 'Initial velocity
ACCEL=1000
DECEL=1000
DPOS=0
MERGE=ON 'Enable continuous interpolation'
TRIGGER Auto Trigger Oscilloscope
MOVE(200) 'Speed 100'
MOVE_PARA(SPEED,0,200) 'Modifies the SPEED parameter value of axis 0 to 200
MOVE(200) 'Speed 200'
WAIT IDLE(0) 'Wait for axis 0 to stop
SPEED 'Print result: 200'
9. MOVE_PWM -- Buffered PWM
BASE axis motion buffer operation PWM.
The instruction buffer does not perform any motion during execution; it only operates the PWM.
PWM can only be turned off by setting the duty cycle to 0, not by setting the PWM frequency to 0. The PWM frequency must be adjusted before PWM is turned on.
Syntax: MOVE_PWM(number, duty cycle[, frequency])
The number indicates the output port number that supports PWM functionality; please refer to the hardware manual for confirmation.
Duty cycle refers to the proportion of the active level in the entire cycle; the range is 0-1, and setting it to 0 disables PWM; in one cycle, the active level is output first, followed by the inactive level.
The default frequency is 1kHz, the maximum hardware frequency is 1MHz, and the maximum software frequency is 2kHz.
RAPIDSTOP( 2 )
WAIT IDLE( 0 )
MOVE_PWM( 0, 0, 1000 ) 'Turn off PWM
BASE(0)
ATYPE=1
UNITS=100
SPEED=100 'Initial velocity
ACCEL= 1000
DECEL= 1000
DPOS= 0
TICKS = 10000
MOVE( 10 )
MOVE_PWM( 0, 0.111, 200 0 ) 'When axis 0 reaches axis 10, operate PWM0 to output.
MOVE_DELAY(100)
MOVE_PWM(0, 0.555, 3000) 'Delay 100 ms, modify PWM0 output
MOVE( 20 )
MOVE_PWM( 0, 0, 1000 ) 'Turn off PWM
WHILE NOT IDLE(0) 'Exits the while loop after IDLE( 0 ) = -1'
? -TICKS,PWM_DUTY( 0 ),PWM_FREQ( 0 )
DELAY ( 30 )
WEND
Example execution effect: Initialize and turn off PWM output. After MOVE(10) completes, operate PWM0 output. After holding for 100ms, modify the duty cycle and frequency of PWM0 output. Then run MOVE(20) and turn off PWM output. When the WHILE loop is running on axis 0, print the duty cycle and frequency of PWM output every 30ms. After axis 0 stops, exit the WHILE loop and stop printing.
10. MOVE_SYNMOVE -- Buffer triggers other axes
The BASE axis motion buffer triggers other axis motions, and the current axis waits until the other axis motions are complete before continuing its motion.
Syntax: MOVE_SYNMOVE(axisnum, dis[, ifsp])
axisnum: The axis number that needs to be synchronized.
dis: relative distance of motion
ifsp: Whether to use SP motion. The default value is 0, which means not to use it. Set it to other values to use it.
RAPIDSTOP( 2 )
WAIT IDLE( 0 )
WAIT IDLE( 1 )
BASE( 0,1 )
DPOS = 0,0
ATYPE = 1,1
UNITS = 100,100
SPEED= 100,100
ACCEL= 1000,1000
DECEL= 1000,1000
MERGE=ON,ON
TRIGGER
MOVE( 100 )
MOVE_SYNMOVE( 1,120,0 ) 'When axis 0 reaches 100, axis 1 starts moving 120.'
MOVE(100) 'Wait for axis synchronization to complete before axis 0 continues to move.'
The effect after using SP motion is as follows: set the last parameter to a non-zero value, and the motion speed of axis 1 is FORCE_SPEED=200.
11. MOVE_ASYNMOVE -- Buffer triggers other axes 2
If the BASE axis motion buffer triggers motion on other axes, the current axis will not wait and will continue to move.
Syntax: MOVE_ASYNMOVE(axisnum, dis[, ifsp])
axisnum: The axis number that needs to be synchronized.
dis: relative distance of motion
ifsp: Whether to use SP motion. The default value is 0, which means not to use it. Set it to other values to use it.
RAPIDSTOP(2)
WAIT IDLE(0)
WAIT IDLE(1)
BASE(0,1)
DPOS=0,0
ATYPE=1,1
UNITS=100,100
SPEED=100,100
ACCEL=1000,1000
DECEL=1000,1000
MERGE=ON,ON
TRIGGER
MOVE(100)
MOVE_ASYNMOVE(1,120,0) 'When axis 0 reaches 100, axis 1 starts moving 120.'
MOVE(100) 'Wait for axis synchronization to complete before axis 0 continues to move.'
12. MOVE_TASK -- Buffer start task
BASE axis motion buffer added to startup TASK.
This instruction buffer does not perform any movement during execution; it only starts the task and does not interrupt the continuity of the interpolation movement.
Syntax: MOVE_TASK(task_number, function_name)
When the MOVE_TASK instruction is retrieved from the entire motion buffer area and executed, the program marked with task_move is started as task 1, and task 1 can be seen to be started in the task window.
RAPIDSTOP( 2 )
WAIT IDLE( 0 )
BASE( 0 )
ATYPE = 1
UNITS = 100
DPOS= 0
SPEED= 100
ACCEL= 1000
DECEL= 1000
MERGE=ON
TRIGGER
MOVE( 100 )
MOVE_TASK( 1 , task_move) 'After the first movement is completed, start task_move as task 1.
MOVE(100)
END
Task 1
task_move:
PRINT "TASK_MOVE"
END
13. MOVE_WAIT -- Buffered wait
Add a conditional check to the BASE axis motion buffer.
The instruction buffer does not perform any movement during execution; it only waits for the specified conditions to be met. The speed will automatically drop to 0 when the preceding movement instruction ends.
Syntax: MOVE_WAIT(parameter name, parameter number, comparison condition, comparison value)
The parameters can be: DPOS, MPOS, IN, AIN, VPSPEED, MSPEED, MODBUS_REG, MODBUS_IEEE, MODBUS_BIT, VECTOR_BUFFERED, REMAIN
Comparison conditions: 1 Parameter value ≥ comparison value; -1 Parameter value ≤ comparison value; 0 Not recommended.
RAPIDSTOP(2)
WAIT IDLE(0)
BASE(0)
ATYPE=1
UNITS=100
DPOS=0
SPEED=100
ACCEL=1000
DECEL=1000
TRIGGER
MOVE(100)
MOVE_WAIT(IN, 0, 1, 1) 'Wait for a signal at IN(0) before executing the next motion.'
MOVE(100)
14. MOVE_CANCEL -- Buffer stop
Write the CANCEL command to the motion buffer.
Syntax: MOVE_CANCEL(axis number, mode value)
0: Cancel the current motion and continue fetching buffer instructions.
1: The movement in the buffer is canceled, but the current movement must still be completed.
2: Cancel the current motion and the buffer zone motion; the axis stops immediately.
3: Immediately interrupt pulse transmission
RAPIDSTOP( 2 )
WAIT IDLE( 0 )
WAIT IDLE( 1 )
BASE( 0,1 )
DPOS = 0,0
ATYPE = 1,1
UNITS = 100,100
SPEED= 100,100
ACCEL= 1000,1000
DECEL= 1000,1000
MERGE=ON,ON:
TRIGGER
MOVE( 50 ) AXIS( 0 ) 'Current motion on axis 0
MOVE(80) AXIS(1) 'Current motion of axis 1'
MOVE_CANCEL( 1,2 ) AXIS( 0 ) 'Write the command to stop axis 1 into the buffer of axis 0.'
MOVE(60) AXIS(0) 'Axis 0 Buffer Motion
MOVE( 70 ) AXIS( 1 ) 'Axis 1 buffer motion, canceled
Example execution effect: After axis 0 moves 50, the MOVE_CANCEL(1,2) AXIS(0) instruction takes effect. The CANCEL(2) mode cancels the current motion and buffer motion of axis 1. Axis 1 stops immediately, and axis 0 continues to move.
15. LOADED -- Buffer empty
Used to determine if the motion buffer of an axis is empty. It is a read-only parameter. A return value of 0 indicates that there are still instructions in the motion buffer, and a return value of -1 indicates that the motion buffer is empty.
BASE(0)
ATYPE=1
UNITS=100
SPEED=100
ACCEL=1000
DECEL=1000
DPOS=0
MERGE=ON 'Enable continuous interpolation'
OP(0,OFF)
TRIGGER
MOVE(100) 'Current motion'
MOVE(50) 'Buffered motion, at this time the buffer only has this one motion.'
The buffer was cleared when this movement was executed.
WAIT LOADED 'Execute can proceed once the motion buffer is empty'
OP(0,ON) 'Turn on OP0'
WAIT LOADED Waiting for the buffer to empty
Wait for the axis to stop.
16. MOVE_MARK -- Motion Marker
The MARK number of the next motion instruction to be invoked will be written to the motion buffer along with the motion instruction.
MOVE_MARK is automatically incremented by one for each motion instruction invoked.
If you want to force the MOVE_MARK to be specified, you need to set it once before each movement.
The MOVE_PAUSE (2) instruction can pause at different boundaries of MARK.
BASE(0)
ATYPE=1
UNITS=100
DPOS=0
SPEED=100
ACCEL=1000
DECEL=1000
MERGE=OFF 'Disable continuous interpolation'
OP(0,OFF)
TRIGGER
MOVE_MARK=0 'Initial value: 0
MOVE(100) 'Motion instruction 1'
MOVE_DELAY(1000) 'Motion command 2'
MOVE(50) 'Motion Instruction 3'
MOVE_OP(0,ON) 'Motion instruction 4
MOVE(80) 'Motion Instruction 5'
PRINT MOVE_MARK 'Print result: 5'
17. MOVE_CURMARK -- Current motion label
Returns the MOVE_MARK label of the current axis in motion command. The numbering starts from 0 by default and decreases by 1 from the total number of motion commands.
The axis parameter window allows you to monitor the number of motion commands scanned by the current program and view MOVE_MARK; and to view which motion command the axis is currently running and view MOVE_CURMARK.
BASE(0)
ATYPE=1
UNITS=100
DPOS=0
SPEED=100
ACCEL=1000
DECEL=1000
MERGE=ON
OP(1,OFF)
TRIGGER
MOVE_MARK = 1
MOVE(50)
MOVE_MARK = 2
MOVE(100)
MOVE_MARK = 3
MOVE(150)
WAIT UNTIL MOVE_CURMARK = 2 'Open output port 1 when MOVE(100) starts executing.
OP(1,ON)
That concludes our discussion of motion buffering in the Zheng Motion Technology motion controller. For more learning videos and articles, please follow our WeChat official account, "Zheng Motion Assistant".
This article was originally created by Zheng Motion Assistant. We welcome everyone to reprint it for mutual learning and to improve China's intelligent manufacturing capabilities. Copyright belongs to Zheng Motion Technology. Please indicate the source if you reprint this article.