High voltage continuity & leakage tester

Discussion in 'The Projects Forum' started by strantor, Jun 11, 2011.

  1. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    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 board is already made and I have tested it on a few diffferent conductors, and it performs perfectly. What I am seeking from the members here is a little proofreading of my circuit & the ideas behind it. I am a novice at best and there's a good chance that I designed this thing insufficiently in one or more areas. As you read, if what I say is incorrect ot my circuit is incorrect, please tell me. On monday I will be demonstrating the operation of the device to the thermoplastics engineers who design the cables that we make to get their blessing to install it; so if you have something to say, please speak now. Thanks

    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.


    Ok, first a couple of pics:
    [​IMG]


    [​IMG]

    I know it's not pretty, but it's functional, and I'm likely the only one who will ever see it from the back side.

    Now the drawing:
    [​IMG]

    And finally, the code:

    Code ( (Unknown Language)):
    1.  
    2. /*
    3. Armor Machine Fault Tester
    4.  
    5.  Reads an 3 analog in puts: 2 optocoupler channels, isolating from 0-1000V, and 1 potentiometer.  
    6.  Also prints the results to the serial monitor.
    7.  
    8.  The circuit:
    9. see drawing
    10.  
    11.  created 11 jan. 2011
    12.  by Charles Staton
    13.  */
    14. const int optoCH1InPin = A2;  // Analog input pin that ch1 of the optocoupler is attached to
    15. const int optoCH2InPin = A1;  // Analog input pin that ch2 of the optocoupler is attached to
    16. const int thresholdpotInPin = A0;  // Analog input pin that the potentiometer is attached to
    17. const int allgood =  3;       //output that will trigger relay for lightstack green light & relay for machine estop contact closure
    18. const int turn1KVon = 2;      // output to relay that will turn on the 1KV DC/DC converte
    19. const int resetbutton = 4;    // reset button, will turn the unit on initially & reset after a fault is detected.
    20. int opto1Value = 0;           // value read from the optocoupler CH1
    21. int opto2Value = 0;           // value read from the optocoupler CH2
    22. int thresholdValue = 0;       // value read from the threshold pot
    23. int leakagedetected = 0;      // Value to store if optocoupler in is higher or lower than threshold value
    24. int readytogo = 0;
    25. int reset = 1;                //  value to store state of reset button (normally closed button)
    26. int startupsequence = 0;
    27. void setup() {
    28.   pinMode(allgood, OUTPUT);
    29.   pinMode(resetbutton, INPUT);
    30.   pinMode(turn1KVon, OUTPUT);
    31.   // initialize serial communications at 9600 bps:
    32.   Serial.begin(9600);
    33. }
    34. void loop() {
    35.   // read the analog in value:
    36.   opto1Value = analogRead(optoCH1InPin);    
    37.   opto2Value = analogRead(optoCH2InPin);  
    38.   thresholdValue = analogRead(thresholdpotInPin);  
    39.   reset = digitalRead(resetbutton);  
    40.   if (reset == 0) {
    41.     startupsequence = 1;
    42.   }
    43.   else {
    44.     startupsequence = 0;
    45.   }
    46.   if (startupsequence == 1) {
    47.     digitalWrite(turn1KVon, HIGH); //turn on the HV and..
    48.     delay(500); //wait half a second for it to charge up
    49.     startupsequence = 0;
    50.     readytogo = 1;
    51.   }
    52. if (readytogo == 1) {
    53.  
    54. //detect leakage. If the voltage on both opto channels are higher than
    55. //the user-set threshold voltage then no leakage tripwire exists. The
    56. //principle is that if an indirect short allows enough current to pass,
    57. //the voltage output of the dc/dc converter will drop.
    58.   if (opto1Value > thresholdValue || opto2Value > thresholdValue ) {
    59.     leakagedetected = 1;
    60.   }
    61.   else {
    62.     leakagedetected = 0;
    63.   }
    64.   if (leakagedetected == 1){
    65.      digitalWrite(allgood, LOW);
    66.      readytogo = 0;
    67.    }
    68.  else{
    69.   digitalWrite(allgood, HIGH);  
    70.  }
    71.  }
    72. else{
    73.   digitalWrite(turn1KVon, LOW);
    74.   digitalWrite(allgood, LOW);
    75. }
    76.  
    If you are still reading, thank you very much for your time and Ilook forward to reading your comments.
     
  2. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Nothing?
    I'm going to demonstrate this in 4 hrs
     
  3. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Ok, demonstration went over very well. Device performed as advertized in front of my audience of engineers.

    There is however time for any suggestions, as it will be a couple of days before I have a chance to install it.

    I guess I am looking for a prediction as to how long the circuit will last as I have designed it. What I am afraid of is that right now it works great, but after a week of running is it going to crater and make me look like an a-hole?
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, the point-to-point wiring on the back of the board looks a bit iffy. You have some rather close tolerances there, and I don't know offhand what's high and what's low voltage, nor do I have time to figure it out.

    When you're dealing with HV on a circuit board, you need to pay attention to how closely things are routed, provide extra separation in HV areas, and it's really good if you can actually have cuts in the board to prevent carbon tracking - if there is no board for carbon to form on, there is not much of a chance for a short circuit.

    You might consider designing a PCB for the project. Once the PCB is assembled and tested, you can use conformal coating rated for high voltage to prevent the accumulation of carbon and/or debris on the board where it could interfere with the operation of the circuit. "Corona Dope" is one kind of HV insulation that is suitable for such applications; around 4kv per mil thickness.

    If your application is just going to be used for the "short haul", then it may not be worth going to the extra trouble. However, if it's going to be in use for a long period of time, it would be worth building in the extra reliability, as "down time" is very expensive.
     
    strantor likes this.
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Sorry I missed your deadline, I only saw this this morning as I was leaving for work.

    OK, so you tie the "drive wire" to the others such that all wires should see the same 1,000 volts. Each side of the sense sees 4 round trips thru the wire. How much resistance does 4 x 40,000 feet give? Is that where the 666K ohms comes from?

    OK, so with no wire in the works the diodes dropping R sees the full 1,000 volts:

    I = 1,000/ 20M = 50 uA

    And with the long wire:

    I = 1,000/ 20.666M = 48 uA

    so the current seems stable and should allow you to detect broken wires.

    What worries me is YOU HAVE 1,000 VOLTS GOING OUT OF THIS THING.

    That is a TON of voltage, enough top fry someone touching something they should not touch, such as a frayed end when there is a problem.

    You have switches for turning off the machine, yet you let this current go on and on, even after a fault is detected, even before you start testing. And you put the 20 M ohms on the "safe" side of the circuit. If they go anywhere it is on the 1,000 volt output, that might be the only thing that keeps some poor guy alive.

    This is a good place to put a ground fault detector! Only currents coming back thru the wires are allowed. Any current coming back thru ground trips this OFF.

    I would add the following:

    1) Relay to shut off the 1,000 volts. Putting a relay before it and after it is not overkill.

    2) move those 20M resistors to the better place.

    3) Add TWO switches to turn it on (you may already have these).

    I do not know your installation. You need to very carefully review it to make sure no fault, either by the operator or by equipment, can allow this lethal voltage to escape from your device.
     
    strantor likes this.
  6. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Sorry about that, see attachment. I don't know what the tolerance is for 1000V or 120V, but I just left as much room as I could. The holes are standard .254.
    Never hear of carbon tracking. I will look into it; maybe I can design it into the PCB that I have in the works. Thanks.

    I currently have a PCB design made in eagle. I tried the toner transfer thing a while back and almost had success. I will be making more of these things if this prototype turns out to work long term; and those will definately be on a PCB.

    [​IMG]
     
  7. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    No worries. I still have a couple of days before I install it. Plus, I will be making another one, so any advise will help.

    4X40,000ft gives between 500-5000Ω depending on the type of cable we run.
    The 666K ohms was what I calculated for the minimum resistance the DC/DC converter can pass 1000V through (1.5mA max output). 1000V/1.5mA = 666KΩ.
    In the code, as soon as a fault is detected, it immediately cuts power to the DC/DC converter. I have found that if there is an open at the far end of the cable, the capacitive charge in the cable itself will continue to feed the unit for a few seconds, so opens at long distances are detected a little late. I don't see a way around this.

    In my mind, I see this whole thing is a ground detector, just functioning opposite of normal ones. it reads the absence of return voltage in the proper place, vise the presence of voltage in the improper place.

    I may design the next one the other way around, as I know I'm not smarter than the guy who designed the normal type.

    It has one, relay "A". I did not put one on the 1KV side because I didn't have one with contacts rated for that. I will plan the next one accordingly.

    What about this: the DC/DC converter only puts out 1.5mA, not enough (going off the magic 4mA number) to kill, but the reel is a giant capacitor, which has no current limiting if there are no resistors between it and ground. If I put too much resistance between a potential fault location and ground, it won't register a fault anymore. How about if I put just enough resistance there to limit a capacitive discharge to 4mA, and leave the rest of the resistance where it is?

    Thank you very much for your insight.
     
  8. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Ok, So I slept on it and realized that this:

    is the answer to this:


    If I redesign the board to detect current flowing back through ground, rather than waiting for the output voltage to drop + capacitive charge in the reel to dissipate, then I can detect a fault in the cable the instant it happens.

    EDIT: Actually, that is how I planned it in the beginning (I have been working on this off-and-on for months) but changed my mind somewhere along the line. I don't remember why, but I had a reason for it.

    This is exactly the kind of food for thought I was looking for. Thank you again very much.
     
    Last edited: Jun 14, 2011
  9. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    I'll echo these statements with the following.

    Any soldered joints at high voltage should be rounded to avoid sharp points. This avoids the danger of HV point discharge which can damage the circuit etc. Such discharge can reach a very long way between metal points at high voltage difference.

    I have attached an extract from your pic to show what I mean, although I too do not know if the joint in question is at high or low voltage.

    go well
     
    strantor likes this.
  10. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    That specific extract is the 0V portion of the circuit, but you point out something that I did not know. Does a point increase the likelihood of an arc, or does increase the range that an arc can travel? - or I guess those 2 are one in the same. For good design, I will round off the points, but just out of curiosity, would covering all the high voltage parts with insulative eopxy or potting negate the effect of the points?
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Carbon tracking can occur around high voltage circuits where there are particulates in the atmosphere. As the carbon track builds up, the resistance of the carbon track decreases, eventually causing a low-resistance path for the current to flow.

    This was quite common in automotive electronic ignition systems back when they had distributor caps; the inside of the cap would accumulate carbon tracks over time, eventually causing ignition misfires; intermittent at first, then soon becoming a regular misfire. This became a big problem in the mid-1970's with GM autos when they came out with the so-named "high energy ignition"; the carbon tracks built up at a much higher rate due to the increased spark plug gap causing a higher secondary voltage on the ignition.

    You might also observe carbon tracking on the circuit boards of very old television sets or tube (valve) amplifiers.

    At 1kv, the tracking may take a long time to form; however you really don't want it to form at all. With the testing you are performing, even minor unplanned current paths could spoil the tests; possibly resulting in scrapped wire assemblies (lots of $$$ lost) until the actual problem can be determined.

    The test procedure should include some sort of verification of board functionality; that it doesn't indicate a short on it's own, but does trip when a known value of resistance is used from the board to ground.

    Once you get your Eagle schematic complete and your board started, you should post them up to get some feedback.
    Posting .png format files in 80dpi to 150 dpi is a must; if you also post your .sch and .brd files, some of us may show you some suggestions using your source files.
     
    Last edited: Jun 14, 2011
    strantor likes this.
  12. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Remember good ole Benjamin Franklin and his lightning rod? Same concept, the point helps "concentrate" the voltage for a discharge.


    Epoxy will insulate very nicely, except it will tend to run off the points. So don't do that! <grin>
     
    strantor likes this.
  13. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    That's how I set the adjustment pot. I put a 1MΩ resistor across the terminals and adjusted the pot until the device tripped. Now it will trip anwhere below 1MΩ. The second test I performed was slowly pinching the insulated wire under test against a grounded armor wire with insulated channel-lock pliers. The device will trip before the insulation is broken, which is what I'm after. These test are very repeatable; I have done them countless times and will do them again after it is installed on the armor machine.
    Will do. Probably not right away, as other work has been piling up as I've been preoccupied with completing this thing.
     
  14. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Both.

    I have dashed off some quick sketches concerning good high voltage practice.

    In general you need to look also at the component side of the board and try to place components so that adjacent leads do not carry HV or are insulated or both.
     
    • HV1.jpg
      HV1.jpg
      File size:
      30.1 KB
      Views:
      31
  15. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    awesome! thanks! I can identify quite a few spots on my board (mainly the low voltage part) that fall under the "bad" category. I had no idea. I will need some more solder practice.
     
  16. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Mods, This device has been in service for almost a year now. It works marvelously, and has proven itself multiple times. It's a pretty niche thing and I doubt it would help anybody but myself, but I would still like it to be represented in the completed projects forum. Post #1 is pretty well documented, and having lost all the data on my hard drive, I will actually be using post #1 as the guide to building 2 more for our other machines. The new models will be built on arduino protoshields, and housed in an arduino enclosure to look more professional.
     
  17. strantor

    Thread Starter AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    proposed parts list for new models:
    [​IMG]
     
    Last edited: Apr 13, 2012
Loading...