Search This Blog

Sunday, 25 March 2012

Circuit Equation Derivation Consideration

Once a while it is useful to be able to derive the circuit equation, this will ease the design process. Below are some points to consider when performing circuit equation derivation:
1.       If you already know the purpose of circuit, use that info to do the derivation.
2.       Most circuit can be modeled as y = mx +c, so you must define what is desired x (input) and y (output) prior to the actual derivation itself.
3.       Keep all variable names short – to ease your derivation.
4.       Always try to inspect the circuit and equation for opportunity to simplify the equation.
a.       For example, if a group of terms keep repeating itself, use a new term to represent them.
b.      Sometimes it is easier and more intuitive to use current as your parameter.
5.       Acknowledge characteristic of circuit component – such as
a.       Opamp input pins will generally be at the same potential (hence the term “virtual ground” for inverting Opamp with non-inverting pin tied to “Ground”.
b.      Base emitter of BJT will always be a diode drop.

Example circuit equation derivation – level shift and scaling circuit

Generally voltage DAC output will be [0V : +VREF ], where VREF is the reference voltage to the DAC. But sometime you would like to have a bipolar signal out of DAC for your use. In this case, you would need to level shift and scale the signal accordingly. Shown below is a circuit that level shift the DAC output from [0V : +VREF ] to [-VREF : +VREF]

To derive the equation, first is to identify from y = mx + c, y = vout, x = Gdac. In actual application, when you program DAC to half its range, Gdac = 0.5, and the number can be controlled from 0<=Gdac <=1 by changing DAC data input.

Why Divide and Conquer

It is tough break a bunch of sticks that tied together (it is tough to solve all aspect of design requirements one-shot):

But if we divide the bunch of stick to individual stick or smaller bunch of sticks, each stick or small bunch of stick is easier to break than before.

It is always tough to solve complicated circuit without breaking the circuit into manageable blocks. Building and testing of each block by itself and combine them into final solution is the systematic way of solving complicated task. It is called applying "divide and conquer" strategy.

The key is to know how to break the complicated design requirements into manageable pieces – and to do this we need to understanding loading, and to understand concept of output and input impedance of each circuit block. 

Saturday, 24 March 2012

Understand Loading

When deriving Zout_G1 - it is assumed that driving source of block G1 is of low impedance (such as opamp output stage), analysis will be different if this is not the case

Let’s define Gideal = G1*G2, and Gactual is the actual G1, G2 overall gain that factor in inter-stage loading. Then Gerr = 100% * (Gideal - Gactual)/Gideal

From the graph, it can be seen that:
1.       As driving stage (G1 in this case) output impedance becomes much lower than the input impedance of loading stage (G2 in this case), each block becomes more and more independent of each other.
2.       For system design, it is critical to have each block having high input impedance and low output impedance, so that we can design each stage by itself and still be able to cascade them together

Example circuit equation derivation – absolute circuit

1.      Since it is already known that this is absolute circuit – then consider the scenario where input signal is positive and negative.
2.       Let’s label the circuit resistors as Rx (x = 1,2,3…) instead of Rin, Rfeedback…
3.       Assume all diode drop are equal, and opamp input pins are of the same potential.

To determine which diode is on and which is off, consider both being off, then it is obvious that R4, R5 and X1 form a basic inverting amp configuration.
When Vin is positive, then output of X1 will try to go negative, since inverting input of X1 is at 0V potential (virtual ground), then it can be seen that D2 is reversed biased and will be off. Since both R5, R3 has one end at 0V, we can conclude that D1 will turn on.
When vin is negative, X1 output will go positive, and D2 will be on. D1 will be off.

Saturday, 17 March 2012

Tools for circuit design


As someone who is just about to go into the world of circuit designs, it makes sense to know what’s the available tools (free or paid) out there, this allows ones to do his job more efficiently (and less frustrated J). Stated below are what I have personal experienced, however, there are much more out there than what is stated here out.

Programming and automation

There are plenty of free programming software out there, personally (as a windows user) I prefer excel VBA, and here are some good reasons for it

1.  You can always record macros and learn up the syntax of the code to do what you wanted to 

2. There’re plenty of built in functions that comes in handy. 

3. Microsoft Office is almost readily available for most folks 

4. Instrument controls are easy – plus you can create all sorts of controls (buttons, list…) that ease your job 

5. And if you really must implement low level stuffs using C++, you can create dll and use it 

6. It eases data analysis – all the math operations, graph options are readily available

Circuit simulation

Plenty to choose from, just to mention a few (free version):

1. LTSpice from Linear Tech

2. TINA-TI from Texas Instruments

3. Mindi from Microchip (

Things to consider when picking one for you own used are

1. Circuit size limitation

2. Convergence issues

3. Ease of use

Try to understand the simulation types, and knowing when to use them

1. DCOP (DC Operating Point)
    a. Most basics stuffs – good for checking simple mistakes such as wrong connection
    b. Should be used before running other type of simulation

2. Transient
    a. Used to check how fast your circuit gets the right output
    b. How much overshoot, undershoot, pre-shoot

3. AC
    a. Critical for control loop
    b. Allows one to design stable feedback loop.


Every once a while, it is useful to be able to do some mechanical drawing, one of the most convenient , free, easy to use software is Google Sketch up.

Catches of Kelvin or 4 Wires Operation

Let’s face it, there’s no free meal, there are prices to pay if Kelvin or 4 Wires operations were to be used
1.       4 wires operation supplies are generally more costly, you pay more $$$ for this feature.
2.       2 additional wires are needed to sense the voltage
3.       There’s limitation on how much voltage the supply can source, if max voltage it is capable is 15V, and there’s 10V drop across the cables, which means only 5V is available across the load
4.       It works by sensing what is at the voltage across the load and adjust itself – which means it is a feedback control loop, and there’s limitation on how fast it can adjust itself, or how stable it can be. When very fast current transient occurs, capacitor across load is generally required.

Friday, 16 March 2012

Why do we need Kelvin or 4 Wires operation?

In short, that’s because all interconnect has resistance, for sure some amount of voltage will drop across the cables, causing less than desire voltage level at load end.

Why 4 wires or kelvin operation is the solution? See the diagram below, since there’s no voltage drop across the sense wires, the source see what the actual voltage across the load, and can adjust accordingly. 

Friday, 9 March 2012

Why do we have capacitors at IC supply pins - another perspective

Why de-coupling cap?

Before we even try, we need to redo the schematic into some sort of diagram as shown below:
From the diagram it is obvious that there is no way for the amp to force the desired voltage across the load, since the current will need to be from the battery and the connection has series trace inductance!

Where and how does the current flow when the load resistor is being replaced by realistic next stage?

What’s the current loop for a step positive voltage at vin?

The flow:
Note that there’s no ground current involve other than the interconnect of 2 decoupling capacitors. – current does not always flows in ground interconnect

Why do we want to understand the current loop?

Because it allows us to build the physical circuit with the best result, we should always minimize the distance fast current travels – the smaller the loop the better it is. See the difference of the good or bad placement – for the bad placement sometimes it does works, depending on the specification of the circuit.
Bad one:

Good one:

Friday, 2 March 2012

Where and how does the current flow?

All circuit has different current loop, let’s start with something simple such as a voltage buffer circuit shown above. Before we even try, we need to redo the schematic into some sort of diagram as shown below :

Positive pulse at output:

Negative pulse at output:

What is the matter with the Ground symbol? How is it being relate to the actual circuit built?

This is a tough one. The symbol is a must for PSPICE simulation; it is called “Ground” or “Circuit Common”.

It is a confusion that takes me years to get it right. For beginner, just take it as all nodes connected to this symbol being electrically joint up through wires – the trick is to acknowledge that wires are not perfect conductor, they has resistance, inductance…

To give you a feel on how real world’s “Ground” connection like, refer to the schematic diagram below – the black wires are the so called “Ground”, and in diagram below “Star Ground” connection is being used, however, this is usually not the case:

Why is it that in text book circuit analysis the “load” of circuit is always a resistor?

What if in my circuit my next stage is a speaker, or a lamp, or another Opamp circuit?

In short it is to ease the circuit analysis.

The way the circuit was drawn implies that the analysis “assume” that whatever being connected to amp output eventually will not affect the behaviour of the circuit. Actually, the load (in this case, R1) can be anything that demand current within the capability of the amp, and if the load is not, then we just need to insert “something” or "buffer circuit" in between the amp and the load to ensure the behaviour of the circuit remains the same. This is what you would call divide and conquer – analyse/design one stage at one time.