MC_GearIn (FB)¶
FUNCTION_BLOCK MC_GearIn
The function block couples the slave axis to the master axis, and applies a certain velocity ratio between master and slave.
When MC_GearIn
is started, the slave axis is ramped up to the
given ratio of the master velocity.
Coupling takes place once this is achieved. The distance travelled during
the coupling is not compensated for.
Note
MC_GearIn
should be called after the motion FB controlling
the Master
axis has been called. Otherwise, the Slave
axis
will lag behind the Master
axis.
While MC_GearIn
is in operation, the velocity ratio can be changed
by sequential MC_GearIn
commands. To do this, no preceding call of
MC_GearOut is necessary.
InGear
is set as soon as the desired velocity ratio is reached.
Once InGear
is set, the type of coupling depends on the current
control mode. In the standard case, i.e. in the position
control mode, the coupling is performed with the position values.
For example, with a ratio of 1:2, the slave is moved by exactly half
the distance of the master.
If velocity control mode is used, then the coupling is performed
with the velocity values. For example, with a ratio of 1:2, the slave
will move with half the master velocity in each cycle.

Ratio Reached
: Velocity ratio has been reached.
- InOut:
Scope
Name
Type
Initial
Comment
Inout
Master
Reference to master axis.
Master
needs not to be stationary.Slave
Reference to slave axis
Input
Execute
BOOL
Rising edge: Starts the execution of the function block.
RatioNumerator
DINT
1
Numerator of the quotient for the desired velocity ratio
RatioDenominator
UDINT
1
Denominator of the quotient for the desired velocity ratio
Acceleration
LREAL
Maximum acceleration for ramping up in [u/s²]
Deceleration
LREAL
Maximum deceleration for ramping up in [u/s²]
Jerk
LREAL
Maximum jerk for ramping up in [u/s³]
BufferMode
MC_BUFFER_MODE
Defines the chronological sequence of the FB relative to the previous block. Only the BufferModes
Aborting
,Buffered
andBlendingPrevious
are supported.BlendingPrevious
means that the configured velocity (including the direction) of the previous movement is used as the blending velocity, even if this movement has the opposite direction. If the function block is Busy, then only BufferMode=Aborting is allowed.Output
InGear
BOOL
TRUE
: Coupling has taken place. The slave moves with the given velocity ratio of the master.Busy
BOOL
TRUE
: Function block is in operation.Active
BOOL
Indicates that the FB has control on the axis
CommandAborted
BOOL
FALSE
TRUE
: Execution has been interrupted by another function block instance operating on the axis.Error
BOOL
TRUE
: Error has occurred.ErrorID
SMC_ERROR
Error identification