Closed philipstarkey closed 5 years ago
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
It's possible that the lab using this feature doesn't even need it anymore. It was always a hack to use the short pulseblaster pulses to trigger the novatech off falling edges that were shortly after rising edges. I think they may have moved on to less hacky triggering of novatechs. In that case we can just remove the pulse width setting. I'll find out.
Clearly no other lab is using this feature, since this bug has existed for many years in mainline labscript.
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
It turns out that both labs here do need this, so no removing it for now.
I think I can fix the issue though. If you're going to do any work on it @philipstarkey let me know, otherwise I'll have a go at it.
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Addressed by PR #67
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Resolve issue #33.
Pulseblasters now have a long delay time computed from their core clock freq, which has been added as an instance attribute to every subclass. (this is messy, as it is duplicated in the BLACS worker classes too. It should be passed as a connection table property ideally, but this will have to wait for a more general 'pulseblaster unification' change I think, along the lines of the NI DAQ unification).
For each clock tick, the high time is half the clock period if
pulse_width='symmetric'
(the default), the minimum possible if
pulse_width='minimum'
, or a fixed value if pulse_width
is given as a number.
The high time is then clipped to self.long_delay if it is larger, in which case the pulse_width argument is not honoured, but 57 second high times ought to be visible on scopes and not too fast for any devices, so this is preferable to the alternative of adding LONG_DELAY instructions to both the high and low times of the clock ticks.
The low time is then computed as whatever is left, and split into a LONG_DELAY instruction plus the remainder as an END_LOOP instruction, as before.
If the PulseBlaster has no external clocks for this clock tick, it uses a LONG_DELAY plus the remainder as a CONTINUE instruction, as before.
→ \<\<cset 0178a80aded7fa2c547f3ced1d55509808ec25d8>>
Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
If the PulseBlaster's
pulse_width
keyword argument is used, the shot ends up being approximately twice as long as it should be:This prints
6.000053678714858
as the total duration of PulseBlaster instructions, although the requested stop time was 3 seconds.This is a regression introduced by 8de5e8fb815b859102163c2cb724ac9d927dea2c. If I backout that changeset, the above prints the more expected value
3.0000429429718882
.Backing out the changeset had a minor merge conflict. It was trivial, but for what it's worth here is a commit that backs it out, if you want to see the diff without all the noise of what happened in between then and now.
There is also a spurious error raised if there is a single segment of the experiment in which no non-external clocks tick. The error is clearly intended to prevent you using pulse_width when there are no external clocks in use, but it is being tested on a per-instruction basis. It almost looks like the error checking can be removed with no consequence.