Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: AVRnj on January 29, 2014, 05:31:31 PM

Title: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 29, 2014, 05:31:31 PM
Hey everyone,

I just converted my lathe for CNC.

I have been playing around with the lathe turning wizards and the first few I tried worked fine.

I than tried the Lathe threading wizard.

I entered in some standard values, and posted the code. Just like any other wizard, the paths appeared in the window.

When I went to run it, my z axis went positive for a while, than returned to it's prior position, and just sat there and did nothing, it looked like it stopped at the G76 line in the code.

The only thing I can think of is my actual spindle speed is not connected to Mach3, and perhaps Mach3 is waiting for my spindle to get up to the speed I set in the wizard?

I at a loss and tried many different values and kept getting the same result.

Any help would be greatly appreciated.

Thanks.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 29, 2014, 05:35:37 PM
You need the Index pulse hooked up as Mach has no way of knowing the spindle speed and also no way to know where the index is so it can sync the threading.
You could uncheck the options on General Config (use spindle feedback in sync mode) for simulating if you wanted but it would not give you an accurate thread, so best not try and cut anything.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 29, 2014, 05:53:01 PM
Ok, that makes sense.

I guess I need to get an encoder or tachometer and hook it up toy lathe and mach3?

Are there any resources that explain how to do this in a painless way?

Thank you!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 29, 2014, 05:57:25 PM
If you are using the parallel port then the index pulse from an encoder will be too short to use.
Most people use a slotted disc with an optical sensor.
Optek OPB917B is one I have used in the past, all that is required in addition to the disc and the sensor is a current limiting diode so you dont fry the LED, I used 220ohm when hooking to 5v.
If you do a serch for OPB916B or OPB917B on this site you should find posts that I have made telling how to connect.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 29, 2014, 07:22:08 PM
Ok, thank you very much for your help.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 08:16:26 AM
Hood, I have been looking into this a bit more and wanted to see if I could ask you a quick question.

When you say that the index pulse from an encoder would be too short, would that also include the output of a Hall effect sensor?

I have a few extra Hall effect switch sensors laying around, and some magnets, and I was thinking of putting a neodymium magnet on the back of my chuck and mounting the hall sensor to read the magnet every time it turns. I would think that would allow for 1 pulse per rotation and was wondering if that would work in your opinion?

Just trying to use what I have rather than buying more stuff.

Thanks!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 30, 2014, 08:31:11 AM
Yes a hall could well work, will all depend on the hall I suppose but people do use them.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 08:34:09 AM
OK, thanks, I will give it a shot.

Can I ask one more question, from reading other posts about this topic, I assume all I should really have to do is connect the output of my hall to an input on my G540, enable the index and pick the pin I connected it to? Is it that simple or am I missing something?

Thanks for your help.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 30, 2014, 08:57:19 AM
If your spindle speed  is controlled via Mach you also need to make sure the Max RPM in Spindle Pulleys (from Config menu) matches the Velocity you have in Motor tuning. Also make sure the ratio is set to 1 in spindle pulleys.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 09:26:52 AM
Hood, thanks.

My lathe has belt controlled speed for now, so I am not controlling the speed through Mach.

I hope to try this out tomorrow, thanks much for your help!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 30, 2014, 09:55:08 AM
No problem, be sure to post your results, especially your threading :)
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 09:57:00 AM
I most definitely will!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: RICH on January 30, 2014, 10:39:24 AM
Quote
I have a few extra Hall effect switch sensors laying around, and some magnets,

I use a Hall effect sensor and below is a link to how it's mounted. Works great,but, if one needs to purchase new it's cost
may be pricey.

http://www.machsupport.com/forum/index.php/topic,12484.msg82818.html#msg82818

You should check the spec info for the sensors you have. The sensor must be able to proivde / sense index at spindle speeds you will be using.
Can't remember details but a few sensors I have were not adequate.

RICH
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 11:53:43 AM
Rich,

Thanks for the link.

Your solution looks great.

My hall effect sensor is a cheap $3 sensor that I was planning on using on a little DC motor to make my own encoder way back when that I never got around to.

I am quite certain my sensor will be able to read the magnet at any speeds I need to for threading, my concern is more whether the output signal will be acceptable for my G540/Mach3 combo.

Title: Re: Lathe Threading Wizard Rev 1.17
Post by: RICH on January 30, 2014, 01:26:23 PM
I would need to look at the G540 info but you could always just go to designated pin for the index.
RICH
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 01:35:44 PM
Rich,

