Define Custom Macros For M3/M4/M5 In The M950 Mcode
-
I would like to request that an option be added to the M950 command that would allow custom macros to be executed for the M3/M4/M5 commands when that specific tool is used instead of setting a PWM value on a GPIO pin. This would allow for complex actions to be taken when a Spindle's RPM (or Lasers power) is changed.
For instance I have a Dewalt Brushless Trim Router where the stock ESC has been replaced by an ODrive. While the ODrive is configured to use an ADC to read the voltage from an RC Circuit. It would be far better if I could use execonmcode to run a script that directly tells the ODrive what speed to set the router to. This would be safer and more precise. If I could execute a Macro on M3/M4/M5 commands this would all be possible. It would allow for some error handling as well.
Another use case for this would be someone who's Spindle does not have an ADC and requires it's dial to be manually adjusted. A servo could be attached to the dial and be controlled by the M3/M4/M5 macros.
What I purpose is adding a Z argument to the M950 command. It would take three macro names as arguments like so:
M950 R0 Z"tool0M3.g+tool0M4.g+tool0M5.g"