User's Manual

Turbo PMAC User Manual
Synchronizing Turbo PMAC to External Events 369
The conversion from axis position to motor position involves a scale factor and an offset, with the
following equation:
MotorPosition = ScaleFactor * AxisPosition + Offset
The scale factor is specified in the axis definition statement in counts per engineering unit. It should be
constant for an application. You can specify the scale factor directly in your equation, or you can access
the actual register that PMAC is using with suggested M-variables:
Mxx91 ; Axis scale factor for X, U, A, B, or C assigned to Motor xx
Mxx92 ; Axis scale factor for Y or V assigned to Motor xx
Mxx93 ; Axis scale factor for Z or W assigned to Motor xx
The offset is the position bias term, with suggested M-variable Mx64, and units of 1/(Ixx08*32) counts.
It is set equal to the axis definition offset (usually 0) on power-up/reset and homing. It can be changed
after this with on-line command {axis}= or motion program command PSET.
For example, with Motor 1 assigned to the X-axis, if you want to set the Compare 1A register to trigger at
+2.5 engineering units from the axis origin, you can compute motor position in counts as:
P1=M191*2.5+M164/(I108*32)
Then you can set the actual compare register with:
M108=P1+M173+I126/16
Note
If the expression on the right-hand side of this equation had produced a result
outside of the range of the compare register, the act of writing to the M-variable
assigned to this register would truncate the value properly to the 24-bit range so
that the compare function will work properly. 24-bit signed registers have a range
of -8,388,608 to +8,388,607. If you attempted to write a value of +9,388,608 –
one million counts past the rollover point – into this register, the resulting value
would be -7,388,608, which would be reached one million counts after the
rollover.
Synchronous M-Variable Assignment Outputs
Synchronous M-variable assignment statements allow outputs to be set and cleared synchronously with
the start of the next commanded move in the motion program. Note that the output is synchronous with
the commanded position, not necessarily the actual position, which can be different due to following
error. These statements are discussed in detail in the Computational Features section of this manual.