project8 / dripline

Slow controls for medium scale physics experiments based on AMQP centralized messaging
http://www.project8.org/dripline
1 stars 0 forks source link

Bad DPPH Fit #96

Closed ldeviveiros closed 9 years ago

ldeviveiros commented 9 years ago

The DPPH field value varies wildly for Z>110mm. I suspect it's the fitting function. Looking at the oscilloscope, we see the crossing frequency decreasing smoothly as we increase Z, so it's not random fluctuations. We need to improve the fit.

See Elog entry: https://maxwell.npl.washington.edu/elog/project8/Project+8/549

laroque commented 9 years ago

Can you provide more information about what "fluctuating wildly" means. The ddph_scan script supports (or is supposed to support) dumping the raw data. Could you post either a plot of the amplitude values being used, a plot of them, or a screenshot of the scope for a case which isn't working?

Some notes on what is done vs what should be:

laroque commented 9 years ago

After further feedback from Megan and Luiz, I'm more confident that there are two problems:

  1. The Weiner filter needs to be given a signed input. The magnitude values are better than x or y alone, but is positive definite. Normal rules for complex numbers should allow one to compute a sign from the product of the signs of X and Y. (This is the sign of the derivative of the absorption lineshape)
  2. Originally the sweep speed and range, the lock-in ADC rate, etc. were all fixed, and so the target function to the Weiner filter was hard coded based upon all of those values. We've since changed all of those values and so this hard coded value is not well motivated. The correct thing to do would be to query the sweeper for not only the frequency sweep range, but also the number of points and dwell time. This gives a Hz/s for the input. Next select a lock-in ADC sampling rate that should resolve the line shape (based on its expected width), and a number of points for the lock-in sampling to over-cover a sweep (I like 110% of the sweep time). This should allow one to compute the (Hz swept)/sample in the lock-in data output. The "width" in samples used to construct the Weiner filter's target function can then be computed.
ldeviveiros commented 9 years ago

Although that has already been discussed elsewhere, I added a plot of the DPPH Field vs Insert Z-position to the elog entry, to illustrate what I mean by "varying wildly". The problem is that when we use the magnitude of the lockin signal (as already addressed above), the filtered curve will have extra minima, and the dpph_scan code can pick a different minimum to calculate the field. So the field just jumps up and down arbitrarily for different measurements.

laroque commented 9 years ago

Above comments are wrong, X and Y don't mean quite what I thought that they did. The Lock-in supports tuning the phase such that most signals are purely in X and Y is zero. If we're able, we should add this to the lock-in tuning procedure and then filter on X. If not, perhaps we can systematically get a sign from the phase output channel. If not we can go back to just using the X data and deal with the fact that the signal is less clean because part of it is in Y.

ghost commented 9 years ago

I suggest you take the signal as X+iY. Then take the magnitude of the filter output.

On Fri, Jul 24, 2015 at 8:05 AM, Ben LaRoque notifications@github.com wrote:

Above comments are wrong, X and Y don't mean quite what I thought that they did. The Lock-in supports tuning the phase such that most signals are purely in X and Y is zero. If we're able, we should add this to the lock-in tuning procedure and then filter on X. If not, perhaps we can systematically get a sign from the phase output channel. If not we can go back to just using the X data and deal with the fact that the signal is less clean because part of it is in Y.

— Reply to this email directly or view it on GitHub https://github.com/project8/dripline/issues/96#issuecomment-124552481.

laroque commented 9 years ago

@mwachtendonk @ldeviveiros Is this issue still active or does the complex valued filter input give reasonable/stable results? Or maybe it is expected to work but hasn't been tested enough because there were troubles getting everything cabled and configured correctly?

mwachtendonk commented 9 years ago

So far we've run two scans with the new filter; one on Friday of last week and one on Monday. Luiz had me compare the average field values between the two days. Monday's average was 9.58205 and Friday's average was 9.58775, so a difference of 0.0057kG. I don't know if this difference would be due to the filter or something else, but if we decide that the filter isn't doing something weird do the data, then I think it's safe to say that this issue is no longer active.

laroque commented 9 years ago

I'm less interested in the difference between days as if you do many measurements at the same z one after the other. Also, just plotting everything does it look reasonable.

On Thu, Aug 6, 2015, 9:55 AM mwachtendonk notifications@github.com wrote:

So far we've run two scans with the new filter; one on Friday of last week and one on Monday. Luiz had me compare the average field values between the two days. Monday's average was 9.58205 and Friday's average was 9.58775, so a difference of 0.0057kG. I don't know if this difference would be due to the filter or something else, but if we decide that the filter isn't doing something weird do the data, then I think it's safe to say that this issue is no longer active.

— Reply to this email directly or view it on GitHub https://github.com/project8/dripline/issues/96#issuecomment-128440873.

laroque commented 9 years ago

Closing this issue as mostly resolved (the bugs anyway). Opened issue #108 to cover the upgrades to the script that it would still be nice to implement.