Programming modulo axes
The default mode for modulo programming supports the specific definition of the direction of rotation and position by programming 2 signs and limiting to maximum one revolution in absolute dimensions.
Syntax: | |
<axis_name> [ + | - ] <pos> | |
<axis_name> | Designation of modulo axis. Long axis designations are not supported (e.g. "C_MODULO"). |
+ | - | The 1st sign after the axis name always determines the direction of rotation: - means rotation clockwise (cc) + means rotation counter-clockwise (ccw) no sign means rotation in the direction of the shortest way (optimised alignment) |
<pos> | Axis position in [°]. The position value can be combined with an additional sign to specify an absolute dimension. The assignment of sign and position value can be forced to execute the shortest way by brackets [..]. |
Attention
The programming of 2 signs (direction and position) is only permitted if the axis has the "Modulo" axis mode P-AXIS-00015). Positioning is always executed on the shortest way if no sign is programmed directly after the axis name.
In addition, there is also an option to change to a mode that always positions on the shortest path (section Positioning on the shortest way). In this mode, programming 2 signs is also permitted. However, evaluation is based on the following rule:
-- => + (minus minus is plus)
+- => - (plus minus is minus)
-+ => - (minus plus is minus)
++ => + (plus plus is plus)
Programming in absolute dimensions (G90):
- The value assigned to the axes (target point) is shifted to the modulo range. Therefore, a maximum of one revolution can be moved.
- The value may be a numerical expression such as [3*2+5] , P1 , [P1+P2-3] , [-30].
- The first sign of the value after the axis name always defines the direction of rotation. Every further sign is evaluated as a part of the (absolute) position definition.
Example (assuming: 360° modulo)
G90 G1 C+560 * G90 G1 C+200 (Move to position 200 in + direction)
G90 G1 C-P1 (Go to position P1 (with implicit modulo) in – direction)
- If programmed position = current position, no motion.
- The motion path of a modulo axis is not limited by software limits.
Programming in incremental dimensions (G91)
- The value assigned to the axis indicates the amplitude of rotation of the axis with reference to the previous position. The first sign of the value after the axis name always defines the direction of rotation. Additional signs are not permitted in incremental programming.
Example (assuming: 360° modulo)
G91 G1 C+560 (Movement to "current position plus 560" in + direction)
- If the value is greater than the modulo value, the number of revolutions is taken into account. Therefore, a motion of more than one revolution is permitted.
The following V.A. variables permit read access to the current axis-specific modulo settings
V.A.MODE[i] | supplies the axis mode according to the axis table, |
V.A.MODULO_VALUE[i] | os used to read the modulo range |
Programing Example
Programming examples of modulo programming in absolute dimensions
G90 G1 C+350 <=> Go to position 350 in + direction
P1 =+10
G90 G1 C+P1 <=> G1 C+10 <=> Go to position 10 in +direction
P1= -350
G90 G1 C-P1 <=> G1 C-[-350] <=> G1 C-[10] <=> Go to position 10 in - direction
G90 G1 C+450 <=> G1 C+[450 mod 360] <=> Go to position 90 in + direction
Programing Example
Examples of correct programming:
C+200 Rotate in positive direction to position 200
C-200 Rotate in negative direction to position 200
C+-200 Rotate in positive direction to position -200 (= +160)
C+[-200] Rotate in positive direction to position -200 (= +160)
C—200 Rotate in negative direction to position -200 (= +160)
C-[-200] Rotate in negative direction to position -200 (= +160)
C200 Rotate on shortest way to position 200
C[+200] Rotate on shortest way to position 200
C[-200] Rotate on shortest way to position -200
Programing Example
Examples of incorrect programming:
None because the first sign after the axis name determines the direction of rotation and every additional sign belongs to the position expression.
Programing Example
Programming examples of modulo programming in relative dimensions
G91 G1 C+30
G91 G1 C-30
Programing Example
Examples of correct programming:
C+200 Rotate in positive direction to "current position plus 200”
C-200 Rotate in negative direction to "current position minus 200”
C200 Rotate in positive direction to "current position plus 200”
Programing Example
Examples of incorrect programming:
C+-200 Error: Negative motion path during rel. programming not allowed.
C—200 Error: Negative motion path during rel. programming not allowed.
P1=-1
C-[P1] Error: Negative motion path during rel. programming not allowed.