I'm new to CP.

I’m new to CP. Can some one point me in the right direction for a spindle speed override widget so I can adjust spindle speeds for a quiet cut spindle on the fly while chilipeppr is crunching the gcode

I don’t believe such a widget exists yet. How would one control the spindle? Send a gcode to the machinecontroller which pwm’s a pin going to the spindle controller?

I’m using a tinyg I would assume there would be a way to inject after reading the current state of the s(rpm) then do a bit of math such as s(rpm)*.8 resulting in somewhere around 80% of your current speed and injecting it into the next line of gcode

Oh, I see. So if I understand correctly - if you run a gcode job right now that has the relevant lines, the spindle will vary its speed, you’d like to feed this to a widget for display and manipulation.


The way I can think of to do this would be to add a publish to the gcode widget so that if it sees a line of gcode matching this criteria it will fire off a signal that this spindle speed widget could pick up. For changing the speed, I think it would just need to send a new line of gcode with the speed you want, I suppose it would persist until any future speed changes in your gcode.

You should also check out how macros work in the gcode widget, they can already do some cool things like picking up on pauses or firing off other tasks when instructed to.

The spindle speed code is a modal code like g1 g0 it is persistent until its state is changed by another modal code

There is an SPJS command called sendnobuf that you could use to inject the spindle control command in the middle of a running job. You should look at the docs on https://github.com/chilipeppr/serial-port-json-server. You can more easily send a non-buffered command via pubsub as chilipeppr.send("/com-chilipeppr-widget-serialport/jsonSend", {“D”: "G0 X1 ", “Id”:“123”, “Buf”:“NoBuf”}); I have not done this in a while, but this should work fine. Watch out for how long you make this command though as you could overflow the buffer in TinyG as this will not pass through SPJS’s buffer then, rather go straight to TinyG.

Why would you want to make changes in mid flight? If it’s just to fine tune an original cut you could use a varible speed controller. Once you know the sweet spot you can then modify the gcode.