sanworks / pulsepal Goto Github PK
View Code? Open in Web Editor NEWOpen source pulse train generator
License: GNU General Public License v3.0
Open source pulse train generator
License: GNU General Public License v3.0
Dear Josh,
I'm playing a bit around with my PulsePal (Gen 2; FW: 2.0.1).
When setting the Phase1Duration manually (by joystick) to 300µs (=0.00030s) and the PulseInterval to 333ms (=0.33300s) in order to obtain 3Hz stimulation, in a burst of 16s - I, instead of the desired 3*16=48 pulses, get 49 pulses. That makes sense, - as there's still room for another pulse.
So I went for the python interface to circumvent this, by writing a loop with a "total number of pulses per burst".
But that introduces some new problems in regards of rounding.
Regardless if I set "myPulsePal.phase1Duration[1] = 0.00030" or "myPulsePal.programOutputChannelParam('phase1Duration', 1, 0.00030)" - the PulsePal reads the Phase1Duration as "0.00025s". And measuring the pulse width on an oscilloscope, the width does seem to be closer to 250µs.
I've also tried approaches with the decimal.Decimal module in python. E.g.
Decimal('300')/Decimal('1000000') => with and without either or both float(Phase1Duration) and round(Phase1Duration,6)...
If I put the following:
myPulsePal.programOutputChannelParam('phase1Duration', 1, 0.000301) -> that is, 301µs, the PulsePal reads "0.00030s", and the width (measured with an oscilloscope) does appear closer to 300µs.
According to your paper regarding the PulsePal (Sanders and Kepecs, 2014) you restricted the shortest configurable pulse duration to 100µs, which is also seen in that it is not possible to adjust the last precision point in the float (by joystick). But then it shouldn't be a problem with 300µs pulses? So I guess it is something about rounding...
When I get the python script to print the values that I assign to the Phase1Duration or InterPhaseInterval (etc.), it does seem to be the right values.
So... I'm probably missing a simple mistake that I make? Or there might be a bug in how these values a registered / assigned on the Arduino?
Hope to hear from you how you would suggest I go forward / circumvent this problem :)
Br,
Christian Skoven
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.