How to Find Optical Switches with 3.3V Output?

Discussion in 'The Projects Forum' started by Zero Potential, Jul 30, 2016.

  1. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    I'm trying to set up a lathe for CNC. I need to set up a couple of optical switches to provide input from the spindle. I plan to mount a thin disc around the spindle with a slot in it. The switches will be mounted at 90 degrees to each other. The slot will turn the switches on and off as it passes through them on each revolution of the spindle.

    I need each switch to put out a 3.3V signal; the controller receiving the signals can work with anything between 3.3 and 5 volts.

    I have never used an optical switch before. I looked at Mouser's site, and when I checked the datasheets for switches, they went into great detail concerning the output CURRENT, but I don't see anything about signal voltage. Am I missing something here?
     
  2. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,176
    397
    Assume a photo transistor output stage, open collector; when energized output will be low, when off, output will be supply V in series with collector load. Supply V 3.3 V-- output 3.3 V.
     
  3. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    Thank you for your reply. I just assumed there would be voltage gain.

    So apparently, just about any switch that fits will do the job.
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    Optocouplers have a current gain from input to output (called transfer ratio, which has a typical value of less than one.
    This output current is converted to a voltage by a load resistor at the output.
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    The slot opto output is open collector so you should be OK, BTW if setting up a quadrature pair, you can get dual slot opto's to do this a little simpler than two units.
    Max.
     
    Zero Potential likes this.
  6. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    Thanks for the replies.

    As Max guessed, I am looking for quadrature input for threading. My controller will not work with a single input, for reasons I know nothing about.

    I was told that the simplest solution was two optical sensors spaced out on the disk at 90 degrees.

    The idea of a two-slot sensor is interesting, but it sounds like I would need two disks, which would be hard to set up with the limited room I have on the spindle. I think I can cram one more disk onto it, but two would be difficult.
     
  7. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    No you only need one disk as the slot opening has to be made according to the spacing of the two pulses, this produces the well known 90° spacing of a quadrature encoder.
    In any quadrature encoder the detection system has the option of using the basic pulse count or read each rising pulse for x2 or all four edges for x4 resolution of the disk.
    Max.
     
    Zero Potential likes this.
  8. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    I'm sorry; I didn't explain why I needed two disks. The lathe has a tachometer, and for that reason, there is already one disk on the spindle. That's the other disk I was referring to.
     
  9. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    Why not use one disc for double duty? Even if you had to use another opto?
    What controller/system are you interfacing with.
    If going with an existing one that is not quite compatible with the standard dual slot opto, then you would need two separate heads to get the 90°.
    Max.
     
    Zero Potential likes this.
  10. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    The problem is the existing disk. It has two round holes in it 180 degrees apart. I don't know of any way to leave those holes in place and still use the disk for quadrature input. I suppose I could get rid of the tachometer and replace the disk with one made for quadrature input.

    The controller is a KFlop. Right now I'm using Mach3 because I had problems with the manufacturer's software, KMotionCNC.

    I wanted to use a single signal, but apparently that is not possible with the KFlop.
     
  11. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    Mach uses a single pulse and is not as good as the industry method of using a quadrature encoder, which is what you have with Kflop.
    The object of the quadrature encoder is the Z axis is geared off of the spindle encoder, so if the spindle varies in rpm slightly, the Z should keep track of it, IOW electronic gearing.
    Is there no way you can accomodate both?
    In your first post you mention 90° apart, are you talking electrical degrees as in quadrature or physical/mechanical degree's?
    How many pulses do you plan on for the quad encoder?
    Max.
     
  12. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    My understanding is that I can do it with two switches on one wheel, at 90 degrees to each other physically. Say one at 12 o'clock and one at 3 o'clock. Single slot. I may be wrong about that; my big concern when I posted here was finding switches that would work, so I hadn't cooked up a complete plan.

    As far as I know, you can't use the KFlop with a single switch and a single slot. I asked other KFlop users about this more than once, and they seem positive it can't be done, so I assume they know what they're talking about. I don't know how I'll make it function with Mach3, but as I said, this weekend's big challenge was the switches. Now that I know more about the switches, I can get into the question of where to go from there.

    This is all very preliminary. I don't even know what to do with the signals once I get them to the KFlop.
     
  13. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    That doesn't make sense?
    Although not having implemented it, I have talked to Tom at Kflop on this and as far as I am aware, Kflop requires a quadrature (90°) encoder pair, this is not obtained by two pulses 90° apart physically as you describe..

    Max.
     
  14. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    I hate to waste your time so early in the process. When I started the thread, I was only concerned about getting switches, so I was not prepared to provide intelligent input regarding anything beyond that. Now that I have some clue about the switches, I'll order a couple and then worry about the rest of the problem.

    I appreciate you taking so much time to respond. I will be back once I'm in a better position to discuss the project.
     
  15. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    I would ensure whether you are confusing quadrature pulses with the 90° physical spread you mention in post #12.
    e.g. A B quadrature outputs.
    upload_2016-8-1_15-59-52.png

    Max.
     
  16. Zero Potential

    Thread Starter Member

    Mar 25, 2015
    64
    2
    Thanks again. I will try to get up to speed before returning to the forum.
     
Loading...