I'm not sure what that means, do you mean that there is a designated spindle index pin on some parallel breakout boards?
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 04:18:11 PM
Guys, one more question I just thought of.

My hall sensor is actually an analog output, I am wondering if this will be a problem for Mach3? I suspect that Mach3 is looking for a digital 1 or 0 type input?

If so, I suppose I could take an arduino and write some code to convert my analog output to a digital signal, but i'd rather not if I don't have to.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 30, 2014, 04:57:16 PM
Yes, digital would be needed. Unless you really like messing with the aduino you would be better spending $10 and getting an opto.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 30, 2014, 05:10:38 PM
Yeah, makes sense.

Darn, was really hoping to see some threads this weekend!

Thanks again.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 31, 2014, 08:02:04 AM
I really want to cut some threads this weekend. I was going through my electronics stash and found some goodies.

I have a LED infared emitter and a phototransistor.

I made up a small circuit with a few resistors and hooked it up to an extra arduino I have not in use right now.

I wrote code that reads the analog signal from the phototransistor, and if it's above a threshold variable I set, it sees white, and I set a digital pin high, if it sees black, it goes below a lower threshold and I set the digital pin low.

I tried it on a little DC motor I have lying around and it's working well.

Going to try to hook up that digital pin from my arduino to my G540 and mach3 and see if this works later today. If it works, I will make a black disk with one white stripe on it and put it somewhere on my spindle and mount my phototransistor/emitter setup to read it.

Hopefully this works, I will post back when I get a chance to play around with it.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: JohnHaine on January 31, 2014, 08:54:31 AM
See this pageb for how to add a Hall effect sensor - an Arduino is rather a complicated way of doing it!

http://www.jeffree.co.uk/pages/ml7-cnc/part-3-files/myfordcncpt3.htm

HE switches that give a digital ouput are easily available, and even if you don't have one you only need a simple op-amp and a couple of resistors to square up an analogue output.  The A1101 that Tony Jeffree uses are a pound or two, save you even that trouble.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 31, 2014, 10:21:47 AM
Oh I fully realize that this is a very complicated and highly unnecessary way of doing this!

This is me being highly impatient and wanting to cut threads ASAP, not even for any specific project, more to test out my recent conversion.

I will be ordering a hall effect switch to do this, I think that will make a very simple solution.

Thanks for the link, I appreciate it. I am very interested in squaring an analogue output, as that would even allow me to use my current analog hall effect sensor most likely.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 31, 2014, 03:14:00 PM
So I set up my connection to my G540 and modified Mach3 and I got no reading at all on my spindle reading.

I had a digital out from my Arduino going directly into a Pin 1 which is the DB25 pin 10, and everything else is the same, basically my motors are connected, and working and nothing else.

I am wondering if there is anything I am missing.

I confirmed that I had a high low output from my digital output pin on my arduino.

All I really did was went into Mach, ports and pins, went to index.

I set it to Port 1 and Pin 10 and applied and rebooted my machine.

No results, meaning the spindle never changed from 0.

So I played with the other settings, emulated and active low, tried all combos and still nothing.

Any ideas? I know this is not the right way to do this, but what I am doing should simulate a digital optical or hall sensor, so I assume I need to work this out to get the right solution to work as well.



Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 31, 2014, 03:26:56 PM
Did you tell Mach your spindle was started by either commanding a M3 or pressing the spindle button?
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 31, 2014, 03:28:37 PM
No, I did not.

So I should just click the spindle button on the Mach3 command icon bar on the bottom of turn?
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 31, 2014, 03:34:42 PM
Yes or MDI a M3.
You may also have to set the spindle relay up if you are using the parallel port, just set it to any unused output number and then enable the output.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 31, 2014, 03:48:03 PM
Hood, Thanks.

I tried pressing the spindle button, still no reading.

I will un-Disable the relay and see if that works.

