MC_GearIn
Synchronizes the slave onto the master's velocity and acceleration scaled by a constant gear ratio. Synchronizes as fast as the function block's inputs Acceleration, Deceleration and Jerk allow. MC_GearIn has no input Velocity. The axis' parameter Maximum Velocity is used while synchronizing. Once the slave has reached the scaled velocity and acceleration, the function block's output InGear signals true and the slave is coupled to the scaled master. From then on the slave's dynamics and position are coupled to the scaled master's, ignoring any dynamic restrictions (commanded dynamics as well as axis parameters). The position relationship when reaching InGear is consequently not configurable. Use MC_GearInPos when a specific position relationship is required. The command may be ended by sending another command. Using input BufferMode := Aborting makes the next command take over immediately while input BufferMode := Buffered queues the next command. It will then take over as soon as InGear is reached.
Syntax
Definition:
FUNCTION_BLOCK MC_GearIn
VAR_INPUT
Master : Type_Master1D;
Slave : Reference To AXIS_REF;
Execute : BOOL;
RatioNumerator : LREAL;
RatioDenominator : UDINT;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : EBufferMode;
ReactionToMasterError : EReactionToMasterError;
ReactionToSlaveError : EReactionToSlaveError;
END_VAR
VAR_OUTPUT
InGear : BOOL;
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorId : UDINT;
MasterHasError : BOOL;
END_VAR
Inputs
Name | Type | Default | Description |
|---|---|---|---|
Master |
| Reference to the master axis | |
Slave | Reference To AXIS_REF |
| Reference to the slave axis |
Execute | BOOL |
| Trigger the command with rising edge. |
RatioNumerator | LREAL | 1.0 | The numerator of the gear ratio. Once synchronous, the slave's velocity, acceleration and position changes are (RatioNumerator / RatioDenominator) times the master's values. A negative value moves the slave opposite to the master. |
RatioDenominator | UDINT | 1 | The denominator of the gear ratio |
Acceleration | LREAL | #Default | The input Acceleration is used for planning the synchronization ([PosUnit]/s^2, positive). It is not a strict maximum, it might be exceeded due to initial conditions. It has no effect once the slave is synchronous. Must currently be equal to input Deceleration. |
Deceleration | LREAL | #Default | The input Deceleration used for planning the synchronization ([PosUnit]/s^2, positive). Not a strict maximum, see input Acceleration. It has no effect once the slave is synchronous. Must currently be equal to input Acceleration. |
Jerk | LREAL | #Default | The jerk used to ramp up or down acceleration during planning the synchronization ([PosUnit]/s^3, positive). It has no effect once the slave is synchronous. |
BufferMode | Aborting | Whether the command shall take effect immediately (Aborting) or be queued (Buffered). | |
ReactionToMasterError | TriggerSlaveError | This input affects how the slave axis reacts to an error on the master axis. | |
ReactionToSlaveError | TriggerMasterError | This input affects how an error on the slave axis is propagated to the master axis. |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
InGear |
BOOL |
TRUE once the slave has reached the master's velocity and acceleration scaled by the gear ratio. From then on the slave's velocity, acceleration and position changes are locked to the scaled master's values. The lock is permanent for the remainder of the command. |
|
Busy |
BOOL |
The function block is not finished and new output values are to be expected. |
|
Active |
BOOL |
The function block has active control on the axis. |
|
CommandAborted |
BOOL |
The command is aborted by another command. |
|
Error |
BOOL |
An error occurred within the function block. |
|
ErrorId |
UDINT |
Error identifier |
|
MasterHasError |
BOOL |
Master is in error state. |
Weiterführende Informationen
Die Eingänge Acceleration und Deceleration sind identisch zu belegen. Des Weiteren ist eine Kopplung nur dann möglich, wenn die Slave-Achse sich im Stillstand befindet.
Ergänzungen zu ReactionToSlaveError und ReactionToMasterError
Grundsätzlich gilt bei einem Fehler der Slave-Achse:
- Slave-Achse: Die Kopplung wird aufgelöst und die Reaktion ist abhängig vom Fehlertypen.
- Master-Achse: Die Master-Achse meldet einen Fehler und folgt einer Stopprampe der MC oder führt ihre laufende Bewegung ohne Beeinflussung fort.
Bei einem Fehler der Master-Achse gilt:
- Master-Achse: Reaktion ist abhängig vom Fehlertypen.
- Slave-Achse: Die Slave-Achse meldet einen Fehler und folgt einer Stopprampe der MC oder den Sollwerten der Master-Achse.
Ausführliche Informationen sind im Kapitel Fehlerverhalten dokumentiert.
Mögliche Fehlercodes
Für diesen Funktionsbaustein sind unter anderem die folgenden Werte für den Ausgang ErrorId möglich:
Fehler(Hex) | Fehler(Dez) | Fehlertyp | Beschreibung |
|---|---|---|---|
0x813c | 33084 | Parameter | Der Buffer-Modus ist ungültig. Der am Funktionsbaustein angegebene BufferMode ist unbekannt oder wird vom Kommando nicht unterstützt (einige Kommandos akzeptieren z.B. nur Aborting, andere nur Buffered). |
0x8143 | 33091 | Kommunikation | Funktionsbaustein oder das entsprechende Kommando wird vom Zielsystem nicht unterstützt. Das Zielobjekt (z.B. Achse, Gruppe oder Encoder-Achse) unterstützt das angeforderte Kommando nicht, etwa weil eine optionale Funktion nicht implementiert oder das Objekt vom falschen Typ ist. |
0x8146 | 33094 | Funktionsbaustein | Ungültiger Geschwindigkeits-Wert. Die Geschwindigkeit ist nicht gesetzt worden oder der eingegebene Wert ist ungültig. |
0x8151 | 33105 | Zustand | Das Kommando ist im gegenwärtigen Achszustand nicht erlaubt. Wenn die Achse keine Reglerfreigabe hat, sich im Fehler befindet oder einer Gruppe hinzugefügt wurde, sind einige Kommandos nicht erlaubt. |
0x8169 | 33129 | Funktionsbaustein | Masterachse existiert nicht oder kann nicht verwendet werden. Die als Master übergebene Achse ist nicht vorhanden oder hat keine zyklische Verknüpfung und kann daher nicht als Master (z.B. für Camming oder Gearing) verwendet werden. |
0x816f | 33135 | Zustand | Achskopplung würde eine zyklische Achsabhängigkeit verursachen (z.B. über MC_GearInPos). Die angeforderte Master-Slave-Kopplung würde einen Zyklus in der Kopplungs-Hierarchie erzeugen (eine Achse wäre direkt oder transitiv ihr eigener Master). |
0x81a9 | 33193 | Parameter | Ungültiger Beschleunigungs-Wert. Der übergebene Beschleunigungs-Wert ist ungültig (z.B. kein endlicher Wert, negativ oder außerhalb des zulässigen Bereichs). |
0x81aa | 33194 | Parameter | Ungültiger Verzögerungs-Wert. Der übergebene Verzögerungs-Wert ist ungültig (z.B. kein endlicher Wert, negativ oder außerhalb des zulässigen Bereichs). |
0x81ab | 33195 | Parameter | Ungültiger Ruck-Wert. Der für die Bewegung verwendete Ruck-Wert ist ungültig (z.B. negativ, Null oder außerhalb des erlaubten Bereichs des Movers bzw. der Achse). |
0x81b6 | 33206 | Funktionsbaustein | Die gegebene Fehler-Reaktion ist ungültig. Die am Bewegungsbaustein angegebene Fehler-Reaktion ist ungültig (z.B. unbekannter Wert in ErrorReactionToMaster oder ErrorReactionToSlave an Synchronisations-Bausteinen). |
0x8145 | 33093 | Funktionsbaustein | Die Verknüpfung des zyklischen Interfaces zwischen NC und SPS fehlt (z.B. AXIS_REF, AXES_GROUP_REF, ...). Eine vom Funktionsbaustein verwendete Referenz (z.B. auf eine Achse, Gruppe, einen Mover oder ein anderes Motion-Objekt) ist nicht mit dem zugehörigen NC-Objekt verknüpft oder die zyklische Verknüpfung ist unvollständig. |
0x813f | 33087 | Funktionsbaustein | Der Slave kann sich nicht synchronisieren. Der Slave kann die SlaveSyncPosition mit den gegebenen Dynamiken nicht erreichen. |
Eine Übersicht aller NC-Fehlercodes finden Sie hier:
Versionsinformation
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.6