Site description

A blog for electronics professionals, amateurs, hackers, and anyone interested in the world of electronics.

17 May 2011

Precision Current Measurement

Building the Perfect Beast Current Meter

In order to measure resistance (and, for that matter, inductance and capacitance) we need to measure both the voltage across the device, and the current through it. The voltage part is easy, we drive the device at a known voltage derived from a precision source. Measuring current is a little trickier, especially when you are trying to do it with an AC source, as you must for an inductance, capacitance or LCR meter.

The traditional way of measuring current is to introduce a small resistance into the circuit, and measure the voltage across it. Clearly, this voltage offset (sometimes known as burden voltage) is going to change the effective drive voltage, and will be a particularly large offset when the device under test (DUT) is comparatively low resistance.

What we need to do is somehow re-inject this voltage drop back into the circuit, and - hey presto - no more burden voltage to distort readings. We could do this by feeding back the voltage from the current sensor and offsetting the drive level, but there is a much simpler way.

Those of you who have studied electronics at school, college or university may remember the inverting configuration of the op-amp. Feedback is applied to the inverting (-) input, so that it is driven to the same potential as the non-inverting (+) input. This makes it appear that there is a zero-resistance short circuit between the inputs, but it is a very controlled one.

Another name for the inverting input in this configuration is the “virtual ground”, but in practise it can be driven to any level within the op-amp’s spec (largely limited by the power supply rails). This can be very useful, as we can effectively offset the ground potential by applying a voltage to the non-inverting input instead of grounding it.

Fig.1
If we introduce a resistor into the circuit as above, the op-amp will continue to do whatever it takes to make sure both inputs are at the same potential. Thus creating a potential difference across the resistor which is proportional to the current flowing through it. Handily, the DUT still thinks it has a near-zero impedance path to ground. Simply put:

Vout = -Iin * Rfb

Problems and Gotchas

Clearly, the op-amp output has to be able to source and sink sufficient current, and the feedback resistor must be chosen so that the output voltage does not approach the supply rail voltages. Without a custom output drive stage, current is going to be limited to 100mA or so.

Any system with negative feedback has the potential to oscillate, especially if the source is capacitive or inductive and so capable of inducing a phase change. The solution is to add capacitance in parallel with the feedback resistor, but this clearly limits the response bandwidth. Not a problem if the current being measured is DC, but potentially problematic in an AC system such as the LCR meter.

Another less obvious problem is input bias current (Ib). Any op-amp requires a small amount of current to be present at the inputs before the input stage transistors detect a signal. This is normally negligible, in the order of nA or even pA, but this may be an issue in certain ultra-sensitive current meter applications and should be borne in mind. Similarly, op-amp inputs have an offset voltage (Vos) that may be problematic under extreme circumstances.


Transimpedance / Transconductance Amplifier - What's the Difference?

I can never remember which is which, so I had to look it up! Apologies if I get these wrong elsewhere!  

  • A transimpedance amplifier converts an input current to an output voltage.
  • A transconductance amplifier converts an input voltage to an output current.

22 April 2011

PCB Fabrication - DIY or Commercial Services?

(At the time of writing it is Good Friday, so a Biblical start seemed appropriate)

In the beginning...

Was tagstrip and perfboard, which begat Veroboard, and it was good. Then the 1980s came along, and lo! Hobbyists didst discover copper clad and ferric chloride etchant, and there was much rejoicing.

I seem to remember my first printed circuit board used some of my mum's nail polish. Dalo pens then arrived in my toolbox, along with rub-down transfers, and my PCBs got a bit fancier.

