Displaying report 1-1 of 1.
Reports until 15:41, Wednesday 13 May 2015
H1 ISC
stefan.ballmer@LIGO.ORG - posted 15:41, Wednesday 13 May 2015 - last comment - 00:29, Thursday 14 May 2015(18415)
Python code for mimicking saturable integrator.
We repeatedly had problems with engaging ASC loops to the bottom or penultimate mass that have a top stage relieve loop.

In a nutshell, the problem comes with engaging the loop with a relatively big initial misalignment. The fast loop to PUM or TST does the right thing, but saturates its drive stage before the top mass relieve can kick in. Increasing the top mass relief doesn't always work because different loops feed the same test mass.

The ideal approach would be a saturable integrator in the ASC filter banks. Since this this would require a front-end code change, I wrote a python version that watches filter module output and input, and simply turns the input off if the integrator exceeded the limit and the error signal would drive it further away.

The code relies on guardian decorators. I.e. it should be added to any state during which this logic should be active. The decorator is defined in ISC_library.py, and can be called as:

    @FM_limit_checker_decorator(ListOfFIlterModulePrefixes_pos_gain,+1)
    @FM_limit_checker_decorator(ListOfFIlterModulePrefixes_neg_gain,-1)

Example:
    @FM_limit_checker_decorator({'ASC-SRC2_P','ASC-SRC2_Y','ASC-DSOFT_Y','ASC-CSOFT_Y'},+1)
    @FM_limit_checker_decorator({'ASC-DSOFT_P','ASC-CSOFT_P'},-1)

Positive and negative gain characterizes the overall gain of all engaged filters, i.e.
 - +1 : positive input signal leads to growing output signal and vice versa
 - -1 : positive input signal leads to shrinking  output signal and vice versa



Current testing:
================
 - For initial testing we added the decorator to

i) DRMI guardian ENGAGE_DRMI_RUN state:
    @FM_limit_checker_decorator({'ASC-SRC2_P','ASC-SRC2_Y'},+1)

ii) ISC guardian ENGAGE_ASC run state:
    @FM_limit_checker_decorator({'ASC-SRC2_P','ASC-SRC2_Y','ASC-DSOFT_Y','ASC-CSOFT_Y'},+1)
    @FM_limit_checker_decorator({'ASC-DSOFT_P','ASC-CSOFT_P'},-1)

Known bugs:
===========
 - Currently the filter module will be left in whatever state it was when the decorator ran for the last time. It is up to the user to assure the filter module is actually on in the end.


The full code in ISC_library.py is:
---------------------------------------------------------------------------------------------------
def FM_limit_checker_decorator(FMlist,sign):
    class FM_limit_checker(GuardStateDecorator):
        """Check for FM reaching limiters - if so, turn of input"""
        def pre_exec(self):
            for FM in FMlist:
                if  ((-ezca[FM+'_OUTMON'] >= ezca[FM+'_LIMIT']) and (-ezca[FM+'_INMON']*sign> 0)) or
                    (( ezca[FM+'_OUTMON'] >= ezca[FM+'_LIMIT']) and ( ezca[FM+'_INMON']*sign> 0)) :
                    ezca.switch(FM, 'INPUT', 'OFF') 
                else:
                    ezca.switch(FM, 'INPUT', 'ON')   
    return FM_limit_checker
Comments related to this report
stefan.ballmer@LIGO.ORG - 00:29, Thursday 14 May 2015 (18418)
The beta version described above failed on the turn on/off transients, amplified by the inverse plant lead filters.
The solution was to a filter section with gain of 0 and ramp time for input switching.

Version 1.0 now is:
--------------------------------------------------------------------------------------------------------
def FM_limit_checker_decorator(FMlist,sign,action,onstate,offstate):
    class FM_limit_checker(GuardStateDecorator):
        """Check for FM reaching limiters - if so, turn of input"""
        def pre_exec(self):
            for FM in FMlist:
                if  ((-ezca[FM+'_OUTMON'] >= ezca[FM+'_LIMIT']) and (-ezca[FM+'_INMON']*sign> 0)) or
                    (( ezca[FM+'_OUTMON'] >= ezca[FM+'_LIMIT']) and ( ezca[FM+'_INMON']*sign> 0)) :
                    ezca.switch(FM, action, offstate) 
                else:
                    ezca.switch(FM, action, onstate)   
    return FM_limit_checker
--------------------------------------------------------------------------------------------------------

We successfully used it on the ITM ASC loops. The following decorators are added for  each following state:
    @FM_limit_checker_decorator({'ASC-DSOFT_Y','ASC-CSOFT_Y'},+1,'FM2','OFF','ON')
    @FM_limit_checker_decorator({'ASC-DSOFT_P','ASC-CSOFT_P'},-1,'FM2','OFF','ON')
and finally, in DC_READOUT one final call of 
    # make sure it is on now (FM2 off in all cases)
    @FM_limit_checker_decorator({'ASC-DSOFT_Y','ASC-CSOFT_Y'},+1,'FM2','OFF','OFF')
    @FM_limit_checker_decorator({'ASC-DSOFT_P','ASC-CSOFT_P'},-1,'FM2','OFF','OFF')
guarantees that the loops are on, no matter what.

Remarks:
- The current code works best with the front end limiters turned off, but the limit set to a conservative value. The integrator will slightly overshoot the limit because of the guardian delay and the filter ramp time. But it will not produce a transient.
Displaying report 1-1 of 1.