The Past Week
I spent the past week coupling NPRO light into the fibers, and subsequently measuring the fiber mode profile using the beam profiler.
The Next Week
In the next week, I plan to at least do measurements of the Polarization Extinction Ratio of the fibers.
My current optical setup, plus an additional polarizing beam splitter (have it).
We wanted to improve the coupling into the fibers, because it's very rarely good enough to take measurements with, as the beam is obscured by random noise.
Additionally, we want to add some things to the current setup in order to better measure Polarization Extinction Ratio.
What Was Done
After flailing for several hours, Koji helped me couple the NPRO light into the fiber, using the fiber illuminator for alignment. The coupled optical power immediately jumped from 0-1uW to 5.6mW (around 11% coupling).
Q and I discussed the setup for measuring PER. In addition to the current setup, we added a half wave plate to control the angle of the polarization, in addition to the existing quarter wave plate, which corrects the beam for ellipticity.
Once everything was coupled, I started minimizing S-Polarization coming out of the first polarizing beam splitter, and maximizing the P-Polarization entering the fibers.
I did this by first varying the Quarter Wave plate to eliminate as much S Polarization as possible, and then, maintaining a constant differential in angle between QWP and HWP, I rotated them both to maximize power coupled into the fibers.
I measured 0.2 mW of S-Polarization, and 54.3 mW of P-Polarization.
At this point, a locking effort started, and I had to leave the 40m.
Tomorrow, I would like to finish the setup of the PER measurement design. That is to say, add a collimator to the other end of the fiber, and align it with the second PBS.
And, of course, take a measurement of the Polarization Extinction Ratio of the fiber.
To eventually be implemented in Frequency Offset Locking.
To eventually be implemented in Frequency Offset Locking.
Today, I encountered a problem with the stage that holds the coupler, in that its ability to rotate unchecked causes coupling to degrade over time due to torsion in the fibers. Our solution was to stress-relieve the fiber with a clamp.
Unfortunately, this also meant losing coupling completely. It was re-coupled at up 72% efficiency. (Subsequent changes in the setup have decreased that to ~24%)
When I took preliminary measurements of the PER, it was significant, which was unexpected. Upon further discussion with Q, we concluded that since the fiber's fast axis hadn't been aligned with the light's polarization, I was getting multiple polarizations out the end of the fiber.
Subsequent measurements of the power contained in the two polarizations of the output light gave about 0.8% S-Polarization introduced by the fiber.
I would like to find another collimator holder, to hold the output side of the fiber.
Also, I will spend more time aligning the fiber axes, and the second PBS in order to get a better (read: more reasonable) measurement of PER.
We're putting together a box to go into the 1X2 rack, to facilitate the frequency counters, and Raspberry Pi that will be used in FOL.
Separately, I am working on characterizing the Polarization Extinction Ratio of the PM980 fibers, for further use in FOL.
What's Been Done
The frequency counters have been mounted on the face of the box, and nylon spacers installed in the bottom, which will insulate the RPi in the future, once it's finally installed.
In regard to the PER setup, there is an issue, in that the mounts which hold the collimators rotate, so as to align the axes of the fibers with the polarization of the incoming light.
This rotational degree of freedom, however, isn't "sticky" enough, and rotates under the influence of the stress in the fiber. (It's not much, but enough.)
This causes wild fluctuations in coupled power, making it impossible to make accurate measurements of PER.
In the FOL box's case, we've ordered a longer power cable for the raspberry pi (the current one is ~9 inches long).
Once it arrives, we will install the RPi, and move the box into its place in the rack.
In the case of the PER measurement, we've ordered more collimator mounts//adapters, which will hopefully give better control over rotation.
We want a measurement of the fiber modes at either end, with the collimators, because these will be the modes that we'll be trying to match in order to couple light into the fibers, for FOL and/or future projects.
In order to measure these modes, I used the beam profiler (Thorlabs BP 209-VIS) to take measurements of the beam diameter (cut off at 13.5% of the amplitude) along the optical axis, for each of the fiber ends.
The ends are arbitrarily labelled End 1 and End 2.
For each measurement, the fibers were coupled to roughly 30%, or 25mW at the output.
Regarding the issue of free rotation in the collimator stages: while End 1 was relatively stable, End 2 tended to move away from its optimal coupling position. In order to correct for this, I chose a position where coupling was good, and repositioned the stage to that coordinate (124 degrees) before taking each measurement.
The data were then entered into A La Mode, which gave waist measurements as follows:
End 1--- X Waist: 197um at Z = 4.8mm Y Waist: 190um at Z = 13.6mm
End 2--- X Waist: 192um at Z = 7.4mm Y Waist: 190um at Z = 6.0mm
A La Mode code is attached in .zip file
These are the types of profiles that we will hopefully be matching the PSL and AUX lasers to, for use in frequency offset locking.
More characterization of the fibers is to follow, including Polarization Extinction Ratio.
We also hope to be testing the overall setup soon.
//edit Manasa// Harry will update this elog with before/after pictures of the table and power of the 1064nm rejected beam from the SHG.
While making these measurements, I reduced the Y end laser power (decreasing the current) so that we could use the beam profiler without burning anything and then brought it back up to the nominal power after the measurements were done.
We wanted to take measurements of "waists" of the PSL and AUX (Y-Arm) so I can then design a telescope to couple both into fibers for use in FOL.
For both lasers, PSL and AUX, I measured the profile of the dumped red (1064nm) beams coming out of the second harmonic generators, as this is the light that we will be using in FOL.
The power in the beam I measured from the PSL was 87.5 mW, and the power in the measured beam at the end table was 96 mW (when reduced from nominal power).
I used the beam profiler to take measurements of spot size at multiple points along the optical axis of both lasers.
An issue with these measurements was space constraints. In other words, there was no room on either table for a translation stage to hold the Profiler. I used a tape measure to determine Z-Coordinates. However, especially in the case of the AUX laser, parallax error caused uncertainty in my position measurements, which I would estimate at plus and minus 1.5cm.
I then fit these data using ALM to determine waist size and location for use in telescope design.
Z = 0 in the PSL graph is the face of the first mirror in the beam path, and in the AUX graph Z = 0 is the face of the SHG.
My measurement of the PSL gave:
X Waist = 43um at z = 6.8mm, as measured from the face of the SHG.
Y Waist = 44um at z = 6.8mm, as measured from the face of the SHG.
AUX Measurements gave:
X Waist = 44um at z = -3.1mm from the SHG face
Y Waist = 36um at z = -3.6mm from the SHG face
Find attached alm files in .zip
Movement on the Tables
In order to facilitate the measurements, we needed to move some things around, as pictured below.
On the PSL table, we installed a steering mirror after the Green filtering mirror, which is immediately after the SHG output, in addition to appropriate beam dumps.
At the end table, we removed some unused optics, as well as a PD, which were in the way . //edit// manasa: We removed IPANG (which has no light on it) and the associated steering optics.
Either tonight or tomorrow morning, I will use these data to design coupling telescopes for the PSL and AUX light.
Tomorrow, I will couple both lasers to fibers, and hopefully finish assembling the optics for FOL
In the past week, I have improved the coupling in the fiber testing setup on the SP table to up to ~45%
I also measured the input/output modes of the fiber with collimators.
Manasa, Q and I have designed, and redesigned a setup to measure Polarization Extinction Ratio introduced by fibers.
I have also partially assembled the box that will hold the frequency counters and RPi for FOL.
Today (Tuesday) I measured waists of PSL and AUX, at dumped light from the SHG's for use in designing coupling telescopes for FOL.
In the next week, I will design and couple light from PSL and AUX (Y arm) into fibers for use in testing FOL.
Once that's done, I will continue testing fiber characteristics, starting with Polarization Extinction Ratio.
Power cord for Raspberry Pi (ordered)
AD9.5F collimator adapter (ordered)
These telescopes will be used to mode match//couple the dumped SHG light from both PSL and AUX (Y-Arm) lasers into PM fibers for use in FOL.
Using the waist measurements I made yesterday (29/7/14) as seed waists, I used a la mode to design coupling telescopes.
These are designed to match the output mode of the fibers with collimators.
ALM files are attached in .zip file.
Once the fibers are coupled, I will continue in assembling the Y-Arm FOL setup, using fiber coupled beam combiner and photodiodes.
I will also do the same procedure for the X-Arm, access permitting.
We wanted to measure the PER of the polarization maintaining fibers, so we could say to what extent they are truly polarization maintaining.
The experimental setup of this measurement includes: The NPRO, quarter and half wave plates for tuning ellipticity and orientation of the resultant polarization, attenuating optics, two steering mirrors for coupling, a polarizing beam splitter before and after the laser coupled fibers, the coupling assembly and fiber, and a powermeter.
I measured the beam power at all the pertinent locations, shown in the figure below. Note that dots represent S polarization, and orthogonal line segments represent P polarization.
I first assembled this, coupling the output to a fiber coupled powermeter, in order to adjust the coupling.
Then I needed to couple the fibers to the NPRO, which I did to 39.8%. This gave me enough output power to have a coherent, visible beam. (Visible to non-fiber coupled power meter, and on the viewer card). It was important to be sure that the fast axis of the fiber was aligned in some known orientation. Mine was aligned to the horizontal, using the key on the fiber as an indicator. This is to be certain that the output polarization is consistent with the input.
Once everything was coupled and collimated, I began tuning the polarization of the beam at different points.
Immediately after the NPRO, I used the quarter and half wave plates to first eliminate as much ellipticity as possible, and then turn the polarization to align it with the beam splitter and the fiber axis. I then tuned the first PBS to reflect as little as possible. At the output, I installed the second PBS. Since there was no fine adjustment for the angle of this one, I tuned it using the yaw controls of the 6-axis mount the collimator was held in.
Once all this tuning was done, I took power measurements (displayed above) using the unfiltered, Orion/PD power meter.
From a theoretically completely P-polarized input, the Polarization Extinction Ratio, calculated at 10*log(P/S), was -24.26 +/- 0.43 dB.
These results can be effected by environmental conditions, such as high tightly wound the cable it, its length, etc.
The next measurement to make would be to characterize the frequency noise introduced by the fiber.
In addition to this measurement, the setup of the beat note system for FOL can be done as soon as we have more collimator adapters.
These measurements may be important in FOL, and in future experiments that may use these types of apparatuses.
Took first round of PER measurements after a long setup.
Started setting up to take measurement of the other polarization--ran into issues with mounts again. (Spinning of their own free will again.)
Devised a new scheme for taking more robust measurements of PER--still in progress.
Finish data analysis of these latest PER measurements
Hopefully finally move on to frequency noise characterization
None for PER
Unknown for frequency noise
I wanted to do a more robust measurement of PER of PM fibers for FOL, so I thought up this scheme.
I put together a setup as depicted below in order to take measurements of PER.
The first thing to do was to calibrate the whole setup. In order to do so, I first used the quarter and half wave plates closest to the NPRO to eliminate as much ellipticity from the output beam as possible, and then rotate the newly linearized light to be in alignment with the transmittance of the first polarizing beam splitter (P-Polarization).
I then aligned the fiber's fast axis with the P-Polarization on both the input and output sides. This was important so that no virtual ellipticity would be measured in the final measurement of PER.
I then mode matched and fiber coupled the first PBS output into the fibers, to about 30 mW (~60% coupling).
I wanted to measure both intensity of P and S simultaneously, so as to minimize the random little time-varying changes that would affect the measurements, so I used a powermeter and a PD, calibrated with the aformentioned powermeter.
In order to be able to compare the photodiode (PDA520) output to the powermeter (Orion) output, I fixed them each in their positions, and varied the laser power to produce the type of linear relationship we expect to see between PD Voltage and Optical Power. In this case, the conversion was P = V*2.719.
As opposed to the first method, which took only one datum, this method records P and S simultaneously, at different points through rotation of a linearly polarized beam.
Using the second HWP, I rotated the linearly polarized beam before it entered the fiber, at each point, recording the outputs of the PD and the Powermeter.
These data were then converted to be the same units, and fit to a sine wave.
As you can see, the intensities vary nearly identically, at a half wavelength phase difference, which is what one expects in this case. The PER of each polarization can be calculated by dividing the maximum value of one by the minimum of the other, and vice versa. The fact that these oscillate as we expect shows that the beam is relatively well linearized, and essentially that everything is working as it is assumed to be.
By looking at these fits, however, it is visible that they do not overlap with the actual extrema of the data. So, in order to produce more realistic values of extrema, those particular regions were fit to second order polynomials.
The values of these extrema yield the following measurements:
(SMin / PMax) = 0.007 +/- .004 ---> -21.54 +/- 2.48 dB
(PMin / SMax) = 0.022 +/- .009 ---> -16.58 +/- 1.78 dB
The problem I find with these measurements is that they're hard to reproduce.
Plus they seem high, since non-PM fibers advertise extinction ratios around -30 dB., plus I measured it at roughly -24 dB the first time I tried.
The next thing to do in terms of fiber characterization is to measure the frequency noise they introduce.
With respect to FOL, I just need some time to work on the PSL table, and at the Y end to couple the dumped SHG light, and then we can start using 1064nm beat notes to test//implement the feedback control system.
I'm currently in the process of coupling dumped SHG light from the Y arm end table into fibers for FOL.
The main point is that the NPRO at that end in shuttered, because I wasn't sure whether or not leaving it open would've set anything on fire.
The Y End laser dumped SHG light has been coupled into the yellow fiber that terminates at the PSL table.
It's not super stably coupled, and only at 5mW. I'll be interested to see what it is on monday.
I put the PSL telescope in place, and started coupling to it.
Unfortunately, I was only able to couple about 55 uW into the "fiber coupler" (read: fiber coupled splitter). See picture below:
Additionally, I'm not sure why this is, but both of the splitters we ordered don't split equally, but to 90% and 10% in each output port.
We also found that, since we aren't using the fibers we originally intended to, the specs are a little different, and the waist we're trying to have at the collimator face is now 283 um.
In the past week, I designed and assembled coupling telescopes for the PSL and Y Arm Lasers
The Y Arm was coupled to ~5mV, and the PSL remains uncoupled.
For the next week, I'm planning on working on things like my presentation and/or final report.
Though as of last night, my computer refuses to turn on, so there may be some further "troubleshooting" involved in that whole process.
Per Q's request, I've made up a diagram of the complete FOL layout for general reference.
We want to characterize the sort of response the fibers have to temperature gradients along them (potentially altering indices of refraction, etc.)
I have constructed a sort of two chambered "calorimeter" (by which I mean some coolers and other assorted pieces of recycling.)
The idea is that half of the length of PM fiber resides in one chamber, and the other in the other.
One chamber will remain at an uncontrolled, stable temperature (as measured by thermocouple probe) while the other's temperature is varied using a heat gun.
Using this setup, one can measure losses in power, and effects on polarization within the fiber.
This is currently living on the electronics bench until tomorrow morning, and is a little fragile, just in case it needs to be moved.
Earlier today Q and I somewhat resurrected my old PER measurement setup so I could run the temperature characterization experiment.
Unfortunately, when I tried to use the fiber illuminator, no light came from the other end, causing me to fail my primary goal for the summer of "don't break anything." The fiber has been re-spooled and labeled appropriately. Also sorry.
In addition to this, Q and I scavenged parts from the telescopes on the PSL and Y End tables, which were either not functional, or needed to have their mode matching adjusted, since we're using the non-PM fibers for FOL, which have a different numerical aperture, and thus slightly different output modes.
Specifically, this is involved removing the rotational mounts, and appropriate beam dumping.
My "calorimeter" still remains intact, in case anyone wants to make this measurement in the future, as this is my last day in the lab.
It's also effective at keeping drinks cold, if you'd rather use it for that.
Harry will update this elog with details about his beam waist measurements for the old NPRO on the SP table.
see http://nodus.ligo.caltech.edu:8080/40m/10098 for the update
Modified one of the PD assemblies carrying a large SI-Diode (~10mm diameter).
Removed elements used for resonant operation and changed PD readout to transimpedance
configuration. The opamp is a CLC409 with 240 Ohm feedback (i.e. transimpedance) resistor.
To prevent noise peaking at very high frequencies and get some decoupling of the PD,
I added a small series resistor in line with the PD and the inverting opamp input.
It was chosen as 13 Ohm, and still allows for operation up to ~100MHz.
Perhaps it could be smaller, but much more bandwith seems not possible with this opamp anyway.
Changes are marked in the schematic, and I list affected components here.
(Numbers refer to version 'PD327.SCH' from 30-April-1997):
-connected L3 (now open pad) via 100 Ohm to RF opamp output. This restores the DC sognal output.
-connected pin 3 of opamp via 25 Ohm to GND
-connected kathode of PD via 13 Ohm to pin 2 of opamp
-removed L6, C26, L5, C18, and C27
-shorted C27 pad to get signal to the RF output
Measured the optical TF with the test laser setup.
(Note that this is at 1064nm, although the PD is meant to work with green light at 532nm!)
Essentially it looks usable out to 100MHz, where the gain dropped only by about
6dB compared to 10MHz.
Beyond 100MHz the TF falls pretty steeply then, probably dominated by the opamp.
The maximal bias used is -150V.
If the bias is 'reduced' from -150V to -50V, the response goes down by 4dB at 10MHz and
by 9dB at 100MHz.
The average output was 30mV at the RF output, corresponding to 60mV at the opamp output (50Ohm divider chain).
With 240 Ohm transimpedance this yields 250µA photo-current used for these transfer functions.
Recorded transfer functions for the 1cm Si-PD as described on p. 2708
for different biases. I put the plots in there, to keep the info in one place,
where the label on the PD case (which Steve made without asking him) points
I talked to some people recently about the fact that the responsivity (A/W) of the PD
changes even at DC for different biases. I tested this again and should be more precise about this:
The first time I observed this was in the transfer functions as shown on p. 2708.
With 'DC' I meant 'low frequency' there, as you can still see an effect of the bias as low as 100kHz.
Then at one point I saw the responsivity changing with bias also at true DC.
However, it turned out that this is only the case if the photocurrent is too high.
If the photocurrent is 4mA, you need 400mV bias to get the max. responsivity.
For 2mA photocurrent, the responsivity is already maximal for 0V bias.
An effect for relative low frequencies remains however.
The DC check of responsivity was done with white light from a bulb.
just a few infos on Silicon PDs I looked up.
If you want to go beyond the 100MHz achievable with the device I worked on,
the one thing to improve is the opamp, where Steve is trying to find OPA657.
This is a FET with 1.6GHz BWP, minimum stable gain of 7, and 4.8nV/rt(Hz) noise.
Should be ok with 750-1000 Ohm transimpedance.
The other thing you might want to change is the PD
(although it might be the 1cm PD with high bias is as fast as smaller ones with lower bias).
There are two types of other Si diodes at the 40m right now (~3mm):
-Rana and I found a Centronic OSD 15-5T in the old equipment
-Frank gave me a Hamamatsu S1223-01 on a Thorlabs pre-amp device (could be taken out).
The Centronic OSD 15-5T has up to 80pF with 12 V bias according to the datasheet.
The Hamamatsu S1223-01 is stated with 20pF only, but stated to have a max. frequency resp. of 20MHz ('-3db point').
I dont know what this means, as the corner freq. of 10pF into 50Ohm is still 160MHz.
In any case there are faster 3mm types to start with, as for example Hamamatsu S3399 (~ 90$),
which is stated to have the corner at 100MHz with 50 Ohm load.
For this type the stated capacity (20pF) looks consistent with ~100MHz corner into 50 Ohm.
So probably you can get higher BW with this one using much smaller load, as in transimpedance stage.
I made a simple PD test circuit which may allow to test PD response up to few 100MHz.
Its not for low noise, only for characterising PD response.
Here is the circuit:
The 2 capacitor values (for bypassing) are kind of arbitrary, just what I found around
(one medium, one small capacity). Could be improved by better RF types (e.g. Mica).
The PD type has no meaning. I put in the Centronic 15-T5 for a start.
The bias can be up to 20V for this diode.
The signal appears across R1. It is small, to make a large bandwidth.
R2 is just for slightly decoupling the signal from the following RF amplifier.
The wire into the RF amplifier is short (~cm). And the amplifier is supposed to have 50 Ohm
I use a mini circuits ZFL 500 here.
power supply for this is 15V.
Added Matlab to the Docker machine. This should help immensely with workflow as well as keeping installed libraries consistent. Next step is outlining the project so coding is easier
Command to launch is: $ matlab &
From Jon just for bookkeeping:
Then in the Matlab command window, open the CDS parts library via:
Then open an RTCDS model (for example, here the LSC plant) via:
The x1SUSsim model on the docker was made in a more recent version of Simulink so I updated Matlab (see this)
I updated Matlab to 2021a so now the docker has 2020b and 2021a installed. This should also install Simulink 10.3 for the sus model to open. I used my account to activate it but I can change it over if I get a dedicated license for this. I am not sure what Jon did for the 2020b that he installed.
it is giving me "License error: -9,57" so I guess it didn't work... I will try to just make the model on the 2020b just so I have something.
I was able to fix the problem with the activation (using this).
I can now open the x1sussim.mdl file. It is trying to access a BSFM_MASTER Library that it doesn't seem to have. the other files don't seem to have any warnings though.
the simple suspension model can be found in home/controls/docker-cymac/userapps/c1simpsus.mdl on the docker system. This is where I will put my model. (right now it is just a copied file)
Also using Simulink on the docker is very slow. I think this is either a limit of the x2goclient software or the hardware that the docker is running on.
So I am stuck on how to add the control block to my model. I am trying to make it as simple as possible with just a simple transfer function for a damped harmonic oscillator and then the control block (see overview.png).
The transfer function I am using is:
For future generations: To measure the transfer function (to verify that it is doing what it says it is) I am using the discrete transfer function estimator block. To get a quick transfer function estimator Simulink program run ex_discrete_transfer_function_estimator in the Matlab command line. This works well for filters but it was hit or miss using the discrete transfer function.
The roadblock I am running into right now is that I can't figure out how to add the controller to the model. Not on an interpretation level but in a very straightforward "can I drag it into my model and will it just work" kind of way.
I am also a little confused as to exactly which block would do the controlling. Because I want to just use the x of the pendulum (its position) I think I want to use the suspension controls which come are connected to in the suspension plant model. But where exactly is it and how can I get the model? I can't seem to find it.
I have attached the framework that I am using for the full system. Plantframework.pdf has the important aspects that I will be changed. Right now I am trying to keep it mostly as is, but I have disconnected the Optic Force Noise and hope to disconnect the Suspension Position Noise. The Optic Force Noise Block is additive to the signal so eliminating it from the system should make it less realistic but simpler. It can be added back easily by reconnecting it.
The next step is adding my plant response, which is simply the transfer function and measurement from the last post. These should be inserted in the place of the red TM_RESP in the model.
The TM_RESP block takes in a vector of dimension 12 and returns a vector of dimension 6. The confusing part is that the block does not seem to do anything. it simply passes the vector through with no changes. I'm not sure why this is the case and I am looking for documentation to explain it but haven't found anything. As to how a 12 vector turns into a 6 vector I am also lost. I will probably just disconnect everything but the x position.
I tried to just throw in my model (see Simple_Plant.pdf) and see what happened but the model would not let me add built-in blocks to the model. This is weird because all the blocks that I am adding are part of the basic library. My guess is that this mode will only accept blocks from the CDL library. I will either need to change my blocks to be made from blocks in the CDL library or maybe I can pass the signal out of the plant framework model then into my model then back to the plant framework model. I think this is just a Matlab thing that I don't know about yet. (Jon probably knows)
I have also attached an image of the controls model for reference. It looks like a mess but I'm sure there is a method. I won't get lost in going through it just assume it works... for now.
The next question I have been asking is how do I show that the system works. When anchal and I made a python simulation of the system, we tested it by seeing the evolution of the degrees of freedom over time given some initial conditions. We could see the pendulum propagating and some of the coupling between the DOFs. This is a fast and dirty way to check if everything is working and should be easy to add. I simply recorded the POS signal and graph it over time. Once we get to a state-space model we can test it by taking the transfer function, but since our plant is literally already just a transfer function there isn't much of a point yet.
Also, I need to add color to my Simple_Plant.pdf model because it looks really boring :(
The first version of the single filter plant is below. Jon and I went through compiling a model and running it on the docker (see this post)
We activated an early version of the plant model (from about 10 years ago) but this model was not designed to run on its own so we had to ground lots of unconnected pieces. the model compiled and ran so we moved on to the x1sus_single_plant model that I prepared.
This model is shown in the first attachment wasn't made to be run alone because it is technically a locked library (see the lock in the bottom left). It is supposed to be referenced by another file: x1sup.mdl (see the second attachment). This works great in the Simulink framework. I add the x1sus_single_plant model to the path and Matlab automatically attaches the two. but the docker does not seem to be able to combine the two. Starting the cymac it gives these errors:
cymac | Can't find sus_single_plant.mdl; RCG_LIB_PATH=/opt/rtcds/userapps:/opt/rtcds/userapps/lib:/usr/share/advligorts/src/src/epics/simLink/:/usr/share/advligorts/src/src/epics/simLink/lib:/usr/share/advligorts/src/src/epics/simLink
cymac | make: *** [Makefile:30: x1sup] Error 2
cymac | make: *** [Makefile:35: x1sup] Error 1
I have tried putting the x1sus_single_plant.mdl file everywhere as well as physically dragging the blocks that I need into the x1sup.mdl file but it always seems to throw an error. Basically, I want to combine them into one file that is not referencing anything other than the CDS library but I cant figure out how to combine them.
Okay but the next problem is the medm screen generation. When we had the original 2010 model running the sitemap did not include it. It included models that weren't even running before but not the model Jon and I had added. I think this is because the other models that were not running had medm screens made for them. I need to figure out how to generate those screens. I need to figure out how to use the tool Chris made to auto-generate medm screens from Simulink but I can't seem to figure it out. And honestly, it won't be much use to me until I can actually connect the plant block to its framework. One option is to just copy each piece over one by one. this will take forever but at this point, I am frustrated enough to try it. I'll try to give another update later tonight.
To add the required library: put the .mdl file that contains the library into the userapps/lib folder. That will allow it to compile correctly
I got these errors:
I removed all IPC parts (as seen in Attachment 1) and that did the trick. IPC parts (Inter-Process Communication) were how this model was linked to the controller so I don't know how exactly how I can link them now.
I also went through the model and grounded all un-attached inputs and outputs. Now the model compiles
Also, The computer seems to be running very slowly in the past 24 hours. I know Jon was working on it so I'm wondering if that had any impact. I think it has to do with the connection speed because I am connected through X2goclient. And one thing that has probably been said before but I want to note again is that you don't need a campus VPN to access the docker.
Now that the model is finally compiled I need to make an medm screen for it and put it in the c1sim:/home/controls/docker-cymac/userapps/medm/ directory.
But before doing that I really want to test it using the autogenerated medm screens which are in the virtual cymac in the folder /opt/rtcds/tst/x1/medm/x1sup. In Jon's post he said that I can use the virtual path for sitemap after running $ eval $(./env_cymac)
When the cymac is started it gives me a list of channels shown below.
$ Initialized TP interface node=8, host=98e93ecffcca
$ Creating X1:DAQ-DC0_X1IOP_STATUS
$ Creating X1:DAQ-DC0_X1IOP_CRC_CPS
$ Creating X1:DAQ-DC0_X1IOP_CRC_SUM
$ Creating X1:DAQ-DC0_X1SUP_STATUS
$ Creating X1:DAQ-DC0_X1SUP_CRC_CPS
$ Creating X1:DAQ-DC0_X1SUP_CRC_SUM
But when I enter it into the Diaggui I get an error:
The following channel could not be found:
My guess is that need to connect to the Diaggui to something that can access those channels. I also need to figure out what those channels are.
After a helpful meeting with Jon, we realized that I have somehow corrupted the sitemap file. So I am going to use the code Chris wrote to regenerate it.
Also, I am going to connect the controller using the IPC parts. The error that I was having before had to do with the IPC parts not being connected properly.
I added the IPC parts back to the plant model so that should be done now. It looks like this again here.
I can't seem to find the control model which should look like this. When I open sus_single_control.mdl, it just shows the C1_SUS_SINGLE_PLANT.mdl model. Which should not be the case.
When using mdl2adl I was getting the error:
$ cd /home/controls/mdl2adl
$ ./mdl2adl x1sup.mdl
error: set $site and $ifo environment variables
to set these in the terminal use the following commands:
$ export site=tst
$ export ifo=x1
On most of the systems, there is a script that automatically runs when a terminal is opened that sets these but that hasn't been added here so you must run these commands every time you open the terminal when you are using mdl2adl.
I copied c1scx.mdl to the docker to attach to the plant using the commands:
$ ssh nodus.ligo.caltech.edu
$ cd opt/rtcds/userapps/release/isc/c1/models/simPlant
$ scp c1scx.mdl controls@c1sim:/home/controls/docker-cymac/userapps
Working with Chris, we decided that it is probably better to use a simple filter module as a controller before we make the model more complicated. I will use the plant model that I have already made (see attachment 1 of this). then attach a single control filter module to that: as seen in attachment 1. because I only want to work with one degree of freedom (position) I will average the four outputs which should give me the position. Then by feeding the same signal to all four inputs I should isolate one degree of freedom while still using the premade plant model.
The model I made that is shown in attachment 2 is the model I made from the plan. And it complies! yay! I think there is a better way to do the average than the way I showed. And since the model is feeding back on itself I think I need to add a delay which Rana noted a while ago. I think it was a UnitDelay (see page 41 of RTS Developer’s Guide). So I will add that if we run into problems but I think there is enough going on that it might already be delayed.
Since our model (x1sup_isolated.mdl) has compiled we can open the medm screens for it. I provide a procedure below which is based on Jon's post.
$ cd docker-cymac
$ eval $(./env_cymac)
$ medm -x /opt/rtcds/tst/x1/medm/x1sup_isolated/X1SUP_ISOLATED_GDS_TP.adl
To see a list of all medm screens use:
$ cd docker-cymac
# cd /opt/rtcds/tst/x1/medm/x1sup_isolated
Some of the other useful ones are:
See attachment 4. This screen shows the POS plant filter module that will be filled by the filter representing the transfer function of a damped harmonic oscillator:
THIS TF HAS BEEN UPDATED SEE NEXT POST
The first one of these screens that are of interest to us (shown in attachment 3) is the X1SUP_ISOLATED_GDS_TP.adl screen, which is the CDS runtime diagnostics screen. This screen tells us "the success/fail state of the model and all its dependencies." I am still figuring out these screens and the best guide is T1100625.
The next step is taking some data and seeing if I can see the position damp over time. To do this I need to:
The transfer function given in the previous post was slightly incorrect the units did not make sense the new function is:
I have attached a quick derivation below in attachment 1
The plant transfer function of the pendulum in the s domain is:
Using Foton to make a plot of the TF needed and using m=40kg, w0=3Hz, and Q=50 (See attachment 1). It is easiest to enter the above filter using RPoly and saved it as Plant_V1
I was able to measure the transfer function of the plant filter module from the channel X1:SUP-C1_SUS_SINGLE_PLANT_Plant_POS_Mod_EXC to X1:SUP-C1_SUS_SINGLE_PLANT_Plant_POS_Mod_OUT. The resulting transfer function is shown below. I have also attached the raw data for making the graph.
Next, I will make a script that will make the photon filters for all the degrees of freedom and start working on the matrix version of the filter module so that there can be multiple degrees of freedom.
Added difference to the graph. I included the code so that others could see what it looks like and use it for easy use.
I have attached an updated transfer function graph with the residual easier to see. I thought here I would include a better explanation of what this transfer function was measuring.
This transfer function was mainly about learning how to use DTT and Foton to make and measure transfer functions. Therefore it is just measuring across a single CDS filter block. X1SUP_ISOLATED_C1_SUS_SINGLE_PLANT_Plant_POS_Mod block to be specific. This measurement shows that the block is doing what I programmed it to do with Foton. The residual is probably just because the measured TF had fewer points than the calculated one.
The next step is to take a closed-loop TF of the system and the control module.
After that, I want to add more degrees of freedom to the model. both in the plant and in the controls.
I have added more degrees of freedom. The model includes x, y, z, pitch, yaw, roll and is controlled by a matrix of transfer functions (See Attachment 2). I have added 5 control filters to individually control UL, UR, LL, LR, and side. Eventually, this should become a matrix too but for the moment this is fine.
Note the Unit delay blocks in the control in Attachment 1. The model will not compile without these blocks.
Jon and I tested the ADC and DAC cards in both of the systems on the test stand. We had to swap out an 18-bit DAC for a 16-bit one that worked but now both machines have at least one working ADC and DAC.
[Still working on this post. I need to look at what is in the machines to say everything ]
Anchal and I wrote a script (Attachment 1) that will test the ADC and DAC connections with inputs on the INMON from -3000 to 3000. We could not run it because some of the channels seemed to be frozen.
The channels on both the C1BHD and C1SUS2 seem to be frozen: they arent updating and are holding one value. To fix this Anchal and I tried:
I wonder if Jon has any ideas.
Anchal and I ran tests on the two systems (C1-SUS2 and C1-BHD). Attached are the results and the code and data to recreate them.
We connected one DAC channel to one ADC channel and thus all of the results represent a DAC/ADC pair. We then set the offset to different values from -3000 to 3000 and recorded the measured signal. I then plotted the response curve of every DAC/ADC pair so each was tested at least once.
There are two types of plots included in the attachments
1) a summary plot found on the last pages of the pdf files. This is a quick and dirty way to see if all of the channels are working. It is NOT a replacement for the other plots. It shows all the data quickly but sacrifices precision.
2) In an in-depth look at an ADC/DAC pair. Here I show the measured value for a defined DC offset. The Gain of the system should be 0.5 (put in an offset of 100 and measure 50). I included a line to show where this should be. I also plotted the difference between the 0.5 gain line and the measured data.
As seen in the provided plots the channels get saturated after about the -2000 to 2000 mark, which is why the difference graph is only concentrated on -2000 to 2000 range.
Summary: all the channels look to be working they all report very little deviation off of the theoretical gain.
Note: ADC channel 31 is the timing signal so it is the only channel that is wildly off. It is not a measurement channel and we just measured it by mistake.
I have looked at my code from the previous plot of the transfer function and realized that there is a slight error that must be fixed before we can analyze the difference between the theoretical transfer function and the measured transfer function.
The theoretical transfer function, which was generated from Photon has approximately 1000 data points while the measured one has about 120. There are no points between the two datasets that have the same frequency values, so they are not directly comparable. In order to compare them I must infer the data between the points. In the previous post  I expanded the measured dataset. In other words: I filled in the space between points linearly so that I could compare the two data sets. Using this code:
#make values for the comparison
tck_mag = splrep(tst_f, tst_mag) # get bspline representation given (x,y) values
gen_mag = splev(sim_f, tck_mag) # generate intermediate values
for x in range(len(gen_mag)):
dif_mag.append(gen_mag[x]-sim_mag[x]) # measured minus predicted
tck_ph = splrep(tst_f, tst_ph) # get bspline representation given (x,y) values
gen_ph = splev(sim_f, tck_ph) # generate intermediate values
for x in range(len(gen_ph)):
At points like a sharp peak where the measured data set was sparse compared to the peak, the difference would see the difference between the intermediate “measured” values and the theoretical ones, which would make the difference much higher than it really was.
To fix this I changed the code to generate the intermediate values for the theoretical data set. Using the code here:
tck_mag = splrep(sim_f, sim_mag) # get bspline representation given (x,y) values
gen_mag = splev(tst_f, tck_mag) # generate intermediate values
for x in range(len(tst_mag)):
dif_mag.append(tst_mag[x]-gen_mag[x])#measured minus predicted
tck_ph = splrep(sim_f, sim_ph) # get bspline representation given (x,y) values
gen_ph = splev(tst_f, tck_ph) # generate intermediate values
for x in range(len(tst_ph)):
Because this dataset has far more values (about 10 times more) the previous problem is not such an issue. In addition, there is never an inferred measured value used. That makes it more representative of the true accuracy of the real transfer function.
This is an update to a previous plot, so I am still using the same data just changing the way it is coded. This plot/data does not have a Q of 1000. That plot will be in a later post along with the error estimation that we talked about in this week’s meeting.
The new plot is shown below in attachment 1. Data and code are contained in attachment 2
I am adding a State-space block to the SimPlant cds model using the example Chris gave. I made a new folder in controls called SimPlantStateSpace. wI used the code below to make a state-space LTI model with a 1D pendulum then I converted it to a discrete system using c2d matlab function. Then I used these in the rtss.m file to create the state space code I need in the SimPlantStateSpace_1D_model.h file.
Q = 1000;
phi = 1/Q;
g = 9.806;
m = 0.24; % mass of pendulum
l = 0.248; %length of pendulum
w_0 = sqrt(g/l);
f=16000 %this is the frequency of the channel that will be used
A = [0 1; -w_0^2*(1+1/Q*1i) -w_0/Q]
B = [0; 1/m];
C = [1 0];
D = ;
sys_dc = ss(A,B,C,D)
This code outputs the discrete state space that is added to the header file attached.
I gave some of the data analysts a look around because they asked and nothing was currently going on in the 40m. Nothing was changed.