MC_GearInPos

PLCopen motion icon

 Function Block - Performs a slave axis move which follows the master axis based on the ratio specified by RatioNumerator and RatioDenominator.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0, 1

N/A

No default

On the rising edge, request to queue the slave gear ratio move.

Master

AXIS_REF

1 to 256

N/A

No default

Name of a declared instance of the AXIS_REF library function.

Slave

AXIS_REF

1 to 256

N/A

No default

AXIS_REF.AXIS_NUM is the slave axis number.

See AXIS_REF Structure.

RatioNumerator

DINT

-2147483648 to 2147483647

N/A

No default

Numerator of master/slave ratio.

The + or - sign indicates the direction for the slave axis.

RatioDenominator

DINT

-2147483648 to 2147483647

N/A

No default

Denominator of master/slave ratio.

  • The + or - sign indicates the direction for the master axis.
  • The direction determines the sync trigger comparison direction for the slave.
  • For a master moving in the:
    • positive direction, use a positive RatioDenominator.
    • negative direction, use a negative RatioDenominator.

MasterSyncPosition

LREAL

-1.7E308 to 1.7E308

N/A

No default

Master axis sync position.

14 to 15 significant digits of accuracy.

SlaveSyncPosition

LREAL

-1.7E308 to 1.7E308

N/A

No default

Slave axis sync position.

14 to 15 significant digits of accuracy.

SyncMode

INT

0, 1

N/A

No default

SyncMode determines the allowed conditions for synchronization.

MasterStartDistance

LREAL

-1.7E308 to 1.7E308

User units

No default

When the master axis reaches this distance before MasterSyncPosition, the slave axis begins its lock-on process.

  • 14 to 15 significant digits of accuracy.
  • The MasterStartDistance * (RatioNumerator/RatioDenominator) should be greater than (or equal to) the slave sync distance.
  • The slave sync distance is defined as the distance between the slave position when MC_GearInPos executes and the SlaveSyncPosition.
  • If the MasterStartDistance is too short, the MC_GearInPos may have excessive acceleration and a warning log message is generated.

BufferMode

SINT

1

N/A

No default

Outputs

Output

Data Type

Range

Unit

Description

StartSync

BOOL

No range

N/A

Indicates the master axis has reached the MasterStartDistance from the MasterSyncPosition and the lock-on process has begun.

InSync

BOOL

No range

N/A

Indicated the slave axis is locked on to the master axis.

Busy

BOOL

No range

N/A

High from the moment the Execute input goes high until the time the move is ended.

Active

BOOL

No range

N/A

Indicates this move is the Active move.

CommandAborted

BOOL

No range

N/A

Indicates the move was aborted.

If the abort arises because the inputs cause inconsistent motion, then this FB:

  • Performs no motion.
  • Sets an error flag.
  • Set the ErrorID to 13.

Error

BOOL

No range

N/A

Indicates either:

  • An invalid input was specified.
  • The move was terminated due to an error.

ErrorID

INT

No range

N/A

Indicates the error if the Error output is set to TRUE.

See PLCopen Function Block ErrorIDs.

Remarks

SlaveCommandPosition = MasterActualPosition * RatioNumerator / RatioDenominator
  • See Function Blocks - General Rules about how inputs and outputs work.
  • This function block allows the application to specify sync positions for the master and slave axes.
    • It is the point in which the master and slave axes become engaged in synchronous motion.
  • When the master axis reaches the MasterStartDistance from the MasterSyncPosition, the slave axis begins to accelerate to the target velocity determined by the master axis velocity and the ratio.
    • The slave axis arrives at the target velocity and the SlaveSyncPosition at the same time the master axis arrives at the MasterSyncPosition.
    • At that time, the slave is locked on to the master and follows the master at the ratio specified.
    • The slave axis continues to follow the master axis until this move is aborted.

Aborting Gearing

Gearing functions can generate large accelerations while following the master.

  • If the aborting function block has small, non-zero Jerk, or small acceleration values, it can take a long time for an accelerating axis to reach the target velocity, or position of the aborting function block.
    • If the Jerk and/or acceleration of the aborting function cannot be increased to suitable values, it may be desirable to either:
      • Abort the gearing function with an MC_GearOut with higher accelerations and/or Jerk values (or zero jerk value).
      • Execute the next MC motion function block (e.g., MC_Halt).

Time to Reach the Target Velocity

While following the master, gearing functions can generate large accelerations.

  • If the gearing function is aborted while the axis is currently accelerating, and the aborting function block has small non-zero Jerk or small acceleration values, it can take a long time to reach the target velocity, or position of the aborting function block.
    • If the Jerk and/or acceleration of the aborting function cannot be increased to suitable values, it may be desirable to either:
      • Abort the gearing function with an MC_GearOut with higher accelerations and/or Jerk values (or zero jerk value).
      • Execute the next MC motion function block (e.g., MC_Halt).

Figure 1: MC_GearInPos

Time Diagram

Figure 2: Time Diagram

Example

  • Master and Slave are rotary axes with rollovers at 360 degrees.
  • The Master initial position is 0 degrees and the slave initial position is 45 degrees.
  • The GearInPos FB commands the slave to accelerate up to the geared ratio (1:1) during the master start distance (90 degrees) and be synchronized with the master at the master and slave sync positions.

 

  1. Master Axis
  2. Slave Axis
  3. Master Start Distance
  4. Slave starts to accelerate
  5. Master Sync Position
  6. Slave Sync Position

FBD Language Example

Not available.

FFLD Language Example

IL Language Example

Not available.

ST Language Example

            (* MC_GearInPos ST example *)
            
Inst_MC_GearInPos( GearInPosReq, Axis1, Axis2, 2, 1, 0, 0, 0, 100.0, 1 );
//Inst_MC_GearInPos is instance of MC_GearInPos
GearInPosSync:= Inst_MC_GearInPos.InSync; //store InSync output into user defined variable