Recommended way to implement spindle enable conditions?

More
10 Jul 2026 11:26 #347658 by TripleM
Hi everyone,I'd like to add some safety conditions for enabling the spindle on my lathe.The spindle should only be allowed to start if all required conditions are met, for example:
  • The auxiliary drives are enabled.
  • The chuck is clamped (clamping pressure is present).
  • (I may add more conditions later.)
My first idea was to simply combine these signals with one or more
and2
components and use the result as the spindle enable signal.Something along the lines of:
net spindle-enable-request ...
net aux-drives-on ...
net chuck-clamped ...

and2.0.in0 <= spindle-enable-request
and2.0.in1 <= aux-drives-on
...
Is this the usual way to implement this in LinuxCNC, or is there a better or more recommended approach?How have you implemented spindle interlocks on your machines?Thanks!

Please Log in or Create an account to join the conversation.

  • spumco
  • Away
  • Platinum Member
  • Platinum Member
More
10 Jul 2026 14:05 #347661 by spumco
If you have a long string of conditional pins/signals, the logic component is a little less messy in HAL than a bunch of nested/sequential and2 components.

linuxcnc.org/docs/stable/html/man/man9/logic.9.html

If you just want some interlocks to prohibit starting the spindle while chuck is open, or opening the chuck while spindle is turning, and2 or logic work fine.

However, I prefer using Classic Ladder for my spindle(s) and drawbar(s).  My lathe has two spindles, each with a pneumatic drawbar.  I control the drawbars with either physical buttons OR via M-codes.  M-code control is necessary for automated bar-feed operations.

I also want to be able to open the collet closer while the spindle is running, although at a low maximum speed.  Also need ability to orient spindle while the closer is open (hex/square stock).

Given the complexity of my particular config, I found ladder be be more intuitive and easier to configure (and test).

Please Log in or Create an account to join the conversation.

Time to create page: 0.107 seconds
Powered by Kunena Forum