What Does MC_GrpHalt Do?

MC_GrpHalt (Execute, AxesGroup, Deceleration, JerkClosedIn physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time) performs a controlled motion stop of all axes in a coordinated motion group. Differences between MC_GrpHalt and MC_GrpStop.

MC_GrpHalt Application Example

The following example demonstrates a linear coordinated move with a starting point of (0,0) and an ending point of (200, 0). The first and second MC_GrpHalt commands are called while the linear coordinated move is still moving to the endpoint. As noted in the oscilloscope, the second call to MC_GrpHalt aborts the first MC_GrpHalt as seen by the new deceleration rate. The path velocity reaches zero (approximately (60, 0) ) before the linear coordinated move reaches its end point value.

1: // Perform Linear ABSOLUTE move start (0,0) end (200,0)
PosAbs[0]:= 0;
PosAbs[1]:= 200;
PosAbs[2]:= 0;

pathVelocity := Inst_MC_GrpReadCmdVel2.PathVelocity;

Inst_MC_MoveLinAbs(  TRUE, Group1_ref, PosAbs, Velocity, Acceleration, Deceleration, Jerk,
     MC_COORDINATE_SYSTEM_ACS, MC_BUFFER_MODE_ABORTING, MC_TRANSITION_MODE_NONE, TransParam);
Inst_TON3( true, t#600ms );	//Allow for the move to reach path velocity before calling MC_GrpStop
Inst_TON3.Q  THEN
     MC_MoveCounter := MC_MoveCounter + 1;
     Inst_TON3(false, t#100ms);
END_IF;

2: //Perform a halt on the group
halt_deceleration := 50.0;

pathVelocity := Inst_MC_GrpReadCmdVel2.PathVelocity;

Inst_MC_GrpHalt(TRUE, Group1_ref, halt_deceleration, default_jerkClosedIn physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time);

Inst_TON3( true, t#200ms );   //Allow for first halt deceleration rate to be captured on the scope
IF Inst_TON3.Q THEN
     MC_MoveCounter := MC_MoveCounter + 1;
     Inst_TON3(false, t#100ms);
END_IF;

3: // Perform a second halt increasing the deceleration value.
// The second call to MC_GrpHalt will abort the first MC_GrpHalt
halt_deceleration := 200.0;

pathVelocity := Inst_MC_GrpReadCmdVel2.PathVelocity;

Inst_MC_GrpHalt1(TRUE, Group1_ref, halt_deceleration, default_jerk);

Inst_TON3( true, t#200ms );
IF ((Inst_TON3.Q) and (Inst_MC_GrpHalt1.Done Or Inst_MC_GrpHalt1.Error)) THEN
     Inst_TON3(false, t#100ms);
     Inst_MC_MoveLinAbs(  FALSE, Group1_ref, PosAbs, default_velocity, default_acceleration, default_deceleration, default_jerk,
          MC_COORDINATE_SYSTEM_ACS, MC_BUFFER_MODE_ABORTING, MC_TRANSITION_MODE_NONE, TransParam);
     Inst_MC_GrpHalt1(FALSE, Group1_ref, default_deceleration, default_jerk);
END_IF;

When MC_GrpHalt is called in the example above, the current move will be aborted and a controlled motion stop will be applied to axes group 'Group1_ref'. The deceleration value, 'halt _deceleration' is set to 50.0 user units/sec2 on the first call and 200.0 user units/second2 on the second call. Jerk is currently not supported.

When MC_GrpHalt is called, the deceleration value from the function block is applied to the path velocity until it reaches zero when the MC_GrpHalt command is issued during a coordinated motion move. The group state is "GroupMoving" while the coordinated move is decelerating. The group state goes to “GroupStandBy” once the path velocity reaches zero. Any coordinated moves in the buffer are flushed, and new coordinated moves can be queued up upon completion of the MC_GrpHalt command.

Figure 7-11: Oscilloscope Representation of linear coordinated move with a MC_GrpHalt command called twice

Exceptions:

  • The deceleration rate from the MC_GrpHalt function block is only applied to the absolute and relative coordinated motion moves. Direct coordinated motion moves use the default deceleration value as defined by the AxisRef.
  • A MC_GrpHalt cannot occur if a group is not enabled.
  • A MC_GrpHalt command may be aborted by another MC_GrpHalt command, a MC_GrpStop command or a MC_Move* command.
  • When there are two coordinated motion moves (Active and Next) in the queue, and the path velocity does not reach zero before the end of the Active move, the path velocity will continue to reach zero during the Next move.
  • The deceleration rate will be increased if there is only one Active coordinated move and the path velocity cannot reach zero before the endpoint. This will prevent overshooting the endpoint.
  • A MC_GrpHalt command does not prevent single axis motion from being performed.