Find's Treasure Forums

Welcome to Find's Treasure Forums, Guests!

You are viewing this forums as a guest which limits you to read only status.

Only registered members may post stories, questions, classifieds, reply to other posts, contact other members using built in messaging and use many other features found on these forums.

Why not register and join us today? It's free! (We don't share your email addresses with anyone.) We keep email addresses of our users to protect them and others from bad people posting things they shouldn't.

Click here to register!



Need Support Help?

Cannot log in?, click here to have new password emailed to you

Digital PI results

A

Anonymous

Guest
I have the digital PI processor connected to a normal Analog PI board now, and I am starting to get test results.
The diagram below shows how the boards are connected for these tests. The digital PI taps into the analog PI at two points. The output of the analog PI amplifier goes to the digital PI A-D converter. A strobe signal is also needed to tell the digital PI when to sample the signal. A timing signal that goes low when the analog PI integrator gate opens is connected to a Digital PI interrupt line. A few microseconds after the timing signal goes low the Digital PI takes its main sample. One hundred microseconds later the digital PI takes its secondary sample. The secondary sample is subtracted from the main sample and the result is integrated.
When I first turned on the analog PI I found the output of the integrator was hard against one side, and putting a target near the coil did not change the output. The output from the amplifier had part of a sine wave during the coil off-time. This turned out to be from an IB coil sitting on the floor a couple of feet away from the PI coil. The IB coil was not powered but the PI pulses were exciting it and the signal returned from the IB coil was overloading the PI receiver. When I moved the IB coil to the other side of the room that problem went away.
Then the analog PI seemed to be working correctly so I connected the digital PI. The digital PI had a lot more noise at the output of the integrator than the analog PI did. I found about 50 mv of noise coming out of the amplifier that the analog PI was able to cope with but not the Digital PI. I could not get the scope to sync on the noise and could not tell what it was. While I was scratching my head trying to figure it out, my computer display timed out and went blank, and at the same time the noise disappeared. Once I knew what I was looking for I was able to see that the noise was a 50 kHz triangular wave from the display deflection circuits. The analog PI integration window was 20 usec which was almost exactly one period of the display signal so the analog PI was almost completely eliminating this interference. The digital PI was just taking one narrow sample. Sometimes it would catch the peak of the interference waveform and sometimes the trough. This resulted in some large random looking noise at the output of the digital PI integrator. I expected that taking a single A-D sample would give more noise than integrating for 10 or 20 usec, but I did not expect to get hit so hard in the first few minutes of testing. As long as I am careful to blank the display I can continue with testing.
The test conditions are:
Pulse repetition frequency: 5000 Hz
Main delay: 20 usec
Secondary delay: 100 usec after start of main sample
Analog integration window: 20 usec
Digital sample: one A-D sample at each point
I have a windmill type device that swings a target past the coil at a constant rate. The target is moving about one foot per second, and the signal from this moving target is about 250 msec wide. With the outputs of both integrators on a dual trace scope the controls are adjusted so both traces deflect the same amount on average when the target goes by.
The digital PI is doing a two stage integration. It is adding up 160 differential samples to get approximately 30 samples per second (5000/160 = 31.25). Then the low rate samples are digitally filtered with a 3 pole low pass filter. The output of the digital PI integrator has about twice as much noise as the analog integrator. I assume that this is because the analog integrator has a wider sample window. With the computer display on there is a lot more than twice as much noise.
Besides the noise, the output of the analog integrator is much better looking. It is more consistent and smoother. One reason for this is that the digital integrator output is only updated 30 times a second or about 7 times during the width of the target signal. I am not sure at this point if the update rate and extra noise on the digital integrator output account for all of the inconsistency in the target signal or if there is something else going on.
At this stage I am getting approximately what I expected. With single A-D samples the output from the digital PI is worse than the output from the analog PI, but not so much worse that It's hopeless.
I will post additional test results as I try other variations.
Robert
 
Hi Robert,
You are learning fast <IMG SRC="/forums/images/smile.gif" BORDER=0 ALT=":)">. Even now I sometimes get caught out by coils of wire under the bench or search coils of other detectors that are too close. Spent ages once, unsuccessfully trying to damp some ringing, only to find that it was the mains wiring around the laboratory which was connected in a loop.
Computer monitors, TV sets, fluorescent lights especially when about to die, step down transformers in soldering irons, are all prime sources of interference.
In my present workshop, I have to tilt the search coil several degrees off the horizontal to minimise 200kHz interference from a long wave radio transmitter. This however, can be nulled out by a fine adjustment of the frequency control.
Look forward to the next installment.
Eric.
 
