Skip to content

Commit

Permalink
Merge pull request #126 from nrwslac/state-movers
Browse files Browse the repository at this point in the history
MR1K1, MR1K2, SP1K1 State Movers With PMPS
  • Loading branch information
nrwslac authored Sep 25, 2024
2 parents 5aaf273 + 25a7d97 commit f0de8e4
Show file tree
Hide file tree
Showing 15 changed files with 15,427 additions and 3,205 deletions.
149 changes: 37 additions & 112 deletions lcls-plc-rixs-optics/_Config/NC/Axes/M1K2-Yleft.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 @@ -622,7 +622,7 @@ Drive Status 4 (manually linked):
</Relations>
</DataType>
<DataType>
<Name GUID="{4C3FC5AC-D5AA-44C6-AC5A-159774BA0F6D}" Namespace="MC" TcBaseType="true" HideType="true" IecDeclaration="DWORD;">NCTOPLC_AXIS_REF_STATE</Name>
<Name GUID="{4C3FC5AC-D5AA-44C6-AC5A-159774BA0F6D}" Namespace="MC" TcBaseType="true" HideType="true" IecDeclaration="DWORD;">NCTOPLC_AXIS_REF_STATE_OLD</Name>
<BitSize>32</BitSize>
<SubItem>
<Name>Operational</Name>
Expand Down Expand Up @@ -1014,11 +1014,11 @@ Drive Status 4 (manually linked):
</ArrayInfo>
</DataType>
<DataType>
<Name GUID="{6A65C767-34E5-42BF-AD87-E1A503EAC7BE}" Namespace="MC" TcBaseType="true">NCTOPLC_AXIS_REF</Name>
<Name GUID="{6A65C767-34E5-42BF-AD87-E1A503EAC7BE}" Namespace="MC" TcBaseType="true">NCTOPLC_AXIS_REF_OLD4</Name>
<BitSize>2048</BitSize>
<SubItem>
<Name>StateDWord</Name>
<Type GUID="{4C3FC5AC-D5AA-44C6-AC5A-159774BA0F6D}" Namespace="MC">NCTOPLC_AXIS_REF_STATE</Type>
<Type GUID="{4C3FC5AC-D5AA-44C6-AC5A-159774BA0F6D}" Namespace="MC">NCTOPLC_AXIS_REF_STATE_OLD</Type>
<BitSize>32</BitSize>
<BitOffs>0</BitOffs>
</SubItem>
Expand All @@ -1031,8 +1031,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 @@ -1046,8 +1045,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 @@ -1060,31 +1058,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 @@ -1310,13 +1304,13 @@ 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>
</Relations>
</DataType>
Expand All @@ -1331,38 +1325,33 @@ External Setpoint Generation:
<OtherSettings AllowMotionCmdToSlave="true"/>
</AxisPara>
<Encoder Name="Enc" EncType="29">
<EncPara ScaleFactorNumerator="1" ScaleFactorDenominator="1000" Offset="-96270.56" MaxCount="#xffffffff">
<SoftEndMinControl Enable="true" Range="-8870.56"/>
<SoftEndMaxControl Enable="true" Range="16239.44"/>
<EncPara ScaleFactorNumerator="1" ScaleFactorDenominator="1000" Offset="-99172.35" MaxCount="#xffffffff">
<SoftEndMinControl Enable="true" Range="-11772.35"/>
<SoftEndMaxControl Enable="true" Range="13337.65"/>
<Inc RefSoftSyncMask="#x0000ffff"/>
</EncPara>
<Vars VarGrpType="1">
<Name>Inputs</Name>
<Var>
<Name>In</Name>
<Type GUID="{9ED17BA1-BC38-47CA-9DD2-F96861AB0266}" Namespace="MC">NCENCODERSTRUCT_IN3</Type>
<BitOffs>1024</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 @@ -1371,7 +1360,6 @@ External Setpoint Generation:
<Var>
<Name>Out</Name>
<Type GUID="{4AA66E19-7B91-4A09-817D-0357681B7869}" Namespace="MC">NCENCODERSTRUCT_OUT3</Type>
<BitOffs>2048</BitOffs>
</Var>
</Vars>
</Encoder>
Expand All @@ -1385,25 +1373,12 @@ External Setpoint Generation:
<Var>
<Name>In</Name>
<Type GUID="{F95C7C69-0C87-46C4-9559-1285CCA5B23A}" Namespace="MC">NCDRIVESTRUCT_IN2</Type>
<BitOffs>1664</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 @@ -1423,7 +1398,6 @@ Drive Status 4 (manually linked):
<Var>
<Name>Out</Name>
<Type GUID="{644DC4BD-3D15-4DCB-94C7-24F3A5D579AA}" Namespace="MC">NCDRIVESTRUCT_OUT2</Type>
<BitOffs>2688</BitOffs>
<SubVar TypeFormatIndex="2">
<Name>nDataOut1</Name>
</SubVar>
Expand All @@ -1432,23 +1406,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 @@ -1476,91 +1446,46 @@ 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>
<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="{6A65C767-34E5-42BF-AD87-E1A503EAC7BE}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
<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="{6A65C767-34E5-42BF-AD87-E1A503EAC7BE}" Namespace="MC">NCTOPLC_AXIS_REF_OLD4</Type>
</Var>
</Vars>
</Axis>
<Mappings>
<OwnerA>
<OwnerB Name="TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^Term 5 (EK1122)^EK1100_M1K2^EL5042_M1K2_Yleftright">
<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 1^Position"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 1^Status^Diag" Size="1" OffsA="12"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 1^Status^Error" Size="1" OffsA="1"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 1^Status^Input cycle counter" Size="2" OffsA="14"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 1^Status^Ready" Size="1" OffsA="2"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 1^Status^TxPDO State" Size="1" OffsA="13"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 1^Status^Warning"/>
<Link VarA="Enc^Inputs^In^nState1" VarB="FB Inputs Channel 1^Status^Warning" Size="1"/>
</OwnerB>
<OwnerB Name="TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^Term 5 (EK1122)^EK1100_M1K2^EL7047_M1K2_Yleft">
<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^Motor stall" Size="1" OffsA="7"/>
<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^nCtrl2" VarB="STM Control^Control^Digital output 1" Size="1" OffsA="3"/>
Expand Down
Loading

0 comments on commit f0de8e4

Please sign in to comment.