Hello Guest it is September 21, 2019, 02:23:49 AM

Author Topic: Open/Close Spindle Collet....Best Way  (Read 7609 times)

0 Members and 1 Guest are viewing this topic.

Open/Close Spindle Collet....Best Way
« on: February 14, 2008, 06:49:56 PM »
Howdy folks,
I want to use an air operated collet closer on my 5C lathe spindle.
There will be either a puller on the tool plate or a solid stop on the plate with constant feed pressure on the stock.
Basically, the part would be machined and parted off, then the spindle stops and the puller moves to and grips the stock. (or the stop moves into pos.)
Now I need to open the collet, then pull the stock Z+, (or allow it to hit the stop), then close the collet, move the puller (or stop) clear and resume the program.
The closer is a double acting cyl. with a 4 way 2 solenoid valve. 2 outputs from Mach through relays I suppose.
Then 1 input from the stock limit switch. (prox.)

What is the simplest way to do this..Brain? Or can It be done in G code ?    VB is only slightly more familiar than Chinese to me, I would need MUCH help with a macro.
Also, will want it to run continuously until the stock gets to a limit switch.... or stop at the end of any given part cycle. Controlled on screen ? I CAN make a button work........sometimes.  :D
Thanks for all,
RC
Re: Open/Close Spindle Collet....Best Way
« Reply #1 on: February 14, 2008, 07:22:01 PM »
A quick and dirty G code solution would be to use the Y axis outputs on your BOB. Say, 0 volts is the collet closed position, when you want to open the collet, send G00 Yaa from Mach, where Yaa takes long enough to open the collet and feed to a stop. To close, send G00 Y -bb where bb takes long enough to close the collet. The DIR 5 volts from the BOB is used to drive the relay controlling your solenoid valve via a power transistor or SSR.
No need to stop the spindle if your puller is bearing mounted so it can rotate and your feed stop limit switch can be used to interup the Mach charge pump circuit. Not very sophisticated but should work.

Ian
Re: Open/Close Spindle Collet....Best Way
« Reply #2 on: February 14, 2008, 07:45:27 PM »
Thats pretty keen Ian. I can see that working.
I'll tinker with it this weekend.
That IS "Down and Dirty".
The pump going down would require referencing every time though... wouldn't it ? That would be a pain.
Thanks Ian,
RC

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Open/Close Spindle Collet....Best Way
« Reply #3 on: February 14, 2008, 10:10:17 PM »
Here is a "Puller Macro", it assumes that you have constant pressure to feed your stock forward.  You would put this macro right before the M30.
it also assumes that your stop plate has a push in trigger switch or some other way to tell the stock has made contact with the stop. You would set the Stop at a certain X, Z position (that would obviously be out of the tool path). You will need to open the Macro in the VB scripter and set the X, Z position for your stop. It will also use OUTPUT5 and 6 (hopefully outputs that you arnt currently using, if you are you will need to change these, make sure to enable them in ports and pins under outputs, and set what port pin you want them to activate, same for the Input. I will use INPUT4 for your Stop Switch). You may have to adjust the pause times as well they are in seconds.

here is the Macro, open up VB scripter and paste it in, do a save as M800 for instance.

Sub Main()

'M800.m1s Bar Stock Feeder

'OUTPUT5 is open collet, OUTPUT6 is close collet, INPUT4 Barstop signal

Dim StopPositionX, StopPositionZ

StopPositionX=4      'Stop location in X axis in machine coordinates
StopPositionZ=4      'Stop location in Z axis in machine coordinates

Code "M5"   'Stop Spindle
Code "G0 G53 X" & StopPositionX & " Z" & StopPositionZ
While IsMoving()
Wend

ActivateSignal(OUTPUT5)   'Open collet
Code "G4 p2"         '2 second pause give stock time to move forward
While IsMoving()      'Give more or less seconds depending feed forward time
Wend               'I didnt use a wait for or a while statement so not to tie you your processor.

