Im in the process of assembling some optocouplers and a PWM to analog voltage

Im in the process of assembling some optocouplers and a PWM to analog voltage board for spindle control, and I realized that chilipeppr doesn’t have a spindle control widget in the current workspaces. Are we aware of any existing initiatives before I start on one?

Im thinking its something that ill need to add to the existing TinyG widget, right?

We have needed a spindle control widget for a long time. Nobody has worked on one. For me, I still do manual spindle on/off but would love to move to automated, so I know I’d love to see a new widget.

I would create it as a standalone widget. Those 3 videos on the chilipeppr homepage describe how to make a new widget and bring it into the workspace by using the template widget. I’d start there.

The crux of that widget would just send Gcode using chilipeppr.publish(). Look at the sample macros for how to send Gcode from Javascript.

I can publish the widget if you do a pull request via Github. Maybe just squeeze in the widget the same way all those add-on widgets work. Eventually I think we need to make a pulldown menu for all those widget buttons in upper left because that workspace area is starting to get big.

But why we need an extra widget? Tinyg support the pwm output via “M3 S6000” or “M5” to switch off. You can set config via “$p1”. Just my 2 cents :slight_smile:

You are right +Frank Herrmann​. If one is using the Eagle Board widget, the spindle speed is available in the Gcode tab, default to 12000 rpm.

I don’t think this widget does much other than let you turn on/off your spindle. Use a slider for speed. Possibly a tab to configure your PWM settings on TinyG. Also, possibly a pulldown menu of typical configurations for different spindles/machines.

Hmm, yes also we thought about a widget to set automatic Feed and RPM for different materials. This means you have gcode for wood, but you want mill aluminium … then we can change a pulldown to “Alu” and the widget will change the feed/rpm.

I didn’t know the new G2 core allowed reverse. That’s hot. So this widget could help educate folks to what the Gcode commands are to control the spindle and help folks even like me know that there’s a reverse command.

TinyG has SDir too

Can it just be tacked onto the axis widget to save room it’s only going to be 2 buttons and a slider I’d imagine.

Isn’t it M4 to rotate spindle anticlockwise?

It feels dirty to put any spindle stuff in the Axes widget.

I kinda agree, not everyone needs spindle control… I think it needs its own widget. We will need to add spindle stuff in to the TinyG widget though, for configuring PWM

Any widget can do anything any other widget does. That’s why ChiliPeppr’s structure is all about the chilipeppr.publish() and chilipeppr.subscribe() model. The TinyG widget just publishes Gcode just like any other widget. Any widget can listen to incoming responses as well. So, the PWM config should be done as it’s own widget, just like the Configuration dialog box was done (the one you get to via cog wheel in top right bar of tinyg widget). Then, any button can call up the PWM config dialog box, or that PWM config could just we placed in a tab in the Spindle widget.

@jlauer I was thinking more along the lines that the TinyG pwm config is specific to the TinyG hardware, and other solutions may do it differently. We should make the spindle widget itself use standard gcode so everything that implements it, can use it.

Well, in the TinyG workspace someof the widgets are tinyg specific including touch plate, super touch plate, and auto-level. So, I too like making stuff generic, but we’ve also thrown in the towel a few times on that out of sheer necessity.

@jlauer haha fair enough

I hope your optocoupler has proper speed and accuracy. I am not knowledgeable about them.

@NathanielStenzel we shall see :wink:

If you have circuit diagrams, I am sure a number of people in the community could easily tell you and give advice. Just in case you have not considered it.