The simplified diagrams below show the part of a PI detector I am testing. The output of the amplifier contains the signal in which we are interested plus a lot of noise. The target signal level is high only for a fraction of each pulse period. So the amplifier output is sampled during the time that the target signal is strong. If most of the noise within the sample interval is at a higher frequency than the target signal then the signal to noise ratio can be improved by integrating the samples.
All the integrators in this test are differential integrators. That means that one sample is added into the integrator and a short time later a second sample is subtracted from the integrator. What gets integrated is the difference between the two samples. This eliminates a lot of low frequency noise like power line frequencies and signals due to the earth's magnetic field. It also eliminates certain frequencies above the pulse repetition frequency.
The top diagram is part of the analog PI detector. A low pass filter is used to integrate the samples. This filter could consist of more than one stage, but in this case it is a single stage single pole filter with a time constant of 47 msec.
The second diagram is a digital implementation that is very similar to the analog case. The samples are sent directly into a digital single pole filter with a time constant of 47 msec. I set it up this way to make the digital version as close to the analog as possible for this test. But this is not a very practical digital implementation. The problem is that the sampling frequency is much higher than the signal frequencies in which we are interested. This has a couple of bad consequences. The filter calculations are performed at the sampling frequency. This means that the calculations must either be very simple, or a very powerful processor will be needed. Also when the sample frequency is high more bits are needed in the calculations. This compounds the CPU power problem because not only are there a lot of calculations, but they must be performed on long word lengths. Also the intermediate results of filter calculations must be saved in their long form even if not many bits are needed in the final output. This increases the processor memory requirements. I was able to do this version by using a very simple filter that does not offer any flexibility and is not capable of anything beyond one pole.
The last diagram is a more practical way of implementing high order digital filters. It uses two sampling frequencies, the A-D sample frequency and the filter sample frequency. The A-D samples are resampled to a lower frequency that is closer to the signal frequencies. The filter sample rate has to be at least twice as high as the highest signal frequencies. But it is not a good idea to go much above the signal frequency unless really necessary. In the previous diagram the sample rate was about a thousand times the signal frequency.
The simplest way to resample the signal is to do a straight integration of all the A-D samples in one filter sample period. This means just adding them up. If the A-D sample rate is 5000 per second and you want a filter rate of approximately 30 per second then 5000/30 = 166 A-D samples are added together to produce each filter sample. This is not the best possible way to resample the signal but the better ways require more calculations and we cannot afford to do them at the A-D sample rate.
In this implementation the A-D samples are added up (integrated) for 32 msec to produce each filter sample. These are filtered by a single pole low pass filter with a time constant of 35 msec. This should give approximately the same results as the second diagram.
The advantage of doing it this way is that we are not limited to a single pole filter. Because of the lower filter rate we can afford to use higher order filters.
The results of comparing these three cases on the scope are: The analog integrator is best. This is probably because of the wider sample window. Digital method 1 is next best. The output gets updated at a high rate and gives a smooth output, but it has higher noise than the analog. Digital method 2 is the worst of the three when done with only a single pole filter. This is probably because of the crude resampling method used to get from the A-D sample rate down to the filter sample rate. But it is not a lot worse. And because the filtering is done at a lower rate it will be practical to use higher order filters. Also after the filtering is done it is possible to resample to a higher frequency to smooth the output. I do that for the audio signal, I resample from 30 Hz to 120. But I am not testing that part yet.
After I do enough testing with digital method 2 I may decide to increase the filter sample rate. It will depend on how much CPU time is left over after all the calculations and on whether increasing the rate causes overflow or underflow problems in the filters.
Robert
 
Hi Robert
Great work. A quick question. Is there a Sample/Hold in front of that ADC? Allowing the
input to the ADC to change while conversion is
in progress can generate some strange data. I
have seen that happen many times while working
with 16 bit 1MHz ADC's.
Keep up the good work & waiting for the next report.
Cheers
 
Paul
Yes the Sample and Hold is built into the ADC. It is an Analog Devices MicroConverter ADuC812.
Robert
 