Thanks for your help, this is not easy.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on January 31, 2014, 04:37:29 PM
Yes I seem to recall that is needed when using the parallel port, its been a long time since I have used it however so maybe it has changed but dont think so.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: JohnHaine on January 31, 2014, 05:53:00 PM
I didn't have to do anything with the relay or M3 but just click the spindle button.  Have you checked the  pulse polarity?
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on January 31, 2014, 06:02:55 PM
John, do you mean have I checked with a multimeter whether or not I am getting a positive voltage?
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 03:36:50 AM
What I would do as a test is go to ports and pins and then set the Index to emulate and the choose a key for the emulation, maybe F8 or something. Next turn on the spindle in Mach and start tapping the key and see if the RPM starts reading in Mach. If it doesnt then there are problems in the setup, if it does then there must be a problem with your real index.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 01, 2014, 07:38:17 AM
Hood, I tried and it did not work. So I definitely have a problem with my settings somewhere, I just cannot figure out where.

Just to be clear, I am looking for Spindle True to be reading something, and it does not budge from 0 after I hit the spindle button, when I first click it, it bumps to around 1000, comes to 0, and stays.

Would you or anyone be able to identify the problem? Here are some pics of my settings.

I also tried to un-disable the relay and that did not make a difference.

https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2057%2038%20AM.jpg (https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2057%2038%20AM.jpg)

https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2057%2056%20AM.jpg (https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2057%2056%20AM.jpg)

https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2058%2011%20AM.jpg (https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2058%2011%20AM.jpg)

https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2058%2030%20AM.jpg (https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2058%2030%20AM.jpg)

