Please critique my fault tester circuit

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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:
I have designed this little board which will monitor a 7 conductor cable during a specific stage of production. During this stage, the cable (between 3,000ft & 40,000ft) is having heavy duty steel armor wires wrapped around the outside of it and there is a potential for one or more of these steel armor wires (if the tension is not set properly) to cut into the cables, resulting either in a direct short from conductor to armor wire, a high resistance short from conductor to armor wire (think armor wire compressed almost all the way through conductor insulation) or an open caused by armor wire severing one or more of the conductors. The purpose of this board is to detect any of the above scenarios and shut down the machine so that a repair can be made before it's too late, or so the cable can be scrapped before all the supplies are used up. The armor wire contacts the machine, which is bolted to the ground, so armor wire = chasis ground = earth ground. It is controlled by an arduino microcontroller and has 2 relay outputs; one for the 120V machine run signal, and one for a 120V red/green stack light.


The basic theory of operation is that 1,000v from the DC/DC converter will be sent out on the center conductor, weave back and forth through the rest of the conductors, and return on 2 conductors. the DC/DC converter can only supply 1.5mA, so it should be able to push all 1000V across 666KΩ; any lower resistance and voltage starts to drop off. In the circuit, I have 10MΩ of resistance, (plus 500Ω-5KΩ for the conductor), so that means that theoretically I should be able to start to detect a DC/DC voltage output drop (leakage from conductor to armor wire) around 715KΩ. The voltage recieved back on the 2 conductors is conveyed to the microcontroller via a darlington optocoupler. I am aware that the output of the opto is not linear, but at the specific current resultant of the 20MΩ resistors, it seems to be the "butter zone" and testing has shown that I get a useable analog output from it - doesn't need to be exact. The μcontroller recieves the 2 analog signals (inverted signals) from the opto and compares them to a value from a potentiometer; this value would be the user-set tripwire - if the value of either opto channel is > than the pot value, there is a problem: either there is a short to ground or an open.
So I've drawn up this little schematic which I believe should do the same thing (eagle schematic attached):





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..
 

Attachments

wayneh

Joined Sep 9, 2010
17,496
[*]If the idea is sound.
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.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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.
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.
 

wayneh

Joined Sep 9, 2010
17,496
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...
Cool
I'm basically just trying to make a microcontroller-less version of it.
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.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
Cool
So the "untested" part is just the comparator and gate arrangement? (the transistor and relay part is fine)
Pretty much, and this time I'm putting 12V through the optoisolators instead of 5.

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.
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.

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.
I don't quite follow; are you suggesting that if I reverse the logic, I can get rid of the gate altogether?
 

wayneh

Joined Sep 9, 2010
17,496
...are you suggesting that if I reverse the logic, I can get rid of the gate altogether?
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.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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.
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.
 

wayneh

Joined Sep 9, 2010
17,496
...when current is NOT flowing throught the optocouplers (that is a fault condition)...
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!
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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.

 

Attachments

wayneh

Joined Sep 9, 2010
17,496
Ok, I simulated your idea and it works just like I want. Thanks for that.
Woot! Now let's hope it works. ;)
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?
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.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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.
 

wayneh

Joined Sep 9, 2010
17,496
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.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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:

wayneh

Joined Sep 9, 2010
17,496
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.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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.
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!
 

Thread Starter

strantor

Joined Oct 3, 2010
6,782
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.
 
Top