Function BlockMC_GearInPLCopen motion icon

Description

This function block performs a slave axis move which follows the master axis based on the ratio specified by RatioNumerator and RatioDenominator.

SlaveCommandPosition = MasterActualPosition * RatioNumerator / RatioDenominator

When this command is executed, the slave axis accelerates or decelerates (using the Acceleration, Deceleration, and JerkClosedIn physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time) to the target velocity determined by the master axis velocity and the ratio. When the slave axis reaches a velocity within the “In Gear” bandwidth around the target velocity, it locks on to the master, and the InGear output goes high. When the slave is locked to the master, the slave motion is no longer affected by the acceleration, deceleration, and jerkClosedIn physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time inputs.

For example if the “In Gear” bandwidthClosedIn computer networking, bandwidth often refers to a data rate measured in bits/s, for example, network throughput. The reason for the connection of data rate with the term bandwidth is that the limit to the data rate of a physical communication link is related to its bandwidth in hertz is set to 0.1 User Units per second, the InGear output will turn on if the slave velocity is within +/- 0.1 User Units per second of the target velocity.

The slave axis then 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:

  • 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 such as 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:

  • 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 such as MC_Halt.

MC_GearIn

Figure 7-143: MC_GearIn

Time Diagram

MC_GearIn: Timing Diagram

Arguments

For more detail on how inputs and outputs work, refer to PLCopen Function Blocks - General Rules

Input

Execute

Description

Requests to queue the slave gear ratio move

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

 

Default

Master

Description

Name of a declared instance of the AXIS_REF library function (for more details,About Axis Name and Number)

 

Data type

AXIS_REF

 

Range

[1,256]

 

Unit

N/A

 

Default

Slave

Description

AXIS_REF.AXIS_NUM is the slave axis number

 

Data type

AXIS_REF

 

Range

[1,256]

 

Unit

N/A

 

Default

RatioNumerator

Description

Numerator of master/slave ratio

 

Data type

DINT

 

Range

[-2147483648, 2147483647]

 

Unit

N/A

 

Default

RatioDenominator

Description

Denominator of master/slave ratio

 

Data type

DINT

 

Range

[-2147483648, 2147483647]

 

Unit

N/A

 

Default

Acceleration

Description

Trapezoidal: Acceleration rate

S-curve: Maximum acceleration

 

Data type

LREAL

 

Range

 

Unit

User unit/sec2

 

Default

Deceleration

Description

Trapezoidal: Deceleration rate

S-curve: Unused

 

Data type

LREAL

 

Range

 

Unit

User unit/sec2

 

Default

Jerk

Description

Trapezoidal: 0

S-curve: Constant jerk

 

Data type

LREAL

 

Range

 

Unit

User unit/sec3

 

Default

BufferMode

Description

0 = abort

1 = buffer

See table in Buffer Modes

 

Data type

SINT

 

Range

[0,1]

 

Unit

N/A

 

Default

Output

InGear

Description

Indicates the slave axis is locked on to the master axis

 

Data type

BOOL

Busy

Description

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

 

Data type

BOOL

Active

Description

Indicates this move is the Active move

 

Data type

BOOL

CommandAborted

Description

Indicates the move was aborted

 

Data type

BOOL

Error

Description

Indicates an invalid input was specified or the move was terminated due to an error

 

Data type

BOOL

ErrorID

Description

Indicates the error if Error output is set to TRUE

See table in PLCopen Function Block ErrorID Output

 

Data type

INT

Example

Structured Text

(* MC_GearIn ST example *) Inst_MC_GearIn( GearInReq, Axis1, Axis2, 2, 1, 150.0, 150.0, 0, 0 ); //Inst_MC_GearIn is an instance of MC_GearIn

See also how this function is used in the Hole punch project here

Ladder Diagram

MC_GearIn: LD example

Go back to the top of the page [Top]