What Does MC_GrpStop Do?

MC_GrpStop (Execute, AxesGroup, Deceleration, JerkClosed In 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_GrpStop Application Example

The following example demonstrates a linear coordinated move starting point of [0,0] and ending at point of [200, 0]. MC_GrpStop is called while the linear coordinated move is still moving to the endpoint. As noted in the oscilloscope, the path velocity reaches zero (approximately [100,0]) before the linear coordinated move reaches its end point value.

Linear Move Parameters MC_GroupStop Parameters
Velocity = 100 stop_velocity = 75
Acceleration = 200  
Deceleration = 200  
Jerk = 0  
Inst_MC_GrpReadCmdPos( TRUE, Group1_ref, MC_COORDINATE_SYSTEM_ACS, CmdPositionArray );
Inst_MC_GrpReadCmdVel2( TRUE, Group1_ref, MC_COORDINATE_SYSTEM_ACS, VelocityArray);
CASE MC_MoveCounter OF

0: // Enable the group
Inst_MC_GrpEnable(TRUE, Group1_ref);
Inst_TON3( true, t#1500ms );	// Allow for turning on the scope
IF ((Inst_TON3.Q) and (Inst_MC_GrpEnable.Done OR Inst_MC_GrpEnable.Error)) THEN

     Inst_TON3(false, t#1s);
     IF (Inst_MC_GrpEnable.Error) THEN
          PrintMessage( LEVEL_INFO (*DINT*),  'MC_GrpEnable failed - ErrorID: ' + any_to_string(Inst_MC_GrpEnable.ErrorID));
     END_IF;

     Inst_MC_GrpEnable(FALSE, Group1_ref);
     MC_MoveCounter := MC_MoveCounter + 1;
END_IF;

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
IF Inst_TON3.Q  THEN
     MC_MoveCounter := MC_MoveCounter + 1;
     Inst_TON3(false, t#100ms);
END_IF;

2: //Perform a stop on the group
stop_deceleration := 75.0;

pathVelocity := Inst_MC_GrpReadCmdVel2.PathVelocity;

Inst_MC_GrpStop(TRUE, Group1_ref, stop_deceleration, default_jerkClosed In physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time );

Inst_TON3( true, t#200ms );
IF ((Inst_TON3.Q) AND (Inst_MC_GrpStop.Done Or Inst_MC_GrpStop.Error)) THEN
     IF Inst_MC_GrpStop.Error THEN
          PrintMessage( LEVEL_INFO (*DINT*), 'Step '+any_to_string(MC_MoveCounter)+',MC_GrpStop ERROR. ErrorID('+any_to_string(Inst_MC_GrpStop.ErrorID)+'), Description:'+MC_ErrorDescription(any_to_int(Inst_MC_GrpStop.ErrorID)));
     END_IF;

     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_GrpStop(FALSE, Group1_ref, stop_deceleration, default_jerk );
END_IF;

When MC_GrpStop 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, 'stop_deceleration', is set to 75.0 user units/sec2 and is applied to the path velocity until it reaches zero. Jerk is currently not supported.

The group state is “GroupStopping” when the MC_GrpStop function block becomes active. While the axes group is in the GroupStopping state, no other function blocks can perform any motion on the same axes group. Once the path velocity reaches zero the Done output is TRUE. The Execute input must be set to FALSE before the group state can go to “GroupStandBy”. Any coordinated moves in the buffer are flushed, and new coordinated moves can be queued up upon completion of the Stop command

Figure 7-12: Oscilloscope Representation of linear coordinated move with a MC_GrpStop

Exceptions:

  • The deceleration rate from the MC_GrpStop function block is only applied to the absolute and relative moves. Direct moves use the default deceleration value as defined by the AxisRef.
  • MC_GrpStop cannot occur if a group is not enabled.
  • A MC_GrpStop command cannot be aborted by any other commands (while MC_GrpHalt can be).
  • 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_GrpStop command does not prevent single axis motion from being performed.