Skip to content

Commit

Permalink
modify parameters after swapping the mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
tongju12 committed Aug 29, 2024
1 parent 946b0d2 commit 380d109
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 63 deletions.
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="{5EA336A7-BBC1-CAA7-3118-CDD119B4865E}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tmo_motion\tmo_motion.tmc" TmcHash="{2A171A47-435F-81F5-D78A-688DB5203B14}">
<Name>tmo_motion Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down
4 changes: 0 additions & 4 deletions plc-tmo-motion/plc-tmo-motion.tsproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@
</Project>
<Mappings>
<MappingInfo Identifier="{00000000-2001-0850-0020-500841000403}" Id="#x02030030"/>
<MappingInfo Identifier="{00000000-2002-0850-0120-500852000403}" Id="#x02030070"/>
<MappingInfo Identifier="{00000000-0010-0304-3000-040310000403}" Id="#x02030010"/>
<MappingInfo Identifier="{08502001-0010-0304-0020-500810000403}" Id="#x02030020" Watchdog="00000000000000000000000000000000"/>
<MappingInfo Identifier="{08502002-0010-0304-0020-500810000403}" Id="#x02030050" Watchdog="00000000000000000000000000000000"/>
<MappingInfo Identifier="{08502002-0040-0304-0020-500840000403}" Id="#x02030060" Watchdog="04000000040000000400000004000000"/>
<MappingInfo Identifier="{05000010-2001-0850-3000-040300205008}" Id="#x02030040" Watchdog="14000000040000000400000004000000"/>
<MappingInfo Identifier="{05000010-2002-0850-3000-040301205008}" Id="#x02030080" Watchdog="14000000040000000400000004000000"/>
</Mappings>
</TcSmProject>
18 changes: 9 additions & 9 deletions plc-tmo-motion/tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ fbMotionLI2K4X(stMotionStage:=Main.M46);
//LI2K4 2DPMPS
fbStateSetup(stPositionState:=stDefault, bSetDefault:=TRUE);
fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.OUT], fDelta := 0.5, sName := 'OUT', fPosition:=-0.75);
fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.OUT], fDelta := 0.1, sName := 'OUT', fPosition:=-0.214);
fbStateSetup(stPositionState:=aLI2K4YStates[ENUM_LaserCoupling_States.OUT], fDelta := 0.5, sName := 'OUT', fPosition:=133.0);
fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 5.0, sName := 'MIRROR1', fPosition:=-3.375);
fbStateSetup(stPositionState:=aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 5.0, sName := 'MIRROR1', fPosition:=84.5);
fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 0.4, sName := 'MIRROR1', fPosition:=-0.795);
fbStateSetup(stPositionState:=aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 0.5, sName := 'MIRROR1', fPosition:=80.896);
aLI2K4YStates[ENUM_LaserCoupling_States.OUT].stPMPS.sPmpsState := 'LI2K4:IP1-OUT';
aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1].stPMPS.sPmpsState := 'LI2K4:IP1-MIRROR1';
Expand All @@ -73,18 +73,18 @@ aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1].stPMPS.sPmpsState := 'LI2K4:IP1
//LI2K4 EPS condition: OUT->In move Y then move X + IN->OUT move X thenm move Y
//Y only can move up and down when X is OUT
{*
EPS_LI2K4Y_Positive(eps:=Main.M45.stEPSForwardEnable);
EPS_LI2K4Y_Positive.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.8 OR Main.M45.stAxisStatus.fActPosition < 85);
EPS_LI2K4Y_Positive.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.3 OR Main.M45.stAxisStatus.fActPosition < 82);
EPS_LI2K4Y_Negative(eps:=Main.M45.stEPSBackwardEnable);
EPS_LI2K4Y_Negative.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.8 OR Main.M45.stAxisStatus.fActPosition > 84);
EPS_LI2K4Y_Negative.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.3 OR Main.M45.stAxisStatus.fActPosition > 79);
EPS_LI2K4X_Positive(eps:=Main.M46.stEPSForwardEnable);
EPS_LI2K4X_Positive.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 85 OR Main.M46.stAxisStatus.fActPosition < -0.65);
EPS_LI2K4X_Positive.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 82 OR Main.M46.stAxisStatus.fActPosition < -0.114);
EPS_LI2K4X_Negative(eps:=Main.M46.stEPSBackwardEnable);
EPS_LI2K4X_Negative.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 85 OR Main.M46.stAxisStatus.fActPosition > -0.85);
EPS_LI2K4X_Negative.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 82 OR Main.M46.stAxisStatus.fActPosition > -0.314);
*}
//LI2K4 sequenct move : OUT->IN Y move first and then X moves IN->OUT X moves first then Y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ CASE nState OF
stPMPSPlcToEpics=>stPMPSPlcToEpics,
);
tonStateSequenceTimeout(IN:=NOT stMotionStage1.bBusy,PT:=tStateSequenceTimeoutTime);
IF eEnumGet1 = nGoal THEN
IF stMotionStage1.Axis.NcToPlc.ActPos >= astPositionState1[nGoal].fPosition - astPositionState1[nGoal].fDelta AND
stMotionStage1.Axis.NcToPlc.ActPos <= astPositionState1[nGoal].fPosition + astPositionState1[nGoal].fDelta THEN
eEnumGet1 := nGoal;
eEnumSet := nGoal;
tonStateSequenceTimeout(IN:=FALSE);
nState := 10;
Expand Down Expand Up @@ -183,7 +185,9 @@ CASE nState OF
stPMPSPlcToEpics=>stPMPSPlcToEpics,
);
tonStateSequenceTimeout(IN:=NOT stMotionStage2.bBusy,PT:=tStateSequenceTimeoutTime);
IF eEnumGet2 = nGoal THEN
IF stMotionStage2.Axis.NcToPlc.ActPos >= astPositionState2[nGoal].fPosition - astPositionState2[nGoal].fDelta AND
stMotionStage2.Axis.NcToPlc.ActPos <= astPositionState2[nGoal].fPosition + astPositionState2[nGoal].fDelta THEN
eEnumGet2 := nGoal;
eEnumSet := nGoal;
tonStateSequenceTimeout(IN:=FALSE);
nState := 20;
Expand Down Expand Up @@ -211,7 +215,9 @@ CASE nState OF
stPMPSPlcToEpics=>stPMPSPlcToEpics,
);
tonStateSequenceTimeout(IN:=NOT stMotionStage2.bBusy,PT:=tStateSequenceTimeoutTime);
IF eEnumGet2 = nGoal THEN
IF stMotionStage2.Axis.NcToPlc.ActPos >= astPositionState2[nGoal].fPosition - astPositionState2[nGoal].fDelta AND
stMotionStage2.Axis.NcToPlc.ActPos <= astPositionState2[nGoal].fPosition + astPositionState2[nGoal].fDelta THEN
eEnumGet2 := nGoal;
nState := 0;
tonStateSequenceTimeout(IN:=FALSE);
ELSIF tonStateSequenceTimeout.Q THEN
Expand All @@ -237,7 +243,9 @@ CASE nState OF
stPMPSPlcToEpics=>stPMPSPlcToEpics,
);
tonStateSequenceTimeout(IN:=NOT stMotionStage1.bBusy,PT:=tStateSequenceTimeoutTime);
IF eEnumGet1 = nGoal THEN
IF stMotionStage1.Axis.NcToPlc.ActPos >= astPositionState1[nGoal].fPosition - astPositionState1[nGoal].fDelta AND
stMotionStage1.Axis.NcToPlc.ActPos <= astPositionState1[nGoal].fPosition + astPositionState1[nGoal].fDelta THEN
eEnumGet1 := nGoal;
nState := 0;
tonStateSequenceTimeout(IN:=FALSE);
ELSIF tonStateSequenceTimeout.Q THEN
Expand Down
75 changes: 30 additions & 45 deletions plc-tmo-motion/tmo_motion/tmo_motion.tmc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<TcModuleClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2009/05/TcModuleClass" Hash="{5EA336A7-BBC1-CAA7-3118-CDD119B4865E}" GeneratedBy="TwinCAT XAE Plc">
<TcModuleClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2009/05/TcModuleClass" Hash="{2A171A47-435F-81F5-D78A-688DB5203B14}" GeneratedBy="TwinCAT XAE Plc">
<DataTypes>
<DataType>
<Name Namespace="LCLS_General">ST_System</Name>
Expand Down Expand Up @@ -19263,21 +19263,6 @@ contributing fast faults, unless the FFO is currently vetoed.
</Property>
</Properties>
</DataType>
<DataType>
<Name>USINT (USINT#1..255)</Name>
<BitSize>8</BitSize>
<BaseType>USINT</BaseType>
<Properties>
<Property>
<Name>LowerBorder</Name>
<Value>1</Value>
</Property>
<Property>
<Name>UpperBorder</Name>
<Value>255</Value>
</Property>
</Properties>
</DataType>
<DataType>
<Name Namespace="lcls_twincat_common_components.lcls_twincat_motion.Tc3_IPCDiag">E_IPCDiag_Datatype</Name>
<Comment> parameter datatype 1..15</Comment>
Expand Down Expand Up @@ -20886,7 +20871,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</Parameter>
<Local>
<Name>nParameterIdx</Name>
<Type>USINT (USINT#1..255)</Type>
<Type>USINT (1..255)</Type>
<BitSize>8</BitSize>
</Local>
<Local>
Expand Down Expand Up @@ -24747,7 +24732,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</Method>
</DataType>
<DataType>
<Name>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</Name>
<Name>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</Name>
<BitSize>16</BitSize>
<BaseType>UINT</BaseType>
<Properties>
Expand All @@ -24761,6 +24746,21 @@ contributing fast faults, unless the FFO is currently vetoed.
</Property>
</Properties>
</DataType>
<DataType>
<Name>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Name>
<BitSize>16</BitSize>
<BaseType>UINT</BaseType>
<Properties>
<Property>
<Name>LowerBorder</Name>
<Value>1</Value>
</Property>
<Property>
<Name>UpperBorder</Name>
<Value>1000</Value>
</Property>
</Properties>
</DataType>
<DataType>
<Name Namespace="lcls_twincat_common_components.lcls_twincat_motion.PMPS.TcUnit">FB_AdsTestResultLogger</Name>
<Comment>
Expand All @@ -24778,7 +24778,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</SubItem>
<SubItem>
<Name>PrintingTestSuiteResultNumber</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<BitSize>16</BitSize>
<BitOffs>192</BitOffs>
</SubItem>
Expand Down Expand Up @@ -24816,12 +24816,12 @@ contributing fast faults, unless the FFO is currently vetoed.
</Local>
<Local>
<Name>TestsInTestSuiteCounter</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</Type>
<BitSize>16</BitSize>
</Local>
<Local>
<Name>MaxNumberOfTestsToPrint</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</Type>
<BitSize>16</BitSize>
</Local>
<Local>
Expand Down Expand Up @@ -25754,7 +25754,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</SubItem>
<SubItem>
<Name>WritingTestSuiteResultNumber</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<BitSize>16</BitSize>
<BitOffs>530752</BitOffs>
</SubItem>
Expand Down Expand Up @@ -26156,21 +26156,6 @@ contributing fast faults, unless the FFO is currently vetoed.
</Property>
</Properties>
</DataType>
<DataType>
<Name>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</Name>
<BitSize>16</BitSize>
<BaseType>UINT</BaseType>
<Properties>
<Property>
<Name>LowerBorder</Name>
<Value>1</Value>
</Property>
<Property>
<Name>UpperBorder</Name>
<Value>100</Value>
</Property>
</Properties>
</DataType>
<DataType>
<Name Namespace="lcls_twincat_common_components.lcls_twincat_motion.PMPS.TcUnit">U_ExpectedOrActual</Name>
<BitSize>4096</BitSize>
Expand Down Expand Up @@ -27794,7 +27779,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</Local>
<Local>
<Name>NumberOfTestsToAnalyse</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<BitSize>16</BitSize>
</Local>
<Local>
Expand Down Expand Up @@ -29329,7 +29314,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</Local>
<Local>
<Name>NumberOfTestsToAnalyse</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<BitSize>16</BitSize>
</Local>
</Method>
Expand Down Expand Up @@ -29914,7 +29899,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</Local>
<Local>
<Name>NumberOfTestsToAnalyse</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<BitSize>16</BitSize>
</Local>
</Method>
Expand Down Expand Up @@ -30362,7 +30347,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</Local>
<Local>
<Name>NumberOfTestsToAnalyse</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<BitSize>16</BitSize>
</Local>
</Method>
Expand Down Expand Up @@ -30736,7 +30721,7 @@ contributing fast faults, unless the FFO is currently vetoed.
</Local>
<Local>
<Name>NumberOfTestsToAnalyse</Name>
<Type>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<Type>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites)</Type>
<BitSize>16</BitSize>
</Local>
</Method>
Expand Down Expand Up @@ -100443,7 +100428,7 @@ second version of targets paddle 2</Comment>
We do this by defining an array, in where we can see which current TEST_ORDERED() is the one to be handled right now.
The below array is only used for TEST_ORDERED()-tests. </Comment>
<BitSize>16000</BitSize>
<BaseType>UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</BaseType>
<BaseType>UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite)</BaseType>
<ArrayInfo>
<LBound>1</LBound>
<Elements>1000</Elements>
Expand Down Expand Up @@ -104595,11 +104580,11 @@ second version of targets paddle 2</Comment>
</Property>
<Property>
<Name>ChangeDate</Name>
<Value>2024-08-22T11:36:35</Value>
<Value>2024-08-28T15:32:09</Value>
</Property>
<Property>
<Name>GeneratedCodeSize</Name>
<Value>1282048</Value>
<Value>1228800</Value>
</Property>
<Property>
<Name>GlobalDataSize</Name>
Expand Down

0 comments on commit 380d109

Please sign in to comment.