Site description

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

31 May 2011

Difficult Calculations

I suspect I was part of the first generation to have been brought up with “pocket” calculators (“pocket” to distinguish them from desktop mechanical calculators the size of a bread bin). I vaguely remember seeing them in my dad’s electronics magazines, sometime around 1979. One Christmas around then, my dad was bought one which has a fluorescent blue/green display which really looked super high-tech, and is still a really pleasing design. Although it was only a classic four-function machine (add, subtract, multiply, divide) I really coveted it, but it was couple of years before I got my own calc. 

Late 1970s Vintage LED Calculator
(Similar to mine)
I remember going to one of the electronics exhibitions that the magazines helped organise – possibly “Breadboard ’79” – where a stall was selling classic red-LED calculators for £2:99. Not only did it have the standard four functions, but a memory too. Wow, that was practically a computer! Other than the 7-segment, 8-digit display, the thing I remember most about it was the clicky keys. Noisy, but really good tactile feedback and, even on a super cheap calculator, it gave a feeling of confidence and precision. The 9V PP3 battery didn’t last more than maybe 10 hours, but it was long enough.

Of course the first thing I did when I got it home was to release the plastic moulded latches (no screws holding the case together) and take it apart. I was disappointed to find it had just one chip, and some convex metallic pads mounted directly on the PCB to act as switches. I felt ripped off that there weren’t half a dozen chips and proper switches, but it was all highly engineered compared with today’s products.

It was maybe a couple of years later, when I had moved up to the “big” school, that I discovered my form teacher had a programmable calculator. Woah! I had read about programmable calculators in magazines like PCW and Computing, and I had seen them locked away in glass cases in Boots in Leeds (for some reason Boots the chemist always had better calculators than the electronics stores of the time) but I had never seen one close up before. From what I remember, I think it must have been a Hewlett Packard HP-67, but I never got to see it again. The teacher had left it on charge at the back of the classroom over lunchtime, and some idiot had switched it off while the teacher was out of the room . She never (probably quite rightly) trusted us again.

Retro Calculator Sexiness
 The HP67 programmable

 Time moved on, and a year or so later I had saved up enough money to buy myself a Casio fx-3600p. Liquid crystal displays had pushed out the power-hungry LED machines, and my trusty Casio looks just like an average calculator you would buy today. Indeed it is only recently that Casio only stopped production of this model. Incredibly, it is still running on the same battery it came with. If I hadn’t experienced it personally, I would have said a 30-year battery life was impossible, but there you are. On the back it quotes “DC 3V 0.00043W”, something modern manufacturers still have trouble approaching today. The fx-3600p is programmable, but with only a 38 step memory and no alpha characters it’s programmability is rather limited to say the least.

As with many kids of the time I had a Casio CA-90 calculator watch (with a built in game that was surprisingly popular with the non-geeks at break times), and then a CFX-20 scientific calculator watch. Geeky? Hell yes. It even has a dot-matrix display which tells you what scientific or conversion function you have selected. Bloody good watch though, and I still have the slightly posher version, the chrome CFX-200. For some reason, I never particularly liked the styling of the CFX-40/CFX-400 which added potentially useful binary, octal and hexadecimal functions, but a cheap looking touch keypad.

1983 Casio CFX-200 Scientific Calculator Watch
(on my hairy wrist.)
Casio's later CFX-400 model with touch keypad.
Note the hex/octal/binary and logic functions.

 Sadly, that was the end of the line as far as calculator watches went. Casio decided to make “memory bank” and TV remote control watches instead. You can still get calculator watches of course, but they don’t even have the abilities I had in my 1983 scientific machine.

It would be remiss of me if I didn't mention at this point, Dave Jones' programmable scientific calculator watch design. I think Dave would be the first to admit it isn't exactly stylish fashion jewellery, but it is a phenomenal bit of work. It even plays a game of chess for goodness sake! Just imagine what Casio or Seiko could do with a bit of willpower and a million dollars or so.




Eventually I did my A-levels and decided that, for Uni, I deserved a better calculator and bought a fearsomely expensive and highly desirable Casio graphing calculator, the fx-7000g. So desirable that it lasted nearly 6 months before being nicked, and I went back to my fx-3600p. In all honesty, the fx-7000g wasn’t a great machine. Sure it did graphs, but then I know what graphs of sine waves, X^2 and so on look like anyway. I did get it to plot Mandelbrot and Julia set fractals, but that took forever, and a 1-bit greyscale can never do them justice. The huge screen just made it look clunky. In hindsight, this is where calculator design started to drive up a blind alley.

Casio fx-7000G Graphing Calculator
 
The temptation didn’t last long though, and a friend of mine had a Hewlett-Packard HP-28C. Properly programmable with a real programming language, small bitmapped display, alpha-numeric keys, hex/octal/binary, arrays, complex numbers and, most importantly, it had proper clicky keys and operated using the mystical Reverse Polish Notation – RPN. The absolute pinnacle of the calculator world. I spent a huge chunk of my first term’s grant on the 28C’s faster and more capacious offspring, the 28S. Thanks to the RPN, people only ever borrowed it once, and it never got stolen. It was worth every penny, HP had a track record of making well engineered calculators for people who use them every day. Calculators for engineers and scientists, not calculators for 14 year olds.