I think it was some time around 1990 that I graduated to photo-etch. This meant I could use proper CAD tools and high resolution printed transparencies. An entire new world had suddenly opened up to me! With surface mount devices starting to become popular, it meant that I could lash up relatively quick prototypes without having to post a floppy to a commercial PCB house (even in the late 90s many still didn't use the Internet), wait for them to do whatever they do, and eventually post me the completed board complete with an invoice that would make Bill Gates wince.

Of course, self-made PCBs don't have through-plating (although in most instances there are work-arounds for this) and cannot normally be multi-layer, so that does limit what you can do, but for 1-off prototypes that don't have to be optimised for size and price (and indeed how they look) then self-made PCBs had a lot going for them.

Another decade went by, the 21st century arrived and things moved on again. Eastern Europe and China started to increase their influence and using commercial PCB houses not only became financially viable, but effectively relegated the UV exposure unit and bubble etcher to the store room. Then the world economy fell off a cliff, taking the exchange rates with it. PCB prototyping services once again started to look painfully expensive.

So, the market is changing once again. This time, the concept that is changing things, is that rather than selecting from the 200 dishes available on the restaurant menu, you can have a burger, or a quarter pounder burger. Companies like Itead are starting to fill that huge gap at the bottom of the market . In terms of bangs-per-buck they are great, but there obviously have to be compromises and limitations.

Itead and SeeedStudio charge a fixed fee, for which you get 5x5cm or 10x10cm of dual layer, green solder mask to play with, and you receive 10 PCBs, 5 of which are tested. Personally, I would prefer just 1 tested PCB, but the actual production process costs peanuts, the money goes in set-up costs. It is thought that these companies use spare board capacity on large panels that are already being used for other PCBs. Places like DorkBot create efficiency by waiting until they have enough to make up a big batch run, hence the lack of selection of finishes.

These processes don't have great tolerance (at $20 I wouldn't expect it anyway) and the size limitation can be a problem, but what are the options? Jon Chandler over at Digital-DIY has compiled an excellent run-down of the various PCB suppliers here

Having run my requirements through some of the web sites, there is a bit of a jump between the ultra low budget suppliers and the mainstream. For those times when 10x10cm isn't enough, and a fortnight turnaround is too long, I think I am going to give serious to consideration to dusting off the bubble etch tank and going back to making my own.

Interestingly, Itead are now doing PCBs at 5x15cm and 10x15cm. Sadly, that's just 1cm short of Eurocard size, but nevertheless it is a good amount of PCB real estate.


PCB Houses

SeeedStudio. 
    5x5cm (10 pcs) US$20 +$4 standard postage
    10x10cm (10 pcs) US$40 +$5 standard postage

Itead
    5x5cm (10 pcs) $12
    10x10cm (10 pcs) $28
Also now offering:
    5x15cm (10 pcs) $38
    10x15cm (5 pcs) $48

BatchPCB

Dorkbot

PCB Cart

PCB Fab Express

PCB Geek

12 April 2011

Design for a Precision LCR meter - Part 2 - Design Tweaks

Before I start, I should say a big thanks to Dave Jones and Chris Gammell  for giving this project a shout-out on the excellent AmpHour weekly podcast. It sent my weekly reader stats up by a factor of 10! Cheers guys! 


A number of people have contacted me about the LCR meter project. It is really good to hear from other people and find out what they think and has certainly given me some food for thought. I have been asked if I will be publishing the full schematics and making a PCB available. I will certainly be making the schematics and Gerbers available in a downloadable CAD file (probably Altium format). I may make a small number of prototype PCBs available if there are no bugs. I do not intend to sell any kits or complete products. 

Not Design for Manufacture - Design for Me

It is worth me saying a few words about the general design of the LCR meter. Most designs have a target customer in mind. This might typically be a hobbyist kit constructor or a commercial product manufacturer. In this instance, the target customer is just me. This means that, in the first instance, I am designing around what is cheapest and most effective for myself. I have an FTDI USB module in my spares boxes, along with an AD5933, AD9834 DDS and PIC16LF1518

If I were optimising this for minimum production cost, I would remove the DDS, multiplexers and PIC16. I would swap the controller for a PIC18 or ARM (anything cheap with USB capability and lots of I/O pins) and would replace the multiplexers with nice cheap 2-to-4, 3-to-8 or 4-to-16 logic decoders and MOSFETs acting as switches.  Something along these lines:
 
Fig.1: Alternative inexpensive range select circuit

