Stop motion if spindle slows

More
13 Dec 2012 18:25 #27660 by denis1024
Hello,
I have broken another milling bit today, because the spindle of my gantry has slowed. I would like implement a security that will stop motion (or an emergency stop) if the speed of the spindle becomes too slow.

motion.spindle-at-speed doesn't work, because I want control the speed during all movements, not before the first
motion.enable "spindle-at-speed" doesn't work because at the first movement, the spindle has not reached the wanted speed.

The only think I've found is to make something like :
motion.enable = (spindle-at-speed OR SWITCH) with "switch" is a push button. I click on it during the start of the first movement in order to inhibit "spindle-at speed".

Not smart !
Does anybody has a better idea ?
Thanks
Denis

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

More
13 Dec 2012 19:44 #27661 by BigJohnT
Take smaller cuts... do you have an encoder spindle feedback?

John

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

More
13 Dec 2012 21:11 #27665 by denis1024
Yes, of course ! I mill with 1 mm bit in aluminium and I think since the cuts are small, the chips are as small as dust and sometimes stuff the cuts and slow the spindle (I've made my own spindle, the motor seems to be a bit too short !)

Yes I have encoder, PID and so on on the spindle.

I just want an automatic emergency stop in order to save my milling bits.

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

More
13 Dec 2012 21:18 #27666 by andypugh

I would like implement a security that will stop motion (or an emergency stop) if the speed of the spindle becomes too slow.


I assume that you have a spindle encoder (otherwise there is no way to tell that the spindle has slowed).

Are you running the spindle speed under closed-loop PID control? That by itself might help with the problem, if not.

What I would suggest is that you monitor the PID error term using the HAL "near" component (or possibly the "comp" comparator component). You could pass this direct to the motion.feed-hold HAL pin. (or e-stop in). I would suggest masking this error term for the first few seconds after spindle start using a HAL "oneshot" component to create a pulse of a few seconds triggered by motion.spindle.is-on. Then use an "and2" or "or" HAL component to combine the two signals (which is correct rather depends on which pins you decide to use, whether positive (TRUE = inhibit) or negative (False = disallow motion).
The pins you might want to use are listed here:
www.linuxcnc.org/docs/html/man/man9/motion.9.html
The comparators I mentioned:
www.linuxcnc.org/docs/html/man/man9/comp.9.html
www.linuxcnc.org/docs/html/man/man9/wcomp.9.html
www.linuxcnc.org/docs/html/man/man9/near.9.html
Onesehot (single masking pulse generation)
www.linuxcnc.org/docs/html/man/man9/oneshot.9.html
And the boolean logic:
www.linuxcnc.org/docs/html/man/man9/and2.9.html
www.linuxcnc.org/docs/html/man/man9/or2.9.html

These are all things that you can add to the HAL file and combine as you see fit (The HAL file, along with the INI file) defines your machine configuration, and can be found in the "configs" folder in the "linuxcnc" sub-folder of your home folder)

If you need help implementing this, then feel free to ask. One price of the flexibility of LinuxCNC is that it can get quite complicated. HAL is quite simple, but also rather unlike anything else.
The following user(s) said Thank You: denis1024

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

More
14 Dec 2012 00:04 - 14 Dec 2012 00:08 #27685 by cncbasher
you would be better trying to clear the swarf , than allowing it to settle with such a small milling cutter , try a cylinder vac wet/dry one etc
for aluminium using WD40 or similar for coolant helps a great deal , any thin oil or paraffin will do and you only need to spray on now and again , rather than flood

I sometimes just spray the whole work before hand , and it does the trick , i'm often milling with 0.5mm slot mills , and it's saved me from snapping
and of course have the spindle speed as high as you can get it ...

with 1mm I use a spindle speed of around 28,000 rpm , and slow feed rate , my shop vac clears 90% out the way quite easlily
I have also use one of the quick fit coolant nozzles and used a small compressor to gently blow the chips out , and then the shop vac pulls them in
Last edit: 14 Dec 2012 00:08 by cncbasher.

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

More
16 Dec 2012 23:11 #27786 by denis1024
Thanks, it works like a charm.
Here is the code that I have added to Custom.hal, for other guys which have a similar problem.


loadrt oneshot
loadrt and2 count=2
loadrt not

addf oneshot.0 servo-thread
addf and2.0 servo-thread
addf and2.1 servo-thread
addf not.0 servo-thread
addf near.0 servo-thread


net spindle_enable motion.spindle-on => pwmgen.0.enable => pid.0.enable => oneshot.0.in => and2.1.in0

setp oneshot.0.width 5
setp near.0.scale 1.200000

net pid_command => near.0.in1
net pid_feedback => near.0.in2
net spindle-at-speed <= not.0.in <= motion.spindle-at-speed <= near.0.out

net inv_spindle_at_speed not.0.out => and2.0.in0
net startup_delay oneshot.0.out-not => and2.0.in1
net spindle-at-speed_and_delay and2.0.out => and2.1.in1

net spindle-at-speed_and_delay_and_spindle-on motion.feed-hold <= and2.1.out

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

Time to create page: 0.222 seconds
Powered by Kunena Forum