I've made some improvements, and done a bit of cleanup, to the SUS guardian code.
Some of this was to clarify the SUS/ISC interface, after discussion with the ISC team.
To the main SUS.py (H1 is using a separate copy of this in sus/h1/guardian/SUS.py, so we should eventually merge these changes into the common SUS.py):
-
Removed all ramping of ISC input gains. These gains will now be completely left alone by the SUS guardian, leaving them to the either be set appropriately in the safe.snap, or by ISC.
-
Add state indices for all states. The "idle" states all already had indices, but some of the transitional states did not.
-
Improve alignment handling. We now check that alignment offsets are ramping, using ezca.is_offset_ramping() method, rather than setting timers.
-
Reset alignment TRAMPS after re-aligning. Make sure alignment offset tramps are set back to a default of 2 seconds after increasing the ramp time during alignment slewing.
-
Minor code cleanup of SUS.py and sustools.py, including some purging of no-longer-used functions
I then cleaned up the various ALIGNED_TO_PD* states that have been added to align optics to various baffle PDs.
-
Broke out all ALIGN_TO_PD* states into a separate file: sus/common/guardian/SUS_align_to_pd_states.py. This is then imported by the various optics that need to support these states. Currently this is only SUS_BS, SUS_TMSX, SUS_TMSY. If we need to add these states to other optics we can easily do so.
-
Add edges between all various ALIGNED states.
All code has been committed, and SUS guardians have been restarted to pull in these changes.