The DDS would be replaced with a chain of dividers with some more MOSFETs to select the appropriate frequency division ratio. With sufficient free I/O pins, the binary decoders could probably be removed from the design too.

Fig.2: Alternative programmable clock source

The most important thing I would add would be some protection against charged capacitors! I don’t measure big high voltage caps, but you can be sure that there would be users out there who would forget, and then blame me for not protecting their meter (and computer!). I guess I could add passive protection via some zeners on the sense connections, but I am not sure how big these would need to be to cope with a fairly meaty cap discharges whilst still protecting the meter. 

An alternative would be a relay either isolating the meter, or acting as a crowbar across the measurement terminals. Relays do draw a relatively high amount of current though, reducing lifespan on battery powered devices, and can tend to oxidise over time, leading to intermittent contact.

If I were going to the extent of putting a relatively 32-bit ARM controller in there, that would open up the possibility of making it hand held, or at least a standalone portable. As it is, there will be a connector for a standard 4x20 LCD and a keypad, but they are there mostly for debugging. I have no requirement for a portable meter and that add another set of constraints that would push up both the development time and cost.

Range Selection

You may recall from Part 1 that I am using two switched ranges to maximise the LCR meter's measurement range. The first of these controls the voltage across the Device Under Test (DUT), the second range selects the amount of gain generated by the I-V amplifier.

I selected the Analog Devices ADG706 16-channel analogue multiplexer for this task. 16 channels may seem somewhat over the top, but it is nice to have extra space to be able to experiment. I may well be using 10 or so gain settings in the receive amplifier anyway, so a 16 channel switch is ideal.

It is crucial that the multiplexer does not have a high “on” resistance, which would potentially affect the net value of the lowest feedback resistor (possibly as low as 100 Ohms). I have seen multiplexers with an “on” resistance as low as 0.5 Ohms, but these only appear to be 4 channels at best. The ADG706 has a usefully low “on” resistance of 2.5 Ohms which is pretty decent. Channel crosstalk capacitance and resistance figures seem to be sufficient too, but that will need testing to be sure.

Drive Amplifier

As it stands, the AD5933 is only designed to measure down to 1kOhms. At impedances below this, the drive amplifier cannot supply sufficient current. Whilst the AD5933 has a number of pre-set drive ranges, the manufacturer’s data sheet for the AD5933 advises the use of an external amplifier (actually acting as an active attenuator). They suggest using one of the following op-amps: AD8531, AD820, AD8641, AD8627. Comparing data, the AD8531 can drive the most current (+/- 250mA) and has the best capacitance driving ability (100nF @ 300kHz). Happily, it is also the cheapest one suggested.

100nF doesn’t seem a very high maximum capacitance, but in practise we don’t need the amplifier’s full performance. If we consider that a 100nF capacitor at 100kHz has an impedance of just 15.9 Ohms then we should be driving it at a lower peak-to-peak voltage, and at a lower frequency. Both of which greatly improve the chip's ability to drive capacitive loads beyond the headline spec. Although I do want to retain the ability to sweep as high a frequency range as possible, in order to detect potential resonances. This means that rather than driving the DUT at a standard 3V pk-pk we need to be looking at sub-mV level capability.

Stability at high capacitances and various drive frequencies needs to be tested. Unfortunately SPICE simulations aren't great at modelling this sort of thing.

Drive Offset

The AD5933 is a single-supply chip, and so generates a sinusoidal test signal which is biased by a DC offset. Normally this is not a problem as the receive amplifier simply subtracts the same amount. Curiously, the data sheet claims the output offset (for a 3.3V input) to be 1.48V, yet it shows the receive amplifier biasing the remote end of the DUT at  Vdd/2 (1.65V). The recommended drive amplifier circuit also adds Vdd/2 to the existing offset. To confuse matters further, the AD5933 can also be programmed to drive at various pk-pk levels with a different offset. It may be easier to ignore this facility and rely on my own gain and offset control.

