- Posts: 29
- Thank you received: 0
Recommended way to implement spindle enable conditions?
3 months 2 weeks ago #347658
by TripleM
Recommended way to implement spindle enable conditions? was created 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:
components and use the result as the spindle enable signal.Something along the lines of:
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!
- The auxiliary drives are enabled.
- The chuck is clamped (clamping pressure is present).
- (I may add more conditions later.)
Code:
and2
Code:
net spindle-enable-request ...
net aux-drives-on ...
net chuck-clamped ...
and2.0.in0 <= spindle-enable-request
and2.0.in1 <= aux-drives-on
...
Please Log in to join the conversation.
3 months 2 weeks ago #347661
by spumco
Replied by spumco on topic Recommended way to implement spindle enable conditions?
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).
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 to join the conversation.
3 months 2 weeks ago #347684
by cmorley
Replied by cmorley on topic Recommended way to implement spindle enable conditions?
There is also:
spindle.N.inhibit - (bit, in) When this bit is TRUE, the spindle speed is set to 0.
spindle.N.inhibit - (bit, in) When this bit is TRUE, the spindle speed is set to 0.
Please Log in to join the conversation.
3 months 2 weeks ago #347739
by Sascha H.
Replied by Sascha H. on topic Recommended way to implement spindle enable conditions?
I used lut5 to check for various conditions.
Here is my HAL on Github: github.com/shallerbach/endchen_rack_atc/...3f0/endchen.hal#L124
Here is my HAL on Github: github.com/shallerbach/endchen_rack_atc/...3f0/endchen.hal#L124
Please Log in to join the conversation.
3 months 2 weeks ago #347743
by tuxcnc
Replied by tuxcnc on topic Recommended way to implement spindle enable conditions?
Lut5 is the best solution, especially when condition is type of "if a=true and b=false".
BTW. Beware situations when your spindle turns off when axis moved. It is more dengerous than continue when something fails.
BTW. Beware situations when your spindle turns off when axis moved. It is more dengerous than continue when something fails.
Please Log in to join the conversation.
3 months 2 weeks ago #347780
by TripleM
Replied by TripleM on topic Recommended way to implement spindle enable conditions?
Thanks for all the suggestions and ideas!
I will give it a try and see how it works out on my machine.
I will give it a try and see how it works out on my machine.
Please Log in to join the conversation.
Time to create page: 0.104 seconds
