More effort at debugging the LSC whitening.
Today I tried moving things over to the c1tst model, which runs on the y-end computer, but I crashed c1iscey. I rebuilt the TST model to a known good state, then cycled the power on c1iscey, and the computer came back up fine.
I have now backed off and am just writing the code inside a little wrapper script, so that I can just compile and test the code completely independent from the realtime system. Then once I get all the bugs out, I can try again installing on the actual system.
Still, there are no changes to the functionality of the c1lsc model. There will not be until I get the c-code for matrix parsing debugged.
The logic, in non-diagram form (I'll make a diagram, but so you can read without waiting):
* Inputs is an array of degree of freedom triggers, the same schmidt triggers used for main LSC locking. (This means it also uses the same thresholds as main triggers. Side note, now that the WAIT command (see below) works, I want to change the filter module triggers to use the same main trigger, and then just wait a specified time before turning on.)
* Parse the LSC input matrix (internal to the c-code).
* This tells you which photodiode is being used to control which degree of freedom.
* Multiply rows of the LSC input matrix by the degree of freedom triggers (the same trigger as the main LSC triggers, which is a schmidt trigger).
* This gives a matrix, where non-zero elements indicate that a photodiode is supposed to be used for a degree of freedom, AND that DoF has been triggered (is locked or has flashed).
* Sum along the columns of the matrix.
* If a column has a non-zero element, that means that that PD quadrature is used, and has been triggered (by any DoF).
* Apply OR to I and Q quadratures of each PD.
* Since the phase rotation happens after whitening and dewhitening, if either I_ERR or Q_ERR is requested (used and triggered), we need to turn on the whitening for both channels. I am hopeful that this doesn't cause problems for cases when we want to use both quadratures of a PD to control 2 degrees of freedom, but I haven't yet put much thought into it. COMMENTS WELCOME on this point.
* Output of c-block is array of PD triggers. So if either AS11I or AS11Q is triggered, output a "1" for the first element, which corresponds to AS11, etc.
*** LSC model
* Give GoTo/From flag for each DoF trigger to the mux of inputs.
* Go through c-code
* Demux outputs into GoTo/From flags, one per PD (one flag for AS11, one for AS55, and one for ASDC...DC elements count separately, even though they're derived from the same physical PD).
* For each PD, trigger flag goes through WAIT c-code
* This allows you to define a wait time, in seconds, with an EPICS variable.
* Starts counting the wait time as soon as it receives a "1". Resets counter each time it receives a "0".
* Output of wait function is ANDed with the current (non-delayed) trigger.
* This allows for cavity to flash, but if it's not still locked after the wait time, don't actually flip any switches.
* Use delayed ANDed trigger to flip the FM1 switch on both the I and Q filterbank for that PD.