586,103 active members*
3,420 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 21
  1. #1
    Join Date
    May 2006
    Posts
    161

    Opto-isolated BOB design

    Hello all,
    Since I could not find a sub-forum about BOBs I posted here in general.

    I am designing a opto-isolated BOB for my cnc and have some questions about the parallel port connections that I have to make.
    I wonder which of the two circuits I have to use to power the optocouplers - the source or the sink one? My parallel port gives 5V at the pins when unloaded but drops to about 3.2V when loaded with about 5mA /I am using UHU servo drive with its optocouplers wired from parallel port pins to ground/.
    I suspect I can wire my BOB so the optos are powered from the computer's 5V line and the data pins bring them low. I have read that the sink circuit could give much higher current - in the order of 15-20mA.

    The other problem is I have another computer that is generating only 3.3V at its port. Can I wire an opto here to the +5V line or it is not going to be good?
    I know some computers produce less voltage at the lpt port pins but wondered why this should be. Or I have to wire it to the 3.3V line then?
    The same load which brought the firts lpt port from 5V to 3.2V here made less difference - it dropped from 3.3 to about 3.05V.

    I am going to use CNY17-4 devices.

    Thanks in advance for any clarification on the subject.

    Todor

  2. #2
    Join Date
    May 2006
    Posts
    2420
    I always make my BOB switch active low, as you say the parallel port can sink much more than it can source, I am using Elm Chan drives (which the UHU was originally based on) and it works fine.

    I haven't tried in the source configuration as it doesn't sound like it would work with opto's unless some buffering is done, just my 2c

    Cheers.

    Russell.

  3. #3
    Join Date
    Jul 2008
    Posts
    411
    You should always use active low on parallel ports with LED returned to +5v rail as this is least susceptible to noise when several lines change at once.

    Also, from a logic perspective, active low turns on the LED which then turns on the output transistor in the opto, giving an isolated active low output and preserving the logic polarity, which helps protect against 'stupidity' later (personal experience!)

    Finally, active low has a better capacitive current drive and sharper fall times which is better for clock edges, which is why most clock signals act on the negative edge.

    In answer to your question re voltages... it depends on the logic chip driving the port. An older TTL device would give 3.3v, a discrete CMOS device off 5v rail would give 4.5v but all in one support chip designs might give only 3.1-3.2v loaded (mosfet off 3.3v rail). Since they are really only intended to drive another TTL/CMOS device anything over 2v or so is a logic 1 and under .8v is a logic 0. ideally therefore you should buffer the signals before using them but the active low approach removes that additional cost.

  4. #4
    Join Date
    May 2006
    Posts
    161
    So I guess the better way to do this is to put a couple of 74LS244N's in the beginning and drive the optocouplers after that

    Todor

  5. #5
    Join Date
    Dec 2003
    Posts
    24221
    When interfacing to the 'Outside World' I usually use a ULN2803 or for just a couple of outputs, a 2N7000 on each works.
    This way you only need the common reference, the final driving supply can be up to 50~60vdc.
    My thoughts are, to never use logic voltage out on the machine, I much prefer the industry standard of 24vdc.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  6. #6
    Join Date
    May 2006
    Posts
    2420
    Quote Originally Posted by Al_The_Man View Post
    My thoughts are, to never use logic voltage out on the machine, I much prefer the industry standard of 24vdc.
    Al.
    I will second that, I setup my machine with 5V limits/homing etc being lazy and got a lot of random trips, changed it all to 24V and the random trips completely dissapeared (except when I crashed it and one time when I leant on the limit switch (chair))

    Russell.

  7. #7
    Join Date
    May 2006
    Posts
    161
    I am going to use 24V for the limit switches as was decided long time ago. I'll also have a proximity switch on each axis that I am going to combine with the index pulse from the encoders to give real accurate homing. It will also be powered off the 24V line.

    I am talking about getting +5V out of the computer just for the buffer logic I plan to use. It will not be used anywhere else on the machine, just the BOB.
    I've seen many DIY BOB's that use power from the computer through the USB port.

    Todor

  8. #8
    Join Date
    Dec 2003
    Posts
    24221
    If using the PC supply, I generally use a spare 4 pin HD connector etc.
    This way you have the common ref as well as the 5v.
    Anywhere else, and the power tracks through the MB back to the supply.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  9. #9
    Join Date
    Oct 2006
    Posts
    106
    Have you considered taking the 5v off of one of your Driver boards?

  10. #10
    Most parallel ports use 3.3V logic. You cannot Use 5V for the pull-up voltage; when your parallel port output is at a logic '1' (3.3V), there will be 1.7V across the opto LED and limit resistor (5V - 3.3V = 1.7V). Opto LEDs begin to turn on at 1.3V. This means your LED will never be fully off.

    Mariss

  11. #11
    Join Date
    May 2006
    Posts
    161
    Quote Originally Posted by edo View Post
    Have you considered taking the 5v off of one of your Driver boards?
    I don't want to mess the driver power supply with the computer PS, that why I want an optoisolation. And there will be a ground loop since my driver PS's minus lead is grounded anyway.

    The BOB will handle signals from 2 parallel ports because I want more I/O. The second port's data pins being selected for inputs gives me a total of 18 inputs. This is for now, later I consider buying some gamepad and use it in MACH3 through the Keygrabber.

    Todor

  12. #12
    Join Date
    May 2006
    Posts
    2420
    Quote Originally Posted by Mariss Freimanis View Post
    Most parallel ports use 3.3V logic. You cannot Use 5V for the pull-up voltage; when your parallel port output is at a logic '1' (3.3V), there will be 1.7V across the opto LED and limit resistor (5V - 3.3V = 1.7V). Opto LEDs begin to turn on at 1.3V. This means your LED will never be fully off.

    Mariss
    But if the P Port is switching to ground wouldn't the pin just float to 5V with the pullup and then once the pin switches go logic low ?

    I thought if the port is switching active low then it only sinks current and does not source any voltage at all...

    My BOB has three voltage levels, 5V from PC with the P Port switching low, 30V for estop/limit/estop and 5V for logic supply for the opto's to driver cards. It all seems to work fine, not trying to argue, just trying to better understand

    Russell.

  13. #13
    epineh,

    Sadly, no. Except for a very few specialized ICs, the voltage on any input or output cannot exceed the supply voltage by + or - one diode fwd voltage drop (0.5V give or take a little). Any forcing voltage beyond that will forward bias the IC substrate and clamp it to +/- one diode drop. For 3.3V logic that means 3.8 to 3.9 VDC. If you force the issue with a substantial current, the device will reward you by entering a destructive avalanche condition. That can take as little as 10mA in many instances.

    Read the fine print in the IC datasheets or their application notes. A lot of hidden knowledge resides in device ap-notes and requires "between the lines" interpreting, mostly because a lot of it isn't pretty.:-)

    Mariss

  14. #14
    Join Date
    Dec 2003
    Posts
    24221
    Quote Originally Posted by LZ1TWB View Post
    So I guess the better way to do this is to put a couple of 74LS244N's in the beginning and drive the optocouplers after that

    Todor
    I still think the better way to go is with the ULN2803, the darlingtons switch on at 3v and you can use optos with up to 50v in the collectors.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  15. #15
    Join Date
    Jun 2007
    Posts
    3757

    Lightbulb Protected inputs..

    If you want to have protected logic inputs against spikes, you can use a 40106 or 74HC14 hex schmitt trigger inverters which have input clamping diodes rated to +/- 10mA.
    Putting a 10K resistor in series with each input will give protections to 100v and still only introduce a delay of 30nS which is usually negligible.
    22K will protect to 220v and 65nS delay.
    The 40106 can be run from 5v or up to 18v supply, but typically 15v.
    The 74HC14 is for 5v operation.

    Although this can protect against blown inputs, it still does not overcome common mode noise problems from earthing problems, which and where the opto coupler fixes most noise issues.

  16. #16
    Join Date
    May 2006
    Posts
    161
    Hi,

    Talking about the 74HC14 lets me to another thought. When interfacing the input switches they'll go through the opto's and then to the PP Port. Will it do any good if I put the 7414 between the opto and the PP Port to smooth out the signal and produce real logic levels? I see some round corners in the waveform after the optos when they switch.

    Thanks, Todor

  17. #17
    Join Date
    Jul 2008
    Posts
    411
    Quote Originally Posted by LZ1TWB View Post
    Hi,

    Talking about the 74HC14 lets me to another thought. When interfacing the input switches they'll go through the opto's and then to the PP Port. Will it do any good if I put the 7414 between the opto and the PP Port to smooth out the signal and produce real logic levels? I see some round corners in the waveform after the optos when they switch.

    Thanks, Todor
    Round corners suggest insufficient current drive to overcome capacitance somewhere. If the opto is open collector output then I suspect your pull-up resistor is too big and you need a lower value to handle the input capacitance of the PP gate. Putting the Schmitt input driver after the open collector output to drive the PP input will help but its a bit overkill IMHO.

    Reading the previous posts it seems to me people are talking at cross-purposes about both input from the CNC and output to the CNC via optoisolation.

    I concur with Mariss that on the output an opto-LED with a Vf <1.3v returned to a 5v rail may prove problematic. One solution to this I have used in the past is to put a series diode in with the series resistor to increase the offset and bias the LED off.

  18. #18
    Join Date
    May 2006
    Posts
    2420
    Well for what it is worth, here is a schematic of what I meant, for the step/dir signals anyway, this is going on my machine and has been working nicely (so far)

    I also added the schematic for the estop(and limit switch) circuit I am using, the pullup is a 1.5K for the input, the resistor for the output I just worked out using 5V and 15mA current for the opto, about 330 ohm

    Russell.
    Attached Thumbnails Attached Thumbnails Output .jpg   Input.jpg  

  19. #19
    Join Date
    Jul 2008
    Posts
    411
    Quote Originally Posted by epineh View Post
    Well for what it is worth, here is a schematic of what I meant, for the step/dir signals anyway, this is going on my machine and has been working nicely (so far)

    I also added the schematic for the estop(and limit switch) circuit I am using, the pullup is a 1.5K for the input, the resistor for the output I just worked out using 5V and 15mA current for the opto, about 330 ohm

    Russell.
    330 ohm is probably fine, will give 10mA in the ON state and <0.5mA in the OFF state but there is a risk it will not turn off fully at all temperatures as the maximum If specified for guaranteed OFF is 250uA. A better value would be 430ohm, which gives 7.5mA in the ON state and~300uA in the off state but TBH I doubt you'll see the difference in practice.

    For the O/C pull-up I'd go lower. I'd probably not go much above 500ohm to ensure there's enough drive to charge the PP input capacitor and would probably use 330ohm to give a collector current of around 15mA. The test conditions are 2V, 2mA which is a load of 1k (although the spec sheet has a fault, it says 100ohm). Again the value of 1.5k will work, its just not optimal. Incidentally the 817 series are incredibly slow... 4uS rise/fall times, not surprising its 'rounded'. I'd look for a better part TBH, than again do you need a fast switching time assuming the PP is being sampled and not being used as an interrupt/edge trigger.

  20. #20
    Join Date
    May 2006
    Posts
    2420
    Cheers Irving, I am using the 817's for the limit/estop and HCPL2630's for the step/dir signal's, it is a little painful getting parts here (I live miles past woop woop) so I keep the fast opto's where they are needed and use the slower ones where I can.

    I am looking at building a new BOB myself so will take all suggestions on board (no pun intended ) At the moment I have a straight through type and have all optoisolation on the driver cards, it is working but I can refine the whole thing.

    Cheers.

    Russell.

Page 1 of 2 12

Similar Threads

  1. Replies: 0
    Last Post: 12-12-2006, 12:38 PM
  2. New Product, Opto-isolated PWM interface to 0-10v
    By imserv in forum News Announcements
    Replies: 4
    Last Post: 10-30-2006, 05:51 PM
  3. buffered vs Opto Isolated
    By miljnor in forum CNC Machine Related Electronics
    Replies: 26
    Last Post: 02-18-2006, 12:14 AM
  4. 3 Axis Opto Isolated Interface board now up
    By pminmo in forum Open Source Controller Boards
    Replies: 2
    Last Post: 10-06-2005, 11:12 PM
  5. Simple unipolar schematic, opto isolated
    By Konstantin in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 03-31-2004, 12:02 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
  •