[Koji, Annalisa, Gautam]
Annalisa noticed that over the weekend the Y-arm green PDH was locked to a sideband, despite not having changed anything on the PDH box (the sign switch was left as it was). On friday, we tried turning on and off some of the filters on the slow servo (C1ALS_Y_SLOW) which may have changed something but this warranted further investigation. We initially thought that the demodulation phase was not at the optimal value, and decided to try introducing some capacitances in the path from the function generator to the LO input on the universal PDH box. We modelled the circuit and determined that significant phase change was introduced by capacitances between 1nF and 100nF, so we picked out some capacitors (WIMA FKP) and set up a breadboard on which to try these out.
After some trial and error, Koji dropped by and felt that the loop was optimized for the old laser, the various loop parameters had not been tweaked since the new laser was installed. The following parameters had to be optimized for the new laser;
The setup was as follows:
The PDH error signal did not have very well-defined features, so Koji tweaked the LO frequency and the modulation depth till we got a reasonably well-defined PDH signal. Then we turned the excitation off and locked the cavity to green. The servo gain was then optimized by reducing oscillations in the error signal. Eventually, we settled on values for the Servo Gain, LO frequency and modulation depth such that the UGF was ~20kHz (determined by looking at the frequency of oscillation of the error signal on an Oscilloscope), and the PDH signal had well-defined features (while the cavity was unlocked). The current parameters are
We then proceeded to find the optimal demodulation phase by simulating the circuit with various capacitances between the function generator and the PDH box (circuit diagram and plots attached). The simulation seemed to suggest that there was no need to introduce any additional capacitance in this path (introducing a 1nF capacitance added a phase-lag of ~90 degrees-this was confirmed as the error-signal amplitude decreased drastically when we hooked up a 1nF capacitor on our makeshift breadboard). In the current configuration, the LO is connected directly to the PDH box.
Now that we are reasonably confident that the loop parameters are optimal, we need to stabilise the C1ALS_Y_SLOW loop to stabilise the beat note itself. Appropriate filters need to be added to this servo.
Circuit Diagram: 50 ohm input impedance on the source, 50 ohm output impedance seen on the PDH box, capacitance varied between 1nF and 100nF in steps.
Plots for various capacitances: Gold-green trace (largest amplitude) direct from LO, other traces at input to PDH box.
This is an update on the situation as far as PZT installation is concerned. I measured the required cable (PZT driver board to PZT) lengths for the X and Y ends as well as the PSL table once again, with the help of a 3m long BNC cable, just to make sure we had the lengths right. The quoted cable lengths include a meter tolerance. The PZTs themselves have cable lengths of 1.5m, though I have assumed that this will be used on the tables themselves. The inventory status is as follows.
I also did a preliminary check on the driver boards, mainly to check for continuity. Some minor modifications have been made to this board from the schematic shown here (using jumper wires soldered on the top-side of the PCB). I will have to do a more comprehensive check to make sure the board as such is functioning as we expect it to. The plan for this is to first check the board without the high-voltage power supply (using an expansion card to hook it up to a eurocrate). Once it has been verified that the board is getting powered, I will connect the high-voltage supply and a test PZT to the board to do both a check of the board as well as a preliminary calibration of the PZTs.
To this end, I need something to track the spot position as I apply varying voltage to the PZT. QPDs are an option, the alternative being some PSDs I found. The problem with the latter is that the interfaces to the PSD (there are 3) all seem to be damaged (according to the labels on two of them). I tried connecting a PSD to the third interface (OT301 Precision Position Sensing Amplifier), and hooked it up to an oscilloscope. I then shone a laser pointer on the psd, and moved it around a little to see if the signals on the oscilloscope made sense. They didn't on this first try, though this may be because the sensing amplifier is not calibrated. I will try this again. If I can get one of the PSDs to work, mount it on a test optical table and calibrate it. The plan is then to use this PSD to track the position of the reflected beam off a mirror mounted on a PZT (temporarily, using double sided tape) that is driven by feeding small-amplitude signals to the driver board via a function generator.
The LEMO connector on the PZTs have the part number LEMO.FFS.00, while the male SMB connectors on the board have the part number PE4177 (Pasternack)
Plan of Action:
The wiring scheme has been modified a little, I am uploading an updated one here. In the earlier version, I had mistaken the monitor channels as points from which to log data, while they are really just for debugging. I have also revised the coaxial cable type used (RG316 as opposed to RG174) and the SMB connector (female rather than male).
With the help of an expansion card, I verified that the + 15V and + 24V from the eurocrate in the slot I've identified for the PZT driver boards are making their way to the board. The slot is at the right-most end of the eurocrate in 1Y4, and the rack door was getting in the way of directly measuring these voltages once I hooked up the driver board to the expansion card. So I just made sure that all the LEDs on the expansion card lit up (indicating that the eurocrate is supplying + 5, + 15 and + 24V), and then used a multimeter to check continuity between the expansion card and the driver board outside of the eurocrate. The circuit only uses + 15V and + 24V, and I checked for continuity at all the IC pins marked with these voltages on the schematic.
Since the whole point of this test was to see if the slot I identified was delivering the right voltages, I think this is sufficient. I will now need to fashion a cable that I can use to connect a DC power supply to the PZT driver boards so that these can be tested further.
The high voltage points (100V DC) remain to be tested.
The bank marked channel 9-16 is free, but the connector is a 40 pin IDC and I need to know the exact pin-out configuration before I can set about making the custom ribbon cable that will send the control signals from the DAC card to the PZT driver board.
The DAC interface board on rack 1Y4 seems to be one of the first versions of this board, and has no DCC number anywhere on it. Identical modules on other racks have the DCC number D080303, but this document does not exist and there does not seem to be any additional documentation anywhere. The best thing I could find was the circuit diagram for the ADL General Standards 16-bit DAC Adapter Board, which has what looks like the pin-out for the 68 pin SCSI connector on the DAC Interface board. Koji gave me an unused board with the same part number (D080303) and I used a multimeter and continuity checking to make a map between DAC channels, and the 40 pin IDC connector on the board, but this needs to be verified (I don't even know if what is sitting inside the box on 1Y4 is the same D080303 board).
Jenne suggested making a break-out cable to verify the pin-outs, which I did with a 40-pin IDC connector and a bit of ribbon wire. The other end of the ribbon wire has been stripped so that we can use some clip-on probes and an oscilloscope to verify the pin-outs by sending a signal to DAC channels 9 through 16 one at a time. On the software side, Jenne did the following:
We have not restarted c1scy yet as Annalisa is working on some Y-arm stuff right now. We will restart c1scy and use awggui to perform the test once she is done.
Pink edits by JCD
Jenne just rebooted c1scy and daqd on the framebuilder. We will do the actual test after lunch.
The pin-outs for the DAC interface board have been determined.
Turns out that my deductions using the D0902496 wiring diagram, a spare D080303 DAC to IDC adaptor and a multimeter were correct! The pin outs as determined by this test are sketched in the graphic below.
The excitation points added to the simulink model are still there, I plan on keeping it as such till I finish installation of the boards as they will be useful for testing purposes.
Pin-Outs of the DAC to IDC Adaptor (D080303) inside the "DAC Interface Box at 1Y4":
Makeshift break-out ribbon cable:
We have measured the open-loop transfer function of the Y-end green PDH loop. From the measurement, the loop UGF is ~12kHz.
We have been trying to measure this transfer function for some time now, and playing around with various points of injecting the excitation and measuring the output. Koji helped arrive at one that actually worked, and the scheme used to make this measurement is shown in the sketch below. The SR785 signal analyzer was used to make the measurement, while an SR560 preamp was used to sum the output from the PDH box (PZT-OUT) and the excitation, with this sum being delivered to the auxiliary laser PZT via a pomona box that sums the servo output and the signal from the LO. The transfer function measurement made was a1/a2 w.r.t the sketch attached.
Set-up to measure Y-end Green PDH transfer function:
Measured Open Loop Transfer Function:
I did the following with the PZT Driver Board:
With an expansion card attached to the driver board, I used an Agilent E3620A power supply to verify that the 15V and 24V supplies were reaching the intended ICs. It turns out that the +24 V supply was only meant to power some sort of on-board high voltage supply which provided the 100V bias for the PZTs and the MJE15030s. This device does not exist on the board I am using, jumper wires have been hooked up to an SMA connector on the front panel that directly provides 100V from the KEPCO high voltage supply to the appropriate points on the circuit.
All the AD797s as well as the LT1125CS ICs on the board were receiving the required +15V.
The next step was to check the board with the high-voltage power supply connected.
The output from the power supply is drawn from the rear output terminal strip of the power supply via pins TB1-2 (-OUT) and TB1-7 (+OUT). I used a length of RG58 coaxial cable from the lab and crimped a BNC connector on one end, and stripped the other to attach it to the above pins.
There are several options that can be configured for the power supply. I have left it at the factory default: Local sensing (i.e. operating the power supply using the keypad on the front of it as opposed to remotely), grounding network connected (the outputs of the power supply are floating), slow mode, output isolated from ground.
I then hooked up a function generator in order to simulate a control signal from the DAC. The signal was applied to pin 2 of the jumpers marked JP1 through JP4 on the schematic, one at a time. The signal applied was a 0.2 Vpp, 0.1 Hz sine wave.
Continued with tests on the PZT driver board. I made a few changes to replace defective components and also to modify the gain of the HV amplifier stage. I believe the board has been verified to be satisfactory, and is now ready for a piezo to be connected, tested and calibrated.
Revised Wiring Diagram:
DAC Max. Output Trace on Oscilloscope
I measured the maximum output of the DAC at 1Y4 as well as its power spectrum. The results are as follows (plots below):
Therefore, the gain of the high-voltage amplification stage on the PZT driver boards do not need to be changed again, as the required output range of 0-100V from the DAC board was realised when the input voltage ranged from -10V to +10 V w.r.t ground. The AI board converts the differential input to a single ended output as required by the driver board.
I will now change some resistors/capacitors on the AI board such that the position of the notches can be moved from 16k and 32k to 64k and 128k.
Max. amplitude measurement
My previous measurement of the maximum output amplitude of the DAC was flawed as I made the measurement using a single channel of the oscilloscope, which meant that the negative pin of the DAC channel under test was driven to ground. I redid the measurement to avoid this problem. The set up this time was as follows:
The trace on the oscilloscope is shown below;
So with reference to ground, the DAC is capable of supplying voltages in the range [-10V 10V]. This next image shows all three traces: positive and negative pins of DAC w.r.t ground, and the difference between the two.
Power spectrum measurement
I used the SR785 to make the measurement. The set up was as follows:
Initially, I output no signal to the DAC, and obtained the following power spectrum. The peak at 65.554 kHz is marked.
I then re-did the measurement with a 200 Hz (left) and 2000 Hz(right), 1000 counts amplitude (I had to change the Ch1 input range on the SR785 from -18dBm to -6dBm) sine wave from channel 9 of the DAC, and obtained the following. The peaks at ~64 kHz are marked.
Now that this peak has been verified, I will work on switching out the appropriate resistors/capacitors on the AI board to move the notches from 16k and 32k to 64k and 128k.
We need the unit of the voltage power spectrum density to be V/sqrt(Hz).
Otherwise we don't understand anything / any number from the plot.
I redid the measurement with the appropriate units set on the SR785. Power spectral density plots for no output (top), 500Hz, 1000 counts amplitude sine wave (middle) and 2000Hz, 1000 counts amplitude (bottom) are attached, with the right unit on the Y-axis.
Those 'peaks' for the oscillations seem ridiculously broad. I think you should look again, really quickly, with smaller bandwidth at, say, the 2kHz oscillation, to make sure it looks reasonable.
I did just this, and it looks okay to me:
I tried shifting the notch frequencies on the D000186-revision D board given to me by Koji. The existing notches were at ~16 kHz and ~32 kHz. I shifted these to notches at ~64 kHz and ~128 kHz by effecting the following changes (see schematic for component numbering) on Channel 8 of the board-I decided to check things out on one channel before implementing changes en masse:
=> New notches should be at 66.3 kHz and 131.7 kHz.
I then measured the frequency response of the modified channel using the SR785, and compared it to the response I had measured before switching out the resistors. The SR785 only goes up to 102 kHz, so I cannot verify the 128 kHz notch at this point. The position of the 64 kHz notch looks alright though. I think I will go ahead and switch out the remaining resistors in the evening.
Note 1: These plots are just raw data from the SR785, I have not tried to do any sort of fitting to poles and zeros. I will do this at some point.
Note 2: All these smts were taken from Downs. Todd helped me locate the non-standard value resistors. I also got a plastic 25-pin D-sub backshells (the spares are in the rack), with which I have fashioned the required custom ribbon cables (40 pin IDC to 25 pin D-sub with twisted ribbon wire, and a short, 10pin IDC to 10pin IDC with straight ribbon wire).
I have been working on setting up a QPD which can eventually be used to calibrate the PZT, and also orient the PZT in the mount such that the pitch and yaw axes roughly coincide with the vertical and horizontal.
The calibration constants have been determined to be:
X-axis: -3.69 V/mm
I initially tried using the QPD setup left behind by Chloe near MC2, but this turned out to be dysfunctional. On opening out the QPD, I found that the internal circuitry had some issues (shorts in the wrong places etc.) Fortunately, Steve was able to hand me another working unit. For future reference, there are a bunch of old QPDs which I assume are functional in the cabinet marked 'Old PDs' along the Y-arm.
I then made a circuit with which to read out the X and Y coordinates from the QPD. This consists of 4 buffer amplifiers (one for each quadrant), and 3 summing amplifiers (outputs are A+B+C+D = sum, B+C-A-D = Y-coordinate, and A+B-C-D = X-coordinate) that take the appropriate linear combinations of the 4 quadrants to output a voltage that may be calibrated against displacement of the QPD.
The output from the QPD is via a sub-D connector on the side of the pomona box enclosing the PD and the circuitry, with 7 pins- 3 for power lines, and 4 for the 4 quadrants of the QPD. It was a little tricky to figure the pin-out for this connector, as there was no way to use continuity checking to map the pins to quadrants. Therefore, I used a laser pointer, and some trial and error (i.e. shine the light on a given quadrant, and check the sign of the X and Y voltages on an oscilloscope) to map the pin outs. Steve tells me that these QPDs were made long before colour code standardisation, but I note here the pin outs in any case for future reference (the quadrant orientations are w.r.t the QPD held with all the circuitry above it, with the active surface facing me):
Green = GND
Blue = Upper Left Quadrant
White = Upper Right Quadrant
Purple = Lower Left Quadrant
Grey = Lower Right Quadrant
Chloe had noted that there was some issue with the voltage regulators on her circuit (overheating) but I suspect this may have been due to the faulty internal circuitry. Also, she had used 12 V regulators. I checked the datasheet of the QPD, Op-Amp LF347 (inside the pomona box) and the OP27s on my circuit, and found that they all had absolute maximum ratings above 18V, so I used 15V voltage regulators. The overheating problem was not a problem anymore.
I then proceeded to arrange a set up for the calibration (initially on the optical bench next to MC2, but now relocated to the SP table, and a cart adjacent to it). It consists of the following:
Having set everything up and having done the coarse alignment using the mirror mount, I proceeded to calibrate the X and Y axes of the QPD using the translational stage. The steps I followed were:
The plots are attached, from which the calibration values cited above are deduced. The linear fits for the orthogonal axis were done using cftool. There is some residual coupling between the X and Y motions of the QPD, but I think this os okay my purposes.
My next step would be to first tweak the orientation of the PZT in the mount while applying a small excitation to it in order to decouple the pitch and yaw motion as best as possible. Once this is done, I can go ahead and calibrate the angular motion of the PZT in mrad/V.
Yesterday, I mounted the first PZT in one of the modified mounts, and then glued a 2-inch Y2 mirror on it using superglue.
-The mirror is a 2-inch, Y2 mirror with HR and AR coatings for 532 nm light.
-The AR side of the mirror had someone's fingerprint on it, which I removed (under Manasa's guidance) using tweezers wrapped in lens cleaning paper, and methanol.
-Before gluing the mirror, I had to assemble the modified mount. Manasa handed over the remaining parts of the mounts (which are now in my newly acquired tupperware box along with all the other Piezo-related hardware). I took the one labelled A, and assembled the holder part. I then used one of the new mounts (2.5 inches, these are with the clean mounts in a cardboard box in the cupboard holding the green optics along the Y-arm) and mounted the holder on it.
-Having assembled the mount, I inserted the piezo tip-tilt into the holder. The wedge that the machine shop supplied is useful (indeed required) for this.
-I then cleaned the AR surface of the mirror and the top-surface of the tip-tilt.
-The gluing was done using superglue which Steve got from the bookstore (the remaining tube is in the small fridge). We may glue the other mirror using epoxy. I placed 4 small drops of superglue on the tip-tilt's top surface, placed the mirror with its AR face in contact with the piezo, and applied some pressure for a short while until the glue spread out fairly evenly. I then left the whole setup to dry for about half an hour.
-Steve suggested using a reference piece (I used two small bolts) to verify when the glue had dried.
-Finally, I attached the whole assembly to a base.
Here it is in action in my calibration setup (note that it has not been oriented yet. i.e. the two perpendicular axes of the piezo are for the time being arbitrarily oriented. And maybe the spreading of the glue wasn't that even after all...):
Yesterday, while setting stuff up, I tested the piezo with a 0.05 Hz, 10Vpp input from the SR function generator just to see if it works, and also to verify that I had set up all my electronics correctly. Though the QPD was at this point calibrated, I did observe periodic motion of both the X and Y outputs of my QPD amp! Next step- calibration...
I carried some further modifications and tests to the AI Board. Details and observations here:
I think the board is okay to be used now.
I have managed to orient the PZT in the mount such that its axes are approximately aligned with the vertical and the horizontal.
In the process, I discovered that the 4 screws on the back face of the PZT correspond to the location of the piezoelectric stacks beneath the tip-tilt platform. The PZT can therefore be oriented during the mounting process itself, before the mirror is glued onto the tip-tilt platform.
In order to verify that the pitch and yaw motion of the mirror have indeed been roughly decoupled, I centred the spot on the QPD, fed to the 'pitch' input of the PZT driver board (connected to channel 1 of the PZT) a 10 Vpp, 1 Hz sine wave from the SR function generator (having turned all the other relevant electronics, HV power supply etc ON. The oscilloscope trace of the output observed on the QPD is shown. The residual fluctuation in the Y-coordinate (blue trace) is I believe due to the tilt in the QPD, and also due to the fact that the PZT isnt perfectly oriented in the mount.
It looks like moving the tip-tilt through its full range of motion takes us outside the linear regime of the QPD calibration. I may have to rethink the calibration setup to keep the spot on the QPD in the linear range if the full range is to be calibrated, possibly decrease the distance between the mirror and the QPD. Also, in the current orientation, CH1 on the PZT controls YAW motion, while CH2 controls pitch.
I mounted the second PZT in a modified mount, and then glued a 1-inch Y2 mirror on it using superglue.
-The mirror is a Laseroptik 1-inch, Y2 mirror with HR and AR coatings for 532 nm light.
-The procedure for mounting the mirror was the same as detailed in elog 8874. This time, I tried to orient the Piezo such that the four screws on the back face coincided with the horizontal and vertical axes, as this appeared to (somewhat) decouple the pitch and yaw motion of the tip-tilt on the first PZT.
-One thing I forgot to mention in the earlier elog: it is best to assemble the mount fully before inserting the tip-tilt into it and gluing the mirror to the tip-tilt. In particular, the stand should be screwed onto the mount before inserting the tip-tilt into the holder, as once it is in, it will block the hole through which one can screw the stand onto the mount.
I recalibrated the QPD today as I had shifted its position a little. I then identified the linear range of the QPD and performed a preliminary calibration of the Piezo tip-tilt within this range.
-I recalibrated the QPD as I had shifted it around a little in order to see if I could move it to a position such that I could get the full dynamic range of the piezo tilt within the linear regime of the QPD. This proved difficult because there are two reflections from the mirror (seeing as it is AR coated for 532nm and I am using a red laser). At a larger separation, these diverge and the stray spot does not bother me. But it does become a problem when I move the QPD closer to the mirror (in an effort to cut down the range in which the spot on the QPD moves). In any case, I had moved the QPD till it was practically touching the mirror, and even then, could not get the spot motion over the full range of the PZTs motion to stay within the QPD's linear regime (as verified by applying a 20Vpp 1Hz sine wave to the PZT driver board and looking at the X and Y outputs from the QPD amplifier.
-So I reverted to a configuration in which the QPD was ~40cm away from the mirror (measured using a measuring tape).
-The new calibration constants are as follows (see attached plots):
X-Coordinate: -3.43 V/mm
Y-Coordinate: -3.41 V/mm
-I then determined the linear range of the QPD to be when the output was in the range [-0.5V 0.5V].
-Next, at Jenne's suggestion, I decided to do a preliminary calibration of the PZT within this linear range. I used an SR function generator to supply an input voltage to the PZT driver board's input (connected to Channel 1 of the piezo). In order to supply a DC voltage, I set a DC offset, and set the signal amplitude to 0V. I then noted the X and Y-coordinate outputs, being sure to run through the input voltages in a cyclic fashion as one would expect some hysteresis.
-I did this for both the pitch and yaw inputs, but have only superficially analysed the latter case (I will put up results for the former later).
-There is indeed some hysteresis, though the tilt seems to vary linearly with the input voltage. I have not yet included a calibration constant as I wish to perform this calibration over the entire dynamic range of the PZT.
-There is some residual coupling between the pitch and yaw motion of the tip tilt, possibly due to its imperfect orientation in the holder (I have yet to account for the QPD's tilt).
-I have not included a graphical representation here, but there is significantly more pitch to yaw coupling when my input signal is applied to the tip-tilts pitch input (Channel 2), as compared to when it is input to channel 1. It is not clear to me why this is so.
-I have to think of some smart way of calibrating the PZT over its entire range of motion, keeping the spot in the QPD's linear regime throughout. One idea is to start at one extreme (say with input voltage -10V), and then perform the calibration, re-centering the spot to 0 on the QPD each time the QPD amp output reaches the end of its linear regime. I am not sure if this will work, but it is worth a shot. The other option is to replace the red laser with a green laser (from one of the laser pointers) in the hope that multiple reflections will be avoided from the mirror. Then I will have to recalibrate the set up, and see if I can get the QPD close enough to the mirror such that the spot stays within the linear regime of the QPD. More investigation needs to be done.
QPD Calibration Plots:
Piezo tilt vs input voltage plots:
Yaw Tilt Pitch Tilt
In light of recent events and the decision to test the piezo tip-tilts for green beam steering on the X-end table, I have set up 8 excitation points to channels 8 through 15 of the DAC on c1scx (as was done earlier for the DAC at 1Y4 with Jenne's help) in order to verify that the pin-outs of the DAC interface board. I have not yet compiled the model or restarted the computer, and will do these tomorrow, after which I will do the test. The channels are named YYY_CHAN9 etc.
I just compiled and installed the model with the excitation points on c1scx and then restarted framebuilder. The channels I set up are now showing up in the awggui dropdown menu. I will do the tests on the DAC channels shortly.
Just to keep things on record, these are the steps I followed:
I just finished carrying out the same checks for the DAC at 1X9 (with channels 9 through 16 that are unused as of now) as those I had done for the DAC at 1Y4, as the hardware prep up till now was done with the characterisation of the DAC at 1Y4. Conclusions:
I will now proceed to install various pieces of hardware (AI Board, PZT driver board, HV Power Supply and cabling) at 1X9, while not making the connection to the PZTs till I receive the go ahead.
Given that the green beam is to be used as the reference during the vent, it was decided to first test the PZT mounted mirrors at the X-endtable rather than the Y-endtable as originally planned. Yesterday, I prepared a second PZT mounted mirror, completed the full range calibration, and with Manasa, installed the mirrors on the X-endtable as mentioned in this elog. The calibration constants have been determined to be (see attached plots for aproximate range of actuation):
M1-pitch: 0.1106 mrad/V
M1-yaw: 0.143 mrad/V
M2-pitch: 0.197 mrad/V
M2-yaw: 0.27 mrad/V
Second 2-inch mirror glued to tip-tilt and mounted:
Full range calibration of PZT:
Having prepared the two steering mirrors, I calibrated them for the full range of input voltages, to get a rough idea of whether the tilt varied linearly and also the range of actuation.
Analysis and remarks:
PZT Calibration Plots
The circles are datapoints for the degree of freedom to which the input is applied, while the 'x's are for the other degree of freedom. Different colours correspond to data measured with the position of the translational stage at some value.
M1 Pitch M1 Yaw
M2 Pitch M2 Yaw
Installation of the mirrors at the X-endtable:
The calibrated mirrors were taken to the X-endtable for installation. The steering mirrors in place were swapped out for the PZT mounted pair. Manasa managed (after considerable tweaking) to mode-match the green beam to the cavity with the new steering mirror configuration. In order to fine tune the alignment, Koji moved ITMx and ETMx in pitch and yaw so as to maximise green TRX. We then got an idea of which way the input pointing had to be moved in order to maximise the green transmission.
I have updated the schematic of the D980323 PZT driver boards to reflect the changes made. The following changes were made (highlighted in red on the schematic):
I have also changed the routing of the 100V from the HV power supply onto the board, it is now done using an SMA T-connector and two short lengths of RG58 cable with SMA connectors crimped on.
The boards are functional (output swings between 0 and 100V as verified with a multimeter for input voltages in the range -10V to +10V applied using a function generator.
The following hardware has been installed on rack 1X9;
I have also verified that the AI board is functional in the eurocrate by using the LEMO monitoring points on the front panel.
The driver boards remain to be verified, but this cannot be done until we connect the HV supply to the board.
The signal chain from the DAC output to the output of the PZT driver board (including the HV supply) has been verified.
I had installed the two boards in the eurocrate yesterday and laid out the cables from 1X9 to the endtable. The output of the AI board had been verified using the monitor port on the front panel, but the output from the PZT driver board was yet to be checked because I had not connected the HV supply yesterday.
When I tried this initially today, I was not getting the expected output from the monitor channels on the front panel of the PZT driver board, even though the board was verified to be working. Alex helped debug the problem, which was identified as the -15V supply voltage not making it onto the board.
I changed the slot the board was sitting in, and used a long screw to bolt the board to the crate. Both the AI board and the PZT driver board seem to be slightly odd-sized, and hence, will not work unless firmly pushed into the eurocrate and bolted down. This would be the first thing to check if a problem is detected with this system.
In any case, I have bolted both boards to the eurocrate, and the output from the PZT driver board is as expected when I sent a 10Vp sine wave out from the DAC. I think the cables can now be hooked up to the PZTs once we are pumped down.
I have glued a fourth mirror to a PZT (using superglue) and inserted it into a modified mount. This is to be used together with the 1-inch Laseroptik mirror I had glued a couple of weeks back at the Y-endtable. I will be calibrating both these mirrors tonight such that these are ready to put in as soon as we are pumped down.
The mirror was one of those removed from the X-endtable during the switch of the steering mirrors. It is a CVI 2-inch mirror, with HR and AR coatings for 532 nm.
I have made a new model for the endtable PZT servo, and have put it in c1iscex. Model name is c1asx. Yesterday, Koji helped me start the model up. The model seems to be running fine now (there were some problems initially, I will post a more detailed elog about this in a bit) but some channels, which are computer generated, don't seem to exist (they show up as white blocks on the MEDM GDS_TP screen). I am attaching a screenshot of the said screen and the names of the channels. More detailed elog about what was done in making the model to follow.
C1:DAQ-DC0_C1ASX_STATUS (this is the channel name for the two leftmost white blocks)
These are roughly the steps I followed in setting up the new model for the endtable PZT servo - C1ASX.
I made a SIMULINK model of the servo, using MATLAB R2013a. The path to the model is /opt/rtcds/caltech/c1/userapps/release/isc/c1/models/c1asx.mdl. I am listing the parameters set on the CDS_PARAMETERS block:
Making, Compiling and Installing the Model:
After saving the model, I ssh-ed into c1iscex and ran the following commands:
rtcds make c1asx - this gave me a whole bunch of errors initially, which I tracked down to a naming problem in some of the from and goto flags: there should not be any spaces.
rtcds install c1asx
rtcds start c1asx - this gave me an error which said something like 'can't start/stop model.' Koji pointed out that given that a new model is being started, there is an additional step involved, which is to add the model name to the rtsystab file (this is located at /diskless/root/etc/rtsystab on framebuilder, and is mirrored in the various computers. It would be advisable to make sure that the changes are mirrored in the corresponding file on the computer in which the new model is being installed).
After adding the model name to the rtsystab file, I tried running rtcds start c1asx again. This time, no errors were output, but the model was not up and running as verified by looking at the C1:ASX_GDS_TP medm screen.
Koji suggested making a simple model (1 CDS parameters block, 1 ADC block and 2 filter modules, appropriately terminated) and see if that starts up, which it did. I then tried adding my servo minus the DAC block and recompiled and restarted the model. This too worked fine. I figured that the next logical step would be to add the DAC block to the model, and restart the model. But when I tried this, c1iscex crashed .
Jenne helped in restoring things to a working state (we reverted the c1asx model to just 2 filter modules, and went to the X-end and restarted the computer. This did not work the first time so I went back in and restarted it again, at which point we were able to ssh into c1iscex again and restart the four models running on it).
Since Manasa and Koji were working on getting things set up for the pumpdown,I did not try anything again till later in the evening, when Koji helped in debugging the problem further. In the meantime, at Jenne' suggestion, I made the model once again in MATLAB R2010b. In the evening, when I tried restarting the model, Koji suggested that the DAC channels in c1asx may be used by other models, at which point I realised I had set up excitation points on channels 8 through 15 of the DAC in c1scx (detailed here) in order to test the hardware at 1X9. I removed the excitation points from channels 8-11 of the DAC block in c1scx (these are the ones used in c1asx), and recompiled and restarted c1asx (using the above sequence of commands). I then tried recompiling and starting c1asx once more, and this time, it worked . At least, the GDS_TP screen suggests that the model is running alright, except for the fact that some computer generated channels seem to be missing. This problem is unresolved for now, and probably has something to do with the fact that C1ASX channels do not appear in Dataviewer.
I do not think this has to do with restarting framebuilder (I did the usual telnel fb 8088 followed by shutdown). In any case, I have added the new model to the CDS_FE_STATUS screen, and will continue to debug the same. I have also got a template medm screen (work in progress) which I will elog about soon as I get it done.
Note to self: There are 4 more excitation channels still hooked up to the DAC (channels 12-15) in the c1scx model. I plan to remove these and put them in c1asx.
I don't know what's going on here (why the channels are white), and I don't yet have a suggestion of where to look to fix it but...
Is there a reason that you're making a new model for this? You could just use and existing model at c1iscex, like the c1scx, and put your stuff in a top-names block. Then you wouldn't have to worry about all of the issues with adding and integrating a new model.
Koji just fixed this.
It seems that the new model's channels were not automatically added to the master file in the framebuilder (/opt/rtcds/caltech/c1/target/master). Adding the following two lines to the master file fixed the problem;
The box is now green. It looks like C1ASX.ini is created automatically in /opt/rtcds/caltech/c1/chans but the master file needs to be manually edited. The channels are now showing up on dataviewer etc. I have updated the information on the wiki page.
I have made some minor changes to the model, made all the MEDM screens, and linked monitors on these to the appropriate channels. I have borrowed heavily from the C1ASS MEDM screens (particularly for the small filter modules-it was convenient to just copy and paste an existing module, and edit the channel names using EMACS/GEDIT), and have edited these to suit the needs of this servo. Some features:
I think I am now ready to take some measurements and try and optimize this servo. There is no green transmission at the PSL table at the moment, so not much can be done, though the first step would be to take the power spectrum of the error signal, which would help me decide the appropriate frequencies for the LOs. I would then have to add the appropriate filters to the model. The last, and most difficult step, would be the measurement of the output matrix, though Koji has given me some ideas about how this measurement can be done. I also have a template script ready, though I will only finalise this after optimising the servo and running it a couple of times manually.
Attached are screenshots of the MEDM screens.
The following slow channels have been added and are now being recorded by FB.
In order to integrate the data collected by the Raspberry-Pi from the Y-end doubling oven temperature controller and also the data from the frequency counter which will be hooked up to monitor the beat frequency, Koji helped me set up some slow EPICS record channels (in ALS as we felt this was most appropriate). The procedure for setting up slow channels was as follows (virtually identical to what is detailed in this elog:
I will now integrate these channels into my scripts, and make some simple MEDM screens.
In order to decide what frequencies to dither the 4 degrees of freedom (M1-pitch&yaw, M2-pitch&yaw) at, I took the power spectrum of the X and Y-arm green transmission (C1:ALS-TRX_OUT, C1:ALS-TRY_OUT). Plots showing the power spectra are attached. Looking at the power spectra, I would think that for the X-arm, it would be okay to dither at 40, 50, 60 and 70 Hz. In order to check if the piezos could respond to these frequencies, I used my QPD setup and shook the PZTs with a 100Hz, 1Vpp sinusoid, and saw that the spot moved smoothly on the QPD.
As for choosing the modulation amplitude, I did a simplistic approximation assuming that the misalignment only rotates the beam axis relative to the cavity axis, and determined what angle coupled 10% of the power into the next eigenmode. Assuming that this is small enough such that if we are already locked to TEM00, the dither won't kick it up to some higher-order mode, the LO amplitude should be in the range of 30-60 digital counts (determined using the PZT calibration constants determined here. This corresponds to a sine-wave of ~50mV amplitude reaching the PZTs (after HV amplification). I am not sure if this is too small, but according to the PZT datasheet, these platforms are supposed to have a resolution of 0.02 urad, which would correspond to the input signal changing by ~0.1 mV, so this signal should be capable of dithering the tip-tilt.
I have already added band-pass filters centered at these frequencies to the model (with a passband of 5Hz, 2Hz on either side), and low-pass filters to pull out the DC component of the output of the lock-in amplifiers. It remains to tune the gains of the filter stages. These parameters (frequency, amplitude of the LOs) may also have to be changed after tests). Hopefully the PZTs can be plugged in tomorrow, and I can try and make a measurement of the output matrix.
Koji also suggested that it may be good to have a path in the model that feeds back to the PZTs by dithering the cavity mirrors as opposed to the PZT mounted mirrors. I will work on incorporating this into the SIMULINK model (c1asx.mdl) and also into the master medm screen.
Power Spectra of Arm Green Transmission:
I had prepared two more PZT mounted mirrors for the Y-end some time back. These are:
I used the same QPD set-up and the methodology described here to do a full-range calibration of these PZTs. Plots attached. The calibration constants have been determined to be:
CVI-pitch: 0.316 mrad/V
CVI-yaw: 0.4018 mrad/V
Laseroptik pitch: 0.2447 mrad/V
Laseroptik yaw: 0.2822 mrad/V
CVI YAW CVI PITCH
Laseroptik YAW Laseroptik PITCH
I redid the power spectrum measurement for the X-arm green transmission after aligning the arm to green using the ITMX/ETMX Pitch and Yaw sliders on IFOalign.
The Y-axis now reflects the relative intensity noise (RIN), which I obtained by taking the average value of the X-arm green transmission using tdsavg. Based on this measurement, I have now picked four new frequencies at which to try and modulate the PZT mirrors: 10, 19, 34 and 39 Hz. Bandpass filters in the LIA stage have been appropriately modified.
I have done some preliminary testing of the X-End Green ASS Servo. I will write a more detailed elog about this soon, but I thought I'd note down the important stuff here.
Yesterday, while we were venting, I aligned the X-arm to the green using the sliders on IFOalign, maximizing the transmission. Then I retook a power spectrum so as to determine the LO frequencies. Jenne pointed out that LO frequencies should not be integers (it usually suffices to append a .098725 or something to the frequency) so I made the necessary changes.
I did a first run of the servo yesterday, and more runs today. Notable points:
More details to follow.
Over the last three days, I've had the interferometer to test and optimize the ASX Servo. Based on what I have seen, I think the conclusion is that with the current parameters, the servo does its job provided the input pointing set up at the endtable with the coarse adjustment knobs is reasonably good. Once the cavity is aligned and IR transmission maximized using ASS, I have been able to get the green transmission up to 0.8 which is close to the best we had pre-vent. I have not been elogging regularly over the last few days, so this one is going to be a longish one.
Major changes made:
Details of tests runs:
For the most part, I have been trying to optimize the PZT mirror dither servo. To this end, I did the following:
Attempt to measure transfer function:
One of the things that came up during my presentation was how fast the loop was capable of responding. I was able to get a quantitative idea of this by playing around with the overall servo gain. Initially, it took ~30 seconds for the servo to get the transmission up to its peak value, with a servo gain of 1. When I ramped this up to 5, the response was much faster, with the peak transmission being reached in ~5seconds.
I wanted to get a more quantitative picture, and hence tried to measure the transfer function by first injecting an excitation into the 'SIG' filter-bank in the demodulation stage. However, coherence between the IN1 and IN2 signals was very poor for all the amplitude configurations I tried. At Jenne's suggestion, I tried injecting the excitation at the control-filters stage, but found no improvement. Perhaps the amplitude envelope was wrong or the measurement technique has to be rethought.
New MEDM screen:
We fixed the problematic DIN connectors on 1Y2, by swapping out the 3 DIN connector blocks that were of the wrong type (see attached image for the difference between the types appropriate for "Live" and "Ground").
Before doing anything, Eric turned the Wenzel multiplier off. We have not turned this back on.
Then we turned off the power supply unit at the base of 1Y2, removed the connectors from the rail, swapped out the connectors, reinstalled them on the rail, and turned the power supply back on. After swapping these out, we verified with a multimeter that between each pair of "Live" and "Ground" blocks, there was ~15V. We could now use the third unused pair of blocks to power the delay line phase shifter box, though for the moment, it remains powered by the bench power supply.
1. POP110 RF amps are powered from the cross connect. But that +15V block has GND connections that are not connected to the ground.
i.e. The ground potential is given by the signal ground. (Attachment 1)
This is caused by the misuse of the DIN connector blocks. The hod side uses an isolated block assuming a fuse is inserted.
However, the ground sides also have the isolated blocks
2. One of the POP110 RF cable has a suspicious shiled. The rigidity of the cable is low, suggesting the broken shield. (Attachment 2)
I made some changes to the c1tst model running on c1iscey in order to test my algorithm for frequency counting. I followed the steps listed in elog 8909 to make, install and start the model.
I need to debug a few things and run some more diagnostics so I am leaving the model in its edited version (Eric had committed it to the svn before I made any changes).
I have been working on setting up a frequency counting module that can give us a readout of the beat frequency, divided by a factor of 2^14 using the Wenzel frequency dividers as described here. This is a summary of what I have thus far.
The algorithm, and simulink model
The basic idea is to pass the digitized signal through a Schmitt trigger (existing RCG module), which provides some noise immunity, and should in theory output a clean square wave with the same frequency as the input. The output of the Schmitt trigger module is either 0 (for input < lower threshold value) and 1 (for input greater than the high threshold value). By differencing this between successive samples, we can detect a "zero-crossing", and by measuring the time interval between successive zero crossings, we can take the reciprocal to get the frequency. The last bit of this operation (i.e. measuring the interval) is done using a piece of custom C code. Initially, I was trying to use the part "GPS" from CDS_PARTS to get the current GPS time and hence measure intervals between successive zero-crossings, but this didn't work out because the output of GPS is in seconds, and that doesn't give me the required precision to count frequency. I tried implementing some more precision timing using the clock_gettime() function, which is capable of giving nanosecond precision, but this didn't work for me. So I am now using a more crude way of measuring the interval, by using a counter variable that is incremented each time a zero-crossing is NOT detected, and then converting this to time using the FE_RATE macro (=16384). In any case, the ADC sampling rate limits the resolution of frequency counting using zero-crossing detection (more on this later). Attachment 1 shows the SIMULINK block diagram for this entire procedure.
Testing the model
I implemented all of this on c1tst, and followed the steps listed here to get the model up and running. I then used one of the DB37 breakout boards to send a signal to the ADC using the DS345 function generator. Attachment 2 shows some diagnostic plots - input signal was a 2.5Vpp (chosen to match the output from the Wenzel dividers) square wave at 2kHz:
The right column pointed me to the limitations of frequency counting using this method - even though the input frequency was constant (2kHz), the counter variable, and hence the frequency readout, was neither accurate nor precise. But this was to be expected given the limitations imposed by ADC sampling? We only get information of the state of the input signal once within each sampling interval, and hence, we cannot know if a zero crossing has occurred until the next sampling interval. Moreover, we can only count frequency in discrete steps. In attachments 3 and 4, I've plotted these discrete frequencies which can be measured - the error bars indicate the error in the frequency readout if the counter variable is 1 more or less than the "true" value - this can (and does) happen if the high and low times of the Schmitt trigger are not equal over time (see top left plot in Attachment 2, its not very obvious, but all the "low" times are not equal, and so, the interval between detected zero crossings is not equal). This becomes a problem for small values of the counter variable, i.e. at high input frequencies. I was having a look at the elogs Aidan wrote some years ago for a different digital frequency counting approach, and I guess the conclusion there was similar - for high input frequencies, the error is large.
I further did two frequency sweeps using the DS345, to see if I could recover this in the frequency readout. Attachments 5 and 6 show the results of these sweeps. For low frequencies, i.e. 100-500 Hz, the jitter in the readout is small (though this will be multiplied by a factor of 2^14), but by the time the input frequency gets up to 2kHz, the jitter in the readout is pretty bad (and gets worse for even higher frequencies.
Some refinements can be made to the algorithm, perhaps by introducing some averaging (i.e. not reading out frequency for every pair of zero crossings, but every 5) which may improve the jitter in the readout, but I would think that the current approach is not very useful above 2kHz (corresponding to ~30MHz of pre-divider frequency), because of the limitations shown in attachments 3 and 4.
Earlier today, the front panels for the 1U chassis I obtained to house the Wenzel dividers + RF amplifiers arrived, which meant that finally I had everything needed to complete the assembly. Pictures of the finished arrangement attached.
Summary of the arrangement:
Once I figure out the problem with this amplifier/replace it, the box is ready to be installed.
The new 2x2 fiber couplers arrived today so Eric gave me an overview on the changes to be made to the existing configuration of the FOL fiber box. I removed the box from the table after ensuring that the PDs were powered OFF and removing and capping all fiber leads on the front panel. Here is a summary of the changes made.
I then ran a quick check to see what the power levels were at the input to the PDs, using the fiber coupled power meter. However, I found that there was no light in the fiber marked "PSL light in" (the power meter read out "Sig. Low"). The X arm Aux light had an input power of 1.12 mW, which after the various coupling losses etc went down to 63 uW just before the PD. The corresponding figures for the Y arm are 200 uW and 2.2 uW. I am not too sure of how the AUX light is coupled into fibers so I am not trying to tweak the alignment to see if I get more power.
Eric pointed out that the 1x2 couplers that were used in the previous arrangement and which I recycled, were in fact NOT appropriate - they are not 50-50 couplers but 90-10 couplers, which explains the measured power levels I quoted here.
I switched out these for a pair of the newly arrived 2x2 couplers, and have also replaced the datasheets on the inside of the top cover. I then redid the power level measurements, and got some sensible values this time (see Attachment #1 for revised layout and measured power levels, numbers in red are powers for PSL light, numbers in green are for AUX laser light, and all numbers are in mW). I did find that the 90-10 splitter in the PSL+Y path was not working (though the one in the PSL+X path seems to be working fine), and hence, have not quoted power levels at the output of these splitters. For now, I guess we can bypass the splitters and take the PSL+AUX light from the 2x2 couplers directly to the PDs.
We had a look at the IR beat (PSL+Xarm) today using the new FOL fiber box, and compared it to the green beat signal for the same combination. We first switched out the green Y beat input into the RF amplifiers on the PSL table with the PSL+Xarm IR beat input (so in all the plots, the BEATY channels really correspond to the IR beat for PSL+X). The IR and green beat notes were found without much difficulty, and we compared the beat signal PSDs for the green and IR signals (see Attachment #1 - arms were locked to green and the X slow control was turned on). The pink trace (labeled REF1) corresponds to the green beat signal, and was in good agreement with an earlier reference trace Eric had saved for the same signal. The teal trace (labeled REF0) corresponds to the the IR beat signal monitored simultaneously.
We then went back to the PSL table to check the amplitude of the signal from the broadband fiber PDs using the Agilent network analyzer. An initial measurement yielded a beat note (@~50MHz) at ~-22dbm (17mV rms). We figured that by bypassing the 90-10 splitter in this path, we could get a stronger signal. But after switching out the fiber connections we found that the signal amplitude had fallen to ~-27dbm (10mV rms). As per my earlier measurements here, we expect ~600uW of light on the PD, and a quick calculation suggested the signal should be more like 60mV, so we used the fiber power meter to check the power levels after each of the couplers again. We then found that the fiber connector on the front panel of the box for the PSL input wasnt ideal (the laser power after the first 50-50 coupler was only ~250 uW, though the input was ~1.2 mW). The power after the first coupler also fluctuated unpredictably (<100 uW to 350 uW) in response to slightly tightening/loosening the fiber connections on the front panel. I then switched the PSL input to one of the two unused fiber connectors on the front panel (meant for the 10% of the beat signal for the DC readout), and found that this input behaved much better, with ~450 uW of power available after the first 50-50 coupler. The power going into the beat PD was also measured to be ~550uW, closer to what was expected. The beat signal peak now was ~-14dbm (~30mV rms).
We then once again repeated the comparison between green and IR beat signals - but while in the control room, I noticed that the beat signal amplitude on the network analyzer in the control room was fluctuating by nearly 1.5 divisions on the vertical scale - not sure what the reason for this is. A look at the PSD of the IR beat with higher power incident on the PD was also not encouraging (see blue trace in Attachment #1), it seems to have gotten worse in the 10-30 Hz range. We also looked at the coherence between the beat spectrum and the beat note amplitude in order to look for any linear coupling between the two, but from Attachment #2, we cannot explain the disparity between the green and IR beat spectra. This warrants further investigation.
Everything on the PSL table has now been restored to the configurations before these investigations (i.e. the Y+PSL green beat cable has been reconnected to the RF amplifier, and both green beat PDs have been powered back ON. The fiber PDs are powered OFF)
The new ZKL-1R5 RF amplifier that Steve ordered arrived yesterday. I installed this in the frequency divider box and did a quick check using the Fluke RF signal generator and an oscilloscope to verify that both the X and Y paths were working.
I've now installed the box in the 1X2 rack where the olf "RF amplifiers for ALS and FOL" box used to sit (I swapped that out as I needed the L brackets on that chassis to mount mine, see Attachment #1 for the new layout). The power cable that used to power the old chassis was available, but the connector was of the wrong gender, so I had to switch this out. After verifying that I was getting the correct voltage (+15V), I connected it to the chassis.
I then did a quick check with the Fluke generator to make sure that all was working as expected - Eric had set up some ADC channels for me earlier today in the C1ALS model, and I copied over my frequency counting module from C1TST into C1ALS, and recompiled the model. The RF generator was set to generate a 25MHz signal at -20dBm, which I then split using an RF power splitter between the X and Y arms. I then checked the output using dataviewer - I recovered an output frequency of ~27.64 MHz with a jitter of ~0.02 MHz with a 20Hz low-pass filter in place (see Attachment #2), which looks consistent with the systematic error inherent in the zero-crossing counting algorithm and random fluctuations I had observed in my earlier trials, discussed here. But a more systematic investigation needs to be carried out in this regard. The interfacing between the hardware and software seems to be working alright though. I've left the RF generator near the 1x2 rack for now, though its powered off.
The mode cleaner unlocked quite a few times while I was working but looks stable now.
I carried out some more tests on the digital frequency counting system today, mainly to see if the actual performance mirrors the expected systematic errors I had calculated here.
Setup and measurement details:
I used the Fluke 6061A RF signal generator to output an RF signal at various frequencies, one at a time, between 10 and 70 MHz. I split the signal (at -15 dBm) into two parts, one for the X-channel and one for the Y-channel using a mini-circuits splitter. I then looked at the input signal using testpoints I had set up within the model, to decide what thresholds to set for the Scmitt trigger. Finally, I averaged the outputs of the X and Y channels using z avg -s 10 C1:ALS-FC_X_FREQUENCY_OUT and also looked at the standard deviation as a measure of the fluctuations in the output (these averages were taken after a low-pass filter stage with two poles at 20Hz, chosen arbitrarily).
I carried out some further diagnostics and found some ways in which I could optimize the zero-crossing-counting algorithm, such that the error in the measured frequency is now entirely within the expected range (due to a +-1 clock cycle error in the counting). We can now determine frequencies up to ~60 MHz with less than 1 MHz systematic error and <10 kHz statistical error (fluctuations after the 20 Hz lowpass). This should be sufficient for slow control of the end-laser temperatures.
The conclusion from my earleir tests was that there was possibly an improvement that could be made to setting the thresholds for the Schmitt trigger stage in the model. In order to investigate this, I wanted to have a look at the 64K sampled raw input to the ADCs. Yesterday Eric helped me edit the appropriate .par file for viewing these channels for c1x03, and for an input frequency of 70MHz (after division, ~4.3 kHz square wave), the signal looked as expected (top left plot, attachment #1). This prompted me to check the counting algorithm again with the help of various test points I had setup within the model. I found that there was a tendency to under-count the number of clock-cycles between zero-crossings by more than 1 clock cycle, due to the way my code was organized. I fixed this and found that the performance improved dramatically, compared to my previous trials. With the revised counting algortihm, there was at most a +-1 clock cycle error in the counting, and the systematic error between the measured and requested RF frequencies is now completely accounted for taking this consideration into account. The origin of this residual error can be understood by looking at the top right plot in Attachment #1 - presumably because of the effects of some downsampling filter, the input signal to the Schmitt trigger isnt a clean square wave (even at 4kHz) - specifically, the time spent in the LOW and HIGH states of the Schmitt trigger can vary between successive zero crossings because of the shape of the input waveform. As a result, there can be a +-1 clock cycle error in the counting process. Attachment #2 shows this - the red and blue lines envelope the measured frequency for the whole range investigated: 10-70MHz. Attachment #3 shows the systematic error as a function of the requested frequency.
If there was some way to bypass the downsampling filter, perhaps the high-frequency performance could be improved a little.
Steve pointed out that in the aftermath of the Nitrogen running out a couple of times last week, the RGA had shut itself off thinking that there was a leak and so it was not performing the scheduled scans once a day. So the data files from the scheduled scans were empty in the /opt/rtcds/caltech/c1/scripts/RGA/logs directory. The wiki page for getting it up and running again is up-to-date, but the script RGAset.py did not exist on the c0rga machine, which the RGA is communicating with via serial port. I copied over the script RGAset.py from rossa to c0rga and ran the script on that machine - but the error flags it returned were not all 0 (indicating some error according to the manual) - so I edited the script to send just the initialize command ('IN0') and commented out the other commands, after which I got error flags which were all 0. After this, I ran a manual scan using 'RGAlogger.py', and it appears that the RGA is now able to take scans again - I'm attaching a plot of the scan results. We've saved this scan as a reference to compare against after a few days.
I'm working on setting up a moving-average in the custom C code block that counts the zero crossings to see if this approach is able to mitigate the glitchy frequency readout due to mis-counting by one clock cycle between successive zero crossings. I'm storing an array the size of the moving average window of frequency readouts at each clock cycle, and then taking the arithmetic mean over the window. By keeping a summing variable that updates itself each clock cycle, the actual moving average process isnt very intensive in terms of computational time. The array does take up some memory, but even if I perform the moving average over 1 second with 16384 double precision numbers stored in the array, its still only 130 kB so I don't think it is a concern. Some tests I've been doing while tuning the code suggest that with a moving average over 16384 samples (i.e. 1 second), I can eliminate glitches at the 1Hz level in the frequency readout for frequencies up to 5 kHz (generated digitally using an oscillator block). Some tuning still needs to be done, and the window could possibly be shortened. I also need to take a look at the systematic errors in this revised counting scheme, preferably with an analog source, but this is overall, I think, an improvement.
On a side note, I noticed some strange behaviour while running the cds average command - even though my signal had zero fluctuations, using z avg 10 -s C1:TST-FC_FREQUENCY_OUT gave me a standard deviation of ~1 kHz. I'm not sure what the problem is here, but all the calibration data I took in earlier trials were obtained using this so it would be useful to perform the calibration again.