My Hewlett Packard HP-28S and Casio fx-3600P Programmable Calculators
(with obligatory schoolboy humour)


I still have both the fx-3600p and HP-28S, but more importantly though, I still regularly use them. The Casio needs it’s contacts cleaned once a year and the Hewlett Packard is also a pain because it uses three relatively expensive batteries which only last about 2 years.

After HP brought out the HP-28S, the calculator world seemed to go into stasis. Most new models were aimed at the finance market and, as schools and colleges had banned programmable models, I guess there was little incentive to make progress.

In recent years I have looked at the HP-48/49/50 and derivatives, with better displays and progressively larger memory and faster processors, but nothing that really felt like progress. Texas Instruments (TI) have come out with some powerful beasties with all sorts of functions but, again, nothing that really floated my boat. Except…

Someone managed to get Manic Miner running on the TI-89 and 92+. I was seriously tempted at that point. But it was still very limited grey-scale, and looked more like a toy than a serious tool for science and engineering. My fx-3600p and HP-28S may be old, but they look like they were designed to do a job and to work for a living, not like My-First-Mobile-Phone for 4 year olds.


Yes, But What's The Point Of All This?

So, why am I saying all this? I mean, a chunk of life story is all very nice if you are my mother, and a whinge is good for letting off steam (come on, this is a blog) but what is my point? Well, my calculators aren’t getting any younger or more reliable, so I am now reluctantly in the process of looking around for a new one.

Below, you can see a couple of pages from the 1984 edition of the seminal consumer work The 1984 Argos Catalogue (aka the laminated book of dreams). See the selection available? There are seven programmables and many more scientifics. Now – not a single programmable one. These people sell full SLR cameras, iPods, iPhones, iPads, laptops and a million and one mobile phones, but just 8 scientific calculators.

Argos Catalogue 1984 - Calculators


So I looked a little further afield, and went to the manufacturers’ web sites to have a look at their key models.


HP-50G Calculator

With the top of the range model, the HP-50G (pictured above). All these calculators are based on the ARM-9 powered HP-49 architecture and are manufactured on behalf of HP by Chinese company Kinpo. As you might expect, the quality took a nose-dive when HP stopped performing their own R&D and manufacturing, some time around 2003, with various complaints about a lack of key feedback, software bugs, and general build quality. Even Kinpo's web site seems to be bugged and missing pages.

Although they have improved the key feel in recent model revisions, the HP-50G still spurns the traditional (and excellent) shaped buttons which HP used in their earlier models. The up/down/left/right and function buttons also look rather dated in the age of touch screens. Note also how big it is in an adult male's hand. The UK price is a fairly reasonable £90 (new on Ebay, May 2011 price) or £90:34 excluding P&P on Amazon, but it looks too much like a toy to be taken seriously. Sure it has an SD card socket (not SDHC) and infra-red comms, but in these days of Bluetooth and WiFi those features only succeed in making it look even more outdated. A sad end to a noble brand.


TI-83+, TI-84+ (Z80 based)
TI-89 Titanium, TI-92 and Voyage 200 (68000 based)
TI-Nspire series (ARM based): Clickpad, Clickpad+CAS, Touchpad, Touchpad+CAS, CX, CX+CAS


The TI 73/83/84/89 Look very similar to the HP graphing calculators, so it is a fair bet that they are after the same market segment. The TI-89's design is notable in that they seem to have angled the keys closest to the edge, making them look a bit like a mobile phone design from a few years ago.

