First bigger step to automation

- Aligned X and Y NC Axis with aligner camera coordination system
- Added robot plc jobs and feedback
- Began Meca500 robot interface
- Changed hotplate control to slow PWM
- PackML statemachine now starts in aborted state
- Fixed StateML start method
This commit is contained in:
2026-02-04 19:31:13 +01:00
parent 677c03d51d
commit c1850f780b
29 changed files with 1249 additions and 374 deletions

View File

@@ -35,6 +35,12 @@ VAR
timWarningLowOn := T#1S,
timHardwareSignalLevelOff := T#1S));
_fbPITempControl : FB_PI;
_xSaturatedUpper : BOOL;
_xSaturatedLower : BOOL;
_rMV : REAL;
_fbPulsOut : TP;
_fbPWMOut : FB_PWM;
END_VAR
]]></Declaration>
<Implementation>
@@ -48,15 +54,43 @@ _fbTempSensor(
xConfirmAlarms:= xConfirmAlarms,
stHMIInterface=> );
_fbPITempControl(
rSP:= rTargetTemp,
rPV:= _fbTempSensor.rScaledValue,
rKp:= 2,
rTn:= 0,
xEnable:= xEnable,
xSaturatedUpper:= _xSaturatedUpper,
xSaturatedLower:= _xSaturatedLower,
rMV=> _rMV);
IF _rMV >= 100.0 THEN
_rMV := 100.0;
_xSaturatedUpper := TRUE;
ELSE
_xSaturatedUpper := FALSE;
END_IF
IF _rMV <=0 THEN
_rMV := 0.0;
_xSaturatedLower := TRUE;
ELSE
_xSaturatedLower := FALSE;
END_IF
_fbPWMOut(
rPWM:= _rMV,
timPeriod:= T#10S,
xOutput=> _xEnableHotplate);
// Control temperature with two point controller
IF _fbTempSensor.rScaledValue < (rTargetTemp - rDeadBand) THEN
_xEnableHotplate := TRUE;
END_IF
IF _fbTempSensor.rScaledValue >= (rTargetTemp) THEN
_xEnableHotplate := FALSE;
END_IF
// IF _fbTempSensor.rScaledValue < (rTargetTemp - rDeadBand) THEN
// _xEnableHotplate := TRUE;
// END_IF
//
// IF _fbTempSensor.rScaledValue >= (rTargetTemp) THEN
// _xEnableHotplate := FALSE;
// END_IF
]]></ST>
</Implementation>
<Method Name="M_AddItem" Id="{9707459a-6558-487c-b730-c9dc92d598ed}">

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="FB_PWM" Id="{39ea0d97-8eb7-44fa-b55f-8461b6c6c8ae}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_PWM
VAR_INPUT
rPWM : REAL;
timPeriod : TIME;
END_VAR
VAR_OUTPUT
xOutput : BOOL;
END_VAR
VAR
_tonTimer : TON;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_tonTimer(IN := TRUE, PT := timPeriod);
IF _tonTimer.Q THEN
_tonTimer(IN := FALSE);
END_IF
IF rPWM = 0.0 THEN
xOutput := FALSE;
ELSIF rPWM >= 100.0 THEN
xOutput := TRUE;
ELSE
IF (1.0 - (TIME_TO_REAL(_tonTimer.ET) / TIME_TO_REAL(timPeriod))) <= (rPWM * 0.01) THEN
xOutput := TRUE;
ELSE
xOutput := FALSE;
END_IF
END_IF]]></ST>
</Implementation>
</POU>
</TcPlcObject>