msr-consulting / exscalabar_server

Repository for the EXSCALABAR server.
http://www.msrconsults.com/ukmet-gh/exscalabar
0 stars 1 forks source link

Unwanted spikes in IA when so helpfulamiright #140

Closed JustinLangridge closed 7 years ago

JustinLangridge commented 8 years ago

The spikes you see in the IA plot above when you turn the speaker off are erroneous - presumably because we start to integrate and plot the IA before the speaker is fully off. Is it an easy fix to put in a 1s delay after speaker switch off to stop these spikes appearing? We can chop these periods during data analysis, but the driver for doing it online is that when we're ambient sampling these spikes will screw up the scaling

lo-co commented 7 years ago

Not really sure what is going on here. The speaker appears to trigger twice? Dave or Justin can you look into this? I added code in the most recent commit but don't think this will fix it as it appears that when the speaker triggers off, the signal flatlines and then the speaker signal pops up again and then disappears as the laser comes back on...

This may be another issue altogether that is more serious than cosmetic.

lo-co commented 7 years ago

This is a real problem that I am not sure that I am the source of. You guys need to verify that this is not hardware. I seem to be only sending the signal to turn off the speaker once, but it appears to trigger on after it goes off.

JustinLangridge commented 7 years ago

I don't think the speaker is coming on and off (e.g. the speaker power light is not cycling). This is also not a problem for the final data (it is easy to filter out). However can we just remove this 1s from the IA data plotted on the UI as the impacts on scaling are annoying.

lo-co commented 7 years ago

@JustinLangridge The speaker is very clearly turning back on briefly. Please look at the graphs and you will see what is happening. The spike is EXACTLY related to this odd feature. I turn it off once, the speaker goes off and then briefly comes on again! The speaker power light is not cycling because the software is not the source of this. I will reemphasize what I said above - THIS LOOKS LIKE A HARDWARE ISSUE. If possible, let's take a look at this together on TV tomorrow so that we can all see what is happening. The solution you pose above is not ideal and will take some time for me to work around a problem that may have nothing to do with the software.

datid commented 7 years ago

I think I have got to the bottom of this .... There were two issues, firstly if an error goes into reusable\PAS\Data\Cell\Resample Waveforms.vi then it doesn't resample the waveforms. So when the vi before it had an error - which seemed to happen if turning the speaker on or off - then the waveforms were left at 40kHz which caused issues down stream. So I wired the error around it so the waves are always resampled (in reusable/PAS/Main/Analyze Data.vi ). I noticed this because it was a problem in the waveforms I saved. When I switched the speaker off the array size went from (5,8000) to (5,40000). Secondly - there always seemed to be more than 200000 samples left on the DMA which is equivalent to 1 second of data. I put a check in that if there are more than 200000 left then read it off again so as to get up to date ( in PAS/Instrument/Get Data.vi )

datid commented 7 years ago

This has fixed it. Can be closed from my perspective (me being justin)

lo-co commented 7 years ago

That is fine. I would recommend actually trying to figure out why the DMA is backing up and properly handling the error thrown in PAS::Analyze Data that is causing it to miss the resample code.