586,121 active members*
2,985 visitors online*
Register for free
Login
IndustryArena Forum > WoodWorking Machines > DIY CNC Router Table Machines > Optical Limit Switch - Have it powered now what
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2010
    Posts
    0

    Optical Limit Switch - Have it powered now what

    I have managed to power the optical limit switch from a USB port. My issue now is that there is one wire which produces a 3.5ish Volt signal when the switch is closed. I have a G540 and it seems that it is a purely closed circuit/open circuit design with limit switches. With 5 wires - (2 for the IR emitter and 2 for the IR receiver) that leaves only one wire which is the logic wire. Can anyone help me with information on how to incorporate that into the G540?

    Thanks
    Andrew

  2. #2
    Join Date
    Nov 2009
    Posts
    4415
    Do you have the model number of the optical switch? Try posting this in the electronics forum if no one answers this quickly.

  3. #3
    Join Date
    Dec 2010
    Posts
    0

  4. #4
    Join Date
    Apr 2005
    Posts
    1778
    The two wires on the one end are power(red) and ground(black) for the diode. You need a voltage dropping resistor between the power lead and power.

    The three wires on the other end are to the phototransistor, power(white), ground(green) and detector out(blue). Again you may need a resistor between power and power lead, if you are using more than 12V. You also may need a pull up resistor on the logic output (they claim TTL compatibility so maybe not).

    You could use a quad 2 input nand gate. Wire the x-axis detectors to the one nand gate's inputs, the y-axis detectors to another gate and the z-axis detectors to another gate and send the outputs to the BOB.

    Alan

  5. #5
    Join Date
    Mar 2010
    Posts
    371
    The particular switches you have are "Totem pole" buffer outputs. That is not easy to use in this environment. You really want "open collector". The totem pole output is complete, you don't need any resistors on the output side. However, because you don't have a lot of available inputs on the G540, you need to combine them. A NAND gate would do that, but you need a bunch more instruction to do that.

    You have 4 inputs and 8 switches, and you probably want to leave at least one input available for an auto height set trigger. Does your machine have 1 or 2 motors on the Y drive? If you have one motor on each axis, you can use 3 inputs, one each for X, Y and Z, and then you could use a quad 2 input NAND gate (74HC00). If you have a double Y drive, you really want a separate home switch for each side. I use 2 inputs: one has all the switches except the "A" home, the other has A home. You could split this into two parts, and use a dual 4 input NAND gate with X home, X limit, Y home, Y limit on one side and A home, Z home, Z limit on the other.

    Optical switches may not be the best choice because dust from CNC operations could make them unreliable. Can't say whether that's an actual problem or a real one. It should fail safe at least (will trigger when it's not supposed to, rather than not triggering when it should).

    My suggestion is to ditch these switches and instead read this thread:
    http://www.cnczone.com/forums/open_s...made_easy.html

    You can get all the parts from Futurlec, which would be cheap and easy for you to do. T

  6. #6
    Join Date
    Jul 2003
    Posts
    281
    Hi, Take a look at my CNC projects for Info on how to make optical switches at:
    CNC Projects
    Cheers
    Bob A

  7. #7
    Join Date
    Dec 2010
    Posts
    0
    BR Tech - Your logic gates look interesting.

    I'm happy to gang all my optical switches the one input as these will be my home switches. My limit switches are all standard DPDT limit switches. In fact the optical switch requirement came from homing the x axis as i have a slaved motor and the "A axis" limit switches arm kept being slightly bent while the other side was homing which kept making my gantry skew.

    Im a fast learner so any help you can give me with this NAND gate would be helpful. I was thinking that another way around it would be to use a solid state low voltage relay but would this give me the accuracy that I need (i.e how much lag time could I accept), the way around that would be to slow down my homing but then that could get annoying.


    Bob - At first your page looked daunting but I have tried to make head and toe of it. My problem is that I am getting 5V from a USB source which is separate to my Motor Driver's (g540) PSU of 48V. If I ground the USB to the ground line of the other PSU is that acceptable?

    I'm trying to work out how the G540 use's it's limit switches G540 Manual, it seems as though inputs 1-4 are on the ground side of the circuit and they use the limit switches purely to open or close the circuit. If I punch in a 3.5V signal into that port will I not do damage?

  8. #8
    Join Date
    Mar 2010
    Posts
    371
    Quote Originally Posted by TheBulk View Post
    BR Tech - Your logic gates look interesting.

    I'm happy to gang all my optical switches the one input as these will be my home switches. My limit switches are all standard DPDT limit switches. In fact the optical switch requirement came from homing the x axis as i have a slaved motor and the "A axis" limit switches arm kept being slightly bent while the other side was homing which kept making my gantry skew.
    That's how mine works.

    If you only have two optical switches, on X and A home, then you could use them as they are in two inputs, and gang all the other switches on a 3rd input and not need any other circuitry. As long as you home X/Y/Z separately, that works fine.

    If you want to gang one optical switch with one mechanical switch you can do that too: tie the output of the optical switch to the input (common) of the mechanical switch and take the NC output of the switch to the G540.

    You don't want to gang the X and A optical switches - you want them on separate inputs.

    If you are ganging multiple mechanical switches, wire them in series - common of one to NC of the next. On the last one, tie the common to ground, and the NC of the first one is your input. You can wire them in parallel with the NO input to the G540 and the common at ground, but it's not as fail safe (an open wire won't stop it).

    Im a fast learner so any help you can give me with this NAND gate would be helpful. I was thinking that another way around it would be to use a solid state low voltage relay but would this give me the accuracy that I need (i.e how much lag time could I accept), the way around that would be to slow down my homing but then that could get annoying.
    You are right. Don't use a relay.

    Bob - At first your page looked daunting but I have tried to make head and toe of it. My problem is that I am getting 5V from a USB source which is separate to my Motor Driver's (g540) PSU of 48V. If I ground the USB to the ground line of the other PSU is that acceptable?
    yes

    I'm trying to work out how the G540 use's it's limit switches G540 Manual, it seems as though inputs 1-4 are on the ground side of the circuit and they use the limit switches purely to open or close the circuit. If I punch in a 3.5V signal into that port will I not do damage?
    The inputs are inputs. They have an internal pullup resistor - with nothing connected, the input appears high. They are opto isolated from the parallel port (a very good thing). If you tie them low (ground) they go low.

    If you push 3.5 V in, using the totem pole output of the optical switch, it will appear high. When you trip the optical, it's output goes to .5V or less, and you should see the G540 indicate low.

  9. #9
    Join Date
    Dec 2010
    Posts
    0
    Quote Originally Posted by brtech View Post
    If you push 3.5 V in, using the totem pole output of the optical switch, it will appear high. When you trip the optical, it's output goes to .5V or less, and you should see the G540 indicate low.
    Perfect thats what I couldn't figure out. Thank you very much for your help

    Thanks to Bob and Alan as well

  10. #10
    Join Date
    Dec 2010
    Posts
    0

    Didn't work now G540 not working

    Okay - so I tried the above and it does work in the diagnostics page - M1 home switch goes hi when activated and low when not.

    Only problem is now my motors won't turn at all. Nothing works - jogging with the keyboard or through the jogging tab.

    Do you think I may have destroyed my G540 somehow?

Similar Threads

  1. Optical Limit Switch
    By herring_fish in forum Hobby Discussion
    Replies: 27
    Last Post: 05-07-2011, 06:25 AM
  2. I guess this is an optical limit switch...how to wire?
    By HereinCS in forum DIY CNC Router Table Machines
    Replies: 17
    Last Post: 03-09-2011, 05:56 PM
  3. Optical Switch
    By boozeboy in forum CNC Machine Related Electronics
    Replies: 5
    Last Post: 05-07-2010, 12:40 PM
  4. optical switch
    By natchez in forum Xylotex
    Replies: 3
    Last Post: 05-01-2004, 01:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •