pigpio
pigpio copied to clipboard
Continuous Wave Program Concept
I have been finding this library quite useful, but have have discovered some issues driving stepper motors similar to #126, #382, and #146
Each of these issues seems to demand maintaining a continuous set of pulses, however the issue being its challenging to orchestrate wave deletion / waiting leads to issues with memory available.
Since this is a pretty common use case for things like CNC or other hardware where the PWM concepts dont work due to resolution / rate issues, and waves has issues pausing between wave TX.
I had an idea that a "Wave Program" could be implemented that would control a single pin with a defined on/off time, and where an internal counter could handle long pauses over a second or over the buffer size. This I think would be relatively simple to implement and would put another tool in the toolbox for pigpio. This program's rates / on-off times could be updated, paused or stopped. Applying another signal to the pin would override the functionality the same as other concepts in this library.
Waves is a really cool feature but involves some difficult concepts such as interleaving the pin programs. I believe the delete part is an issue as you've mentioned @joan2937. I think there should be a simple solution to this important problem where any failure of the waves program can lead to saftey risks (mechatronic issues like crashing for example).
Curious to hear your thoughts, or any additional ideas related to this topic.