https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2059%2056%20AM.jpg (https://dl.dropboxusercontent.com/u/42248323/Mach3/Photo%20Feb%2001%2C%206%2059%2056%20AM.jpg)

I really appreciate the help, this is frustrating.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 09:26:15 AM
Can you attach your xml please and I will see if I can find an issue with it.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 09:30:37 AM
Just looked at your pics, you do not have any port and pin set up for the Index.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 01, 2014, 09:34:33 AM
I did originally, but took that off when i was trying to emulate, tried to emulate both ways and did not work.

here is my xml

thanks much for your help!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 11:13:21 AM
I will have to go and build up a computer to test this from as the only ones I have here at home have 64bit OS now :(
If I cant find enough bits I will test out when I get to the workshop but that will likely be Monday.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 11:30:13 AM
Ok I decided to try on a virtual machine and it is working fine.
I had to enable the spindle relays and I set the emulation to F8, although I dont think it would really matter which key you choose.
I turned the spindle on with the button on the manual page, the DRO started counting down then I started tapping the F8 key and it worked.

I have attached an xml, if you place it in your Mach3 folder then use the Mach Loader to open it then see if it works for you.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 01, 2014, 12:20:00 PM
Hood,

Thanks very much for doing this for me, really appreciate your help.

I am not sure if I am really dumb or what, but this is not working for me.

I loaded the xml file, checked the config settings, did not change anything.

I clicked on the manual button.

clicked on the e stop to stop it from blinking

clicked on the spindle button, the DRO counted down, the bar below turned yellow, I tapped F8 and nothing at all.

Tried changing from F8 to another key and still nothing.

Really at a loss
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 12:25:29 PM
Ok few things, first go to the View menu then Load Screens and choose the mills 1024.lset. Once loaded go to the Diagnostics page and see what Time in Int and Frequency say.
Also when tapping the key do you see the index flashing?
What Rev of Mach are you using?
You can change back to the lathe screen by the same procedure but make sure you choose lathe screen from the drop down menu or you will not see it.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 01, 2014, 12:30:17 PM
OK, I am using Version R3.043.066

Time in int says: 0, I don't see a frequency.

Yes, I do see the index light flashing.

I am wondering if it's the time in int?
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 01:08:56 PM
Ok that is your problem, the driver is not loaded.
Go to the Mach3 folder and double click the drivertest.exe and let it run. It will say pulsing too fast or something but once done your driver should be installed.
You can then re-open Mach again and hopefully it will be fine. I am of course assuming you are using the parallel port and not an external controller.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 01, 2014, 01:19:55 PM
That worked!!!

Thank you so much! I now have spindle DRO through emulating the index!!!

Next up I can try to get my rigged up optical reader working and hopefully I can eventually thread.

I really appreciate all of your support, there is no way in the world I would have figured that out. I have been reading this stuff and searching and nowhere did I find this stuff.

Much thanks, I will report back when I get some time to try the actual optical reader.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 01, 2014, 01:21:59 PM
Ok but disable the emulation when trying the real index, sometimes emulation can stop things working. Cant remember if the Index is one of the things but best to disable anyway.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 01, 2014, 01:27:10 PM
Will do, thanks!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 01, 2014, 06:12:55 PM
Well, no luck and I ran out of time.

I had my arduino switching 5.5 volts to zero with every revolution measured by multimeter, tried to set it up on my G540 and did not work.

I touched my multimeter on the 10 Pin and the ground and was no longer getting low pulses, only a continuous high pulse.

Something happened with my rigged connections .

Ran out of time today,
Hopefully will get some time tomorrow.

In the meantime I have some digital Hall effect switches on order so that will hopefully be a better solution long term.

Thanks again for all your help Hood, really appreciate it.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: DICKEYBIRD on February 02, 2014, 12:00:01 PM
I'm curious why you're using a hall effect sensor.  Won't the magnet tend to pick up some of the ferrous metal swarf flying around and cause problems?   Seems like an opto sensor would increase the odds of it working more consistently?  My lathe has a knack for throwing debris into the strangest places.  ::)
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 02, 2014, 12:12:33 PM
The only reason is that I cannot find the opto sensor that Hood recommended, it seems to be discontinued.

The hall sensors I bought were really cheap, about $1.5 a piece plus shipping, so I spent about $5 on them and I could use the for other applications if I don't use them for this.


Right now I am debugging a problem I just cannot figure out, this one is bizarre.

My mocked up opto sensor using ir and an arduino is working absolutely perfectly when not hooked up to the G540 board. I get 0 volts when my ir detects black, and 4.8v when it detects white, very consistently and very fast switching.

for some reason I just cannot understand, when I take the exact same wires that I have coming out of my arduino that I am measuring with my multimeter, and plug them into the G540, the voltage is only getting up to 1.1V when it sees white, and 0 v on black.

I don't believe that is going to be enough to trigger the index switch, but I have not tried it actually plugged in to Mach3 right now since I am doing the electronics in my house.

At first I thought maybe there was some resistor in the pin, so I took a battery pack that I have that delivers 6v and set that up in the same pins, and the G540 pin is measuring 5.8v accurately, so it's not the G540 pin.

My G540 is not plugged in right now, just trying to hook up all the electronics and get it working before hooking it up to my lathe again.

I tried different wires, same thing. I am at a complete loss on this.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: RICH on February 02, 2014, 02:12:57 PM
Quote
I'm curious why you're using a hall effect sensor.

DICKEYBIRD,
Provides for easy installation of an index /  sensor in places you would not be able to use a disk.
Dosen't pick up junk if it's covered. Personaly I would apply KISS principle and not have it's ouput based on
another piece of software such as the Auduino. Nothing wrong with a disk and sensor though.

RICH
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 03, 2014, 07:20:14 AM
So I finally got my IR sensor working the way I intended and hooked up to my G540 board.

Basically I have a digital output from my arduino going to input pin 1, and a ground from my arduino going to pin 12 , which is power supply GND.

When my IR detects black, it sends 0 volts to the G540, when it detects white, it sends 4.9 v.

I verified this on the G540 board with a multimeter, and watched it toggle successfully between 300mv and 4.9v when the G540 is powered on.

I have my inputs in Mach3 set to the proper pins, turned off emulate, and I am not able to get a green light on my index light in the diagnostics area no matter what I do.

I tried with active low both on and off, nothing.

So I am now once again at a loss. I have my IR and wiring doing exactly what I wanted on my G540, and no index.

Can anyone confirm for me that this is what I should be doing, sending a ~5v signal on and off to my G540 and to Mach 3?

I am so frustrated with this, I have spend so many hours it's crazy.

While I know a lot of that time has been on my mocked up switch via arduino, most of the exercise would need to be done with an opto or hall switch anyway since what I have been trying to do is send 5 v on and off to my G540.

Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Overloaded on February 03, 2014, 09:15:23 AM
You might need 12v for the Gecko input.
Check this out:   
http://www.machsupport.com/forum/index.php/topic,15978.0.html
Russ
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 03, 2014, 09:20:38 AM
Well, that would be a very nice thing for Gecko to put on their data sheet for the G540 if so, they don't mention that at all.

Thank you, that could certainly explain the problem.

Appreciate the help.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Overloaded on February 03, 2014, 09:21:25 AM
... but, it says TTL.
Not sure, never used one.
Better research a bit more.
I see where you posted @ Gecko, hope you get a reply soon.
I feel your frustration, wish I could help.
Russ
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 03, 2014, 09:26:32 AM
Yeah, also posted at CNCzone, very frustrating.

I don't think I will use a Gecko again, the documentation is just poor IMO.

Thanks for trying, the 12V may be it, but I need some transistors to amplify which I don't have on hand to try out.

Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Overloaded on February 03, 2014, 09:30:04 AM
That fellow on posted in that one topic .... which he started.
Never know how it all turned out for him.
You don't want to fry your Gecko !
Marcus is good, hope he gets back to ya soon.
Be cautious.
Good luck,
Russ
 :)
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 03, 2014, 09:34:39 AM
Thanks Russ.

This board has been amazing, I have gotten so much help. I cannot tell you how much it is appreciated.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Overloaded on February 03, 2014, 09:42:24 AM
That 10-30v sensor may only be acting as a regular relay in that the 12v is just operating a coil which then allows NO or NC to complete a circuit.
That circuit is just to switch the Gecko input to ground in this case.
So, you might not be supplying 5v to the input, but just switching the path to ground on and off with the sensor.

I better quit before I get you into trouble.
Russ
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 03, 2014, 09:45:58 AM
:)