The design suggested in the data sheet clearly has the potential to generate a DC bias voltage (1.65V-1.48V=0.17V) which would manifest itself as an unwanted current in any inductor or resistor being measured. This would normally be calibrated out, but as we intend to measure relatively low values (and so generate small stimulus signals), the offset may swamp the intended signal and may generate a dangerously high current in low resistance DUTs. A trim pot would probably suffice if we were just using a fixed gain in the drive amplifier, but there is another possibility:

Programmable DC Bias Correction

Rather than using a fixed offset correction, how about using a small, low resolution DAC to set the null? This allows the unit to self-correct an offset which may drift according to gain and temperature, but it also allows us to superimpose the AC on top of a known DC bias if we so choose. The actual capacitance of many capacitors does change with voltage (many engineers are unaware of this) and it may prove useful to be able to test values with a bias voltage (or current in the case of inductors) even if it is only a modest +/- 1V or less.


Fig.3: Drive Buffer - Programmable AC Gain and DC Offset Trim

The 20 Ohms resistor output on the op-amp output is recommended in the application note. The AD8531 has a low impedance drive and is capable of sourcing and sinking 250mA. Accidentally going beyond this may result in damage, so a current limiting resistor is a sensible addition. It also helps to protect against the user attempting to test a charged capacitor.


Enclosure and Measurement Probes

What I haven’t yet decided is how I am going to connect the devices under test. This will in turn dictate how the meter is housed. A quick way of measuring surface mount devices might be to have a small PCB with a line etched down the middle, and a plastic mask over the top that holds the DUT in the correct position. That really means somehow obtaining a gold plated PCB though, unless I can find something to cannibalise for the job – maybe gold plated connector fingers. It all feels a bit too much like a rough-and-ready hack, which I want to avoid.Through-hole components will be tested via conventional test probes with standard 4mm banana connectors. Most test tweezers have standard banana plugs, which is useful, but I would rather have a hands-free test ability for small capacitances and inductances. Perhaps an external test fixture would be the best way.

That is pretty much where things are at right now. I have started schematic entry, but this new installation of Altium is being a pain. I really need a few hours together to concentrate on this beastie.

As ever, feel free to leave comments, it is always good to hear opinions and good ideas. See you in part three!


11 April 2011

*Sigh* - Work, Employment Agencies and CVs / Resumés - A Little Advice

(Note to non-British English speakers, C.V. = Resumé)

Before I start, part two of the precision LCR meter will be along shortly. It is all written up, but still needs a couple more diagrams drawing. What can I say, the weather here in the UK at the weekend was absolutely glorious; sunny and warm, with all the spring flowers out. After a long and miserable winter I didn't feel like staying inside and doing computer things. Sometimes even the most techy of engineers has to take a step back and spend some time being an analogue human being.

Don't You Just Love Employment Agencies?

Anyway, here we are. Another Monday, another annoying employment agency. Actually no, just the same employment agency, again. To recap, a few weeks ago I received a phone call from an employment agency who had seen my business details in a trade directory (Electronics Yorkshire) and wanted to know if I was recruiting. I said that I was not, as my business consists mostly of me, with the occasional assistance of some trusted hardware and software people that I have known a long time. After hearing this, they couldn't get off the phone quickly enough, but were very polite about it. So far so good.

A couple of days later I received an email from the aforementioned agency, with an attached CV. To be fair, the email did say "If this candidate is not relevant to you, please let me know and I will amend your details" so I emailed them back, explained that I was not recruiting and would they please stop sending me unsolicited personal information. I don't think it is fair on the candidates that their information should be shown to complete strangers, and to people who could potentially be their current employer. Even with basic personal details redacted, it isn't that difficult to tell who they are if they currently work for you.

