Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Manley86 on September 27, 2010, 11:57:02 AM

Title: Automoatic tool changer macros & sensing
Post by: Manley86 on September 27, 2010, 11:57:02 AM
Hey all,  I have recently been playing with my new toy - a denford orac which i have fitted with a C11G and index pulse board from CNC4PC driving  two gecko 201's and it works great :D

My new set-up in a PC case:

(http://lh4.ggpht.com/_W5CsAza9wc0/TKC8Icv647I/AAAAAAAABTU/eCyjUtraxac/s640/14092010767.jpg)
(http://lh5.ggpht.com/_W5CsAza9wc0/TKC8IlfWLjI/AAAAAAAABTY/WJGL7O-zTjU/s512/14092010768.jpg)

It also came with an automatic tool changer and three burnt out dc motors to operate it.  They rattle, whine and burn out as they are used to keep the ratchet against its pawl in 12v reverse mode.  Well, I have fitted a small stepping motor to it with the idea that using the grey code that the 3 sensors produce with its reflective disk, it could tell where it is, rotate a set number of steps for the tool change (it operated a work at 40:1) and reverse a small amount onto the pawl, skipping a step or two and then hold. I was going to use a small cheap driver such as this http://proto-pic.co.uk/products/EasyDriver-Stepper-Motor-Driver.html (http://proto-pic.co.uk/products/EasyDriver-Stepper-Motor-Driver.html).  Is this an ok idea? and can someone please give me an idea of how to write a macro for it.  I can build a system, do gcode etc but macro's scare me.  I have no idea if the greycode produced by the sensors can be used???

(http://lh6.ggpht.com/_W5CsAza9wc0/TKC6x_G6KfI/AAAAAAAABTM/w1Y5CfLyt7Y/s640/27092010776.jpg)
(http://lh5.ggpht.com/_W5CsAza9wc0/TKC6yBB4WaI/AAAAAAAABTQ/1SjtYJO3sa0/s640/27092010777.jpg)

denford sensor drawings:

http://www.denfordata.com/bb/download/file.php?id=598 (http://www.denfordata.com/bb/download/file.php?id=598)
http://www.denfordata.com/bb/download/file.php?id=597 (http://www.denfordata.com/bb/download/file.php?id=597)

Any help would be amazing :)

Rob.

Title: Re: Automoatic tool changer macros & sensing
Post by: Hood on September 27, 2010, 12:19:52 PM
I have it in my mind I helped someone with something similar but cant remember if it was on the forum or offline.
Will see if I can remember later on when I get home from the workshop.
Hood
Title: Re: Automoatic tool changer macros & sensing
Post by: Manley86 on September 27, 2010, 12:24:11 PM
Hood, I salute you sir.  I really want to get all the machining/mechanical stuff done before I go back to uni next week as the wiring/computer stuff can be done in my room. 

Rob.
Title: Re: Automoatic tool changer macros & sensing
Post by: Hood on September 27, 2010, 02:50:27 PM
Have a look through this thread and see if it helps.
http://www.machsupport.com/forum/index.php/topic,14745.0.html

Hood
Title: Re: Automoatic tool changer macros & sensing
Post by: Manley86 on September 27, 2010, 07:36:06 PM
Hmm, that was a good read and gives me my starting point.  I will have to learn how to write a macro me thinks!  Thanks allot hood, always very helpful.

Im hoping to use the signals generated by the three sensors to give it its position, for example have a table stating that if 1,1,0 is active then for tool number * it must rotate so many steps then reverse 10.  It may be a long macro but it should work well as long as i can get it to read the input signals. 

Can anyone recommend me a cheap, preferably UK based break out board that would be suitable just for this purpose and maybe a few relays for other things as I have a second parallel port. 

 Rob. 
Title: Re: Automoatic tool changer macros & sensing
Post by: Hood on September 28, 2010, 02:10:58 AM
Reading the sensors will not be a problem as long as you have the inputs available. I am not great at VB but can try and give you a hand when you are ready.
Hood

Title: Re: Automoatic tool changer macros & sensing
Post by: cjmerlin on September 29, 2010, 12:59:47 PM

Interesting thread, I have one of these in it's original form and I like what you did with the stepper there, do you have any details of the coupling.


I've attached my macro for you to look at, It uses the original sensors so there are bits of code that may interest you.
Title: Re: Automoatic tool changer macros & sensing
Post by: Manley86 on September 29, 2010, 02:40:07 PM
Thanks for that macro, although I must download something to view them properly as I'm using notepad and its all in a single string - not easy to read at all (as you can tell, haven't even thought about macro's until 4 days ago). 

I'm all electrically hooked up now except for my stepper driver which was deemed 'out of stock' this afternoon :(
This is what my new cable looks like inside : (i have used 20 core video cable and tripled the wires for the stepper - its nice and flexible and screened too)
(http://lh3.ggpht.com/_W5CsAza9wc0/TKOEsBtLV0I/AAAAAAAABTs/J0JlqQfphlY/s640/29092010779.jpg)

An aluminium adapter plate was made a tad less than 1/4" thick.  The spindle of the stepping motor is 6mm and locates in the hole of the worm wheel shaft which seems to be smaller than 1/4" by a tad (drill blank wouldn't go in).  A 3/32 hole was made through the motor spindle 1/8" from the end and a cross pin pressed in.  This locates in the slot in the end of the worm wheel shaft.  This pin has to be fairly accurately drilled. 
(http://lh4.ggpht.com/_W5CsAza9wc0/TKOFp5dl7NI/AAAAAAAABUA/UVESXlCFPKI/s640/29092010780.jpg)

This board operates on 12v, so three 12to5v DC-DC converters were used to step down the output signal voltage to a high of 5.1v and a low of 0.8v when measured with a multimeter.  These outputs were then connected to pins 11, 12 & 13 on the C11G and mach reads them without a problem. 
(http://lh6.ggpht.com/_W5CsAza9wc0/TKOFqGdi3kI/AAAAAAAABUE/NjCgL8wNEVA/s640/29092010781.jpg)

All i need to do know is get my head around Macros and make an efficient program.  Tis all good fun :D 
Title: Re: Automoatic tool changer macros & sensing
Post by: Hood on September 29, 2010, 02:43:23 PM
Thanks for that macro, although I must download something to view them properly as I'm using notepad and its all in a single string - not easy to read at all (as you can tell, haven't even thought about macro's until 4 days ago). 


Open Mach, go to Operator Menu and Choose VB Script Editor. You can then browse to the location you downloaded the macro to and open it and it will display properly.
Hood
Title: Re: Automoatic tool changer macros & sensing
Post by: Manley86 on September 29, 2010, 07:17:13 PM
It's easy once you know  :D

Right, nows the time to learn some visual basic.  I will take the two examples provided and have a play although I cannot really do much until my ATC driver appears which is annoying.  I will have a look at some of the visual basic tutorials tomorrow too.  It can't be that difficult, can it? 

Rob.
Title: Re: Automoatic tool changer macros & sensing
Post by: cjmerlin on September 30, 2010, 06:19:43 AM
VB isn't difficult and i'm sure if you get stuck there's plenty of us that can help. My Boxford lathe uses a stepper on it's toolchanger. When reversing onto the rachet enough pulses are sent to the stepper for about one and a quarter tool positions. The boxford changer is so much quicker than the Orac.

It so happens i've a spare stepper driver built in the Orac and will have to get around to following your lead.

Thanks for sharing.

John
Title: Re: Automoatic tool changer macros & sensing
Post by: Hood on September 30, 2010, 06:28:15 AM
VB isn't difficult


Thats true, even I can manage basic things so it must be simple :)
Just so happens I just finished fitting a second turret to my lathe the last day, the hardest part was making it actually fit my lathe.
http://www.youtube.com/watch?v=geD2jbW9hUY
Hood