The test conditions are:
Pulse repetition frequency: 8300 Hz
Main delay: 12 usec
Secondary delay: 60 usec after start of main sample
Analog integration window: 12 usec
Digital sample: one A-D sample at each point
This was the highest I could push the frequency before the digital PI output started getting erratic. The CPU may have been 100% busy at this point, I did not check. I just wanted to see how the digital compared to the analog when the analog sample window was narrower. The digital still had about twice as much noise as the analog. This was using the digital method 2 with the 2 stage integration.
Both systems had a higher signal output than at 5000 Hz.
When I finished this test and set the PRF back to 5000 I noticed that the outputs from the digital PI and Analog PI were equally noisy. The analog PI had more noise at the output than it did yesterday. This is probably because I did not return to exactly the same frequency as yesterday. When I tweaked the frequency a little bit the analog output quieted down and the digital PI output did not change noticeably. I probably hit a frequency where the analog PI was picking up some interference. The two systems behave differently because the sample windows are different and the delay from the main sample to the secondary sample are not identical. When I say the delay for both is 100 usec there may actually be a few usec difference between the analog delay and the digital delay.
I can see that when I do tests I will have to vary the frequency a little to make sure I have not hit a particularly bad spot for one of the systems.
Robert
 
Robert,
This is just a guess but it may prove to be part of the noise problem. Try isolating the power supplies from the digital and analog circuits. A seperate power supply or a regulated battery supply can be used. I have had a lot of high gain analog circuits suffer from noise pickup from both A-D converters and MPU's. I would start by running the front end coil amplifier from a couple of batteries and the rest of the circuitry from a bench power supply. That coil amp is most likely providing somewhere close to 60dB of voltage gain!!! Keep up the great pioneering work. I and many others are looking forward to your future postings. Good luck and all the best, Dave. * * *
 
Dave
I have been worried about internally generated noise but I think most of what I am seeing is from external sources. The analog PI board seems to be pretty clean. There are a couple of low power 555's (TLC555) that run off the same -5 as the amp, but I don't see any noise from them yet. Otherwise there are no digital chips hanging on the analog supply.
The only glitch I see is from the strobe signal going to the CPU. That is because of the way I interconnect the two boards. But the A-D sample is taken after that glitch has settled. I will have to be careful though when I take more than one A-D sample at each point.
The microprocessor board has its own supply. The ADC is inside the same chip as the microprocessor but they have separate VDD and GND lines and there is some isolation between the supplies. The digital integrator output looks clean when I disconnect the ADC from the amplifier, so I don't think the digital board is generating much noise.
I may see more sources of noise when I start looking more closely. At this point I am still trying to get a feel for what I have here.
Robert
 
Hello Robert and the forum ,For the noise you must take care first of the design of the circuit board for the first Input op (5534) and experiment with the design pads of the irf 740 , i put symetricals squares pad for source y gate and for drain a fine trace going to the resistor of 2K2 I protect also the input of the 5534 with the positive earth,Anothers designs board i experiment give me more noise ( i cannot tell u why !!!) . Also some IRF 740 are more noisly than other !!! you must solder some shorts pigs and choose the better For the supply of the plus 5 and minus 5 of the 5534 ,a strong decouplage with a pair of 47R and 22uF and a filter of 100uH in the power .Separate 12V supply go to the 740 directly from the regulator (if u use one) and batteries.
Robert thank you very much for your experimentals in digital Pi because for me i am in the analogue 70's ,80's design (iam 55 old) and i learn from you youngers...
saludos a todos.Alex
 
Alex,
Your advice is excellent. The NE5534 and other op-amps are prone to picking up high frequency noise. I use a 47uH choke on both the positive and negative supplies. I also decouple the choke with both 1nF and 10nF capacitors. After the chokes I use a 56 Ohm resistor to the supply pins. Finaly I decouple each supply pin to ground with a 10uF tantalum, a 100nF and a 1nF in parallel.
The PC board must have a lot of ground plane available. Unless care is taken It is very easy to make small ground loops when you lay out the PC board. This can cause anything from major problems down to simply getting less than optimum results. I also add a thin brass shield box made from sheet brass to cover the preamplifier circuit. This really helps when there is RF energy about.
 
Hello Dave , I agree 100% with you all yours comments , I see you push more the decouple than me , and you are right,bravo.
 
