Tuesday 3 March 2009

.NET Remote Access Service (RAS) Wrapper Classes in C#. Use C# to access RAS API

I was writing a windows service that needed to access RAS, Dialup, Enumerate connections and create new ones using RASSetEntryProperties and the RASENTRY structure. I had the option of marshalling the calls from C++/CLI I was using but I found this RAS API wrapper
(http://weblogs.asp.net/avnerk/archive/2006/12/13/wrapping-the-ras.aspx)
written in C# by "StrawJackal"which at the time it seemed as if it was making life easier.
Well that changed a while later when it had to be extended to enable me to add new entries. After a lot of effort and corrections made to the previous code due to wrong constant values for RAS I made a more complete version of it which I am happy to share back with everyone,
Download RASWrapper.cs


P.S Thanks to Avner Kashtan (strawjackal) for the original effort and neat coding.

Friday 20 February 2009

CONTROL OF ESD THROUGH THE USE OF MICRO SPARK GAP TECHNOLOGY


ABSTRACT

The control of ESD through the use of micro scale Spark Gap technology was researched for a world leading automotive company. XXX has attempted such an implementation unsuccessfully. Other products for controlling ESD other than Spark Gaps are briefly discussed. Experimental apparatus was constructed and modelled along with the spark gap in P-Spice. Various electrode structures where studied for their breakdown properties along with the failed micro spark gap of X to come up with reasons of failure. FEMLAB an electromagnetic field analysis software package was used to design and analyse spark gap designs. An improved design was developed with a lower breakdown voltage unaffected by PCB manufacturing tolerance problems.

INTRODUCTION

ESD is major cause of failure of semiconductor components. An electrostatic discharge can destroy an IC instantly or it can cause latent defects. The aim is to divert this surge to ground using a cost effective protection device and not for the surge to enter any of the sensitive circuit components. The solution manufactured using current industry standard PCB manufacturing processes. This project was initiated by X electronics who mass-produce and design electronic circuits for major automotive companies globally. X foresees a trend of stringent ESD testing standards, which in order to be met, it will require larger physical size capacitors that cannot fit on their products PCB. Micro scale spark gaps made on the PCB provide a promising solution that has been attempted by X unsuccessfully. A basic spark gap consists of two tracks on a PCB that are insulated by air. The principle of operation is that when the ESD enters the circuit we expect the air across the gap to electrically breakdown and dissipate the energy before the ESD high voltage damages any semiconductor components connected on the same track on the PCB. ESD impulses can reach 25kV but have a very short duration[]. Experimental apparatus was made designed to produce impulse voltages up to 12.5kV in order to research the reasons of the X spark gap failure and the properties of different electrode structures.



THEORY

Spark gap technology involves the electrical break down of a gas used as an insulator; the processes and effects of this phenomenon need to be studied. At a high voltage point Vb the insulating properties of air break and highly conductive phenomena are observed, the current will increase very sharply which can be seen as visible spark that transfers charge between electrodes. The current growth can be described by the Townsend current equation[]. The gas ionization processes are primarily responsible for the breakdown and conduction of gases. These are ionization by collision, photo-ionization and the secondary ionization processes[2].For our purposes we are interested in the prediction of the sparking voltage of air, where the breakdown of air provides a short circuit. Paschen’s law predicts Vs=f(pd) thus Vs is a function of gas pressure and electrode distance in uniform electric fields. He also is stated that there is a minimum sparking potential for each gas and for air it is 327V at 0.567torr-cm. At atmospheric pressure 760torr this minimum voltage is achieved at a distance dmin=0.567/760=7.46μm. The breakdown potential of air can be expressed as [](1)

Where T is temperature(K), p pressure (mmHg or torr) and d= electrode distance. At the distance of minimum PCB feature size d=0.1mm the air will spark at E=85.02kV/cm. Under a voltage impulse, like ESD, the breakdown also depends on the wave front duration of the applied impulse voltage as well as to the rise time of the impulse, as reported by Stekolnikov and Shkilev[]. Also research by Feser[] showed that this variation is also dependent on electrode structure with large variation shown on rod-plane gaps. Since the ESD impulse has a very a small rise time as 3.5ns [] the PCB track to the ESD sensitive IC will act as a transmission line. The shortest path(l=23mm) to from an input pin to an IC on the X product as a transmission line was calculated to have a delay of Td=3.06ns. If spark breakdown time is shorter than this then the impulse energy can be dissipated before it reaches the IC. According to L.H Fisher and B. Bederson[] The spark breakdown time is inversely proportional to the ration of the applied voltage to the Vs except for a statistical time part. Finally electrode material affects the Vs with steel and copper having lower Vs than aluminum.


RESULTS AND DISCUSSION

The breakdown characteristics of electrode configurations: rod-rod, rod-plane, and rod through ring were examined to obtain most suitable structure for our micro spark gap. Over a set distance 2.7mm and pressure (750torr) rod-plane showed a lower sparking potential (6.23kV) than rod-rod (8.6kV) and rod-ring (8.2kV). By pump charging the voltage at the electrodes we found the sparking potential to vary on rod-plane and rod-rod gaps, as reported by Feser[] but this was not so for the rod through ring configuration, which was not studied by Feser. This configuration seemed almost unaffected to the rate of rise. The X spark gaps were then tested and were categorized according to performance as:

Sparking. The spark gap consistently breaks down under impulses. Average Vs=820V

Failing. The spark event occurs on other points on the board, could be multiple. Average Vs=545. Although the spark gap can be identical to a successful one, the circuit track to which it is connected has a structure somewhere that has a lower breakdown voltage.

Malfunctioning. Inconsistent performance where the spark gap falls in either the above categories Sparking or failing. Average Vs=1332V. The voltage rise time affected their performance.

Overused. The gap is sparking but has been overused and it’s characteristics are due to deformation of the electrodes. Average Vs=603V

PO then compared the same structures drawn in an electromagnetic field analysis software package (FEMLAB) and breakdown voltages computed in MATLAB. The Paschen’s predicted breakdown E=85.02kV/cm was not verified at distances of 0.1mm and thus the field was adjusted to 56.8kV/cm since the 820V of the X spark gap was over 0.177mm distance and not 0.1mm. The adjusted value was used for the predictions.

The spark gaps and the misfiring points where studied under a microscope. The main points observed were that: the ground electrode is extremely small and varies in size depending on solder mask alignment. The spark gap distance was big and varied with an average of 1.6λ due to chamfering of the electrode tips by the copper etching fabrication process. The solder mask misalignment had exposed copper at various places, which is better electrode than the HASL finish of the spark gap[]. The areas of the board with the exposed copper are often a minimum feature size apart and thus form a better candidate to spark than the spark gaps. The new design must provide a gap that is as small as possible, to give a low and stable Vs to impulse rise times and be independent of PCB manufacturing tolerance. The estimated breakdown of the new design is Vb=560Vand it is shown on Figure 1. The central square is the input pin and the track around it is ground.

Figure 1, new spark gap design

It avoids the problem of the sharp edges being rounded off by using circular electrodes. Being symmetrical it also solves any misalignment errors and imitates the ring-rod field to minimize variation of Vs due to impulse rise time. If the solder mask slips during fabrication it will expose copper at the corners and make a new better candidate for arcing than the circular electrodes. The spark gap corners areas would then spark, having d=λ gap, instead of some other point on the PCB with exposed copper.

CONCLUSIONS

The PCB fabrication processes have been examined as it was found that the manufacturing tolerances and variations have a major effect on the performance of the spark gaps. The gap distance is the major factor of determining the breakdown voltage. The spark gap needs to have the lowest sparking potential Vs than any other feature on the PCB. The Vs was found to vary proportionally with the rise speed of the impulse and there are indications that the ring-rod configuration is not affected. The rod-plane shows the lowest Vs over fixed distance. This information was used to design a symmetrical spark gap with minimum electrode spacing and safety sparking points that are enabled when the solder mask misaligns. This design will provide a better spark gap unaffected by the fabrication tolerances that can be arranged in an array that will accommodate the 154 pins found on the X product. Xi has been unable to provide a prototype board in time for testing to evaluate the performance of the improved spark gap.


REFERENCES

  1. David W Hutchins,”ESD: Standards or real-world conditions?”,Enviromental Engineering Magazine,2002

  2. J.M Meek J.D Craggs EEE UofL,”Electrical Breakdown of Gases”,1978, John Wiley & Sons

  3. Stekolnikov,I.S and Shkilev,A.V:”Investigation of Negative Spark Mechanisms:”,Soviet Physics – Doklady,8,829,1964.

  4. M.S Naidu,V.Kamaraju,”High Voltage Engineering”,1995,Second Edition,McGraw-Hill




Saturday 5 July 2008

Repairing / Reconstructing the Autohelm Rudder Indicator

A rudder indicator is used on boats to show the angle the boat's steering fin (rudder) is pointing at under water. It uses an analog potentiometer connected on the axle of the rudder to provide a voltage signal to the display unit which shows the angle displacement of the rudder from the centre point.

The representative of the company in Greece told me that there is no replacement part  and that we had to buy a new one made by Raymarine as these analog units made by Autohelm are no longer supported. I found that very disturbing as these units are dear and can be pretty simple.

For that reason I set out on a project to build a low cost circuit that could replace the existing one. I replaced the motor that moves the index on the dial with a tiny servo and the circuit within succesfully. The prototype is now working as required.  If anyone else is interested you can freely contact me for details on how to replace the parts at a low cost and I can even print and make the circuit for you. You can avoid the high replacement cost  with this custom made solution. The  low quality picture on the left shows the unit after it has been re-assembled with the new parts.