If Not(IsActive(INPUT4)) Then
Message("------Stock did not move forward, check stock feed, abort feed op.")
Exit Sub
End If

ActivateSignal(OUTPUT6)   'Close collet
Code "G4 p1"         '1 second pause gives collet time to clamp
While IsMoving()      'Give more or less seconds depending on closure time.
Wend

End Sub

'Let me know how it works out
'Scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Open/Close Spindle Collet....Best Way
« Reply #4 on: February 14, 2008, 11:54:02 PM »
Scott,
That looks excellent. Thanks for the 'Commenting...VERY helpful.
I ran it on my home PC, no machine or stop switch and it seemed to be OK.
Anxious to set it up on the lathe this weekend.
1 question...
  I do not see where this will continue to repeat until the stock is gone. Will see Sunday.
I would also like to stop the machine at the end of a finished part at any time. Preferably with the collet open.
I DO see that the stop switch doubles as an "out of matl." shut down as well as a "Feed Jam" alarm. I LIKE IT...
I'll keep you posted.
Thanks MUCH Scott,
RC

I will try M47 in place of M30. I suppose it should run untill it's out of stock or jams up.
Thanks again
« Last Edit: February 15, 2008, 12:14:10 AM by Overloaded »
Re: Open/Close Spindle Collet....Best Way
« Reply #5 on: February 15, 2008, 12:38:36 AM »
The M47 did not work in place of M30. The code repeats regardless of whether the material fed or not.
If I do like the pic, will it only rerun the code if it fed to the switch ?
Otherwise M30 will rewind and stop ?
Thanks

Looks like out 5 and 6 are active at the same time...New plan below should take care of this. ?

I set a hotkey to IN4 to simulate a run and it did as expected with the M47 in the macro.

I'm changing valve to a 4way, 2 position, 1 sol., spring return.
Output 5 ACTIVE will OPEN the collet.
Will put a switch or toggle button on screen to manually operate the closer.
Will also like to prohibit spindle if collet is OPEN.
Thanks,
RC
« Last Edit: February 15, 2008, 08:08:27 AM by Overloaded »
Re: Open/Close Spindle Collet....Best Way
« Reply #6 on: February 15, 2008, 08:27:24 AM »
This seems to WORK !
Can't wait to try in on the machine.
I'll quit buggin' ya now.....gotta go to work....DAMN !
RC

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Open/Close Spindle Collet....Best Way
« Reply #7 on: February 15, 2008, 10:10:22 PM »
RC,

    The reason you cant get M47 to work in M800, is you cant run a macro from within a macro it is a no-go in Mach.

Also:  I got the Redface real bad......  Sorry I forgot to put the DeActivate outputs in, I just kinda rushed through the macro and didnt really test it out to much.......sorry I forgot them

NOTE: You CAN put the M47 in place of the M30 in your G code file and it should do what you want.

Scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Open/Close Spindle Collet....Best Way
« Reply #8 on: February 15, 2008, 10:34:31 PM »
your other questions:

1).

In screen designer put this in a button"

Open collet  (goes on the button label)

code "M5"     'Stop spindle (safety feature)
code "G4 P3"  'Gives time for spindle to spin down to 0
While IsMoving()
WEnd

DeActivateSignal(OUTPUT5) 'Opens collet

2).

Put this in your Macropump

'Macropump.m1s

If IsOutputActive(OUTPUT5) Then  'If your collet is open
code "M5"         'Force Spindle speed to "0", or you can make a disable spindle output here
Message("-----Cannot start Spindle until Collet is closed!!!!!")
End If

'scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Open/Close Spindle Collet....Best Way
« Reply #9 on: February 15, 2008, 10:47:04 PM »
Good stuff Scott... THANKS !
May not get to it till next week.
In reply #6...The M47 IN the M800 worked perfectly. I simulated the input 4 with a hotkey.
With the program running, if in4 is on, it keeps repeating. In4 off and it stops and gives the message.
But...it should not work ? ? ?  Strange.

Thanks, RC