The test conditions are:
Pulse repetition frequency: 5000 Hz
Main delay: 20 usec
Analog Secondary delay: 100 usec after start of main sample
Digital Secondary delay: 90 usec after start of main sample
Analog integration window: 20 usec
Digital sample: two A-D samples at each point, 7 usec apart
In this test I take 2 A-D samples at each point and add them together. The samples are separated by about 7 usec.
For a foil target the analog and digital outputs are now similar. That is, the signal to noise ratio in both systems looks about the same. They do not look identical because of differences in the filters, but it is hard to say which one is better.
For a copper penny the analog output is still noticeably better. On the analog system the foil and penny are giving approximately equal size signals. On the digital system the penny is giving a smaller output than the foil. My interpretation of this is that the time constant of the penny is greater than 20 usec and the 20 usec window in the analog PI is producing a better signal to noise ratio than the two A-D samples in the digital PI. But the foil time constant is less than 20 usec, so the analog system is not getting the full benefit of that 20 usec window, and the two A-D samples are just about as good as continuously sampling for 20 usec.
This is my second attempt at taking two samples. The first time I could not notice any significant improvement between one sample and two. But on that try the samples were about 17 usec apart. I then rewrote the code to move the samples closer together.
I also had a problem with the last sample running into the next coil turn on, so I reduced the secondary delay from 100 to 90 usec.
The 20 usec window is still better at rejecting the 50 kHz interference from the CRT monitor than the 2 A-D samples are.
Robert
 
Hi Robert,
You may have already done this, but if you take the penny and position it in the same plane as the coil, then look at the waveform on the output of the NE5534, you can see the decay curve and measure the time constant. The penny may have to be moved off centre and nearer to the coil winding to get sufficient signal. Doing the same with the foil will give you the comparison. Certainly the penny will have the longer time constant. I will measure one today and see what it is.
Eric.
 
I quickly found out that a US penny gives too small a signal to get a good display of the decay curve, even if placed close to the winding. I reverted to a ferrite cored probe which gives a much more concentrated field. With the pulse frequency set to 5kHz, I could not see the end of the decay curve before the next TX pulse started. I dropped the frequency to 2kHz, which gives more time to observe the decay. The total decay time for the penny was 350uS, giving a time constant of about 70uS. A piece of aluminium foil 1in square and 2thou thick, gave a total decay of 50uS, giving a TC of 10uS. Another useful test object is a US nickel, with a total decay of 100uS; TC 20uS.
The conductivity of these objects, measured on a Hocking conductivity meter, is - penny 55.0, foil 2.2, nickel 5.4. Ths is the percentage conductivity relative to pure annealed copper.
Incidentally, with the Goldquest and 11in coil, the foil can be detected at 12in when running at 10uS delay.
Eric.
 
Eric
I cannot make very accurate measurements of the time constants on the scope, but it looks like about 50 usec for the penny and 7 usec for the foil. Given that we are not measuring the same targets, I would say that our numbers agree.
If I extrapolate from the two sample test, I could guess that with 4 samples taken at 7 usec intervals and the same test conditions, the digital results for a penny would be about equal to the analog results. Unfortunately with my current setup I do not think I can take four samples that fast and process them in time.
Robert
 
Hi Robert,
The fact that your measurements are a bit shorter than mine has two explanations. Using a large coil makes it impossible to see the later portion of the decay, as it is buried well into the noise level. With my probe coil I am able to see much further into this late portion. This may well add 10-20uS to the TC of a penny. The other point is that when running at 5kHz, the TX pulse is only 60uS wide. This is a bit too short to properly energise the penny. Ideally, the TX pulse should be 5 x the object TC, or equal to the total decay time. The signal you get from the penny with a short TX pulse is a skin effect signal which has a faster decay that would be the case if a longer pulse were used. Using the probe coil, you can see the decay curve of a penny
 
Eric
I found a third explanation. I lied about the copper penny.
It turns out it is a zinc penny. It has been on there so long I forgot what it was.
Robert
 
