Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: sivtek on February 27, 2020, 03:04:17 PM

Title: Index
Post by: sivtek on February 27, 2020, 03:04:17 PM
How to wire up a Reflective Object Sensor (OPBA) using the index function in Mac3 to read actual rev. of the spindle. I have input 11 on the BOB available for the task.
I will be most grateful for any help.
Title: Re: Index
Post by: sivtek on February 28, 2020, 06:09:23 AM
Is it possible to do it? Has anybody done it and if so, how to?
Title: Re: Index
Post by: TPS on February 28, 2020, 08:26:16 AM
if you give us some more Information about your sensor and BOB, maybe?
Title: Re: Index
Post by: sivtek on February 28, 2020, 09:13:28 AM
The sensor is OPB606A and data is on the net. I have newly installed a new BOB from CNC4PC: C11GR9-S3578-46. I do not need information on how to mount the sensor, only the wiring.
Title: Re: Index
Post by: TPS on February 28, 2020, 02:30:44 PM
here: https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=imgres&cd=&ved=2ahUKEwjs04Cl_fTnAhXlAGMBHYevArQQjRx6BAgBEAQ&url=https%3A%2F%2Fwww.homemodelenginemachinist.com%2Fthreads%2Fmach-3-spindle-encoder.15226%2F&psig=AOvVaw3pi3JbNzgehtzKDnUEXHTc&ust=1583004458389991

are some wiring diagrams, witch describe the principals.
Title: Re: Index
Post by: sivtek on February 28, 2020, 04:14:48 PM
TPS
Thanks a lott. Here is a lot of information, lucky I may find find a solution.
THANKS
Title: Re: Index
Post by: MN300 on February 29, 2020, 08:06:00 AM
The OPB606A is specified as having an output of 500 uA under the test conditions. This is barely enough to drive the 10K resistor shown in the diagram found in the link TPS provided. Your conditions will be less than ideal as dirt and film build up on the sensor and the shaft. Also your reflector is curved, reducing the effective area.

The OPB607A uses a Darlington photo transistor and has a much higher output - up to 25 mA (50 times more).

The diagram's R1 which sets the diode current is a bit low. Nominal current is 20 mA, 100 ohms would result in 33 mA. 150 ohms would be a safer choice. You could overdrive the diode but run the risk of overheating and failure.

Your reflective surface should be 50% white and 50% matte black, a bare shaft may reflect light.

An open photo sensor is a high maintenance item. It will take frequent cleaning to keep it running.
Title: Re: Index
Post by: sivtek on February 29, 2020, 08:34:29 AM
AHA, that may be the problem. I have tested the OPB606A on the bench and get the reading 4,56 and 0,15 volt witch should be ok, but when installed in the machine the numbers in the RPM display in the Mach run page flickers. Also the green index button behaves unstable.
Will try to get a OPB607A. Or do you recommend a different solution? 
Title: Re: Index
Post by: MN300 on February 29, 2020, 09:08:48 AM
A magnetic solution such as a hall effect sensor wouldn't suffer from contamination but the part you attach to the shaft is more difficult to make.
Here is a example of a vane sensor  https://www.digikey.com/product-detail/en/tt-electronics-optek-technology/OHB900/365-1002-ND/374780
You would have to make a disk with slots. One vane would not be balanced so there would need to be two. I image someone could make a one vane design with a counterweight but that's way above my pay grade.
You have started on the optical route, it will be informative to hear how successful that is for your application.
Title: Re: Index
Post by: sivtek on March 01, 2020, 05:43:26 AM
I have ordered both "hall effect sensor" and the OPB607A sensor but it will take some time before I get it, I will keep you informed.
In the meantime how is the wiring for the "hall sensor" and can I use the same resistors (150 ohm and 10 Kohm) for the optical solution using the OPB607A ?
Title: Re: Index
Post by: MN300 on March 01, 2020, 07:37:27 AM
There is a diagram in the datasheet.
https://www.ttelectronics.com/TTElectronics/media/ProductFiles/Optoelectronics/Datasheets/OHB900.pdf

Pin 1 is VCC (12V)
Pin2 is Ground
Pin 3 is the output.
You can attach the 10K resistor there. It may not actually be needed if your BOB provides pull up, but it won't hurt.
There is a figure in the datasheet that shows a 820 ohm resistor. This value would be needed to operate at the device's maximum speed. That would be 100,000 rpm with two vanes. I assume you aren't going that fast.

