Skip to content

Commit

Permalink
Updating cc and rolling in three motion changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KaushikMalapati committed Nov 7, 2024
1 parent deaf52d commit 4be22a9
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 133 deletions.
6 changes: 3 additions & 3 deletions iocBoot/ioc-kfe-rix-motion/st.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Libraries:
#
# LCLS General: * -> 2.10.0 (SLAC)
# lcls-twincat-common-components: * -> 0.0.0 (SLAC)
# lcls-twincat-common-components: * -> 3.8.4 (SLAC)
# lcls-twincat-motion: * -> 4.1.1 (SLAC)
# lcls-twincat-physics: * -> 0.1.0 (SLAC)
# PMPS: * -> 3.2.1 (SLAC - LCLS)
Expand Down Expand Up @@ -666,8 +666,8 @@ dbLoadRecords("TwinCAT_Project.db", "PREFIX=PLC:RIX:MOTION,PROJECT=plc-kfe-rix-m

# LCLS General: * -> 2.10.0 (SLAC)
dbLoadRecords("TwinCAT_Dependency.db", "PREFIX=PLC:RIX:MOTION,DEPENDENCY=LCLS_General,VERSION=2.10.0,VENDOR=SLAC")
# lcls-twincat-common-components: * -> 0.0.0 (SLAC)
dbLoadRecords("TwinCAT_Dependency.db", "PREFIX=PLC:RIX:MOTION,DEPENDENCY=lcls-twincat-common-components,VERSION=0.0.0,VENDOR=SLAC")
# lcls-twincat-common-components: * -> 3.8.4 (SLAC)
dbLoadRecords("TwinCAT_Dependency.db", "PREFIX=PLC:RIX:MOTION,DEPENDENCY=lcls-twincat-common-components,VERSION=3.8.4,VENDOR=SLAC")
# lcls-twincat-motion: * -> 4.1.1 (SLAC)
dbLoadRecords("TwinCAT_Dependency.db", "PREFIX=PLC:RIX:MOTION,DEPENDENCY=lcls-twincat-motion,VERSION=4.1.1,VENDOR=SLAC")
# lcls-twincat-physics: * -> 0.1.0 (SLAC)
Expand Down
148 changes: 36 additions & 112 deletions plc-kfe-rix-motion/_Config/NC/Axes/Axis 12 PF1K2-WFS-MMS-Y.xti
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TcSmItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmItem" TcSmVersion="1.0" TcVersion="3.1.4022.30" ClassName="CNcAxisDef" SubType="1">
<?xml version="1.0"?>
<TcSmItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmProject" TcSmVersion="1.0" TcVersion="3.1.4024.35" ClassName="CNcAxisDef" SubType="1">
<DataTypes>
<DataType>
<Name GUID="{76EB036C-07A7-446B-91CB-CECCF6977DF3}" TcBaseType="true" HideType="true">UINTARR2_2</Name>
Expand Down Expand Up @@ -272,15 +272,13 @@
<SubItem>
<Name>nState4</Name>
<Type GUID="{18071995-0000-0000-0000-000000000002}">USINT</Type>
<Comment>
<![CDATA[Drive Status 4 (automatically linked):
<Comment><![CDATA[Drive Status 4 (automatically linked):
0x01 (0000 0001) = IO data invalid (e.g. EtherCAT 'WcState')
0x02 (0000 0010) = IO data input toggle (e.g. EtherCAT 'InputToggle')
Drive Status 4 (manually linked):
0x80 (1000 0000) = Fast axis stop (digital IO interrupt)
]]>
</Comment>
]]></Comment>
<BitSize>8</BitSize>
<BitOffs>88</BitOffs>
</SubItem>
Expand Down Expand Up @@ -329,6 +327,8 @@ Drive Status 4 (manually linked):
<SubItem>
<Name>nState8</Name>
<Type GUID="{18071995-0000-0000-0000-000000000002}">USINT</Type>
<Comment><![CDATA[Digital Inputs 1..8
]]></Comment>
<BitSize>8</BitSize>
<BitOffs>248</BitOffs>
</SubItem>
Expand Down Expand Up @@ -499,7 +499,7 @@ Drive Status 4 (manually linked):
</Format>
</DataType>
<DataType>
<Name GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC" TcBaseType="true">PLCTONC_AXIS_REF</Name>
<Name GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC" TcBaseType="true">PLCTONC_AXIS_REF_OLD</Name>
<BitSize>1024</BitSize>
<SubItem>
<Name>ControlDWord</Name>
Expand Down Expand Up @@ -1025,7 +1025,7 @@ Drive Status 4 (manually linked):
</ArrayInfo>
</DataType>
<DataType>
<Name GUID="{72F5AAAA-16DF-4ED3-8367-F6C8C3ADAE99}" Namespace="MC" TcBaseType="true">NCTOPLC_AXIS_REF</Name>
<Name GUID="{72F5AAAA-16DF-4ED3-8367-F6C8C3ADAE99}" Namespace="MC" TcBaseType="true">NCTOPLC_AXIS_REF_OLD5</Name>
<BitSize>2048</BitSize>
<SubItem>
<Name>StateDWord</Name>
Expand All @@ -1042,8 +1042,7 @@ Drive Status 4 (manually linked):
<SubItem>
<Name>AxisState</Name>
<Type GUID="{18071995-0000-0000-0000-000000000008}">UDINT</Type>
<Comment>
<![CDATA[Present State Of The Axis Movement (continuous axis):
<Comment><![CDATA[Present State Of The Axis Movement (continuous axis):
0 = INACTIVE: axis has no job
1 = RUNNING: axis is executing a motion job
2 = OVERRIDE_ZERO: axis is executing a job but override is zero
Expand All @@ -1057,8 +1056,7 @@ Slaves only:
External Setpoint Generation:
41 = EXTSETGEN_MODE1: external setpoint generation active
42 = EXTSETGEN_MODE2: internal and external setpoint gen. active
]]>
</Comment>
]]></Comment>
<BitSize>32</BitSize>
<BitOffs>64</BitOffs>
</SubItem>
Expand All @@ -1071,31 +1069,27 @@ External Setpoint Generation:
<SubItem>
<Name>HomingState</Name>
<Type GUID="{18071995-0000-0000-0000-000000000008}">UDINT</Type>
<Comment>
<![CDATA[Axis Homing Status:
<Comment><![CDATA[Axis Homing Status:
0: idle
1: start homing
2: searching home switch
3: stopping on home switch
4: moving off home switch
5: searching sync pulse
6: stopping after homing
]]>
</Comment>
]]></Comment>
<BitSize>32</BitSize>
<BitOffs>128</BitOffs>
</SubItem>
<SubItem>
<Name>CoupleState</Name>
<Type GUID="{18071995-0000-0000-0000-000000000008}">UDINT</Type>
<Comment>
<![CDATA[Axis Coupling Status:
<Comment><![CDATA[Axis Coupling Status:
0: axis is a single axis (not coupled)
1: axis is a master axis
2: axis is master and slave
3: axis is a slave axis
]]>
</Comment>
]]></Comment>
<BitSize>32</BitSize>
<BitOffs>160</BitOffs>
</SubItem>
Expand Down Expand Up @@ -1333,22 +1327,22 @@ External Setpoint Generation:
<Type GUID="{F794B740-82D7-4637-848E-4F74A711D038}">NCAXLESTRUCT_TOPLC4</Type>
</Relation>
<Relation Priority="100">
<Type GUID="{40BD39B0-C3EA-4F74-9F4F-5F1982786F7C}"/>
<Type GUID="{40BD39B0-C3EA-4F74-9F4F-5F1982786F7C}"></Type>
</Relation>
<Relation Priority="100">
<Type GUID="{40BD39B2-C3EA-4F74-9F4F-5F1982786F7C}"/>
<Type GUID="{40BD39B2-C3EA-4F74-9F4F-5F1982786F7C}"></Type>
</Relation>
<Relation Priority="100">
<Type GUID="{8CDE0C45-AB9D-42DB-BC94-1CF7521AB268}"/>
<Type GUID="{8CDE0C45-AB9D-42DB-BC94-1CF7521AB268}"></Type>
</Relation>
<Relation Priority="100">
<Type GUID="{6A65C767-34E5-42BF-AD87-E1A503EAC7BE}"/>
<Type GUID="{6A65C767-34E5-42BF-AD87-E1A503EAC7BE}"></Type>
</Relation>
</Relations>
</DataType>
</DataTypes>
<Axis Id="12" CreateSymbols="true" AxisType="1" AxisFolder="PF1K2-WFS">
<Name>Axis 12 PF1K2-WFS-MMS-Y</Name>
<Name>__FILENAME__</Name>
<AxisPara>
<Dynamic AccelerationMaximum="200" DecelerationMaximum="200" Acceleration="10" Deceleration="10" Jerk="500" DelayTime="0.004"/>
<Velo Maximum="20"/>
Expand All @@ -1357,37 +1351,33 @@ External Setpoint Generation:
</AxisPara>
<Encoder Name="Enc" EncType="29">
<EncPara ScaleFactorNumerator="5e-05" Offset="-214679" MaxCount="#xffffffff" ReferenceSystem="1">
<SoftEndMinControl Enable="true" Range="-99.33"/>
<SoftEndMinControl Enable="true" Range="-94"/>
<SoftEndMaxControl Enable="true" Range="-9.71"/>
<Inc RefSoftSyncMask="#x0000ffff"/>
<ParameterChanged>13</ParameterChanged>
</EncPara>
<Vars VarGrpType="1">
<Name>Inputs</Name>
<Var>
<Name>In</Name>
<Type GUID="{9ED17BA1-BC38-47CA-9DD2-F96861AB0266}" Namespace="MC">NCENCODERSTRUCT_IN3</Type>
<BitOffs>24832</BitOffs>
<SubVar>
<Name>nState1</Name>
<Comment>
<![CDATA[Encoder State 1 (automatically linked):
<Comment><![CDATA[Encoder State 1 (automatically linked):
0x0001 (Bit 0) = Warning
0x0002 (Bit 1) = Error
0x0004 (Bit 2) = Ready
0x1000 (Bit 12) = Diagnosis
0x2000 (Bit 13) = TxPDO State
0xC000 (Bit 14+15) = Input Cycle Counter
]]>
</Comment>
]]></Comment>
</SubVar>
<SubVar>
<Name>nComState</Name>
<Comment>
<![CDATA[Encoder Communication State (automatically linked):
<Comment><![CDATA[Encoder Communication State (automatically linked):
0x01 (Bit 0) = IO data invalid (e.g. EtherCAT 'WcState')
0x02 (Bit 1) = IO data input toggle (e.g. EtherCAT 'InputToggle')
]]>
</Comment>
]]></Comment>
</SubVar>
</Var>
</Vars>
Expand All @@ -1396,7 +1386,6 @@ External Setpoint Generation:
<Var>
<Name>Out</Name>
<Type GUID="{4AA66E19-7B91-4A09-817D-0357681B7869}" Namespace="MC">NCENCODERSTRUCT_OUT3</Type>
<BitOffs>38144</BitOffs>
</Var>
</Vars>
</Encoder>
Expand All @@ -1410,25 +1399,12 @@ External Setpoint Generation:
<Var>
<Name>In</Name>
<Type GUID="{F95C7C69-0C87-46C4-9559-1285CCA5B23A}" Namespace="MC">NCDRIVESTRUCT_IN2</Type>
<BitOffs>25472</BitOffs>
<SubVar TypeFormatIndex="2">
<Name>nDataIn1</Name>
</SubVar>
<SubVar TypeFormatIndex="2">
<Name>nDataIn2</Name>
</SubVar>
<SubVar>
<Name>nState4</Name>
<Comment>
<![CDATA[Drive Status 4 (automatically linked):
0x01 (0000 0001) = IO data invalid (e.g. EtherCAT 'WcState')
0x02 (0000 0010) = IO data input toggle (e.g. EtherCAT 'InputToggle')
Drive Status 4 (manually linked):
0x80 (1000 0000) = Fast axis stop (digital IO interrupt)
]]>
</Comment>
</SubVar>
<SubVar TypeFormatIndex="2">
<Name>nDataIn3</Name>
</SubVar>
Expand All @@ -1448,7 +1424,6 @@ Drive Status 4 (manually linked):
<Var>
<Name>Out</Name>
<Type GUID="{644DC4BD-3D15-4DCB-94C7-24F3A5D579AA}" Namespace="MC">NCDRIVESTRUCT_OUT2</Type>
<BitOffs>38784</BitOffs>
<SubVar TypeFormatIndex="2">
<Name>nDataOut1</Name>
</SubVar>
Expand All @@ -1457,23 +1432,19 @@ Drive Status 4 (manually linked):
</SubVar>
<SubVar>
<Name>nCtrl2</Name>
<Comment>
<![CDATA[Digital Outputs Setpoint Generator:
<Comment><![CDATA[Digital Outputs Setpoint Generator:
0x41 (0100 0001) = Minus (0x42 for inverse motor polarity)
0x42 (0100 0010) = Plus (0x41 for inverse motor polarity)
0x80 (1000 0000) = Stop
]]>
</Comment>
]]></Comment>
</SubVar>
<SubVar>
<Name>nCtrl3</Name>
<Comment>
<![CDATA[Digital Outputs (Setpoint Generator + Position Controller):
<Comment><![CDATA[Digital Outputs (Setpoint Generator + Position Controller):
0x41 (0100 0001) = Minus (0x42 for inverse motor polarity)
0x42 (0100 0010) = Plus (0x41 for inverse motor polarity)
0x80 (1000 0000) = Stop
]]>
</Comment>
]]></Comment>
</SubVar>
<SubVar TypeFormatIndex="2">
<Name>nDataOut3</Name>
Expand Down Expand Up @@ -1501,92 +1472,45 @@ Drive Status 4 (manually linked):
<Name>Inputs</Name>
<Var>
<Name>FromPlc</Name>
<Type GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC">PLCTONC_AXIS_REF</Type>
<BitOffs>23808</BitOffs>
<Type GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC">PLCTONC_AXIS_REF_OLD</Type>
</Var>
</Vars>
<Vars VarGrpType="2" InsertType="1">
<Name>Outputs</Name>
<Var>
<Name>ToPlc</Name>
<Type GUID="{72F5AAAA-16DF-4ED3-8367-F6C8C3ADAE99}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
<BitOffs>36096</BitOffs>
<SubVar>
<Name>AxisState</Name>
<Comment>
<![CDATA[Present State Of The Axis Movement (continuous axis):
0 = INACTIVE: axis has no job
1 = RUNNING: axis is executing a motion job
2 = OVERRIDE_ZERO: axis is executing a job but override is zero
3 = PHASE_VELOCONST: axis is moving at constant velocity
4 = PHASE_ACCPOS: axis is accelerating
5 = PHASE_ACCNEG: axis is decelerating
Slaves only:
11 = PREPHASE: slave axis is in a motion pre-phase
12 = SYNCHRONIZING: slave axis is synchronizing
13 = SYNCHRONOUS: slave axis is moving synchronously
External Setpoint Generation:
41 = EXTSETGEN_MODE1: external setpoint generation active
42 = EXTSETGEN_MODE2: internal and external setpoint gen. active
]]>
</Comment>
</SubVar>
<SubVar>
<Name>HomingState</Name>
<Comment>
<![CDATA[Axis Homing Status:
0: idle
1: start homing
2: searching home switch
3: stopping on home switch
4: moving off home switch
5: searching sync pulse
6: stopping after homing
]]>
</Comment>
</SubVar>
<SubVar>
<Name>CoupleState</Name>
<Comment>
<![CDATA[Axis Coupling Status:
0: axis is a single axis (not coupled)
1: axis is a master axis
2: axis is master and slave
3: axis is a slave axis
]]>
</Comment>
</SubVar>
<Type GUID="{72F5AAAA-16DF-4ED3-8367-F6C8C3ADAE99}" Namespace="MC">NCTOPLC_AXIS_REF_OLD5</Type>
</Var>
</Vars>
</Axis>
<Mappings>
<OwnerA>
<OwnerB Name="TIID^PLC Rail (EtherCAT)^Power (EK1200)^Fiber Coupler (EK1521-0010)^Term 123 (EK1100)^Term 131 (EK1122)^PF1K2-WFS (EK1100)^PF1K2-EL5042-E3">
<Link VarA="Enc^Inputs^In^nComState" VarB="WcState^InputToggle" Size="1" OffsA="1"/>
<Link VarA="Enc^Inputs^In^nComState" VarB="WcState^WcState"/>
<Link VarA="Enc^Inputs^In^nComState" VarB="WcState^WcState" Size="1"/>
<Link VarA="Enc^Inputs^In^nDataIn1" VarB="FB Inputs Channel 2^Position"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 2^Status^Diag" Size="1" OffsA="12"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 2^Status^Error" Size="1" OffsA="1"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 2^Status^Input cycle counter" Size="2" OffsA="14"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 2^Status^Ready" Size="1" OffsA="2"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 2^Status^TxPDO State" Size="1" OffsA="13"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 2^Status^Warning"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 2^Status^Warning" Size="1"/>
</OwnerB>
<OwnerB Name="TIID^PLC Rail (EtherCAT)^Power (EK1200)^Fiber Coupler (EK1521-0010)^Term 123 (EK1100)^Term 131 (EK1122)^PF1K2-WFS (EK1100)^PF1K2-EL7041-E1">
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Error" Size="1" OffsA="3"/>
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Moving negative" Size="1" OffsA="5"/>
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Moving positive" Size="1" OffsA="4"/>
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Ready" Size="1" OffsA="1"/>
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Ready to enable"/>
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Ready to enable" Size="1"/>
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Torque reduced" Size="1" OffsA="6"/>
<Link VarA="Drive^Inputs^In^nState1" VarB="STM Status^Status^Warning" Size="1" OffsA="2"/>
<Link VarA="Drive^Inputs^In^nState2" VarB="STM Status^Status^Digital input 1" Size="1" OffsA="3"/>
<Link VarA="Drive^Inputs^In^nState2" VarB="STM Status^Status^Digital input 2" Size="1" OffsA="4"/>
<Link VarA="Drive^Inputs^In^nState2" VarB="STM Status^Status^Sync error" Size="1" OffsA="5"/>
<Link VarA="Drive^Inputs^In^nState2" VarB="STM Status^Status^TxPDO Toggle" Size="1" OffsA="7"/>
<Link VarA="Drive^Inputs^In^nState4" VarB="WcState^InputToggle" Size="1" OffsA="1"/>
<Link VarA="Drive^Inputs^In^nState4" VarB="WcState^WcState"/>
<Link VarA="Drive^Outputs^Out^nCtrl1" VarB="STM Control^Control^Enable"/>
<Link VarA="Drive^Inputs^In^nState4" VarB="WcState^WcState" Size="1"/>
<Link VarA="Drive^Outputs^Out^nCtrl1" VarB="STM Control^Control^Enable" Size="1"/>
<Link VarA="Drive^Outputs^Out^nCtrl1" VarB="STM Control^Control^Reduce torque" Size="1" OffsA="2"/>
<Link VarA="Drive^Outputs^Out^nCtrl1" VarB="STM Control^Control^Reset" Size="1" OffsA="1"/>
<Link VarA="Drive^Outputs^Out^nDataOut2[0]" VarB="STM Velocity^Velocity"/>
Expand Down
2 changes: 1 addition & 1 deletion plc-kfe-rix-motion/_Config/PLC/kfe_rix_motion.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{C31F67CF-3F03-4F49-935F-2494FCDDA958}" Name="kfe_rix_motion" PrjFilePath="..\..\kfe_rix_motion\kfe_rix_motion.plcproj" TmcFilePath="..\..\kfe_rix_motion\kfe_rix_motion.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="kfe_rix_motion\kfe_rix_motion.tmc" TmcHash="{6E39B5FA-C5FB-9A0B-293E-8D4E7D1425B2}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="kfe_rix_motion\kfe_rix_motion.tmc" TmcHash="{ADD6A367-2A13-BD77-5A4A-CDAA94BB92CB}">
<Name>kfe_rix_motion Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down
2 changes: 1 addition & 1 deletion plc-kfe-rix-motion/kfe_rix_motion/POUs/PRG_IM1K1_PPM.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ VAR
fbStateSetup: FB_StateSetupHelper;
stDefault: ST_PositionState := (
fVelocity := 1,
fVelocity := 10,
bMoveOk := TRUE,
bValid := TRUE
);
Expand Down
Loading

0 comments on commit 4be22a9

Please sign in to comment.