I got a reply on CNCZone, but I am not sure what the guy means. He said I need to sink the signal from Pin 1 on my G540, but I am not really sure what he means by that.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Overloaded on February 03, 2014, 09:52:00 AM
I'd guess "pull it to ground".
A SPST switch .... like a simple manual pushbutton in-line between the input and ground would do this.
That's the way the sketch looks to me.

Good luck, and NO SMOKE !
Russ
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 03, 2014, 09:54:21 AM
Ahh, well, that would make sense since I am certainly not pulling it to ground.

I thought that was what you would do with the active low setting, but this stuff is not entirely clear to me.

Thanks Russ, I am hoping for no smoke! @ $300 a board, I cannot afford to fry this thing!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 03, 2014, 06:56:06 PM
Well it definitely does work if you connect the input pin to ground.

I had an old spst switch and I connected to wires to the switch, I than connected one to my ground on my G540 and the other to the input pin.

As I toggle the switch, the input light went lit and unlit.

I even was able to mock up a spindle RPM reading.

I don't know if it would work with 12V or not, I suspect not.

Challenge now is to make a switch that can connect to ground. I am not quite sure how the otto's are working as a switch or if they would allow a ground input to act as a switch.

I have some ideas about using a hall and an NPN transistor to act as a switch.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Fastest1 on February 04, 2014, 12:35:23 PM
  Most of us just use a wire as a jumper to check between pins, no need for a switch unless its permanent as a bypass or similar.

   Anyway hopefully this diagram will help.
 http://www.homanndesigns.com/pdfs/EN010_V8.pdf

  It shows how he is using a 48v power supply to help run his relays.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 06, 2014, 08:33:44 AM
Just a quick update. I decided to buy the C3 breakout board since I could not find an opto that I KNEW would work. I should be getting it early next week.

In the meantime, my hall effect switches came in the mail, and I built  a circuit.

Basically what I am doing is taking the output from the hall switch and going into a NPN transistor through a 10k resistor. The collector goes to the ground of the G540 which connects to pin 12, and the emitter is going to pin 1 (10) as an input on the G540, and I am using a 12V power supply to power the circuit and connecting ground to the G540 ground as well.

I breadboarded the circuit and it was working as expected yesterday. As I moved the magnet past it, the index light in diagnosis toggled. As quickly or slowly as I moved the magnet past it, it seemed to respond.

I than soldered the actual circuit today, hooked it up and not working. I spent two hours troubleshooting it with a multimeter, and it seems that my 10K resistor is not working properly. Ironically I tested the resistor before soldering, and it was working fine, so something happened to it while soldering. I can see that at the connection from the start of the resistor from my output of my hall switch, I am getting about 6V, when switched on at the other end of the resistor, I am getting nothing at all. When I use the ohmmeter function of the mulitmeter, I am getting no reading at all on that 10k resistor.

So hopefully that is the problem, but I ran out of time to replace the resistor. I hope to be able to do that tomorrow morning and hopefully this thing will work.

At that point I will be able to compare this circuit to the C3 to see which one works better. If both are equal, I will use whichever one is easier to mount/protect.