Just four days later, I got yet another email with the title "AVAILABLE ELECTRONICS ENGINEER" (I do find that titles in all capitals really help, don't you?). Despite redactions, after 30 seconds on Google I had the candidate's name. 4 minutes and I had his address. The power of the Internet is scary sometimes. Unfortunately not powerful enough to supply me with an email address for the engineer concerned or I would have let him know what his agency were doing with his personal information. Would a paper snail mail be over the top? Probably. I think most engineers are cynics anyway, and rarely amazed by what agencies get up to.

Today I received a third CV from them - entitled "Available Embedded Software Engineer". Sounds like they are diversifying, I wonder how long before they are sending CVs from Control Systems and HVAC engineers. Still, "know your enemy" is a useful maxim, and it is always good to see what the competition are offering, so I thought I should have a look at it. I'm glad I did. If these CVs are anything to go by, I am seriously under-valuing my skills. I am also nowhere near as good at spouting bulls**t as I should be. Yes, I can tell this surprises you.

Like most people, I hate writing my CV and am never totally sure what to put in and leave out. There seem to be as many "correct" ways to do it as there are employers. Even so, I was amazed at the quality of this particular CV. Or the lack of it. So amazed that I thought I should blog about it; partly to amuse and partly to show younger engineers and students what they shouldn't be doing.


Writing Your CV - Some Advice.

First things first. Four pages is way too long for a CV. Two or maybe three pages is plenty to get across the bare bones if your history. Details can be given on additional sheets if you need to, or on a password secured web page. This way you can make your relevant details available live, and you can ensure that they are up to date. Any sample documentation or photos of your work is a bonus, but don't put it in your CV.

Get someone to proof-read your CV. 

There will be spelling and grammar mistakes in your CV that your eyes just don't see, just like there are in this blog. If you are dyslexic (and many creative people are), or English is not your native language, then there is no excuse for not getting someone to check it over for you. You would really hope that a good employment agent would check it over too. A CV is a hugely important document which exists to get you an interview and it is representing you as a person, so check your personal statement particularly carefully. For example, do not write the following:

"I am (a) very determined and enthusiastic individual with (a) very clear understanding of my future goals. I would like to peruse (pursue) my career with a company which will give me early responsibility and is committed to staff training. I have a firm believe belief in myself and my abilities to meet any challenge as my career progresses forward."

Sorry about getting all schoolteachery there - the red text and strike-thoughs are my additions. Yes, this is from the CV I was sent today; 6 mistakes in 55 words, half of them in the first sentence. A 31 year old engineer who doesn't know the difference between peruse and pursue, or believe and belief, and is asking for "Between £34,500 and £37,000 (negotiable)". It is hardly surprising though, most agencies don't seem to know the difference between principal and principle. If you don't know why I have corrected "future goals" and "progresses forward" then you should read up on tautologies.

A word about the content: at 31 you are also no longer a fresh graduate, and responsibility at that age is not "early". Good luck finding a company with staff training. Most tech departments now are quite small and don't have any formal training.


It is not what you write that matters, but what you leave out.

Part 1: Experience

This works in two ways. First of all, employers are really not interested in what you did for a few hours once. If you are getting a job based on a small amount of experience then you will get found out quickly anyway. Cut to the chase and tell them what you can do well. Secondly, don't tell them what you are bad at! I'm not going to quote the poor sod's CV here there is no point. Briefly:-

18 lines of "IT/computing and technical skills"  (is there a difference?) of which 4 skills are described as "basic" level. In a list that big, those 4 can comfortably be dropped. Otherwise it drags down your perceived average. What are you good at? I mean really good, not just something you did for a week or so. Being able to wire an RS232c lead is not an outstanding engineering skill.

28 lines of text describing what you did for 3 years at one particular company, many of which are describing the same thing in a different way. I lost the will to live after 5 lines (hey, reader, if you made it this far then well done!) 

The more specialist your skills are, the less you should need to write in your list. Target them at whatever role you are applying for too. If you make your lists hard work then your CV will get binned in no time.

Part 2: Qualifications

What matters most to any employer is what you are now and what you can do. A word to Mr Anonymous-CV-Owner: When I saw the marks for every single chuffing test you have done in 4 years of University (yes, he really did, all 34 of them), I did rather wonder how the University of Bradford managed to award a 2:1.

Now, there are some decent scores in there, mostly in the mid 60s, with a couple in the 80s, but what my brain sees are these:
Radio Transmission and Reception  40%
Signal and Systems Theory 47% 
Financial Management 45%                        
Embedded Systems 45%
Analogue Electronics 1  48%
See where I am going here? You got a 2:1 and my brain is seeing just-scraped-by marks, especially the one in embedded systems - and you are applying for an embedded software job. The thing is, most of us have marks like that! I have never, ever, been asked for my individual test marks. Which is probably a good thing, because I have no idea where they are. So don't tell them! Instead, just say you have a 2:1 B.Eng. Honours. and an M.Sc. If they want details then supply them, but not until then.


The Elephant In The Room

I was once in an interview (oddly enough with a company that was a spinoff of our hero's University) when the interviewer said a surprising thing. He said I should always attach a photograph with my CV. I asked why. In not so many words, he said it was because I was 6ft tall, slim and, quite frankly, white. He didn't say white, but he used many many words to avoid saying so. Ever since then I have declined to add a photograph to my CV. I know this is probably strange coming from an Anglo-Saxon white male in Middle England, but I want to be judged on my abilities not my skin colour.

Our hero lists his under-16 education as a Foundation College in Pakistan. With the best will in the world, that could be the Eton or Harrow of Pakistan and I wouldn't have a clue. However good they are, you can be pretty sure that any employer will not rate it as highly as UK GCSEs, and it is going to be very difficult to verify your marks.With a Masters Degree and experience under your belt, I would only add details of my pre-16 education if I got stunning results in the locally accepted examination system.

Under "Additional Skills, Activities and Interests", he also lists Languages: Urdu and Punjabi (Fluent-native). This does partially explain the standard of English (although not why it wasn't checked), but why include it unless you know it is necessary for the job? Why not list English too? Don't give the person filtering out CVs any excuse to be in any way racist. Don't pretend to be something you aren't, but instead persuade them to concentrate on being able to do the job.

What It All Boils Down To

Remember, when applying for a job, of all the people you come into contact with, only one has the power to say yes. All the rest are there to say no. Give them as few reasons as possible to filter you out.


Oh, Just One More Thing...

If you are an employer or an engineer looking for work in the UK, the name of this agency is Progressive Recruitment, based in Manchester. Use your own judgement as to their standards, just consider that they don't read emails, and that they send out personal CVs to people who haven't requested them.

30 March 2011

The Amp Hour #36 — Big Business Buffoonery

The Amp Hour podcast is essential listening for anyone interested in electronics. Dave Jones, Chris Gammell (and occasional guests) have a chat and a rant about life, the universe and electronics. Well, mainly electronics if I'm being honest. Great entertainment for the drive to work, or something to listen to rather than the bloke at the next desk. Unless you work in Ohio or Sydney, in which case one of them might well be the bloke at the next desk!

Yeah, they might possibly have mentioned my LCR meter project too. Cheers guys!

The Amp Hour

23 March 2011

Design for a Precision LCR meter (AKA: Prospero Gets a Brother) - Part 1

I suppose this project should really be called Antonio as it is the brother of Prospero, but it doesn’t exactly sound right for a piece of test equipment. An appropriate name evades me for the moment. It is probably just as well.

Measuring Inductance, Capacitance and Resistance.
In designing Prospero (the RF vector network analyser) it has come to my attention that the inductance and capacitance measuring equipment currently available to me isn’t exactly precision lab reference grade. A resolution of 1nF isn’t really good enough when you are working at sub-pF level. Upon investigating, it seems that a basic LCR (Inductance, Capacitance, Resistance) meter starts at around £150. If I want to measure the equivalent series resistance (and I do) then I am looking at upwards of £250. Hmm. I don’t really have that sort of money to spend on another meter, so just what is an engineer to do? 

Well, after an amount of thought (somewhat less than a second), I decided that building my own was probably the best way forward. But then you knew that didn’t you! 

So, what architecture? There are plenty of simple embedded micro based meter designs around, but they are all designed around similar methods and are rather limited in range and accuracy. I had specified that the unit be capable of a test frequency of at least 100kHz and most units seem to stop at 10kHz. That inherently reduces the ability to read small value components with a good degree of accuracy. I remembered that a few years ago I was sent a sample of Analog Devices’ AD5933 1MSPS 12-bit Impedance Converter. I had meant to do something with it, but it has certain limitations (which I will go into later) and at that time I was working in a lab which had nice test gear, so the chip got filed away. After a good read through of the data sheet however, I decided the AD5933 would probably take a lot of leg work out of my design and was good enough for my purposes.

Fig.1 AD5933 Impedance Converter - Simplified Block Diagram


Never Satisfied
As I mentioned, the AD5933 isn’t perfect. The 10-bit DAC generates spurious signals outside the desired band (although the LPF filters many of these out in the receive section) it is inherently very poor at measuring low impedance values, and the maximum text frequency is limited to 100kHz. Ideally I would have liked 1, 10 or even 100MHz available to test RF components. So I set to work to design something of my own. The first result is reproduced below.

Fig.2 Improved LCR Meter Design - Block Diagram

The intention was to DDS generate a clean 24-bit sinusoidal signal in software (probably with an ARM Cortex M3) and do the D-A conversion with a fancy hi-fi  chip (they really are absurdly cheap). They can be pushed to well over 200KSPS, giving a precise and clean 100kHz source with only a little filtering. Simultaneous measurement of the current and voltage components is to be done with another 24-bit 200KSPS+ hi-fi ADC chip and streamed into the processor via DMA.

To give flexibility, the output is capable of driving peak-to-peak levels between 0.01V and 10V at up to 10mA, with programmable offset. Voltage is sampled across the test ‘probes’ in a 4-terminal manner, with a set of programmable gains to ensure the best possible use of the ADC’s dynamic range. Current is measured via a transconductance amplifier (again with programmable gain) which produces a voltage proportional to the current through it, but without the ‘burden voltage’ associated with a simple resistor as used in most current measurement.  This is then presented to the second ADC channel. After grabbing a large enough sample, software performs a simple Fourier conversion to the frequency domain. Comparing phase and magnitude gives us our desired parameters.

However…

In one of those moments to which most engineers are prone, I decided that wasn’t enough. I really needed 1/10/100MHz and had 14-bit 400MSPS DDS chips in stock. I could use one signal as a source, and a second (coherent) signal to compare the phase in a mixer, reading the magnitude in an ADC. Excellent.
One slight problem though. What I have actually described there is a network analyser. Basically it is a cut down version of Prospero, limiting at 100MHz instead of 500MHz, and not being able to measure the reflected signal. So what is the point making it when I will have a better tool in my hands before long? None at all! Sigh. I had gone around in a huge circle.

Back To The Beginning!

Anyway, I decided to go back to the start and go with the original AD5933 design. It can be modified to handle low impedance values, and the addition of a cheap external DDS makes the clock scale down to audio frequencies, which is handy for audio components such as loudspeakers etc. As you can see from the diagram below, the current sense gain will be selectable.

Fig.3 LCR Meter Block Diagram - Excluding Low Impedance Adaptor

Control is to be done via a simple PIC16, with connection to the PC via an FTDI USB module. In theory I could probably bit-bang the operation from the FTDI module, but that would probably end up being more expensive and more complex than a cheap and fast PIC16. With an on-board micro, I could build in an LCD and do all the maths on the embedded micro but, to be honest, it isn’t going to move outside the lab, and it is far easier to do more exotic maths on a nice fast PC with a good display. Nevertheless, I will probably provide the appropriate connections to drive a standard LCD text module.

For the moment, it is my intention to derive power from the USB connection. The entire system is low power, with the AD5933 drawing a nominal 10mA at 3V. Dropping from 5V to 3V also gives me the opportunity to provide more precise voltage regulation than USB gives, and also the ability to remove noise on the power lines, both of which improve the accuracy of the system.

In Part 2 I intend to cover the design of the low impedance adaptor, how the current range is selected, and some ideas on how the system accuracy can be improved beyond the 0.5% claimed for the AD5933. Until then, toodlepip!


17 March 2011

The Brotherhood (and Sisterhood) of Engineers

I have an awful lot of updates to write; The designs of Prospero and Miranda (Vector Network Analyser and JTAG programmer respectively) are coming on nicely, and there is a huge amount to say. But I am not going to, at least not yet. There are much more important issues I need to speak about.

Japan. One week on and things are at least starting to be a little clearer, but the media are largely still hysterical and uninformed. Even respected sources such as the BBC, CNN and New York Times are having trouble getting good quality information. For example, the BBC was presenting the loss of coolant in the used fuel storage tank as "current" more than 18 hours after the event. Media outlets are even copying things off each other, ending up with a strange sort of echoing feedback loop. Instead of reporting the known facts, they are falling back on the old method of wheeling in some supposed expert or other, who is then made to hypothesise what may be happening. The Japanese broadcaster NHK is not massively better, but at least seems to have faster access to what facts there are. You can currently stream NHK here via Ustream: http://www.ustream.tv/channel/nhk-world-tv . Their main fault is not displaying a "repeat" caption on video that might be an hour or two old, giving the impression that it is live.

Enough complaining though. I do not propose to cover the horrendous humanitarian situation. Far better people than I have written about it, and anything I could add would be pointless. You have seen the photographs and the news footage, they all speak louder than words.

My first comment is what happened in Tokyo. Or rather, what didn't happen in Tokyo. I don't know for sure what the earthquake measured in the city centre, it would be considerably less than the 9.0 at the epicentre, but still up around the 7.8 level. Beyond what they were theoretically designed to withstand.

If you are an engineer (of whatever discipline) you will know that engineers share that intangible "something". Whether you are in electronics, automotive, structural or civil engineering, we all share the universal foundations of maths and science and a similar outlook on life. The attitude of doing the best you can, going that bit beyond the specification, to make the best possible product, whatever it happens to be. Because you just never know when that little extra can make a big difference.

Quite often, when we do our jobs right, nothing happens. A Formula 1 car crashes backwards into a concrete wall at 150 mph and the driver walks away. The media call it luck, or maybe God's will. What they rarely mention is the truth: Thousands, possibly millions of hours of hard work by clever, educated, experienced engineers. To every single one of the architects, designers, testers and yes, even you bureaucrats who came up with and enforced the Tokyo building regulations, you have my utmost respect. So far as I am aware, nothing happened. No pictures flashed around the globe of skyscrapers that collapsed. No footage of thousands of sobbing bereaved Tokyo people. Other areas weren't so lucky, with fires breaking out and many people losing their lives. Let us hope that in future years that those areas can enjoy nothing happening too. It won't be luck that does that. It won't be God. It will be engineers. Invisible, un-named, unseen. Working hard to make sure nothing happens. That makes me proud.

Events move on however, and all the airtime is now being devoted to the Fukushima Daiichi nuclear plant. I'm not going to say much about nuclear plant engineering. At this time we don't have much information about how things failed and what the mechanims were, so it is difficult to say anything except to ask why they think it is a good idea to build nuclear plants near sea level on the coast facing the Pacific tectonic plate boundary, which has historically experienced powerful earthquakes and tsunamis. I believe nuclear power has a big future in the future low-carbon world, but not if they build fundamental weaknesses into power plants, relying on luck for nothing to happen.

Finally. I don't have many heroes on my list, and there are certainly no overpaid footballers or other sportsmen and women on it. The emergency workers who ran into the World Trade Centre towers when any normal human being would have been running away are certainly on it. Hell yes. I think that list has just acquired some more names; The engineers, technicians and others who are currently battling to stop Fukushima Daiichi nuclear plant becoming a hot Uranium dust emitter. These people must know that their lives are probably going to be severely shortened by what they are having to do. Ladies and gentlemen of Fukushima Daiichi plant number 1, you have my profound respect and admiration. Japanese popular culture has a long history of heroes and superheroes. I suspect they have just found some real superheroes, whose actions will be remembered long into the future.

I salute you all.