MC_GearInPos

Function block MC_GearInPos

Commands a gear ratio between the position of the slave and master axes from the synchronization point onwards.

How it works:

First, the slave axis does an MC_MoveContinuousAbsolute move to reach the SlaveSyncPosition at the right time with the right velocity. The Velocity, Acceleration, and Deceleration inputs are for this MC_MoveContinuousAbsolute move. While this move is running, the StartSync output is TRUE. Once this motion is done, the InSync output is TRUE.

GearInPos profiles:

  • If MasterStartDistance is non-zero, the slave axis will start moving once the master position reaches MasterSyncPosition +- MasterStartDistance. Velocity is treated as max velocity that may not be reached, so basically it is omitted unless it is too low and then an error will be triggered as no compatible profile can be generated.
  • If MasterStartDistance is zero and Velocity is non-zero, the shortest possible profile will be calculated based on the maximum velocity provided.
  • If both MasterStartDistance and Velocity are zero, KINGSTAR will generate the smoothest profile as possible.
VAR_IN_OUT
B MasterIn AXIS_REF Reference to the master axis.
B SlaveIn AXIS_REF Reference to the slave axis. The number of slaves is up to 32.
VAR_INPUT
B Execute BOOL Starts gearing at the rising edge.
V Permanent BOOL

Determines whether the gear state is preserved after the motor is disabled.

TRUE: The gear state is preserved even if the motor is disabled. For example, if the master axis is enabled, the slave axis will be enabled. If an error has occurred on the master, it occurred on the slave too.

FALSE: The gear state won't be preserved after the motor is disabled.

B RatioNumerator INT Gear ratio numerator.
B RatioDenominator UINT Gear ratio denominator.
E MasterValueSource MC_Source

Defines the source for synchronization:

  • mcSetValue – synchronization on master set value. We suggest you use these settings.
  • mcActualValue – synchronization on master actual value. This setting may not be stable.
  • mcSecondEncoderValue – actual value of the secondary encoder of the axis. The result is the same as mcSetValue.
  • NOTE:  mcSecondEncoderValue is not supported yet.

B MasterSyncPosition LREAL

The master's position where the slave is in sync with the master.

B SlaveSyncPosition LREAL The slave's position where the slave is in sync with the master.
E SyncMode MC_SyncMode Defines the way to synchronize.
E MasterStartDistance LREAL The distance for the master to travel to synchronize with the slave (when the slave axis is started to get into synchronization).
E Velocity LREAL Maximum velocity during the time difference between StartSync and InSync.
E Acceleration LREAL Maximum acceleration during the time difference StartSync and InSync.
E Deceleration LREAL Maximum deceleration during the time difference StartSync and InSync.
E Jerk LREAL Maximum jerk during the time difference StartSync and InSync.
E BufferMode MC_BufferMode Defines how to blend the velocity of two function blocks.
VAR_OUTPUT
E StartSync BOOL Commanded gearing starts.
B InSync BOOL The synchronization state of the axis. TRUE: The synchronization is completed. FALSE: The slave axis is synchronizing with the master axis.
E Busy BOOL The function block is not finished and new output values are to be expected.
E Active BOOL The function block is controlling the axis.
E CommandAborted BOOL The command is aborted by another command.
B Error BOOL Signals that an error has occurred within the function block.
E ErrorID MC_Error Error identification.
  • If MasterStartDistance is implemented, any previous motion is continued until the master crosses either MasterSyncPosition or MasterStartDistance in the correct direction (according to the sign of MasterStartDistance). At that point in time the output StartSync is set. When a stop command is run on the slave axis before the synchronization has happened, it cancels the synchronization and the function sends CommandAborted.
  • If the MasterStartDistance is not specified, the system itself could calculate the set point for StartSync based on the other relevant inputs.
  • In SyncMode, the difference between mcCatchUp and mcSlowDown is the energy needed to synchronize. Compared to mcCatchUp, mcSlowDown costs the lower energy.

 

  MC_GearInPos  
AXIS_REF   MasterIn   Master   AXIS_REF
AXIS_REF   SlaveIn   Slave   AXIS_REF
BOOL   Execute   StartSync   BOOL
BOOL   Permanent   InSync   BOOL
INT   RatioNumerator   Busy   BOOL
UINT   RatioDenominator   Active   BOOL
MC_Source   MasterValueSource   CommandAborted   BOOL
LREAL   MasterSyncPosition   Error   BOOL
LREAL   SlaveSyncPosition   ErrorID   MC_Error
MC_SyncMode   SyncMode        
LREAL   MasterStartDistance        
LREAL   Velocity        
LREAL   Acceleration        
LREAL   Deceleration        
LREAL   Jerk        
MC_BufferMode   BufferMode        
             

 

Timing Diagram of MC_GearInPos