labscript-suite / labscript

The 𝗹𝗮𝗯𝘀𝗰𝗿𝗶𝗽𝘁 library provides a translation from expressive Python code to low-level hardware instructions.
http://labscriptsuite.org
BSD 2-Clause "Simplified" License
9 stars 48 forks source link

Round-off error in ramps tries to make devices go beyond their limits #16

Open philipstarkey opened 9 years ago

philipstarkey commented 9 years ago

Original report (archived issue) by Shaun Johnstone (Bitbucket: shjohnst, GitHub: shjohnst).


When trying to ramp a DDS to zero amplitude (in this case using an exponential ramp), I often find that the compilation fails saying that the device cannot accept values between 0 and 1. My current workaround for this is to change the final value of the ramp to be a small non-zero number below the quantisation limit of the device so that it will be rounded to zero anyway. There must be some rounding issues involved in the evaluation of ramp functions. The error message does not tell me what value it is tying to program, but I suspect that it will be an extremely small negative number.