I thank everyone again for all the help, particularly Hood!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: DICKEYBIRD on February 06, 2014, 10:07:59 AM
Having C3's on my lathe and mill spindles, I can vouch for their ease of installation and reliability.  My electronics knowledge is weak so I decided to buy them instead of just an opto sensor & resistor as advised by many.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Overloaded on February 06, 2014, 01:49:07 PM
I use the C3 also. But not with the 540.
Be sure to post your final results, thanks.
Russ
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 06, 2014, 05:49:49 PM
Having C3's on my lathe and mill spindles, I can vouch for their ease of installation and reliability.  My electronics knowledge is weak so I decided to buy them instead of just an opto sensor & resistor as advised by many.

Cool, good to know. The one thing I am not sure about is how I am going to mount the opto itself, it seems like the wiring of the C3 is very straightforward, but it does need to be carefully mounted over a disk it appears.

Seems like the hall effect would be much easier, stick a magnet somewhere and mount the hall close by, we will see.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 06, 2014, 05:50:07 PM
I use the C3 also. But not with the 540.
Be sure to post your final results, thanks.
Russ

Thanks Russ, most certainly will!
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 07, 2014, 10:24:15 AM
By any chance, would any of you guys using an opto or the C3 show me how you mounted the disk and the opto sensor to your lathe via a pic?

I am having a hard time figuring out where and how I want to do this.

Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Overloaded on February 07, 2014, 12:29:09 PM
Here is one on my "homebrew" lathe.
Just a disc slid on the shaft behind the pulley.

On another older Hardinge, I put it inside but pulled the spindle as it was between the headstock bearings.

Over time, the opto will accumulate dust and oil mist (if present). These are the only problems I've had.
The operator blowing parts off to gauge them puts a fine mist in the air .... it WILL eventually find the sensor. Every month or so we need to clean/flush the lenses with contact cleaner.
I like the magnet idea, easier to keep metallic bits away than the slightly dirty atmosphere.  :)
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 07, 2014, 12:34:24 PM
Thanks Russ! Looks good.

I got the magnet kind of working, but not reliable right now.

I think I need to play with the sensitivity of the transistor to get it more accurate.

I agree that the Magnet seems like it could be easier to keep clean, just a simple wipe every now and then would probably work.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 07, 2014, 01:45:03 PM
Never had a problem with the optos needing cleaned when I used them but they were away from any belts so no stoor from them.
Dont think I have any pictures now of my setups when I used optos, I now just use the encoders on my spindle motors.

Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: DICKEYBIRD on February 07, 2014, 01:49:16 PM
On the lathe I used a steel disc with an approx 3/16" hole in on the edge.

(http://i57.photobucket.com/albums/g227/DBAviation/PulleyIdler_zps5c2b117f.jpg) (http://s57.photobucket.com/user/DBAviation/media/PulleyIdler_zps5c2b117f.jpg.html)

On the mill I did the quickest cobble-job I could think of as a temporay thing  & and never got around to replacing it; it's a CD disc painted black & pressed on by hand over a piece of heatshrink tubing on the little Sherline spindle shaft.  I call that Tennessee engineering but it works just as well!  Sorry, no pic.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 07, 2014, 02:28:13 PM
Hood, if you are not using parallel, what are you using, a smooth stepper or equivalent?

Dickeybird, lathe looks good! Hey, whatever works on the mill right? Whose to argue with positive results.
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 07, 2014, 02:30:35 PM
On the Beaver Mill I have USB SmoothStepper, Computurn Lathe is Ethernet Smoothstepper, Conect lathe is  CSMIO/IP-S and Chiron VMC is CSMIO/IP-A.
When Mach4 gets threading sorted out with full encoder and CSMIO I will be swapping the big lathe over to the CSMIO/IP-A.
Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 07, 2014, 02:32:50 PM
Do you find the smooth stepper to be just as good as parallel?

I have read that parallel is still the best way to control the stepper, but it seems more and more people are going the smooth stepper route.

Title: Re: Lathe Threading Wizard Rev 1.17
Post by: Hood on February 07, 2014, 02:37:29 PM
The smoothstepper will produce a much cleaner pulse than the parallel port, in fact any of the external controllers will.
The bad thing about external controllers is some may not support all of the functions of the parallel port, for example some controllers do not support lathe threading.
The big advantage to me with the external controller is the higher pulsrate available as I use servos. Having said that when I change over the lathe I will be using the CSMIO/IP-A which does not use Step/Dir, it is +/-10v.

Hood
Title: Re: Lathe Threading Wizard Rev 1.17
Post by: AVRnj on February 07, 2014, 02:38:39 PM
Interesting, thanks for the info Hood.