Quote of the Day
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.
I recently needed to realize a non-standard resistance value precisely in production. Historically, I have used potentiometers (mechanical or electronic) to trim these precision circuits. Potentiometers are undesirable in production because they tend to be expensive, unreliable, mechanical units that require adjustment accessibility, and they can drift.
While I was researching options, I ran across an interesting approach that uses three resistors to realize any resistance from 10 Ω to 1 MΩ within 0.1 % from a set of 70 standard resistance values plus short and open values.
This approach was developed by W. Stephen Woodward, who is a master of analog design. His original article included software to select the resistors, but I was unable to find that code. I have implemented my own version of the code in both Excel VBA and Mathcad, which I discuss below.
- Brute Force Algorithm
- In computer science, brute-force search or exhaustive search, also known as generate and test, is a very general problem-solving technique that consists of systematically enumerating all possible candidates for the solution and checking whether each candidate satisfies the problem's statement (Source).
- The act of setting a circuit parameter to a specific value by adjusting a component value – usually a resistance. This can be done through a number of means, such as a trim potentiometer, laser trimming, or manual resistor selection from a large stock of values.
- Standard Resistor Values
- Some electronic components (resistors, capacitors, inductors, and Zener diodes) are available from manufacturers in standard values that were determine using the Renard system. The specific values used are referred to as the E-series. For a complete discussion of the E-series of standard component values, see this post.
- Select-In-Test Resistor
- During a calibration activity, a specific resistor value is determined to be required for proper circuit operation. This resistor is then selected from a set of discrete resistors. This approach has the disadvantage of requiring a large set of slightly different resistor values – this is not a practical approach in most cases.
Many analog circuits require calibration. Often, this calibration involves determining a specific resistor value to ensure that a device meets its requirements. While potentiometers are easy to design in, they can be unreliable in practice. Woodward's circuits (Figure 1) allow three discrete resistors with standard values to be used to set a specific resistance within 0.1%. This is impressive – it allows you to have a small set of standard parts satisfy a requirement for a precise, non-standard resistance value.
For those of you that want to experiment with this routine, I have implemented it in Excel and Mathcad (Source). My discussion below will focus on the implementation in Mathcad, but the Excel implementation is similar. The Excel implementation uses VBA, so you will receive security warnings when you open it.
Figure 2 shows some of the utility functions that I used to realize the algorithm.
Brute Force Resistor Selection Algorithm
Figure 3 shows the algorithm that I used to try every resistor combination. It may not be very efficient, but this algorithm does not need to execute often.
Figure 4 shows the results of my limited testing.
This was a good exercise for demonstrating how you can code the same algorithm in both Excel VBA and Mathcad – I thought about using Python, but more electrical engineers use Excel than Python. In any case, I often prototype my algorithms in Mathcad – I find it very easy to experiment in Mathcad.
From a mathematical standpoint, I am not sure how to prove Woodward's claim that you can find a three standard resistor combination to realize any resistor value from 10 Ω to 1 MΩ within 0.1%. I need to think about that for a bit.