Zapit-Optostim / zapit

General purpose optostimulation system
GNU Lesser General Public License v2.1
6 stars 1 forks source link

Rampdown is smooth in simulated mode but more jagged in reality #68

Open raacampbell opened 1 year ago

raacampbell commented 1 year ago

There were issues with the smoothed rampdown being a big jagged. I extended the simulated mode and used it to produce a nice smoothed version of the rampdown: b5aeaa78f6728673e1903184ea8eae2f8eb50b47

However, when running it on real hardware I still see a jagged edge. Perhaps not as bad as before, but it's there.

raacampbell commented 1 year ago

Added some debugging output: b66bde2774c995cdf8325295d9a74dd68505c9e7

One thing I have noticed is that there are two cycles of the waveform before the next downward step (in non-rampdown). Probably we can't write them fast enough? I think it's playing whatever is currently in the buffer then it's playing the new buffer. So we often get each waveform twice. That makes it jagged. Maybe the only solution is to pre-compute and dump them all at once. At the moment we play the waveform then use the waveform that was played as the basis for the next one.

raacampbell commented 1 year ago

Did not help to precompute: 7cf746e2c68fc885d954f93967196aeef84d03d4

Maybe there are USB settings we can play with? Should also try this on a PCIe DAQ.

raacampbell commented 1 year ago

This is no longer a requirement to leave beta. We are almost certainly fine to have the steps. The issue surrounding this can be solved at a later time. Or not.