Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: SimonC on September 13, 2011, 04:22:57 PM

Title: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 13, 2011, 04:22:57 PM
Hi all,
I'm having problems setting up the index pulse and i'm looking for a little help.
Its counting more pulses than it should, maybe about twice as many and is not linear.
I've tried Index Debounce and any value above 0 seems to have the same effect, it shows 135 RPM no matter what my spindle speed is.
I'm using an optical sensor (Optek OPB 917 BZ) with a 60mm diameter disc and one 10mm slot.
I read on this forum that its necessary to enable Spindle Relays even if they are not used, I tried this and it didnt seem to make a difference.
Is it necessary to run Spindle Calibration Test to get the Index Pulse to work properly?
I'm using the Demo version R3.043.022 Lockdown also tried the R3.043.045 Development  but same results.
any advice or help would be much appreciated.


Regards,
Simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 13, 2011, 04:35:17 PM
I know that threading can not be done in Demo so possibly index pulse will not either although I think it does.
Index Debounce has always been fine for me at 0 and never any good at anything else.
If you attach your xml I will have a look and see if there are probs in it.
Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 13, 2011, 05:16:54 PM
Hood, thanks for your reply,
Im not sure how to send the file it tells me theres already a file with that name, to rename it and try again. but the computer wont accept any new name. ???

I think it was a post of yours on Zone where i got the idea for the OPB 917 BZ sensor, where you said thats what you were using, and that they work well with mach.
Im using a limiting resistor on the sensor as well as on the LED side, is this correct or should i only be using one on the LED?


Regards,
Simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 13, 2011, 05:31:50 PM
I am not sure what the Z is in the part number, mine are just OPB 917B
I just use the limiting resistor on the LED side as I am feeding it with 5v so if putting a resistor on both sides that may be your issue. But then again it may be needed for the Z variant, I dont know?

To attach the xml you will need to rename so to rename you would need to copy the original from the Mach folder to your desktop and then rename to something like SimonC.xml and then the forum would accept.

Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 14, 2011, 04:06:09 AM
I will try removeing the resistor from the sensor side tonight, and even if it blows it,i have a few spare ones lieing around.

in the meantime heres the XML 


thanx again for your speedy replys


regards
Simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 14, 2011, 04:12:08 AM
Ok if that is the xml you are using you do not have the index enabled and set to the port and pin number it is connected to, also Spindle Relays are disabled so I suspect the xml may be the wrong one?
Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 14, 2011, 03:54:52 PM
Yup that was the wrong XML,not sure were that was from.
This is the correct one

I tried removeing the resistor from the sensors + supply wire and it didnt seem to make any diffrnce so im hopeing theres a flaw in this xml or that i just need to buy the licenced version of mach.


regards
Simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 14, 2011, 04:35:23 PM
Your xml is fine and its not because its demo as I just simulated the index pulse here after removing my licence and its fine.
Not sure what you are meaning by "I tried removeing the resistor from the sensors + supply wire and it didnt seem to make any diffrnce" If you removed the resistor from the LED side also then you have blown the opto for sure.
You should have 5v going to to a resistor then to the Red wire, 5V also going to the white wire but direct rather than through a resistor. Blue wire is the input to Mach and the green and black wires both go to 0V.
Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 14, 2011, 05:12:41 PM
One other thing, have you checked that the voltage from your supply is 5v, if its 3.3v then that may be your problem.
If the above and the voltage are not your issues then I can only think the slot is not wide enough for the Dia disc you are using but that would seem unlikely.
Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 15, 2011, 04:28:17 AM
Hood thanx for takeing the time to check the demo version. now i know that the mach settings and the demo version are ok,it must be the hardware side of things. when i get home from work i will check the voltage is giveing 5V. I still have a resistor on the LED side but i will also try a new opto switch just to be sure its not blown. This is a link to a thread i made on the zone showeing how i have it wired up,i suspect it might be wrong.

http://www.cnczone.com/forums/general_electronics_discussion/121343-wiring_optical_interupt_switch_bob.html (http://www.cnczone.com/forums/general_electronics_discussion/121343-wiring_optical_interupt_switch_bob.html)


regards
Simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 15, 2011, 05:56:00 AM
Wiring is ok with the exception of the limiting resistor on the white wire but you have changed that now.
Could be the input on the BOB that is the problem, try another if you have one free.
Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: mc on September 15, 2011, 08:12:42 PM
Have you checked to see if the blue wire is switching using a muiltimeter?
Rather than start swapping parts, it's best to start with the basics, like is the sensor getting the necessary voltage, then see if it's outputting the correct signal before connecting it up.

However, having just ran through the datasheet for that sensor, the resistor on the input side may be a bit high.
Somebody correct me if I'm wrong in the follwing lines.
The datasheet calls for a typical forward voltage of 1.3V (max 1.8V) at 20mA.
Now for a 5V supply, we need a 3.7V drop across the resistor (5 - 1.3), and that limited to 20mA or 0.02A.
So using R=V/I, R = 3.7/0.02, which gives 185ohm, or for Vmax, 160ohm, so something between those two should work.

Also, is that a regulated 5V power supply you're using?
If it's not regulated, it may well be putting out well over 5V...

Another thing I've just noticed, is that sensor may struggle to output 5V to the BOB (it can only supply 6-7mA), so I'd go back to my original suggestion, and check the blue wire, first disconnected from the BOB, then if voltages are OK, connect it to the BOB and see if they remain the same.


