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, and use of ZDevelop programming software.
Today, we will explain the basic axis parameters and basic motion control commands of the positive motion technology motion controller.
Video Tutorial: Basic Axis Parameters and Basic Motion Control Commands for Motion Controllers
Material preparation and controller wiring reference
Controller Wiring Reference
Setting two commonly used shaft parameters
1. BASE - Axis Selection
Syntax: BASE(axis1, axis2, axis3, ...)
The maximum number of available axes depends on the actual hardware of the controller.
The BASE command is used to guide the reading/writing of parameters for the next motion command axis to a specific axis or axis group.
Each process has its own BASE basic axis group, and each program can be assigned values independently. ZBasic programs are separate from the motion generators that control axis movement.
Each axis's motion generator has its own independent function, so each axis can be programmed with its own speed, acceleration, etc. Axes can be linked together by superimposing motion, synchronizing motion, or interpolating. The speed and other parameters of the interpolated motion adopt the parameters of the master axis. By default, the first axis selected in the BASE is the master axis.
example:
2. ATYPE – Axis Type
Syntax: ATYPE = type value
Set the axis type, providing a list of axis types, and can only be set to the characteristics that the current axis has.
The ATYPE should be set during program initialization. If the ATYPE does not match, the program will not run properly.
Supports mixed interpolation of different types of axes.
example:
3. UNITS – Pulse Equivalent
Syntax: UNITS = Number of Pulses UNITS(axis number) = Number of Pulses
The controller uses UNITS as the basic unit, specifies the number of pulses sent per unit, and supports 5 decimal places of precision.
UNITS is the link between user units and pulse units. UNITS=10000, MOVE(2) is equivalent to giving the motor 20000 pulses.
If the motor is not under mechanical load, the number of revolutions it makes depends on the number of pulses required for one revolution:
Example 1: The motor needs 10,000 pulses to rotate one revolution. MOVE(3) wants the motor to rotate 3 revolutions, so UNITS=10,000.
Example 2: The motor needs 2^17 pulses to rotate one revolution. MOVE(2) wants the motor to rotate 2 revolutions, so UNITS=2^17.
Example 3: The motor needs 10,000 pulses to rotate one revolution. The motor is connected to a 10mm lead screw. 1,000 pulses represent the lead screw moving forward 1mm. Therefore, UNITS=1000 and MOVE(5) means moving forward 5mm.
Settings reference:
Assuming the motor rotates once every 3600 pulses, the UNITS corresponding to the motor rotating 1° is: UNITS=U/360=3600/360=10. At this time, MOVE(1) is performed, and the motor rotates 1°.
Assuming the motor rotates once with 3600 pulses, the lead screw moves one pitch per revolution, and the pitch P = 2mm. The corresponding UNTIS for the worktable to move 1mm is: UNITS = U/P = 3600/2 = 1800. At this time, MOVE(1) is executed, and the worktable moves 1mm.
When the machine has a reduction ratio, the reduction ratio must be taken into account. Assuming the reduction ratio i = 2:1, UNITS = U*i/P = 3600*2/2 = 3600.
4. SPEED – Shaft speed
The speed of the axis during movement, measured in units per second (UNITS/S).
5. ACCEL - Acceleration
The higher the speed achieved by the axis per second, the shorter the time to reach the target speed (SPEED).
Unit: UNITS/S^2.
6. DECEL - Deceleration
The deceleration principle of the axis is the same as that of ACCEL; when not set, the deceleration automatically equals the acceleration value.
Speed, acceleration, and deceleration settings take effect immediately after modification; it is recommended to set them during initialization.
example:
7. SRAMP – Acceleration/Deceleration Curve
The S-curve setting for acceleration and deceleration is used to smooth acceleration and deceleration.
Syntax: SRAMP = smooth time
Smoothing time range: 0-250 milliseconds. Setting this will extend the acceleration/deceleration process by the corresponding time.
1) Trapezoidal curve
When SRAMP=0, the velocity curve is a trapezoidal curve, and the velocity curve changes according to the trapezoidal curve. Keep the values of parameters such as velocity, acceleration, and deceleration constant.
Trapezoidal curve SRAMP=0
2) S-shaped curve
By setting the SRAMP value, an appropriate acceleration/deceleration rate can be determined, resulting in a smoother speed curve and reduced jitter during mechanical start-up, shutdown, or acceleration/deceleration. The SRAMP value ranges from 0 to 250 milliseconds. Setting it will lengthen the acceleration/deceleration process accordingly; the longer the time, the smoother the speed curve. If the set time exceeds 250 milliseconds, smoothing will be performed according to a 250-millisecond timeframe.
S-shaped curve SRAMP=100
example:
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
MPOS=0,0
SRAMP(0)=0 'Axis 0 Trapezoidal Curve
SRAMP(1) = 200' axis 1 S-shaped curve
TRIGGER
MOVE(100) AXIS(0) 'Move along axis 0'
MOVE(100) AXIS(1) 'Axis 1 motion
8. FASTDEC – Emergency Stop Deceleration
Emergency stop deceleration, measured in units of units per second (S^2).
Automatically used when CANCEL, RAPIDSTOP, limit reached, or abnormal stop. Automatically uses DECEL when set to 0 or less than DECEL.
example:
FASTDEC=2000
FASTDEC=0 Emergency stop, decelerate according to DECEL.
9. CREEP – Crawling speed
The crawling speed when the axis returns to zero, used for origin search, and the unit is units/s. See the DATUM single-axis origin search command instructions below for usage.
10. LSPEED – Starting speed
The starting speed of the axis, which is also used for the stopping speed. The default value is 0, and the unit is units/s.
When performing multi-axis motion, it serves as the starting velocity for interpolation motion.
When efficiency is a priority, consider setting a starting speed.
example:
BASE(0,1) 'Select axis 0 as the master axis'
DPOS=0,0
UNITS=100,100 'Pulse equivalent 100
SPEED=100,100 'Spindle speed
ACCEL=1000,1000
DECEL=1000,1000
LSPEED(0) = 40' Initial velocity
TRIGGER Auto Trigger Oscilloscope
MOVE(100,80) 'Movement distance on each axis'
11. AXIS – Temporary Axis Selection
Syntax: AXIS (axis number)
AXIS can temporarily modify a motion command or axis parameter and execute it on a specified axis. Many commands can be followed by AXIS parameters, which is particularly effective in command lines or program lines.
example:
PRINT MPOS AXIS(3) 'Prints MPOS on axis 3, equivalent to PRINT MPOS(3)
PRINT MPOS(4) 'Print MPOS on axis 4'
MOVE(300) AXIS(2) 'Axis 2 motion 100
REP_DIST AXIS(1) = 100 'Sets the coordinate cycle position of axis 1.
12. DPOS – Axis Command Position
The virtual coordinate position of the axis, or the required position, is measured in units of units.
This parameter is often used to monitor the execution of motion commands. Writing DPOS will automatically convert it to OFFPOS offset, which only modifies the coordinates and will not move the motor.
BASE(0,1)
DPOS=0,100
MOVE(100,0) 'First paragraph'
MOVE(-100,-100) 'Second paragraph'
MOVE(100,0) 'Third segment, endpoint (100,0)
movement trajectory
13. MPOS – Encoder Feedback Location
The measurement feedback position of the shaft, in units of units.
This parameter is often used to monitor the encoder's feedback position. Writing to MPOS will automatically convert it to OFFPOS offset, only modifying the coordinates.
When the encoder is not connected, MPOS=DPOS.
14. MERGE — Enable continuous interpolation
Syntax: MERGE = ON/OFF or 1/0
Enabling the continuous interpolation function connects the motion buffers before and after the motion buffer, ensuring that there is no deceleration between continuous multi-segment interpolation motions, thereby improving processing efficiency.
If continuous interpolation is not enabled, after the previous interpolation movement is completed, it will first decelerate and stop at a speed of 0, and then accelerate again to execute the next interpolation movement.
example:
BASE(0) 'Select axis 0'
DPOS=0
UNITS=100
SPEED=100
ACCEL=500
DECEL=500
MERGE=ON 'Enable continuous interpolation'
TRIGGER Auto Trigger Oscilloscope
MOVE(100) 'First segment of motion'
MOVE(100) 'Second phase of motion'
MERGE=ON
MERGE=OFF
When MERGE is set to ON, deceleration still occurs between multiple interpolation segments. Possible reasons include:
1) MERGE may not have been set successfully. You can check by printing or in the axis parameter window.
2) The controller is a point-to-point motion model with simple motion functions and does not support continuous interpolation.
3) CORNER_MODE was set for corner deceleration, and confirmation was printed.
4) The motion command with SP was used, and ENDMOVE_SPEED and STARTMOVE_SPEED were set. At this time, the speed is determined by these two commands.
5) The spindle was switched between multiple interpolation lines, and the spindle speed parameters changed.
6) Multiple interpolation lines have added a MOVE_DELAY delay instruction in the motion buffer. Even if the delay is written to 0, it will still cause deceleration.
Input port settings for three common axis parameters
1. INVERT_IN — Inverted input
By reversing the input state, it can be read to determine whether it has been reversed.
Syntax: INVERT_IN(input channel, ON/OFF) ON - inverts, OFF - does not invert
When the ZMC controller is OFF, it is considered to have a signal input. To achieve the opposite effect, the level can be reversed using INVERT_IN.
When the ECI series controller is ON, it is considered that there is a signal input. To achieve the opposite effect, you can use INVERT_IN to invert the level.
example:
BASE(0,1,2,3) 'Select axes 0,1,2,3'
FWD_IN=6,7,8,9 'Set the positive limit switches respectively
INVERT_IN(6,ON) 'Invert signal
INVERT_IN(7,ON)
Input ports 6 and 7 are set to invert signals, and input signals are given to input ports 6 and 8. The input port status is shown in the figure.
2. Mapping positive/negative limit inputs
FWD_IN — Mapped positive limit input
REV_IN — Mapping negative limit input
Set the input point number corresponding to the positive/negative hardware limit switch respectively; -1 is invalid.
Hard limit switches are physical switching elements that are mapped from commands to corresponding input switch signals. Once the controller's limit signal is activated, it will immediately stop the shaft, with the deceleration set to FASTDEC.
example:
BASE(0,1,2,3) 'Select axes 0,1,2,3'
FWD_IN=6,7,8,9 'Set the positive limit switches respectively
INVERT_IN(6,ON) 'Invert signal
INVERT_IN(7,ON)
INVERT_IN(8,ON)
INVERT_IN(9,ON)
Software limits are used to restrict the DPOS position range of the axis and are used for software safety limits.
FS_LIMIT — Positive soft limit setting
FS_LIMIT(0)=200 'Sets the positive soft limit of axis 0 to 200 units
RS_LIMIT — Negative soft limit setting
RS_LIMIT(0) = -300 'Sets the negative soft limit of axis 0 by -300 units
3. DATUM_IN — Mapping origin input
The general-purpose input port is set to the origin switch signal; -1 is invalid.
This signal input only takes effect during the shaft homing process.
4. ALM_IN — Mapped alarm input
The input port number corresponding to the driver alarm; -1 is invalid.
Once the controller alarm signal is activated, it will immediately stop the shaft, and the deceleration will stop at FASTDEC.
example:
BASE(0,1)
DATUM_IN = 6, 7 ' Define the origin inputs of axes 0 and 1 to input ports 6 and 7 respectively.
INVERT_IN(6,ON) 'Inverts the origin signal
INVERT_IN(7,ON)
ALM_IN = 10,11 ' Define the alarm signals of axis 0 and 1 to input ports 10 and 11 respectively.
INVERT_IN(10,ON) 'Signal inversion'
INVERT_IN(11,ON)
5. FHOLD_IN — Mapping and holding input
Keep the input point number corresponding to the input; -1 is invalid.
If there is an input signal, the speed of the motion axis changes from the programmed speed to the FHSPEED parameter speed; when the input is canceled, the motion speed during the motion process returns to the programmed speed.
6. FHSPEED – Maintain Speed
The axis holding speed is the speed when FHOLD_IN is pressed and held, in units/s.
It can only continue to move at this speed when the corresponding input is in a hold state.
example:
RAPIDSTOP( 2 )
WAIT IDLE ( 0 )
BASE ( 0 ) 'Select axis
0DPOS= 0 'Clear coordinates to 0'
UNITS=100
ATYPE=1
ACCEL=500 'Acceleration'
DECEL= 500
SPEED = 100
FHSPEED=50 'Maintain speed
FHOLD_IN( 0 ) = 0 'The hold input for axis 0 is set to IN0 port.
INVERT_IN(0,ON) 'Inverts the voltage level
TRIGGER Auto Trigger Oscilloscope
MOVE(10000) 'Movement'
7. Map positive/negative JOG inputs
FWD_JOG — Maps forward JOG input;
REV_JOG — Maps negative JOG inputs.
Positive/negative JOG input corresponds to the input port number; -1 is invalid.
When a positive JOG signal is input, the corresponding axis moves in the positive direction at the JOGSPEED speed.
When a positive JOG signal is input, the corresponding axis moves in the negative direction at the JOGSPEED speed.
When both positive and negative signals are valid, the motion is in the positive direction.
JOGSPEED — JOG speed.
The speed during JOG, measured in units/s.
When REV_JOG/FWD_JOG is set, the motor will move slowly at JOGSPEED when the corresponding input point is pressed and the current input state is maintained, and the movement will stop when the input point is released.
example:
BASE(0) 'Select axis 0'
ATYPE=1 'Pulse axis type'
DPOS=0 'Clear coordinates to 0'
UNITS=100 'Pulse Equivalent'
SPEED = 100 'Spindle speed
ACCEL=1000 'Acceleration'
DECEL=1000 'Deceleration'
TRIGGER Auto Trigger Oscilloscope
JOGSPEED=50 'JOG speed 50'
FWD_JOG=0 'IN0 acts as a positive JOG switch'
REV_JOG=1 'IN1 acts as a negative JOG switch'
INVERT_IN(0,ON) 'Invert signal
INVERT_IN(1,ON)
Running result:
When there is a signal input at input port 0, axis 0 runs in the positive direction at a speed of 50.
When there is a signal input at input port 1, axis 0 runs in the negative direction at a speed of 50.
When both input signals 0 and 1 are input simultaneously, axis 0 runs in the positive direction.
8. FAST_JOG - Mapped Jog Input
The number of the rapid jog input; -1 indicates invalid.
If a rapid jog input is set, the speed is given by the SPEED parameter. If no input is set, the speed is given by the JOGSPEED parameter.
FAST_JOG needs to be used in conjunction with FWD_JOG (mapping positive JOG input) or REV_JOG (mapping negative JOG input) to control the axis running speed.
example:
BASE(0) 'Select axis 0'
DPOS=0 'Coordinates cleared to 0'
UNITS=100
ATYPE=1
SPEED=100 'Sets the speed to 100 units/s'
ACCEL=500 'Acceleration is 500 units/s/s'
JOGSPEED=200 ' Jog speed is set to 200 units/s
FAST_JOG(0)=0 'Fast input for axis 0 is set to IN0 port'
FWD_JOG(0)=1 'Set the forward jog switch to IN1 port'
INVERT_IN(0,ON) 'Inverts the voltage level
INVERT_IN(1,ON)
TRIGGER Auto Trigger Oscilloscope
When IN0 has no input, press and hold IN1; the axis speed is JOGSPEED=200.
When IN0 has input, press and hold IN1.
Shaft speed is SPEED=100
Motion states of four common axes
The operating status of an axis can be monitored through the axis parameter window, or the axis status can be determined by reading the return value of the corresponding command.
1. MTYPE – Current motion type
Read the type of the currently executing motion command. For read-only parameters, retrieve the command return value and look up the table to determine the motion type of the current axis.
Syntax: VAR1 = MTYPE
When interpolation is performed, the motion command type of the slave axis always returns to that of the master axis.
2. NTYPE – Next type of exercise
Read the first instruction type following the currently executing motion instruction. This is a read-only parameter; retrieve the instruction's return value and then look it up in a table.
Syntax: VAR1 = MTYPE
When interpolation is performed, the motion command type of the slave axis always returns to that of the master axis.
3. IDLE – Current motion state
The IDLE instruction is used to determine whether a motion command applied to an axis has been completed. It returns 0 during motion and -1 when the motion is finished.
For read-only parameters, the WAIT IDLE(axis number) statement is generally used in programs to determine the axis status.
When the axis is associated with a robot, the joint axis always returns 0 during the CONNFRAME inverse solution; the virtual axis always returns 0 during the CONNREFRAME forward solution.
example:
RAPIDSTOP(2)
WAIT IDLE
BASE(0,1,2)
ATYPE=1,1,1
UNITS=100,100,100
SPEED=100,100,100
ACCEL=1000,1000,1000
DECEL=1000,1000,1000
DPOS = 0,0,0
OP(0,OFF)
TRIGGER
MOVE(100,100) 'Linear interpolation between axis 0 and axis 1'
MOVE(200) AXIS(2) 'Axis 2 Motion'
WAIT UNTIL IDLE(0) AND IDLE(1) AND IDLE (2)
'Wait for axes 0, 1, and 2 to stop'
OP(0,ON)
4. MSPEED – Actual Feedback Speed
The axis measures and provides feedback on position and speed, measured in units per second (UNITS/S). This is a read-only parameter.
During interpolation, the velocity components of each axis are read.
5. VP_SPEED — Current speed
The current speed of the return axis, in units of seconds (UNITS/s), is a read-only parameter.
When performing multi-axis motion, the main axis returns the velocity of the interpolated motion, not the component velocity of the main axis. Non-main axes return the corresponding component velocity, consistent with the effect of MSPEED.
VP_SPEED is designed to display multi-axis composite speeds by default and does not have negative values. Unless the value of bit 0 of the SYSTEM_ZSET instruction is set to 0, it can be used to display single-axis command speeds, which can be positive or negative.
example:
BASE(0,1)
ATYPE=1,1
DPOS=0,0 'Coordinates cleared to 0'
UNITS=100,100 'Pulse Equivalent'
SPEED = 100, 100 'Spindle speed
ACCEL=1000,1000 'Acceleration'
DECEL=1000,1000 'Deceleration'
TRIGGER Auto Trigger Oscilloscope
MOVE(100,100) 'Moves each axis by 100 degrees.'
Running result:
The interpolation motion axis 0 is the main axis, and VP_SPEED(0) returns the composite velocity of the interpolation motion.
6. AXISSTATUS – Axis Status
To view the various states of the axis, display the values in decimal and determine the state by the corresponding binary bits. Multiple errors can occur simultaneously.
The axis parameter window displays octal values, while the values printed using the PRINT command are in decimal.
example:
?AXISSTATUS(1) 'Check the status of axis 1. The print result is 576, indicating that the positive soft limit was exceeded when finding the origin. The axis parameter window displays the value as 240h.
7. AXIS_STOPREASON — Reason for axis stop
The axis history stop reason is latched, written to 0 is cleared, and it is automatically latched bit by bit. The latched information is AXISSTATUS.
Five commonly used motion control commands
1. VMOVE – Continuous Motion
Syntax: VMOVE(direction of motion) [AXIS(axis number)]
Direction of motion: -1 negative motion, 1 positive motion
Once VMOVE is executed, it will continue to run unless the motion cache is cleared using CANCEL or RAPIDSTOP.
When the preceding VMOVE movement has not stopped, the subsequent VMOVE instruction will automatically replace the preceding VMOVE instruction and change its direction, so there is no need to cancel the preceding VMOVE instruction.
example:
2. FORWARD – Continuous Positive Motion
Syntax: FORWARD [AXIS(axis number)]
The axis will continue to move forward at the speed of SPPED, and you must cancel it before you can switch to REVERSE.
3. REVERSE – Continuous negative motion
Syntax: FORWARD [AXIS(axis number)]
To keep the axis moving negatively at the speed of SPPED, you must cancel before switching to FORWARD.
example:
BASE(0) 'Select axis 0'
ATYPE=1 'Pulse axis type'
DPOS=0 'Clear coordinates to 0'
UNITS=100 'Pulse Equivalent'
SPEED = 100 'Spindle speed
ACCEL=1000 'Acceleration'
DECEL=1000 'Deceleration'
TRIGGER Auto Trigger Oscilloscope
FS_LIMIT=200 'Sets the positive soft limit to 200 units'
FORWARD AXIS(0) 'Keep axis 0 moving forward at a speed of SPPED'
FS_LIMIT=200 'Positive soft limit 200'
FORWARD AXIS(0) 'Forward motion'
RS_LIMIT=-300 'Negative soft limit -300'
REVERSE AXIS(0) 'Negative motion'
4. DATUM – Finding the origin on a single axis
Syntax: DATUM (pattern value)
For single-axis origin-finding motion, returning to zero on multiple axes requires calling this command multiple times. Multiple modes are available for selection.
In the image below, adding 10 to the mode value indicates that the search will reverse after encountering a limit switch, and will stop before encountering a limit switch. For example, 13 = mode 3 + limit switch reverse search 10, which is used when the origin is in the middle.
The mode value in the image below is increased by 100 (modes 100+n and 110+n correspond to n and 10+n respectively), and ATYPE=4 or 65, indicating that MPOS can be automatically cleared after connecting the encoder (4 series only). Other modes require manual clearing of MPOS.
The Z signal must be configured to return to zero with Z signal ATYPE (ATYPE=4 or 7).
In addition to using the homing method provided by the controller, EtherCAT or RTEX servos can also use the driver for homing. In this case, the origin and limit signals are connected to the driver.
Driver zeroing syntax: DATUM(21, mode value)
Refer to the corresponding driver manual for the driver's zero-return mode value.
When finding the origin on a single axis, the origin switch is set via DATUM_IN, and the positive and negative limit switches are set via FWD_IN and REV_IN, respectively.
Once the controller's positive/negative limit signals are activated, the shaft will stop immediately, with a stop deceleration of FASTDEC. This excludes the zero-return plus 10 mode.
Input port mapping method:
BASE(0,1)
DATUM_IN = 6,7 'Assign the origin inputs of axes 0 and 1 to input ports 6 and 7.
INVERT_IN(6,ON) 'Inverts the origin signal
INVERT_IN(7,ON) 'Inverts the origin signal
FWD_IN=2,3 'Connect the positive limit switch inputs of axes 0 and 1 to input ports 2 and 3.
INVERT_IN(2,ON) 'Reverses the positive limit signal
INVERT_IN(3,ON) 'Reverses the positive limit signal
REV_IN=4,5 'Connect the negative limit switch inputs of axes 0 and 1 to input ports 4 and 5.
INVERT_IN(4,ON) 'Reverses the negative limit signal
INVERT_IN(5,ON) 'Reverses the negative limit signal
For ZMC controllers, an OFF input indicates that the origin/limit has been reached; normally open signals require an inverted INVERT_IN level. The ECI controller is the opposite; an ON input indicates that the signal is valid.
example:
BASE(0)
DPOS=0
ATYPE=1
SPEED = 100 'Speed for finding the origin'
CREEP = 10 'Reverse crawling speed after finding the origin'
ACCEL=1000,1000
DECEL=1000,1000
SRAMP=100,100 'Smooth acceleration/deceleration'
DATUM_IN=5 'Input IN5 as the origin switch
INVERT_IN(5,ON) 'Inverts the IN5 level signal; normally open signals are inverted (ZMC controller)
TRIGGER Auto Trigger Oscilloscope
DATUM(3)
Mode 3 : The axis runs forward at SPEED speed until it hits the origin switch, then moves backward at CREEP speed until it returns to the position of the origin switch and stops. At this time, the zeroing is completed, and the axis's DPOS is automatically set to 0. If it hits a limit switch in the middle, the axis stops immediately.
example:
BASE(0)
DPOS=0
ATYPE=4
SPEED = 100 'Speed for finding the origin'
CREEP = 10 'Reverse crawling speed after finding the origin'
ACCEL=1000,1000
DECEL=1000,1000
SRAMP=100,100 'Smooth acceleration/deceleration'
DATUM_IN=5 'Input IN5 as the origin switch
INVERT_IN(5,ON) 'Inverts the IN5 level signal; normally open signals are inverted (ZMC controller)
TRIGGER Auto Trigger Oscilloscope
DATUM(103)
Mode 103 : Connect a real encoder. The shaft runs forward at SPEED speed until it hits the origin switch, and then moves backward at CREEP speed until it returns to the position of the origin switch and stops. At this time, the zeroing is completed, and the DPOS and MPOS of the shaft are automatically set to 0. If the shaft hits a limit switch in the middle, it stops immediately.
5. CANCEL & RAPIDSTOP – Axis Stop
Syntax: CANCEL (mode) / RAPIDSTOP (mode)
Both CANCEL and RAPIDSTOP have four modes. The difference between them is that CANCEL is a single axis/axis group stop command, while RAPIDSTOP stops all axes.
Mode 1: CANCEL = CANCEL(0) Cancels the current motion and continues fetching buffer instructions.
Mode 2: CANCEL(1) Cancels the movement in the buffer, but the current movement still needs to be completed.
Mode 3: CANCEL(2) Cancels the current motion and the buffer's motion; the axis stops immediately.
Mode 4: CANCEL(3) Immediately interrupts the transmission of the pulse.
In Mode 2, the deceleration is the maximum value between FASTDEC and DECEL. After using the command, to invoke the absolute position movement, you must first wait for the stop to complete.
Add the axis number to stop the target axis CANCEL AXIS(1). When you want to stop the motor quickly, it is recommended to use RAPIDSTOP(2) or CANCEL(2).
Using the CANCEL command to stop the interpolation motion of the main spindle or any axis in the BASE axis list will stop the interpolation motion of the axis group.
example:
BASE(0)
DPOS=0
SRAMP=0
ATYPE=1
UNITS=100
SPEED=500
ACCEL=1000
DECEL=1000 'Deceleration'
FASTDEC=10000 'Fast deceleration'
TRIGGER
MOVE(1000) 'Current motion'
MOVE(-1000) 'Buffering motion'
'DELAY(1000)' Delay
CANCEL(0)
Taking the CANCEL command as an example, the execution effects of the four modes are shown in the following figure.
CANCEL(0) cancels the current motion.
CANCEL(1) cancels cushioning motion
CANCEL(2) Cancels the current & buffered motion
CANCEL(3) interrupt pulse transmission
6. MOVE – Linear Interpolation
Syntax: MOVE(distance1 [,distance2 [,distance3 [,distance4...]]])
Single-axis linear motion or multi-axis linear interpolation motion, relative motion distance. Absolute linear interpolation uses the MOVEABS command.
Interpolation is a real-time data densification process that performs digital calculations based on given information, continuously calculating the feed amount of each coordinate axis involved in the motion, and driving the corresponding actuators to produce coordinated motion so that the controlled mechanical parts move along the ideal route and speed.
During interpolation motion, only the spindle speed parameter is valid. The spindle is the first axis of the BASE, and the motion references the parameters of this axis. The interpolation motion command enters the spindle's motion buffer.
Supports mixed interpolation of different types of axes.
Interpolation distance:
Interpolation motion speed: The main spindle speed V0 is set to SPEED, and the speeds of each axis are Vn = V0 × Xn / X
example:
BASE(0,1)
ATYPE=1,1
UNITS=100,100
SPEED=100,100
ACCEL=1000,1000
DECEL=1000,1000
SRAMP=100,100
DPOS=0,0
MPOS=0,0
TRIGGER
MOVE(150,200)
The interpolation motion is axial 0, DPOS(0) and DPOS(1) are the motion distances of each axis, MSPEED(0) and MSPEED(1) are the speeds of the sub-axis, and VP_SPEED(0) is the combined speed of the main axis.
XY mode displays the composite trajectory of two-axis interpolation.
7. MOVECIRC – Circular interpolation between the start point, end point, and center point.
Syntax: MOVECIRC(end1, end2, centre1, centre2, direction)
(end1,end2) End point coordinates; (centre1,centre2) Center point coordinates; Direction: 0 - counterclockwise, 1 - clockwise.
Two-axis circular interpolation draws an arc using three points: the start point, the end point, and the center. The start point uses the current coordinates of the axis, and the movement is relative to the axis. Absolute circular interpolation uses the MOVECIRCABS command.
When the starting coordinates and the ending coordinates are the same, draw a complete circle.
example:
BASE(0,1)
ATYPE=1,1 'Set as pulse axis type
UNITS=100,100
DPOS=0,0
SPEED=100,100
ACCEL=1000,1000
DECEL=1000,1000
TRIGGER Auto Trigger Oscilloscope
MOVECIRC(200,0,100,0,1) 'Draws a semicircle clockwise with a radius of 100.
'MOVECIRC(0,0,100,0,0)' Draws a full circle counterclockwise with a radius of 100.
MOVECIRC(200,0,100,0,1) 'Draws a semicircle clockwise with a radius of 100.'
MOVECIRC(0,0,100,0,0)' Draws a full circle counterclockwise with a radius of 100.
8. MOVECIRC2 - Three-point circular interpolation: start point, midpoint, and end point.
Syntax: MOVECIRC2(mid1, mid2, end1, end2)
(mid1, mid2) coordinates of the midpoint; (end1, end2) coordinates of the endpoint
Unlike the instructions above, this instruction draws an arc using three points: a start point, a midpoint, and an end point. The start point uses the current coordinates of the axis for relative motion. Absolute circular interpolation uses the MOVECIRC2ABS instruction.
This command cannot perform full-circle interpolation. For full-circle interpolation, use MOVECIRC relative to the arc, or use two such commands consecutively.
example:
BASE(0,1)
ATYPE=1,1 'Set as pulse axis type
UNITS=100,100
DPOS=0,0
SPEED=100,100
ACCEL=1000,1000
DECEL=1000,1000
TRIGGER Auto Trigger Oscilloscope
MOVECIRC2(100,100,200,0) 'Draws a semicircle clockwise with a radius of 100.
'MOVECIRC2(100,-100,200,0)' Draws a semicircle counterclockwise with a radius of 100.
MOVECIRC2(100,100,200,0)' Draws a semicircle clockwise with a radius of 100.
MOVECIRC2(100,-100,200,0)' Draws a semicircle counterclockwise with a radius of 100.
That concludes our discussion of the basic axis parameters and basic motion control commands for the positive motion technology motion controller. For more learning videos and articles, please follow our WeChat official account "Positive 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.