Skip to content

Commit

Permalink
Merge pull request #135 from tongju12/sp1k4-fzp-new-paddle
Browse files Browse the repository at this point in the history
new sp1k4-fzp paddle
  • Loading branch information
tongju12 authored Nov 6, 2024
2 parents c579e77 + e141a44 commit 797fe13
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 371 deletions.
2 changes: 1 addition & 1 deletion plc-tmo-motion/_Config/NC/Axes/PA1K4-PF-MMS.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ External Setpoint Generation:
</Drive>
<Controller Name="Ctrl" CtrType="1">
<CtrPara PriorControlFactor="1">
<PosDiffControl Range="0.8" Time="0.1"/>
<PosDiffControl Range="0.9" Time="0.1"/>
<Observer BandWidth="20"/>
</CtrPara>
</Controller>
Expand Down
2 changes: 1 addition & 1 deletion plc-tmo-motion/_Config/PLC/tmo_motion.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{9DD0BA81-4A92-4D5E-8BD9-E101C02702D4}" Name="tmo_motion" PrjFilePath="..\..\tmo_motion\tmo_motion.plcproj" TmcFilePath="..\..\tmo_motion\tmo_motion.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tmo_motion\tmo_motion.tmc" TmcHash="{809F7B1D-2ADE-E1E2-94D2-070C6BB450C6}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tmo_motion\tmo_motion.tmc" TmcHash="{A80F8EE4-0A2F-C0C9-F65C-8E1B0DE33650}">
<Name>tmo_motion Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down
27 changes: 23 additions & 4 deletions plc-tmo-motion/tmo_motion/DUTs/ENUM_ZonePlate_States.TcDUT
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,25 @@
<Declaration><![CDATA[{attribute 'qualified_only'}
TYPE ENUM_ZonePlate_States :
(
// Third version of targets paddle 3
Unknown := 0,
OUT := 1,
Yag := 2,
Target1b := 2,
Target5a := 3,
Target4b := 4,
Target5b := 5,
Target3b := 6,
Target2b := 7,
Target1a := 8,
Target2a := 9,
Target6b := 10,
Target7b := 11,
Target6a := 12,
Target7a := 13,
Target3a := 14,
Target4a := 15
) UINT;
END_TYPE
// first version of targets paddle 1
{* FZP860_1 := 3, //Ne1
FZP860_2 := 4, //Ne2
Expand All @@ -22,7 +38,7 @@ TYPE ENUM_ZonePlate_States :
FZP290_1 := 14, // C1
FZP290_2 := 15 //C2
// FZP250_1 := 16 //w1
*}
//second version of targets paddle 2
FZP530_1 := 3,
FZP806 := 4,
Expand All @@ -37,8 +53,11 @@ TYPE ENUM_ZonePlate_States :
FZP350 := 13,
FZP1212_2 := 14,
FZP875 := 15
) UINT;
END_TYPE
*}
]]></Declaration>
</DUT>
</TcPlcObject>
25 changes: 18 additions & 7 deletions plc-tmo-motion/tmo_motion/POUs/PRG_IM5K4_PPM.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ VAR
bValid := TRUE
);
// fStartupVelo: LREAL := 12;
// bInit: BOOL;
// bInit: BOOL;
END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -38,17 +38,25 @@ fbStateSetup(StPositionState:=fbIM5K4.stPower, fposition:=-44.23, sPmpsState :=
fbStateSetup(StPositionState:=fbIM5K4.stYag1, fposition:=-68.23, sPmpsState := 'IM5K4:PPM-YAG1');
fbStateSetup(StPositionState:=fbIM5K4.stYag2, fposition:=-94.24, sPmpsState := 'IM5K4:PPM-YAG2');
//IM5K4 is vetoed by PF1K4
CASE GVL_TcGVL.ePF1K4State OF
E_WFS_STATES.TARGET1, E_WFS_STATES.TARGET2, E_WFS_STATES.TARGET3, E_WFS_STATES.TARGET4, E_WFS_STATES.TARGET5 :
IF( GVL_TcGVL.ePF1K4State >1) THEN// E_WFS_STATES.TARGET1, E_WFS_STATES.TARGET2, E_WFS_STATES.TARGET3, E_WFS_STATES.TARGET4, E_WFS_STATES.TARGET5 :
// Known state targets: allow less strict pmps
fbIM5K4.stYag1.stPMPS.sPmpsState := 'IM5K4:PPM-YAG1_WFS_IN';
fbIM5K4.stYag2.stPMPS.sPmpsState := 'IM5K4:PPM-YAG2_WFS_IN';
ELSIF (GVL_TcGVL.eSP1K4FZP >1) THEN
// Known state targets: allow less strict pmps
fbIM5K4.stYag1.stPMPS.sPmpsState := 'IM5K4:PPM-YAG1_SP1K4_IN';
fbIM5K4.stYag2.stPMPS.sPmpsState := 'IM5K4:PPM-YAG2_SP1K4_IN';
ELSE
// Out, Unknown, or an unexpected state: full pmps
fbIM5K4.stYag1.stPMPS.sPmpsState := 'IM5K4:PPM-YAG1';
fbIM5K4.stYag2.stPMPS.sPmpsState := 'IM5K4:PPM-YAG2';
END_CASE
END_IF
//IM5K4 is vetoed by SP1K4-FZP
//paddle1
{*
Expand All @@ -64,10 +72,12 @@ ELSE
fbIM5K4.stYag2.stPMPS.sPmpsState := 'IM5K4:PPM-YAG2';
END_CASE
*}
//paddle2
//paddle2
(*
CASE GVL_TcGVL.eSP1K4FZP OF
ENUM_ZonePlate_States.FZP1212_1, ENUM_ZonePlate_States.FZP1212_2, ENUM_ZonePlate_States.FZP262_524, ENUM_ZonePlate_States.FZP290, ENUM_ZonePlate_States.FZP350, ENUM_ZonePlate_States.FZP400_1, ENUM_ZonePlate_States.FZP400_2,
ENUM_ZonePlate_States.FZP404_1212_1, ENUM_ZonePlate_States.FZP404_1212_2, ENUM_ZonePlate_States.FZP530_1, ENUM_ZonePlate_States.FZP530_2, ENUM_ZonePlate_States.FZP806, ENUM_ZonePlate_States.FZP875, ENUM_ZonePlate_States.Yag:
ENUM_ZonePlate_States.Target1a, ENUM_ZonePlate_States.Target1b, ENUM_ZonePlate_States.Target2a, ENUM_ZonePlate_States.Target2b, ENUM_ZonePlate_States.Target3a, ENUM_ZonePlate_States.Target3b, ENUM_ZonePlate_States.Target4a,
ENUM_ZonePlate_States.Target4b, ENUM_ZonePlate_States.Target5a, ENUM_ZonePlate_States.Target5b, ENUM_ZonePlate_States.Target6a, ENUM_ZonePlate_States.Target7a, ENUM_ZonePlate_States.Target7b, ENUM_ZonePlate_States.Target6b:
// Known state targets: allow less strict pmps
fbIM5K4.stYag1.stPMPS.sPmpsState := 'IM5K4:PPM-YAG1_SP1K4_IN';
fbIM5K4.stYag2.stPMPS.sPmpsState := 'IM5K4:PPM-YAG2_SP1K4_IN';
Expand All @@ -76,6 +86,7 @@ ELSE
fbIM5K4.stYag1.stPMPS.sPmpsState := 'IM5K4:PPM-YAG1';
fbIM5K4.stYag2.stPMPS.sPmpsState := 'IM5K4:PPM-YAG2';
END_CASE
*)
fbIM5K4(
fbArbiter := fbArbiter,
Expand Down
Loading

0 comments on commit 797fe13

Please sign in to comment.