Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding deltas to ATMs #72

Merged
merged 7 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions plc-kfe-rix-motion/kfe_rix_motion/POUs/PRG_TM1K2_ATM.TcPOU
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="PRG_TM1K2_ATM" Id="{c02e8350-6bfd-4c3f-8509-cf01c04221fa}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM PRG_TM1K2_ATM
VAR
Expand All @@ -25,12 +25,12 @@ END_VAR
<ST><![CDATA[
fbStateSetup(stPositionState:=stDefault, bSetDefault:=TRUE);

fbStateSetup(stPositionState:=fbTM1K2.stOut, fPosition:=-16.00, sPmpsState:='TM1K2:ATM-OUT');
fbStateSetup(stPositionState:=fbTM1K2.stTarget1, fPosition:=-39.124, sPmpsState:='TM1K2:ATM-TARGET1');
fbStateSetup(stPositionState:=fbTM1K2.stTarget2, fPosition:=-53.5, sPmpsState:='TM1K2:ATM-TARGET2');
fbStateSetup(stPositionState:=fbTM1K2.stTarget3, fPosition:=-67.874, sPmpsState:='TM1K2:ATM-TARGET3');
fbStateSetup(stPositionState:=fbTM1K2.stTarget4, fPosition:=-82.25, sPmpsState:='TM1K2:ATM-TARGET4');
fbStateSetup(stPositionState:=fbTM1K2.stTarget5, fPosition:=-96.623, sPmpsState:='TM1K2:ATM-TARGET5');
fbStateSetup(stPositionState:=fbTM1K2.stOut, fPosition:=-16.00, fDelta:=10, sPmpsState:='TM1K2:ATM-OUT');
fbStateSetup(stPositionState:=fbTM1K2.stTarget1, fPosition:=-39.124, fDelta:=10, sPmpsState:='TM1K2:ATM-TARGET1');
fbStateSetup(stPositionState:=fbTM1K2.stTarget2, fPosition:=-53.5, fDelta:=10, sPmpsState:='TM1K2:ATM-TARGET2');
fbStateSetup(stPositionState:=fbTM1K2.stTarget3, fPosition:=-67.874, fDelta:=10, sPmpsState:='TM1K2:ATM-TARGET3');
fbStateSetup(stPositionState:=fbTM1K2.stTarget4, fPosition:=-82.25, fDelta:=10, sPmpsState:='TM1K2:ATM-TARGET4');
fbStateSetup(stPositionState:=fbTM1K2.stTarget5, fPosition:=-96.623, fDelta:=10, sPmpsState:='TM1K2:ATM-TARGET5');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is implemented correctly.

All of the ranges overlap here. It doesn't necessarily need to be fixed, the scientists might prefer this. It should be documented.
I ordered them in reverse because it made the overlaps easier for me to spot.

t5: (-106.623, -86.623)
t4: (-92.125, -72.25)
t3: (-77.874, -57.874)
t2: (-63.5, -43.5)
t1: (-49.124, -29.124)
out: (-26, -6)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I know about the overlap. How do you think it will react in terms of faults in case of overlap between states ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code will "pick one state" in the overlap region.
I do not know how the faults will react, maybe nothing bad will happen at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe!? I will actually try to fix it and try to avoid overlaps by tuning delta.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve now and I'll approve again if you decide to tune the deltas


fbTM1K2(
fbFFHWO := GVL.fbFastFaultOutput2,
Expand Down
16 changes: 8 additions & 8 deletions plc-kfe-rix-motion/kfe_rix_motion/POUs/PRG_TM2K2_ATM.TcPOU
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="PRG_TM2K2_ATM" Id="{127a807d-3b35-4680-8720-2eb4a2f35b86}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM PRG_TM2K2_ATM
VAR
Expand All @@ -24,13 +24,13 @@ END_VAR
<ST><![CDATA[
fbStateSetup(stPositionState:=stDefault, bSetDefault:=TRUE);

fbStateSetup(stPositionState:=fbTM2K2.stOut, fPosition:=5.3, sPmpsState:='TM2K2:ATM-OUT');
fbStateSetup(stPositionState:=fbTM2K2.stTarget1, fPosition:=-15.5, sPmpsState:='TM2K2:ATM-TARGET1');
fbStateSetup(stPositionState:=fbTM2K2.stTarget2, fPosition:=-36.5, sPmpsState:='TM2K2:ATM-TARGET2');
fbStateSetup(stPositionState:=fbTM2K2.stTarget3, fPosition:=-52.0, sPmpsState:='TM2K2:ATM-TARGET3');
fbStateSetup(stPositionState:=fbTM2K2.stTarget4, fPosition:=-60.5, sPmpsState:='TM2K2:ATM-TARGET4');
fbStateSetup(stPositionState:=fbTM2K2.stTarget5, fPosition:=-77.0, sPmpsState:='TM2K2:ATM-TARGET5');
fbStateSetup(stPositionState:=fbTM2K2.stTarget6, fPosition:=-96.6, sPmpsState:='TM2K2:ATM-TARGET6');
fbStateSetup(stPositionState:=fbTM2K2.stOut, fPosition:=5.3, fDelta:=5, sPmpsState:='TM2K2:ATM-OUT');
fbStateSetup(stPositionState:=fbTM2K2.stTarget1, fPosition:=-15.5, fDelta:=10, sPmpsState:='TM2K2:ATM-TARGET1');
fbStateSetup(stPositionState:=fbTM2K2.stTarget2, fPosition:=-36.5, fDelta:=10, sPmpsState:='TM2K2:ATM-TARGET2');
fbStateSetup(stPositionState:=fbTM2K2.stTarget3, fPosition:=-52.0, fDelta:=7, sPmpsState:='TM2K2:ATM-TARGET3');
fbStateSetup(stPositionState:=fbTM2K2.stTarget4, fPosition:=-60.5, fDelta:=10, sPmpsState:='TM2K2:ATM-TARGET4');
fbStateSetup(stPositionState:=fbTM2K2.stTarget5, fPosition:=-77.0, fDelta:=10, sPmpsState:='TM2K2:ATM-TARGET5');
fbStateSetup(stPositionState:=fbTM2K2.stTarget6, fPosition:=-96.6, fDelta:=10, sPmpsState:='TM2K2:ATM-TARGET6');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented correctly again, some overlaps again

t6: (-106.6, -86.6)
t5: (-87.0, -67.0)
t4: (-70.5, -50.5)
t3: (-59.0, -45.0)
t2: (-46.5, -26.5)
t1: (-25.5, -5.5)
out: (0.3, 10.3)


fbTM2K2(
fbFFHWO := GVL.fbFastFaultOutput2,
Expand Down
2 changes: 1 addition & 1 deletion plc-kfe-rix-motion/kfe_rix_motion/kfe_rix_motion.tmc
Original file line number Diff line number Diff line change
Expand Up @@ -109131,7 +109131,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t
</Property>
<Property>
<Name>ChangeDate</Name>
<Value>2024-07-30T16:09:02</Value>
<Value>2024-10-08T15:46:56</Value>
</Property>
<Property>
<Name>GeneratedCodeSize</Name>
Expand Down