The test conditions are:
Pulse repetition frequency: 5000 Hz
Main delay: 20 usec
Analog Secondary delay: 100 usec after start of main sample
Digital Secondary delay: 90 usec after start of main sample
Analog integration window: 20 usec
Digital sample: 4 A-D samples for the main sample, 7, 8, 8 usec apart
2 A-D samples for the secondary sample, 7 usec apart
I cheated a little on this one. I take 4 A-D samples and add them together for the main sample. There is 7 usec between the first two samples and 8 usec between the others, I only take 2 A-D samples and add them together for the secondary sample. Then when I subtract the secondary from the main I subtract twice. This results in more noise than if I took 4 A-D's for the secondary but I am trying not to use too many CPU cycles getting the samples.
The intervals between samples are actually slightly less that 7 and 8 usec so the 4 A-D samples are taken over a window of about 22 usec. This is close to analog window of 20 usec. Also the digital window begins about 4 or 5 usec later than the analog window because of the interrupt response time.
The results are that the digital and analog outputs are now similar to each other for both the foil and penny. After watching them for a while I feel that the analog output is still a little better, but they are close enough for me to claim that it is practical to add A-D samples together and get results that are comparable to the commonly used analog integrators. Though the analog integrator is still doing a better job of rejecting the 50 kHz interference from the display.
I have to add a disclaimer that I should have stated earlier. All the tests I have done so far are with a fairly strong signal. The distance from the coil to the targets is about half the coil diameter. This was so I could get strong enough signals to see them on the scope and be able to make some judgement about their quality. Later when I move the targets farther from the coil I may find that the digital signal dies out suddenly when I run out of resolution while the analog signal declines more gracefully. But I have not gotten that far yet.
Robert
 
Hi Robert,
That would make a difference. I went through a bag of about 100 US pennies from 1970's and 80's and all were reading 50 - 55 on the conductivity meter, except one. This read 28 and was dated 1983. I filed the edge and sure enough it was a silver metal inside.
Eric.
 
The test conditions are:
Pulse repetition frequency: 5000 Hz
Main delay: 20 usec
Analog Secondary delay: 100 usec after start of main sample
Digital Secondary delay: 96 usec after start of main sample
Analog integration window: 20 usec
Digital sample: two A-D samples at each point, 8 usec apart
The diagram below shows the system gains for this test. This is not exactly the same as what I used in the previous tests. I made a couple of changes to simplify the numbers for this test.
The amplifier gain is approximately 450.
The output of the amplifier goes through a voltage divider to the ADC. This divider is to match the +5 to -5 output of the amp to the 0 to 2.5 range of the ADC. This is not how you would do it if you were designing from scratch, this is the bailing wire and chewing gum approach. The gain of the divider is .31.
The ADC has a range of 2.5 volts and 4096 steps (12 bits) which gives a gain of 1.64 steps / mV.
The integrator is adding up 2 samples from each of 160 pulses to get each filter sample. The integrator gain is 320.
The low pass filters have a gain of 1 and are not shown.
The DAC has a range of 5 volts and 4096 steps which gives 1.22 mV per step.
For an example, assume that there is a 2.2 uV signal from the coil. The amplifier gain of 450 gives 2.2 * 450 = 990 uV out of the amp. The divider gives 990 *.31 = 307 uV or .31 mV to the ADC. The ADC gives an output of 0.31 * 1.64 = 0.51. Notice that this is less than the least significant bit. The ADC cannot actually give this output on a single sample, it can only give integer values. But because of noise at the input the ADC values will be jumping around and the average of a lot of samples will be .51. The integrator adds up 320 of these samples giving 0.51 * 320 = 163. That value is sent to the ADC which gives an output of 163 * 1.22 = 199 mV or approximately 200 mV.
This is the output I get from a clad penny at a distance of 8 inches from the 10 inch coil. This is about the smallest signal I can recognize because the noise at the output is about the same size. Most of the noise is about 100 mV but occasionally it goes over 200 mV.
So the current setup has a sensitivity of about 2.2 uV at the coil. The analog PI detector probably has a sensitivity of about 1 uV or maybe even a bit lower. So the analog is at least twice as good.
But an original digital PI design would have some advantages over this test bed. The microprocessor interrupt latency causes some jitter between the coil turn off and the AD samples. This causes some of the noise. In a completely digital design the microprocessor would be controlling both the coil and the sampling and would try to avoid that jitter. The interrupt latency also causes the AD sample to be taken a few usec later than the analog integrator starts. In a new design the samples would be taken when you want them not a few microseconds later.
Also the chip I am using is a little slower than I would like. A faster chip would be able to take more AD samples closer together. I think this would reduce the noise and get the digital performance closer to the analog integrator.
Robert
 
Top