Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: fast89 on October 11, 2013, 07:06:32 PM

Title: tool change macro, how to make it wait for spindle to stop
Post by: fast89 on October 11, 2013, 07:06:32 PM
I made an auto tool changer. It works good but i have dwell in there for the spindle to come to a stop from 6k rpm. Usually it is already stopped before the dwell. How do i make it look at the rpm and proceed with the tool change if the rpm is zero?
Title: Re: tool change macro, how to make it wait for spindle to stop
Post by: Hood on October 12, 2013, 03:45:07 AM
Does your spindle drive have a zero speed signal?
That would be the best way.
If not then it may be a problem depending on whether you use the Parallel Port or an external controller. The parallel port may take a while before the spindle reading sets to zero or at least I think it did but it has been many years since I used the parallel port.
Hood
Title: Re: tool change macro, how to make it wait for spindle to stop
Post by: fast89 on October 12, 2013, 07:47:20 AM
The spindle controller doesn't receive any feedback. I am using the parallel ports. The spindle decels in about 2 seconds. Usually it is stopped before the z ever gets home. I would just like to trim some time off of the tool changes. Isn't there a way to get the DRO then do an if/then comparison
Title: Re: tool change macro, how to make it wait for spindle to stop
Post by: BR549 on October 12, 2013, 10:50:30 AM
In your tool changer macro you would do a check of the Spindle speed

D0 while GetOemDro(39) > 0
Loop

the code will stay in the LOOP until the value of the DRO gets equal  to zero.

Now mind you it can possible stay locked in the loop IF the DRO does not clear to zero.

Just a thought(;-) TP
Title: Re: tool change macro, how to make it wait for spindle to stop
Post by: fast89 on October 12, 2013, 12:45:58 PM
Worked like a charm! Thanks! ;D
Title: Re: tool change macro, how to make it wait for spindle to stop
Post by: BR549 on October 12, 2013, 06:11:33 PM
Asa safety I would allow a break out over time to make sure it does not LOCK into the loop and never let you out(reboot required). The following would let you out of the loop IF the Speed =0   OR if it timed out by 10 seconds.

SetOemDro(2050,0)
D0 while GetOemDro(39) > 0 OR GetOemDro(2050)  < 9
SetOemDro(2050, GetOemDro(2050 +1)
Sleep(1000)
Loop


Just a thought, (;-) TP