Fusion Manufacture
Talk shop with the Fusion (formerly Fusion 360) Manufacture Community. Share tool strategies, tips, get advice and solve problems together with the best minds in the industry.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Turning Spindle on/off During Travel Moves

Message 1 of 3
164 Views, 2 Replies

Turning Spindle on/off During Travel Moves

Hello, does anyone know if there is an existing post processor, or how to modify a post processor so that spindle on/off commands are sent for cutting and travel moves?  I'm using a shapeoko and am trying to connect a switch to the pwm on the control board, it won't actually be controlling the spindle.  I want the switch to be on during cuts, and off during all other travel moves.  Any help is greatly appreciated,

Labels (3)
Message 2 of 3

You could edit the post processor to insert spindle on/off commands (or any other M codes) for rapid moves... as long as you're not actually controlling the spindle with those commands it should be fine, otherwise you'd  be worried about the spindle having time to spin up before re-engaging. You may also have toolpaths with a lot of small rapids where it would toggle on and off rapidly.


What is the actual application? ie: what are you switching on and off? Does the Shapeoko board map spindle speed to a PWM output value, and are you trying to use this? Or just binary on/off?


The onRapid() function for the carbide3d post is below:

function onRapid(_x, _y, _z) {
  var x = xOutput.format(_x);
  var y = yOutput.format(_y);
  var z = zOutput.format(_z);
  if (x || y || z) {
    if (pendingRadiusCompensation >= 0) {
      error(localize("Radius compensation mode cannot be changed at rapid traversal."));
    writeBlock(gMotionModal.format(0), x, y, z);


You could modify it by inserting your "on" command at the start and the "off" command at the end. This would mean if you had consecutive rapid moves it would toggle on/off quickly while still traveling... to get around that you'd need to set a up variable to track the state of the command, which is a bit more advanced programming task.


Message 3 of 3

Thanks Matty, my goal is to turn an airbrush on/off, so I'm not actually cutting anything at all.  The PWM can send spindle speed inputs so I was planning on using max value (10k rpm for the carbide board) for on, and off would either be spindle off command or set spindle to 0 rpm.  Picking the operations to target for inserting these commands is the tricky part because of the rapid on/off toggling you mentioned.  Aside from changing the code itself, I need to pick a lead-in I can target, maybe a helical move, before each cut to turn it on, and maybe the first lead-out move to turn it off.  If you have any thoughts on what operations in the CAM would produce unique commands in the gcode so that I can shoehorn in some commands then I think that would get me most of the way there. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report