Please critique my fault tester circuit

Discussion in 'The Projects Forum' started by strantor, Apr 30, 2012.

  1. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Ok guys, you might remember almost a year ago I built this device for monitoring cables in production. I used an arduino. I am going to be building some more of them, and as I started to get back into the project I realized that it's a pretty simple operation and not much need for a μC.

    To give some background, I'll quote the important parts from last year's post:
    So I've drawn up this little schematic which I believe should do the same thing (eagle schematic attached):

    [​IMG]



    Explanation:
    • Operator holds down the START/CHARGE button until he sees the green light. It takes some time for the wimpy output of the DC/DC converter to charge the big capacitance of the cable.
    • As the voltage on the cable increases (charging the capacitance), the voltage at the + input of the comparators drops. When it drops below the threshold set by the pot both of the comparators should go high.
    • Because of the AND gate, when both comparators go high, the 4PDT relay should switch.
    • When the relay switches, is when the operator sees the green light, and then the relay bypasses the push button and the operator can let it go.
    • It should stay in this mode until there is a fault, at which one or both of the comparators will go low, and the relay will drop out.
    Things I'm not sure of:
    • Whether I got the comparators hooked up right.
    • What kind of caps I need to use & where.
    • If the HCPL-4731-300E optocoupler will function in the same "butter zone" with 12V as it did with 5V.
    • what comparator to use
    • what AND gate to use
    • If the idea is sound.
    Thanks

    EDIT: Failed to mention, the comparator, the Optocouplers, the AND gate, and DC/DC converter were just picked at random from Eagle. I don't know what to use there. The DC/DC coverter will be a HITEK GMA, I already have on order, but it was not in the eagle library, and the optocoupler will be a Avago HCPL-4731-300E but was not in eagle..
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    IMHO this is the forest, which may be obscured by the trees, by all the other details. Your cables must have specifications related to what you're looking for, using some other methods? Whenever you develop a new analytical method, you need to do a statistical analysis of how well it identifies the flaws you're looking for. You need to know the rates of false positives and false negatives. It helps to have known good and known bad samples laying around for testing.

    I sort of understand your circuit design and how it works, but I have no idea how well it might work in the field, to actually do the job it was designed for. The effect of cable capacitance worries me a little. What happens if the weather changes, and maybe you have static or ambient potential differences floating around? I guess I'd feel a little better if you were actually measuring resistance to be below some threshold.
     
  3. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    The previous arduino device works perfectly. It has been in service for almost a year and never had any false faults, and has caught all the real faults so far.. I'm basically just trying to make a microcontroller-less version of it.

    The object is not measurement, so strict accuracy is not needed. We are testing for opens, shorts to ground, and conductor insulation damage. At this stage, all the conductors have already been QA'd and meet the specs. We want to know if anything happens to these already verified conductors as they are having steel armor wrapped around them. To do this, I'm monitoring continuity by sending 1000V through all 7 conductors and then receiving it; 1000V is a little high for a continuity test, but I chose that level so that I can monitor for insulation damage simultaneously. If one of the steel armor wires starts to pinch into the insulation, there will be current leakage to ground, which will pull down the voltage output of my feeble 1KV DC/DC converter, below a threshold set by the potentiometer, which will trigger a fault the same way an open would.
    On the arduino version I did several such pinching & smashing tests. With channel-lock pilers, in vices, etc. The device would trigger on the leakage current before insultion had been completely severed and a direct short occurred.
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    Cool
    So the "untested" part is just the comparator and gate arrangement? (the transistor and relay part is fine)

    Looking a bit more closely at that part, I see there are no pull-ups on the comparator outputs, which float open when "high". They are only pulled to ground when "low". I'm not familiar with the gate and some consideration must be made for what it needs.

    You know, you might just consider changing the logic of the comparators so that you can "OR" them together. A low condition on either one then pulls the ORed output low and the output only goes high when both are high.
     
  5. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Pretty much, and this time I'm putting 12V through the optoisolators instead of 5.

    Should I just be using plain-'ol opamps instead of comparators that have a output transistor? I'm pretty weak in this area, and I have no idea about that comparator I selected in Eagle, it was just a random pick. Same with the gate.

    I don't quite follow; are you suggesting that if I reverse the logic, I can get rid of the gate altogether?
     
  6. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    Yes, I don't see the need for another device there. And I think the comparator is a better choice than an op-amp, just because a comparator is a purpose-built device for exactly this chore. Take a look at the LM393 datasheet, the TI version shows ORing of outputs (nothing more than connecting them together with a single pull-up resistor), and almost any comparator datasheet will show a variety of standard comparator configurations.
     
    strantor likes this.
  7. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    OK, I'm totally eating my shorts over this simple circuit. I found the drawing in the datasheet that you referred to, but before I can digest what you are telling me, I want to make sure that the circuit I designed operates the way I think it does - If I'm going off an incorrect understanding, I'll not understand anything that builds off of it.

    In my drawing, when current is NOT flowing throught the optocouplers (that is a fault condition), the "+" inputs to the comparators are HIGH (higher than the setpoint pot level on the "-" input). This makes the comparators' outputs LOW. When current IS flowing through the optos, the inputs to the comparators is LOW (lower than the setpoint pot level on the "-" input), so the outputs are HIGH. When both the outputs are HIGH, the ANDgate is HIGH and the transistor switches. I'm doubting myself about all this now, especially since you reminded me about the comparator output transistor and pullup for that, and I'm thinking I might already be backwards.
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    OK, let me just review. No current in the cable under test means fault, means no light on in the optocoupler, and then R2 or R3 pulls up the comparator input. Current in the cable turns on the light, sensing transistor impedance drops and so does the input voltage to comparator. Sound right?

    You want the relay energized when there is NO fault, is that right?

    So we want the output of the comparators high, and thus Q1 on, until a fault comes along.

    Working backwards, you want the comparator to go low for a fault. That way, the ORed output of both comparators goes low if either of them goes low individually.

    Output low when input is high means we need to use the inverting input, opposite to the drawing you first posted.

    Mind you, I just had a nice cocktail and this plus/minus stuff gets pretty challenging!
     
    strantor likes this.
  9. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    I trust you after a cocktail more I trust myself after a good night of sleep..
    Thank you sir. I believe it is time to move to the breadboard for some proof of concept. tomorrow.
     
  10. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Ok, I simulated your idea and it works just like I want. Thanks for that. I am starting to build it now, using a NTE834 comparator because that's the only one I have on hand. Do you think that will work?

    Here's the sim (attached); I had to up the 1KV P/S current capacity and lower the resistance by a factor of 1000 in order to make the optos turn on, but that won't be a problem for my optos in real life.

    [​IMG]
     
  11. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    Woot! Now let's hope it works. ;)
    I don't see why not - it looks like a "standard" comparator and probably a bit better than the LM339.

    You need to do something with the inputs of the unused comparators so they don't oscillate. I forget the recommended procedure. Both to ground, one to ground, the other to Vcc, it's something like that. Probably in the datasheet somewhere.
     
    strantor likes this.
  12. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    I had one more question; I made a new thread for it.

    Thanks for all your help.
     
  13. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    I don't need R7 do i? It's the transistor base resistor I'm used to putting it into circuits, but this circuit already has 3Kohms of pullup resistance.
     
  14. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    True. The only function of R7 would be to limit current in the event of Q1 failing to a short from E to B. But even then you've got R9. Not too sure how likely such a failure might be. Bottom line, I'd omit it.
     
    strantor likes this.
  15. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    I've got this thing all soldered up (skipped breadboard phase) and it's not working. I've verified that I'm getting the proper inputs to the comparator, but the output is not changing. I can make + greater than - or I can make - greater than + (on both channels), and the output stays high (by 'high', I mean the position where it is sinking current away from my transistor for the relay).

    Another odd thing, is that when I change the value of the setpoint pot, the values from the opto change. These should be constant I thought, proportional to the current through the opto's LED.

    EDIT: I didn't do anything with the unused inputs & outputs as you suggested - there was nothing in the datasheet about it. Could that be the problem?

    Also I have no decoupling/bypass caps. maybe that's it? I thought it would work without them, if not just poor performance.
     
    Last edited: May 2, 2012
  16. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    Having the setpoint affect the optos is very odd, it just shouldn't happen. And of course the other problems are odd also. Maybe a picture? I doubt the bypass caps are the problem. That's more an issue right at the comparator transition point, when "chatter" can be a problem.
     
  17. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,810
    834
    In my circuits, I use the following, from Maxim's page.

    [​IMG]
     
    strantor likes this.
  18. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    I read this post at home last night, where I had a camera but my circuit was at work. Now I'm at work with the circuit, but my camera is at home. DOH! You don't want to see my soldering handywork anyways :)

    I've been thinking, and the only way I can see the pot changing the voltage on the opto outputs is if the comparator were blown, and somehow making a (> 0Ω) connection between the 2 inputs. I'm starting over on a new board now, and using 2 LM311's that I have. Hopefully I don't blow those up, or I'll have to go get more parts!
     
  19. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    A breadboard build wouldn't hurt. ;)
     
    strantor likes this.
  20. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Ok, my LM311s worked great. Circuit performs more or less the way it should, but I'm getting oscillations (relay chatter) when I move the PCB. It's preventing me from tuning & testing it. Some decoupling/bypass caps should fix that I hope.
     
Loading...