Implemented stuff to get ready for jet measurement
This commit is contained in:
@@ -77,11 +77,26 @@ VAR
|
||||
// =========
|
||||
|
||||
_fbRobot : FB_Mecademics;
|
||||
_fbSpinner : FB_AxisPTP;
|
||||
|
||||
xDisableVacuum AT %Q* : BOOL;
|
||||
|
||||
_fbValveEnableFilmetch : FB_Valve('');
|
||||
|
||||
_stValveConfig : ST_ValveConfig;
|
||||
|
||||
|
||||
// Internals
|
||||
_xOpenChuckClamp : BOOL;
|
||||
_xEjectChuck : BOOL;
|
||||
|
||||
// Debug
|
||||
_iState : INT;
|
||||
_xEnableSpinner : BOOL;
|
||||
_lrSpinnerVelo : LREAL := 36.0;
|
||||
_xAllCompRetracted : BOOL;
|
||||
_xChuckRemoved : BOOL;
|
||||
_xReleaseChuck : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
@@ -104,7 +119,7 @@ ELSE
|
||||
END_IF
|
||||
|
||||
// Todo bessere implementierung finden
|
||||
_xOpenChuckClamp := xOpenChuckClamp OR stHMIInterface.stChuckUnlockCmd.xRequest;
|
||||
//_xOpenChuckClamp := xOpenChuckClamp OR stHMIInterface.stChuckUnlockCmd.xRequest;
|
||||
|
||||
_fbUnlockLeft(
|
||||
xAutomaticOpen:= _xOpenChuckClamp,
|
||||
@@ -123,7 +138,7 @@ _fbUnlockRight(
|
||||
stHMIInterface:= stHMIInterface.stChuckUnlockRight);
|
||||
|
||||
_fbEjectFront(
|
||||
xAutomaticOpen:= _tpEjectChuck.Q,
|
||||
xAutomaticOpen:= _xEjectChuck,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveClampingFrontCfg,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
@@ -131,20 +146,143 @@ _fbEjectFront(
|
||||
stHMIInterface:= stHMIInterface.stChuckEjectFront);
|
||||
|
||||
_fbEjectBack(
|
||||
xAutomaticOpen:= _tpEjectChuck.Q,
|
||||
xAutomaticOpen:= _xEjectChuck,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveEjectBackCfg,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface:= stHMIInterface.stChuckEjectBack);
|
||||
|
||||
_xAllCompRetracted := _fbUnlockLeft.IsClosed AND _fbUnlockRight.IsClosed AND _fbEjectFront.IsClosed AND _fbEjectBack.IsClosed;
|
||||
|
||||
_fbSpinner(
|
||||
xEnable:= _xEnableSpinner,
|
||||
xEnablePositive:= _xEnableSpinner AND _xAllCompRetracted,
|
||||
xEnableNegative:= _xEnableSpinner AND _xAllCompRetracted,
|
||||
rOverride:= 100.0,
|
||||
lrVelocity:= _lrSpinnerVelo,
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
|
||||
xDisableVacuum := (NOT xEnableVacuum);
|
||||
|
||||
_fbRobot(stPackMLHMIInterface := stHMIInterface.stMecaCmds);
|
||||
|
||||
_fbValveEnableFilmetch(
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveConfig,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms := xConfirmAlarms,
|
||||
stHMIInterface:= stHMIInterface.stValveFilmetch);
|
||||
|
||||
// Call base sm
|
||||
SUPER^(stPackMLHMIInterface := stHMIInterface.stStationCmds);
|
||||
|
||||
// Einbaulage Baumer
|
||||
// 35 deg
|
||||
|
||||
// =====
|
||||
// Debug
|
||||
// =====
|
||||
|
||||
CASE _iState OF
|
||||
// Idle
|
||||
0:
|
||||
IF _xReleaseChuck THEN
|
||||
_xReleaseChuck := FALSE;
|
||||
_iState := 5;
|
||||
END_IF
|
||||
|
||||
// Enable spinner
|
||||
5:
|
||||
_xEnableSpinner := TRUE;
|
||||
IF _fbSpinner.xEnabled THEN
|
||||
_iState := 6;
|
||||
END_IF
|
||||
|
||||
// Start moving to zero position
|
||||
6:
|
||||
_fbSpinner.M_MoveModulo(lrTargetPos := 0.0, eMoveDirection := BC.MC_Direction.MC_Shortest_Way);
|
||||
_iState := 11;
|
||||
|
||||
// Move to zero position
|
||||
11:
|
||||
IF _fbSpinner.xDone THEN
|
||||
_iState := 12;
|
||||
END_IF
|
||||
|
||||
IF _fbSpinner.xError THEN
|
||||
_iState := 900;
|
||||
END_IF
|
||||
|
||||
// Disable axis
|
||||
12:
|
||||
_xEnableSpinner := FALSE;
|
||||
IF (NOT _fbSpinner.xEnabled) THEN
|
||||
_iState := 13;
|
||||
END_IF
|
||||
|
||||
// Release clamping
|
||||
13:
|
||||
_xOpenChuckClamp := TRUE;
|
||||
|
||||
IF _fbUnlockLeft.IsOpen AND _fbUnlockRight.IsOpen THEN
|
||||
_iState := 14;
|
||||
END_IF
|
||||
|
||||
IF _fbUnlockLeft.xError OR _fbUnlockRight.xError THEN
|
||||
_iState := 900;
|
||||
END_IF
|
||||
|
||||
// Eject the cuck
|
||||
14:
|
||||
_xEjectChuck := TRUE;
|
||||
|
||||
IF _fbEjectFront.IsOpen AND _fbEjectBack.IsOpen THEN
|
||||
_iState := 15;
|
||||
END_IF
|
||||
|
||||
IF _fbEjectFront.xError OR _fbEjectBack.xError THEN
|
||||
_iState := 900;
|
||||
END_IF
|
||||
|
||||
// Retract ejectors
|
||||
15:
|
||||
_xEjectChuck := FALSE;
|
||||
|
||||
IF _fbEjectFront.IsClosed AND _fbEjectBack.IsClosed THEN
|
||||
_iState := 16;
|
||||
END_IF
|
||||
|
||||
IF _fbEjectFront.xError OR _fbEjectBack.xError THEN
|
||||
_iState := 900;
|
||||
END_IF
|
||||
|
||||
// Wait for Chuck to be remove
|
||||
16:
|
||||
IF _xChuckRemoved THEN
|
||||
_xChuckRemoved := FALSE;
|
||||
_iState := 17;
|
||||
END_IF
|
||||
|
||||
// Retract release pins
|
||||
17:
|
||||
_xOpenChuckClamp := FALSE;
|
||||
|
||||
IF _fbUnlockLeft.IsClosed AND _fbUnlockRight.IsClosed THEN
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
IF _fbUnlockLeft.xError OR _fbUnlockRight.xError THEN
|
||||
_iState := 900;
|
||||
END_IF
|
||||
|
||||
// Error state
|
||||
900:
|
||||
IF xConfirmAlarms THEN
|
||||
_iState := 0;
|
||||
END_IF
|
||||
END_CASE
|
||||
|
||||
// Copy internal signals to output
|
||||
xDoorOpen := _fbValveDoor.IsOpen;
|
||||
xChuckClampOpen := _fbUnlockLeft.IsOpen AND _fbUnlockRight.IsOpen;
|
||||
@@ -167,7 +305,52 @@ END_VAR
|
||||
_stSMConfig.xCompletingDisabled := TRUE;
|
||||
_stSMConfig.xCompletedDisabled := TRUE;
|
||||
|
||||
_stSMConfig.xAbortingDisabled := TRUE;]]></ST>
|
||||
_stSMConfig.xAbortingDisabled := TRUE;
|
||||
|
||||
// Valve config
|
||||
_stValveConfig.xHasOpenFeedback := FALSE;
|
||||
_stValveConfig.xHasClosedFeedback := FALSE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_JetMeasurement" Id="{5ffd6d61-d32b-40d9-aa63-25591d7cd8df}">
|
||||
<Declaration><![CDATA[METHOD PRIVATE M_JetMeasurement
|
||||
VAR_INPUT
|
||||
xExecute : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
xDone : BOOL;
|
||||
xError : BOOL;
|
||||
END_VAR
|
||||
VAR_INST
|
||||
_iState : INT;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _iState OF
|
||||
// Idle
|
||||
0:
|
||||
IF xExecute THEN
|
||||
xDone := FALSE;
|
||||
xError := FALSE;
|
||||
_iState := 10;
|
||||
END_IF
|
||||
|
||||
// Check if robot is in safe position
|
||||
|
||||
// Enable equipment and move robot to measurement position
|
||||
|
||||
// Wait for equipment and robot to be ready
|
||||
|
||||
// Enable nozzle
|
||||
|
||||
// Check measurement and calculate offset
|
||||
|
||||
// Move Robot to new position
|
||||
|
||||
// Check measurement again
|
||||
|
||||
// Move to safe position
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
|
||||
@@ -33,6 +33,9 @@ STRUCT
|
||||
|
||||
// Chuck eject command
|
||||
stChuckEjectCmd : ST_HMI_CONTROL_BUTTON;
|
||||
|
||||
// Filmetch valve
|
||||
stValveFilmetch : ST_HMI_VALVE_DATA;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
|
||||
Reference in New Issue
Block a user