capacitive distance sensor
ManAtWork
Posts: 2,176
in Propeller 1
I have a capacitive distance sensor that is used for THC (torch height control) for plasma or fuel/oxygen cutting. It consists mainly of a metal ring that is placed around the torch tip and moves a few millimeters above the sheet metal to be cut. The original sensor uses an analogue circuit and is sold for lots of money (~$400). I have the feeling that this could be done cheaper and better theese days, digitally and of course with a propeller.
The metal ring (see picture) has around 50mm inner and 80mm outer diameter. I measured the capacitance against the metal surface with an LCR meter. It's between 30pF when nearly touching the plate and 20pF when held 100mm above it. Of course the relation is highly non-linear but that's not the problem. It could be corrected easily with a lookup table.
I have a few ideas for the measuring principle:
1) RC decay. Because of the low capacitance this would need a very high resistance of >1Mohm to achieve reasonable resolution. I think near a source of lots of ionized particles (smoke from the plasma arc) this is not a good idea.
2a) build an LC oscillator and measure the resonant frequency. This can be done very easily with a counter. However, I don't know what influence the parasitic effects have. The ground plate can't be connected with a short cable as the sensor is moving long distances horizontally.
2b) do the same with an RC oscillator.
3) apply a high frequency signal with fixed amplitude and frequency and measure the AC current. If the frequency is high enough and the signal current is well above the leakage current this should work relativey independent of the ground impedance (length of ground return path). However, small HF AC currents are not easily measured accurately.
I know that capacitive sensors are used in scales with amazingly high precision. This is achieved by measuring differentially. The sensor plate moves between two reference plates, both capacitances are measured and the ratio is calculated. This way all unwanted effects like thermal expansion and drift of component values are cancelled out. In my situation this is not possible. But on the other side I don't need high precision. 0.1mm resolution and 1mm accuracy in the range 1..20mm and 5mm accuracy to 100mm distance would be sufficient.
Anyone who has a different idea or knows a schematic trick that could be helpful?
Of course, protection is important. In the case of a crash the arc (up to 200V and 300A) could hit the ring. The ring can be replaced quickly but the circuit should survive this. The arc current is DC so a T-filter with two high-voltage caps and a gas discharge tube (used for lightning protection) should do the job. The caps are effectively in series with the capacitance to be measured. If they are 1nF or greater their influence can be neglected.
The metal ring (see picture) has around 50mm inner and 80mm outer diameter. I measured the capacitance against the metal surface with an LCR meter. It's between 30pF when nearly touching the plate and 20pF when held 100mm above it. Of course the relation is highly non-linear but that's not the problem. It could be corrected easily with a lookup table.
I have a few ideas for the measuring principle:
1) RC decay. Because of the low capacitance this would need a very high resistance of >1Mohm to achieve reasonable resolution. I think near a source of lots of ionized particles (smoke from the plasma arc) this is not a good idea.
2a) build an LC oscillator and measure the resonant frequency. This can be done very easily with a counter. However, I don't know what influence the parasitic effects have. The ground plate can't be connected with a short cable as the sensor is moving long distances horizontally.
2b) do the same with an RC oscillator.
3) apply a high frequency signal with fixed amplitude and frequency and measure the AC current. If the frequency is high enough and the signal current is well above the leakage current this should work relativey independent of the ground impedance (length of ground return path). However, small HF AC currents are not easily measured accurately.
I know that capacitive sensors are used in scales with amazingly high precision. This is achieved by measuring differentially. The sensor plate moves between two reference plates, both capacitances are measured and the ratio is calculated. This way all unwanted effects like thermal expansion and drift of component values are cancelled out. In my situation this is not possible. But on the other side I don't need high precision. 0.1mm resolution and 1mm accuracy in the range 1..20mm and 5mm accuracy to 100mm distance would be sufficient.
Anyone who has a different idea or knows a schematic trick that could be helpful?
Of course, protection is important. In the case of a crash the arc (up to 200V and 300A) could hit the ring. The ring can be replaced quickly but the circuit should survive this. The arc current is DC so a T-filter with two high-voltage caps and a gas discharge tube (used for lightning protection) should do the job. The caps are effectively in series with the capacitance to be measured. If they are 1nF or greater their influence can be neglected.
Comments
* the cutting arc produces lots of hot air and smoke. Speed of sound changes with temperature and density of the gas.
* to blow out the molten metal in the cutting gap compressed air or even special gases (nitrogen, argon...) are used. Changing "side winds" and turbulences are bad for ultrasonic devices and cause noise in the signal.
* you can't center the measuring spot to the torch tip center unless you'd use a "ring" speaker or multiple sensors around the torch. Then you'd have to use an averaging or voting strategy. That doesn't work well, we already tested that. If you cut near the edge or corner of the sheet metal there's one or two sensors giving false signals or none at all. With the capacitive ring sensor you only get a small deviation.
Noise is definitely a problem. The LC or RC oscillator approach would have the advantage that we could switch to a different "channel" (frequency range) by exchaning the R or L component if one channel is too noisy. Counting many periods (for example a 50..100MHz signal over a 10ms interval) also helps averaging out noise. BTW, an LC oscillator is a narrow bandpass filter by nature. An RC oscillator might be sensitive to overtone ringing depending on the type of circuit used.
Method 3 should also give stable results if a good current measurment startegy is used. A wideband AC current meter would be useless because it would also measure the noise. But a synchronous rectifier locked to the oscillator frequency should cancel out all other frequencies (except for the even overtones). How do we build a good current measurement circuit with narrow passband? This is effectively an AM receiver. I'm not very good in designing HF circuits. Wasn't there an app-note about building radio receivers with the propeller somewhere?
The THC uses a control loop to keep the torch distance constant even if the sheet metal is not perfectly flat or buckles up due to local thermal expansion. The nozzle normally moves a few millimeters above the surface. No higfh accurary is required but it would be good if the tip to workpiece distance could be kept within +/-10%. A sample period of 20ms or faster would be good to get quick response. (20ms translates to 1mm horizontal movement with 3m/min cutting speed).
* the nozzle wears out and the gas flow rate changes,
* the cutting speed can't be kept constant due to slow-down in corners,
* oil, rust or dirt is on the sheet metal surface or
* the electrode wears
the THC needs to be re-adjusted (or deactivated at corners). A THC using a capacitive sensor doesn't have this disadvantages. It measures height inpdependently of the arc and even works when the arc is off (starting height before ignition) or if there's no electrical arc at all (fuel/oxygen or waterjet cutting).
So here is idea #4: Build a capacitive voltage divider out of the C of the sensor and a reference capacitor. Apply a square wave to the divider input and measure the AC voltage (via synchronous rectification) at the divider output. The square wave frequency should be well below the resonant frequency of the parasitic LC circuit, but high enough so that leakage currents don't disturb much. I'll try something between 100kHz and 1MHz. I think with a clever circuit the rectification can be done completely in software so that the input is purely linear and passive. This would avoid accidentally de-modulating RF noise or saturation effects (clipping if noise peaks are outside the DC input range).
http://plasmacut-cnc.de/index.php/home/hoehenregelung
The picture "Gleitring" at the top of the page shows the possible arrangement of multiple sensors. The two videos at the bottom demonstrate how the THC works and how a collision could happen.
There is dross around the cut behind the torch. Small pieces fall out of the material and leave a hole. Medium sized pieces can tilt after being cut out. Please believe me that a contact-less distance sensor is superior to other methods and stop suggesting alternatives. Lets focus on how this could be implemented with a propeller.
A ring shaped sensor has the advantage that it protects the torch. As soon as it touches the workpiece it signals "short circuit = infinite capacitance = zero distance". As consequence, the vertical axis motor moves the torch up as fast as it can. If this is not enough to avoid a collision then the torch mounting frame held by magnets or spring couplings detaches and triggers an emergency stop of the horizontal drives.
With the scope I get a stable signal from 730mV (distance 1mm) to 860mV (100mm). the difference is lower than expected because the input capacitance of the probe dampens the signal.
The second circuit uses a counter of the propeller in feedback mode as sigma-delta A/D converter. I get readings from 170,000 @1mm to 240,000 @100mm. So at least it works. Unfortunately, the output is very noisy even without the plasma arc. I think I have to try out a real ADC.
Would you be opposed to buffering with an instrumentation amp, low pass filtering, then amplifying the output so you have a larger output voltage range? If you put the buffer amp pretty close you might kill a bunch of the common mode noise when the torch is on.
And IMHO an instrumentation amp does not help much in this special situation. The ground level of the sensor capacitance is meters away from the ground of the circuit and a large current (>100A!) flows through the machine base so we have a real awful ground-bounce. But any offset or common-mode noise does not hurt as long as the frequency is not equal to that of the square wave.
We must also be careful that the input amplifier is not saturated by noise spikes. Example: there is a +10V 1µs spike followed by a -5V 2µs spike. They would normally cancel out each other to an average of zero. But if the higher positive spike gets clipped away by input range limitation the resulting average (low pass filtered) output is different from zero. Therefore I'd like to put the passive filter before any input amplifier.
Because of the low sensor capacitance and the high input resistance the whole thing is very sensitive to HF noise. The sigma-delta ADC has the advantage that it virtually has a current input and no voltage input. the two 1nF capacitors form a low pass and are clamped to an almost constant voltage level by the counter feedback.
even think it! That's a harder detection problem than direct imaging of ex-planets I suspect...
An inductive proximity sensor would be more robust, but still probably out-matched by a heavy nearby arc.
Sub-mm radar then suggests itself (does such technology exist even? Unclassified I mean)
My vote is for something like a ceramic spring loaded physical probe or probes. You can get zirconia ball bearing
races these days, high tech material in a low-tech sensor.
Come on! Difficult does not mean impossible. I know that it can be done. Why? As I said in the first post: I own one that works. Anybody who does not believe can buy one here: http://www.agelkom.com.tr/prod02.htm Look at the pictures, watch the videos. And I've been in Turkey personally back in 2005 and saw an earlier version with my own eyes. It works, believe me.
If noone here can help me, I'll do it the hard way, tear that thing apart and reverse engineer it.
I've seen capacitive sensors on the flame cutters. 1500 amp Plasma cutter uses a physical switch to find the initial position, then retracts it and sets Z to maintain constant voltage across the arc. (Underwater)
In a pinch, I made a sensor out of a 556. One side as a free running oscillator (It will work with surprisingly low capacitances if you charge/discharge using a resistor from the output), and the other in the classic 'tachometer' arrangement triggered from the oscillator to give an approximation of 5-8V signal for distance. Don't use the Cmos version, it doesn't work well when operating the capacitor from the output. It can be located on the head to minimize cable capacitance.
Of course, you could just use a 555 and count the frequency also. much more resistant to noise.
I've made some amazing measurements from free running oscillators in a 556. One coupled to the measurement, and one with a reference capacitor running at a frequency somewhat removed from the expected range of measurement (They will 'lock' if frequencies get too close) Count the freqs with the Prop, and compensate for temp etc by the drift of the fixed oscillator.
I have opened the Agelkom sensor. No complicated circuits inside. Only one LM339, several transiostors, voltage regulators and pasive components. There is a coil near the BNC connector that looks like the adjustable filters in older radio receivers.
It's the capacitive voltage divider aproach with synchronous rectification in hardware, this time. The switch is a 74HCT4053. The two outputs go to sigma-delta ADCs implemented with propeller counters with feedback.
Now, I get very stable results with very little noise.
Surely, I'll need some calibration. The capacitance to distance relation is non-linear by nature and there's an offset depending on cable length and mechanical arrangement. I hope there's not much temperature drift as the circuit is differential and any drift phenomenons should affect both channels equally.
I plan to implement some auto-calibration procedure. Maybe something like this: Place the sensor 1mm above the material, press a button. Increase the distance to 10mm, press another button. Repeat for 100mm. The propeller calculates a plynomial interpolation table and stores it in the EEPROM.
Absolute accuracy is not that important as long as the results are repeatable. The optimum cutting distance has to by found experimentally, anyway.
Are you finished this project? Do you have a commercial version?