An alternative sensor, with far simpler wiring is the PM series of sensors from RS. I used the PMR44P (RS no. 4805231) as the homing switch on my x-axis, or there is another sensor, which came on the spindle of my lathe, but I'd have to go and check it for the part no, but it was still available when I was hunting for the datasheet.
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 16, 2011, 04:22:33 AM
I think originally the resistance was worked out for 3.3v which I think would work out correct but having said that I have been using these optos for probably 8 years or more with 220ohm resistor and 5v and they have been fine. I have used them as index sensors and limits on various machines but only 3 different input methods to Mach, one was direct to port, one was via an  Acustep BOB and all the rest have been via PMDX 122.
Hood

Edit, actually that would make it worse thinking about it ::) Oh well anyway as said 220 has worked fine for me over the years but try the 180 and see.
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 16, 2011, 04:43:59 AM
Hood i checked  supply voltage and it is putting out 5v,im getting the 5v from the bufered BOB,i also tried a seprate 5v ps.    after you mentioned  trying a different input i was thinking about it and i think the inputs on my BOB have internal resistors so that simple mecanical switche can be used without pullup resistors. so i put the blue signal wire directly to pin 12 on the parallel port so it wont be affected by the BOB. it made a difference but still isnt right,now when i leave the switch open mach doesnt see any pulses wich i think is correct but when i use a pice of black tape to block the switch mach is reading  bettween about 8000 to 30,000 rpm >:(

regards
simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: mc on September 16, 2011, 06:44:17 AM
Have you tried disconnecting the blue wire, and seeing what voltage is on the blue wire when you block/unblock the sensor?

Also, when you put the put the blue wire straight to the PP, did you make sure the BOB was disconnected from that pin?

What BOB are you using?
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 16, 2011, 12:00:12 PM
MC sry i didnt have time to reply to your post this morning when i replyed to hood.    I will go check the voltage of the blue signal wire when the switch is blocked/unblocked and connected/unconnected from the PP.  no i didnt disconnect the pin from the BOB,i just teed into it infront of the BOB but i will go change that now.  dont think i have any 180 ohm resistors around but i will go get some tomorow and give that a try aswell                                    


regards
simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: mc on September 16, 2011, 06:48:35 PM
If 220ohm works for Hood, it should work for you aswell.

If you never disconnected the BOB, then the sensor will be fighting against it to control the signal to the PP, but start with the basics first.
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 17, 2011, 11:16:43 AM
ok i disconnected the BOB from the pin im useing so that it is connected directly to the PP. i also tried a coupe different resistors, the original 220 ohm was feeding the LED with 1.3v, the 180 ohm i tried was giveing 1.32v and the 160 ohm was giveing 1.32v aswell. the switch does give 0v and 5v depending on wether its blocked or unblocked. mach still is reading adout around twice asmany pulses as it should,also tried debounce with no luck. Im thinking maby its because im useing the BZ version and not just the B version that Hood is useing.


Hood, could you tell me where you got your switches from?  the ones i have are from RS conponents.

Is it worth me geting some ferrite bushes to try to get rid of any possible interference?  if so is there a particular type i should use? and should they go near the sensor or near PP?

MC, are the switches you use optical?



regards
simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 17, 2011, 11:45:09 AM
I get mine from RS,  RS number for 916B is  455-0896 and 917B is 455-0919

I used shielded cable with the cable grounded at the control end.
Can you attach your present xml and I will have a look as it does seem weird, you could try changing the active state of the Index just in case that makes a difference.

Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: mc on September 17, 2011, 06:39:06 PM
Sounds a bit strange. Normally any interference causes random readings.
You don't happen to have a multimeter with a frequency setting?

I've also just ran through the datasheets for the B and BZ, and there doesn't appear to be any obvious differences. All the specs are identical, and having a quick scan of the optek website, it appears only the BZ is available now, so I doubt the Z means much to those using it.


All the sensors I'm running are optical. Not sure when I'll be in the workshop next, but I'll try and remember to check to see what the spindle sensor is, as I'm sure it was a good bit cheaper than the one I mentioned above.
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 17, 2011, 06:48:55 PM
There is a difference in the schematic, the Non Z seems to have what I presume is a voltage regulator? VReg it says anyway but not being an electronics person it may be something totally different. Dont really see how that would affect things anyway but its the only difference I saw.

Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: mc on September 17, 2011, 06:54:27 PM
Good point, but the physical properties of all the connections appear to be the same, so it shouldn't make any difference.
The Z obviously signifies some changes of the internals.

This is the kind of problem where an oscilloscope comes in very handy!
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 17, 2011, 06:57:29 PM
Yes a scope would be handy for sure but I am thinking there must be a setting wrong that maybe I missed in the xml but it certainly seemed to work fine here when I simulated the Index pulse. Will look at the xml again and see if I can find anything.
Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 17, 2011, 07:12:03 PM
Ok may have found a problem, you have a ratio set for the spindle puley, unless your index pulse is geared then you shouldnt have that.
Hood
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: SimonC on September 18, 2011, 05:12:31 AM
OK i tried changeing the spindle pully ratio like you suggested and its now working like a charm  ;D (i now have 1 in both pully ratios)

Thankyou both for all the replys and help, it is much appresiated.


regards
Simon
Title: Re: Index Pulse Setup Problems (Lathe)
Post by: Hood on September 18, 2011, 05:21:20 AM
Just sorry I never noticed it the first time. I was just simulating the input so never really paid attention to the time I was inputting the simulated pulses and wrongly just presumed it was showing correct.
Hood