Texas Instruments
TI-89 Titanium
The TI-92 and Voyage(tm) 200 have an added QWERTY keypad (I can't really call it a keyboard). The effect is that it looks like it has been designed by a committee of 12 year olds who wanted EVERYTHING. NOW. We will hear more from these 12 year olds shortly... Quite honestly, if you can cope with something the size of the Voyage 200, then you should probably be using a netbook.

Texas Instruments TI Voyage 200
"Design - We've heard of it"

And now... (big fanfare)... The TI-Nspire Series. When I heard about the new TI Nspire series of calculators, I got really excited, and that isn't something that happens a lot with me (as you can imagine). ARM processor, full colour high resolution backlit LCD, real time 3D graphing, integrated rechargeable battery, USB, all in a slim case. Brilliant! I thought "This is what the market needs, something to move things into the 21st century, the calculator for the iPhone generation". Then I saw it. Oh mother...


The committee of 12 year olds are now 14 year olds, and they still want EVERYTHING. Except design, style, taste, and usability. The TI Nspire CX is 200x100x27mm. That is over an inch thick and 32 square inches of desk space. I calculate that it is double the volume of my already chunky HP-28S. And besides – look at the thing! Just in case you are under the mistaken impression that it is still pocket calculator sized, here is another view courtesy of TI:


Hang on - didn't TI say this thing was slim? My iPod touch is 8mm thick, this Nspire CX is 27mm. What are you talking about TI? It is very telling that TI is aiming these at the "educational" market. In other words, school children.Great, but what about us people who have left school and are now working for a living? Add to this the reluctance, actually no not reluctance - fear - TI seem to have of independent developers (call them hackers, makers, developers or for that matter simply enthusiastic owners) then I think we can remove all TI products from our virtual list of potential calculators.

Anyone considering playing around with TI calculators should read this: Texas Instruments Learns Nothing, Goes After Hobbyists Again

and this: TI vs. Calculator Hobbyists – AGAIN

TI seem to be in the increasingly large collection of companies which are under the impression that they can control the Internet. This tells me that lawyers are running the company, not engineers.



FX-CG10 (FX-CG20) (new),
FX-9860GII (new), FX-9860GII SD (new),
Casio fx-9860GII SD
FX-9750GII (new), FX-9750G+,
FX-7400G+
CFX-9850GC+
FX-9860G, FX-9860G SD

That's a lot of calculators, and a lot of "number and letter soup". Too much, to be honest. Especially if you add the SD card options. I'm generally not keen on the curvy pseudo-phone look of the case, but at least the FX-9860GII adds -gasp- a backlight! Still, it is only a clunky monochrome screen with the usual set of applications we see elsewhere. I'm pushed to distinguish it from the HP-50G and TI calculators. It probably looks a bit more professional than the TI machines, but only marginally.

Fortunately, Casio appear to be changing direction. Presumably being forced by the appearance of TI's colour screen devices. The PRIZM FX-CG10. Urgh, not only a mis-spelled word, but in capitals too. For added confusion, it will be known as the FX-CG20 in the UK. I guess their marketing guys had to invent more work for themselves.

Casio PRIZM FX-CG10/CG20
Anyway, the FX-CG10/20 at least looks like it belongs in this century. They still seem to feel compelled to make the keys look like something from a mobile phone, and the colour screen is obviously not a touch screen, but it is a good start. No processor type is stated (my guess would be one of the ARM family) and the screen is lower resolution than TI's Nspire uses, but it looks a whole lot more professional. Almost HP-like in fact. Almost.

Will I be buying one though? Hell no. The UK price isn't too bad at £105, but it still doesn't do what I want it to do.

A quarter of a century on from the launch of my HP28S, I think we deserve more. There is no shortage of mathematical horsepower from ARM chips, nor is there a problem with memory prices or displays. Touch screens should be standard, removing the need for function and cursor keys (in this instance, a resistive screen would be better than a capacitive one, allowing the user to enter symbols directly with a stylus) but numbers and core functions should be retained as proper hardware keys with shaped buttons.

Software should be much more along the lines of the commercial heavyweights like Matlab or Mathematica. Wolfram Alpha is an obvious example of what the software should aim to be. I am not suggesting it be an iPod/Pad/Phone though, a calculator still needs to retain the immediate usability of conventional designs, whereby you can just flick a switch, and it is on and ready for use. Of course the real way of making it a killer product would be to open the OS and publish the hooks into the software, and to invite users to add to the available software. Pretty much the opposite to TI's attitude.

Conclusion (Yeah about time too!)

Hewlett-Packard
HP-35S
So, they are all useless? Well, useless is probably putting it a bit strongly, but I am disappointed that calculators haven't evolved more. The processor power available from ARM chips is hardly being used at all.

I am tempted to buy a Hewlett Packard HP-35S. It is made by Kinpo (urgh) and the OS is seriously buggy - to the point that the OS can crash, or erroneous results can be generated. But it looks a much more professional than anything else on the market. Come on Kinpo - sort it out! The HP-35S was brought out to commemorate the 35th anniversary of the original HP-35, but is the logical successor to the recent HP-33S. A calculator whose keys were angled in a V-shape, to look like - you guessed it - a mobile phone. It seems that someone at HP or Kinpo actually realised that professionals don't want their tools to look like a kids toy!

Is it too much to hope that someone might perhaps produce a successor to the superb HP-41 series? This calculator still has a huge amount of following, to the point that a number of emulators are available. Most notably, an emulator for the iPod/iPhone/iPad from Alsoft. Not only does it fully emulate an HP-41CX (including printer) but they have added GNUplot functionality too. Best of all, it is priced at just £15. HP are asking £30 for their HP-35S emulator.

Alsoft's i41CX+

Is this the future for calculators? I hope not. I would miss being able to turn on a physical calculator in a fraction of a second, and to receive direct feedback from the keys. I hope it will alert HP (and TI and Casio) to the untapped potential out there.

I would love to hear from anyone out there who has an opinion on this. I guess I am merely on the fringes of calculator geek-dom, I know there are some real collectors out there who go to extreme measures to get just the right calculator with an early serial number, but to me they are primarily an important tool and it frustrates me that nobody seems to make the right one for me.


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.