Status signals of a PTP-axis
(Signals from the cyclic axis interface of the NC and MC_xxx function blocks)
Requirements
NcToPlc.nStateDword (DWORD), variable of NcToPlc cyclic axis interface structure, consists of various axis status signal flags. The flags discussed herewith are: AxisIsMoving (AxisIsMovingForward OR AxisIsMovingBackwards) NOTE: Only the flags AxisInPositionWindow and AxisIsAtTargetPosition depend on the actual values (actual position, actual velocity). On the other hand, the rest of the flags discussed here depend on the setpoint values (set position, set velocity, set acceleration).
AxisHasJob gives the correct and accurate indication of the axis command status. A transition of AxisHasJob from FALSE to TRUE indicates that the axis has got a new job and hence new parameters (like target position, velocity, acceleration or jerk). Completion of a command of an axis is indicated by a FALSE status of AxisHasJob flag.
AxisIsMoving goes to TRUE when the motion command reaches the axis and the setpoint generator is active. Normally if the flag AxisIsMoving is TRUE, then the setpoint velocity has a value other than zero. An exception for this case is velocity override 0%, which implies that the axis has job and is logically moving but with a velocity zero (in this case AxisHasJob and AxisIsMoving are both TRUE but setpoint velocity is zero). AxisHasJob additionally includes the communication time for the request and response of the command.
AxisIsNotMoving has an exact opposite status to that of AxisIsMoving. TRUE status of AxisIsNotMoving indicates that the axis is logically (not necessary physical standstill) standstill.
AxisHasBeenStopped indicates the execution of a stop command for the corresponding axis. AxisHasBeenStopped goes TRUE as soon as the stop command is issued and executed and remains TRUE throughout the stopping phase (throughout the time axis stop command is active) and is set to FALSE only when a new command is executed.
AxisIsAtTargetPosition depends on two parameters specified in the Global parameters of the corresponding axis in the TwinCAT System Manager; Target Position Window and Target Position Monitoring Time. AxisIsAtTargetPosition is TRUE when actual position is within the Target Position Window for a minimum of the time mentioned in Target Position Monitoring Time (without oscillating outside the Target Position Window).NOTE: This flag to use should be enabled in TwinCAT System Manager, in the Global parameters of the corresponding axis under the name Target Position Monitoring.
AxisInPositionWindow depends on the Position Range Window parameter in the Global parameters of the corresponding axis in the TwinCAT System Manager. The flag, AxisInPositionWindow is set TRUE when the actual position is within the value specified in Position Range Window and goes FALSE when the actual position value is outside this window. NOTE: This flag in order to use should be enabled in TwinCAT System Manager, in the Global parameters of the corresponding axis under the name Position Range Monitoring. After positioning, all “MC_Move…” blocks check whether positioning was completed successfully. In the simplest case, the “AxisHasJob” flag of the NC axis is checked, which initially signifies that positioning was logically completed. Depending on the parameterization of the NC axis, further checks (quality criteria) are used: |
- “Target position monitoring” (Important)
If target position monitoring is active, the system waits for feedback from the NC. After positioning, the axis must be within the specified target position window for at least the specified time. If necessary, the position controller ensures that the axis is moved to the target position. If the position controller is switched off (Kv = 0) or weak, the target may not be reached. Floating position control may lead to the axis oscillating around the window but not remaining inside the window. - “Position range monitoring”
If position range monitoring is active, the system waits for feedback from the NC. After positioning, the axis must be within the specified positioning range window. If necessary, the position controller ensures that the axis is moved to the target position. If the position controller is switched off (Kv = 0) or weak, the target may not be reached.
If the axis is logically at the target position (logical standstill) but the parameterized position window has not been reached, monitoring of the above-mentioned NC feedback is aborted with error 19207 (0x4B07) after a constant timeout of 6 seconds.
1.1. Positioning using MC_MoveAbsolute, MC_MoveRelative, …
A normal PTP sequence has been programmed to show the variations of signals corresponding to three different cases as shown below. the three different cases are made depending upon the Position Range Monitoring and Target Position Monitoring options.
1.2. Stopping (aborting) of an activated positioning using MC_Stop, ...
If an axis is stopped during the axis positioning, the axis comes to rest with velocity decreasing at the deceleration rate.
1.3. Occurrence of an NC or drive error (runtime error) during positioning
Occurence of an NC or drive error during positioning leads to abrupt fall of velocity to zero and hence the position remains constant, and no further operation is possible unless the axis is reset.