Open rflulling opened 4 months ago
"I see no reason they should be manually added to a board pins file." you don't need to do this.
Just because the pin define is not In the config files does not mean you cannot add it. It doesn't need to be there by default to enable it.... Just add the line to your Configuration file.
Because with exception to the PWM pin that was referenced (in notes), -the others are not.
If we took away the reference to the fan pins that need to be defined (and others), would users figure out what line they needed to add?
I would love it if way more CNC/Laser users could chime in too. But I fear we are too few, though this is a growing topic. Just gathering info was an uphill battle. Most CNC/DIY forums don't even know Marlin can run a CNC, and the very few out there that do, are Marlin Developers.
I will add, one function I found referenced in old conversations (#define SPEED_POWER_SLOPE) that seems to be relevant to my work. However when searching Marlin for any further references to the function, it was not found. So perhaps in 4 years, it was removed. Or my technique to search the code content of Marlin is flawed. -This remark being specific, not general.
The root core of the issue remaining.
Just checking in to see if there were any ideas, or suggestions.
Is your feature request related to a problem? Please describe.
I have an external Spindle Driver for standard brushed type DC motor I would like to use.
Are you looking for hardware support?
No. This is NOT a request support for a controller or LCD where in code will be installed. This is not a request for assistance with wires or any physical setup configuration issue. This request is for Marlin FW in general but specific to Spindle and Laser section. I humbly request those who previously worked on the code for the laser CNC sections to make these changes.
Describe the feature you want
To augment the existing code slightly to support connectivity of external circuits for use in Spindle Control. Long term changes applied may also benefit others who may want to use various stand alone external controllers for spindle or laser with Marlin.
Perhaps this might be accomplished simply by exposing duty cycle and leaving it at -1 for typical configuration and user configured for all applications where a specific range is needed.
I reason that why I am unable to use CUTTER_POWER_UNIT "RPM" is that the PWMDC which is not exposed.
Might I suggest SPEED_POWER_PWMDC to be nested within #if ENABLED(SPINDLE_LASER_USE_PWM), and then followed by "// -1 to disable, for default function, 1-100 to set duty cycle, higher numbers being more ON time"
The circuit I am driving requires a 50% duty cycle, 1000hz PWM represents 1%, and 3000hz PWM 100%. It is a very simple circuit to offload actual load from control board mosfets which are not all able to handle the load of a spindle board to board. This one supports up to 12A.
Coincidentally, switching over to a dedicated stand alone external spindle controller. I tinkered with it's own PWM duty cycle. I had previously remarked on Discord how Marlin was vastly more noisy than the GRBL controller I swapped out, and now I think I understand why. The default internal value for PWMDC must be currently less than 16000, a guess will say it's actually more like 14840. Anything under 1600 starts to make this low quality Spindle vibrate badly. The default for the stand alone is 20000, with a range of 1k to 99k. It is probable I will need to set a different duty cycle when testing under load. Perhaps this may also be a difference in spindle start up, where duty cycle may be on par with minimum default speed for spindle initialization. Gcode could be set to adjust duty cycles depending on load. -however this would be more valuable when a spindle is connected directly to a mosfet on the controller like say the heated bed. -where my tiny external is concerned, voltage output to the spindle is constant and the duty cycle only effects the onboard SSR.
Additionally exposing the lines to set the pins for Enable, Direction, and PWM should simplify set up for many others, I would like to hope. Plus depending on how this is all implemented open up a wider variety of common external drivers that might be used with spindle laser, ie @section CNC.
Additional context
Suggested layout of the laser spindle section, for reference only. To draw attention to points suggested to be added within conf adv.