The vane is interrupting a magnet field so it needs to be a ferrous material.
Title: Re: Index
Post by: sivtek on March 01, 2020, 08:31:18 AM
Thanks MN300.
I have 5v easy available at the mill, can this be used instead of the12v? Vil it cause problems?
The datasheet says that it operates over a broad range of supply voltages (4.5 V to 25V).
Title: Re: Index
Post by: MN300 on March 01, 2020, 09:00:57 AM
Yes, 5V should be fine.
By the way, I made a mistake in converting the maximum switching frequency of 200 KHz to motor speed. It should have been 100,000 revs per second.
Title: Re: Index
Post by: sivtek on March 01, 2020, 09:56:21 AM
Thanks OK. Mine goes to max 3500 rpm.
Title: Re: Index
Post by: MN300 on March 01, 2020, 11:06:55 AM
My first idea for an alternative was a system we used in the 1990s as an inexpensive and rugged encoder. Sold by Xolox, it consisted of a magnetic wheel with an alternating pattern of north and south poles around the circumference and a hall effect sensor. Unfortunately that company is no longer around.

Today I found equivalent wheels at Digi-Key. I believe the small hole for the shaft can be bored a bit larger if necessary.

4 pole Wheel, equivalent to two vanes
https://www.digikey.com/product-detail/en/phoenix-america/G10-A-0125-25-004/2222-G10-A-0125-25-004-ND/10498946

Hall sensor example,  You can probably find less expensive sensors at a hobby electronics site. There are also sensors in a transistor-like package but those will be harder to mount.
https://www.digikey.com/product-detail/en/standex-meder-electronics/MH21-11S-300W/374-1401-ND/5270608
Title: Re: Index
Post by: sivtek on March 13, 2020, 05:27:28 PM
I have now received some OPB607A sensors and have wired one as the diagram using R1 = 150 ohm and R2 = 10K ohm. I supply 5v and measured the voltage between earth and "signal out" to 1,3v with no reflector. The sensor do not react to a reflector at all,- no change on the reading.
Have I used wrong resistors, or have I blown the sensor?
Title: Re: Index
Post by: MN300 on March 13, 2020, 06:01:59 PM
Most digital cameras can see infrared so it is easy to see if the emitter is working.

Recheck your wiring, pinout diagram is on sheet 1
https://www.ttelectronics.com/TTElectronics/media/ProductFiles/Optoelectronics/Datasheets/OPB606-607.pdf

pin 1  output, 10K to  +5V  BROWN BLACK ORANGE
pin 2  ground
pin 3  LED emitter, 150 ohms to +5V  BROWN GREEN BROWN
pin 4 ground

https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-resistor-color-code-4-band
Title: Re: Index
Post by: sivtek on March 14, 2020, 06:24:27 AM
Yes you were right, my wiring was wrong. I have made a new wiring diagram witch I think is correct. Please comment. I have attached the diagram, but have not tried it jet.
Title: Re: Index
Post by: MN300 on March 14, 2020, 08:51:56 AM
Your diagram looks fine.
Title: Re: Index
Post by: sivtek on March 14, 2020, 10:00:22 AM
OK Thanks.
I tried it connected up, it is working!!!,- but I am getting the following readings: .71v and 1.26v.
What to do? Lover the 10K ohm resistor or the 150 ohm?
Well, I know, I could have tried different resistors but it is easier to ask  :) :)
Title: Re: Index
Post by: MN300 on March 14, 2020, 10:59:52 AM
0.71V is right for when light is reflected by the target but 1.26V indicates too much light is is received during the off period.

The best solution is to increase the light to dark ratio. Here are some things to try.

Shield the sensor from room light. Does the 1.26V reading change?

Make what the sensor sees when the target is not in view less reflective. Try changing the angle to reduce specular reflection. See attached PDF

Increase the reflectivity of the target. Retro-reflective tape is much better than white paint.

https://multimedia.3m.com/mws/media/295767O/reflectivity-flyer.pdf

If an optical solution cannot be found you can experiment with increasing the emitter resistor. Determine the resistance for two points, when the high value approaches 5V and when the low value starts to rise.
Assuming that with time dirt will reduce the light, you should select the lowest resistance that give full output.
The difference between the two points gives an indication how much dirt the system will tolerate before the lower voltage rises.


Title: Re: Index
Post by: sivtek on March 14, 2020, 12:29:02 PM
YES! Turned off the light and I got 4.7v (no reflekt) and .71v (reflekt).
No I am going to mont it to my mill. It will be enclosed so no or little light vill be around.
Let you know how I am getting on.
For now, thanks again a lott. Without yours help I wouldn't have managed!
Title: Re: Index
Post by: sivtek on March 16, 2020, 07:33:43 AM
Hi.
I need some more help.
When I test the sensor with a Travel Adapter giving 5.0v and 1.0amp it works fine, but when wired up to the mill it will not work at all. I measured the built in power supply at the mill to 4.88v. I think that is the reason. Can anything be done?  Reducing the 150 ohm resistor to 100 ohm?
Or is the only solution to use a separate external supply?
Title: Re: Index
Post by: MN300 on March 16, 2020, 08:30:38 AM
The difference between 5.0V and 4.88V is small. The device should still work. What are the voltages you read when you rotate the shaft?

Check your wiring, is there a bad connection?

Is changing the power supply the only change you made? If you connected the output to the mill try disconnecting it when testing.

I can made better suggestions when I read what the voltages are.
Title: Re: Index
Post by: sivtek on March 16, 2020, 09:08:20 AM
I have checked the voltage of the external supply to be 5.12v (not 5v).
The device is not mounted on the mill, but is wired up to the mills supply.
I get the following readings across earth and signal: flickers between 1.4 and 1.9v. There is no differences if reflectit or not.

Is changing the power supply the only change you made? yes

Title: Re: Index
Post by: MN300 on March 16, 2020, 09:38:38 AM
I am trying to think of a combination of events to explain what you see.
If the emitter is not working then room light could explain the flickering output. If this is the case then shielding the sensor will increase the output voltage.

As I mentioned before the output of the emitter can be checked with a digital camera. To test your camera you can point your TV remote control at the camera and push a button. You will see a flickering light. Once you see this work you can move on to checking the emitter.

The voltage from earth to the junction of the emitter and the resistor should be 1.7V.
Title: Re: Index
Post by: sivtek on March 16, 2020, 10:27:50 AM
Yes, the emitter do work, checked with my camara.
I measured the voltage as you mentioned to flicker between .4 and .9 v. I tried to shelter the sensor with little effect, not notesible.
To bee sure I measured the right place I attach a drawing showing where I did the measure.
Sorry, sent you a wrong dravig. Here is the right one
Title: Re: Index
Post by: MN300 on March 16, 2020, 10:43:22 AM
The reading of 4. to .9V at the emitter pin 3 does not make sense. If the emitter is working the voltage there should be well over 1 V.

Let's try going back to the setup that once worked. Can you try the power supply you called the Travel Adapter again?
Title: Re: Index
Post by: sivtek on March 16, 2020, 11:14:42 AM
No it do not work any more. It did work this morning, but not now.
The emitter is working and the voltage at pin 3 was 1.3v and the supply round .8v.
BTW. in the drawing  the R1 is shown as 100 ohm, but 150 ohm is actually used.
Title: Re: Index
Post by: MN300 on March 16, 2020, 11:38:57 AM
Since this worked at one time something has changed. Either there is a wiring fault or the sensor has been damaged.
Title: Re: Index
Post by: sivtek on March 17, 2020, 06:44:25 AM
Getting closer (I think).
Cleaned the device and now it seems to work. Wired it up to the the mill for a test(not installed). The green light on the hardware page responds with on and off. The same does the red status LED on the BOB (G11G Multifunction CNC board Rev. 9 from CNC4pc).- but Mach3 vil not show the REW, the display just flicks wildly even if no a speed is called for.
For ref. my setup is:  Windows 10, Mach3, Smooth Stepper ver. 1.2,  BOB as above and the mill is a SIEG KX3 CNC Mill
Title: Re: Index
Post by: sivtek on March 24, 2020, 01:38:15 PM
Can some tell me why the rev. counter in Mach3 doesn't register the RPM even as the signal is showing up in the hardware page? (Index botten get activated - on and off).
The optho switch is working nice thanks to MN300 and is giving .6 volt and 4.7 volt when reflected and non reflected.
Title: Re: Index
Post by: TPS on March 24, 2020, 02:41:35 PM
see
Title: Re: Index
Post by: sivtek on March 25, 2020, 07:06:44 AM
Thanks TPS your reply, but it bid not help, no indications of RPM on the screen. The green index light on the Mach3 screen is active and also a red LED light on the BOB indicating that the input signal is active.
Title: Re: Index
Post by: sivtek on March 26, 2020, 05:27:10 AM
Is there somewhere I can get information and help to solve my problem?
Title: Re: Index
Post by: TPS on March 26, 2020, 05:36:49 AM
witch Motion Controller/Bob are you using?
Title: Re: Index
Post by: sivtek on March 26, 2020, 06:05:08 AM
Please see my earlier post of March 17.
Title: Re: Index
Post by: TPS on March 26, 2020, 06:28:30 AM
sorry i overread this, i have no experiance with smoothstepper. is it a original one or a clone?
Title: Re: Index
Post by: TPS on March 26, 2020, 06:44:48 AM
just an other idea, a pulley is selected? and it has a Ratio?
Title: Re: Index
Post by: sivtek on March 26, 2020, 09:47:44 AM
Yes, the SS is original but quite old, and yes the pulley selected and ratio is 4.
I am using port 11 on the BOB witch should be ok?