Search This Blog

Showing posts with label design consideration. Show all posts
Showing posts with label design consideration. Show all posts

Monday, 7 October 2013

About AC-DC Adaptor–Heavier is better

So i heard from a long time ago – when choosing a AC-DC adaptor – heavier is better. Really?

For a circuit guy – like myself – I think what the saying is really trying to tell you that AC-DC adaptor with transformer built in is better. For this I can’t agree more... from low level signal perspective.

For a +5V AC adaptor without transformer – each and every node inside the adaptor circuit is considered “LIVE” which means it is dangerous – the AC outlet voltage 230V for example is directly switched by silicon IC, and filtered to give a output of +5V. See schematic below:
image
(picture from some online forum.. sorry that can’t remember where I got it exactly, been with me for some time)

For a +5V AC adaptor with transformer – generally the transformer will scale down the line voltage to much managed able 12VAC or so, before passing it through bridge rectifier to and further drop down to +5V. So the secondary side of the transformer is not “LIVE” and much safer to mess around. Note that since the switching is done at much lower voltage level – the electrical noise will be much less. As shown below:
image

There are considerations on which is better – costing, how “clean” it is..., eventually it is up to the application and individuals to decide. For me, when I build something that requires mV or nA level of accuracy – those with transformer are definitely my choice of adaptor. Other than that, it does not bother me much.

I guess at the end of the day, knowing the fundamental of different AC adaptors allow an engineer to decide what is good enough for the application, and this especially important when dealing with low level analogue signals.

Sunday, 26 May 2013

The Catches: Voltage follower that rings

In my first year doing circuit design – I was evaluating a circuit that contains a voltage follower op-amp – something that I didn’t quite happy with is the amount of overshoot on the step input. Digging through all the information – I found out that not op-amp are suitable for being a voltage follower. And in fact – for a voltage feedback op-amp to be used as voltage follower – it will state “unity gain stable” in the datasheet.
image
 
image
 
Lesson learnt –
There are certain amp that are not meant to be unity gain stable – mainly for fast response – read the datasheet before using them.





Saturday, 11 May 2013

The Catches: My first encounter with Current Feedback Op-Amp

So to say, I was evaluating a circuit given in manufacturer’s reference circuit, being young and naïve (ignorant too), I just get the parts and put it in together – most of the time the circuit works – but when debugging one particular non-working circuit – something was not working accordingly.
So it was the time that I look at the datasheet of that amp – and found out that it was current feedback op-amp – not the assumed typical voltage amp – it turns out to be that current feedback op-amp are generally faster – and the behaviour differs as well.
for more details refer to wiki:
http://en.wikipedia.org/wiki/Current-feedback_operational_amplifier
Lesson Learnt:
Textbook op-amp circuit is generally voltage feedback op-amp – and there are much more in the market then what offered in text book.




Saturday, 12 January 2013

Wolverine versus Real Life Capacitor

If you watch X-Men comics or movies, you know that Wolverine self heals, its his power. Believe it or not, some real life capacitor types also selfheal (if the damage is not too serious) – now is that amazing or what?
read more about this fantastic characteristic on links below:
http://en.wikipedia.org/wiki/Types_of_capacitor
http://www.ehow.com/list_7686462_self-healing-properties-capacitors.html
Marvelwolverine.jpg
picture from http://en.wikipedia.org/wiki/Wolverine_(comics)

Saturday, 29 December 2012

Inductor Voltage Rating

Have you ever wonder that when you read through datasheet for inductors, you rarely see the voltage rating?
Shown in picture below are some common inductors seen.
image
The fact is, inductor does have voltage rating, the winding wire have a fix thickness of insulation coating, if high enough voltage is applied across the inductor, although momentary and the current is within the specification limit, the insulation will breakdown and short to adjacent wire. From personal experience, normally inductor voltage is about 60V, unless specifically stated in datasheet. Maximum voltage allowed is usually depends on insulation thickness of wire used, and whether the windings overlap.
If you does wonder whether your inductor has insulation breakdown, the easiest way is to measure DC resistance, depending of actual short, the resistance will be a lot or somewhat lower than a good one. Alternately, if you have a LCR meter, you can use it to measure the inductance instead, in this case, expect faulty inductor to have lower inductance (less winding over the magnetic core).



Friday, 5 October 2012

Getting to know simulation - Part11 - Monte Carlo


To best illustrate the usefulness of the monte-carlo simulation, let’s use a voltage divider as example.
Run Transient simulation and get:
So this is a perfect voltage divider. But we all knows that resistor has tolerance, let’s say each of R1, R2 has 1% tolerance. We should factor this in by running Monte Carlo simulation and see what are we dealing with.
Enter 1% as the resistor tolerance.
Tick “Enable multi-step” to enable Monte-Carlo analysis


Set number of runs to 100
Re-run the transient simulation to see gain statistic of  divider made of 2 pieces of 1% resistor.
With resistor tolerance of 1%, the voltage divider will give an error of ~-0.9% to ~+1%. Use of Monte-Carlo simulation will ease such analysis. If your application cannot tolerate such variance, then resistors with better tolerance are needed.

Friday, 28 September 2012

Getting to know simulation - Part10 - Multi-Step



So continue from previous session, inserting C2 1nF to kill oscillation gives you the stability but make your buffer damn slow. You can try out few value to see the optimum C2 value for highest speed and still gives you the best stability, instead of manually change the values and re-run Transient Simulation, there is something called “Multi-Step” analysis that let you sweep any parameter and plot the result.


1. Open up analysis and tick “Enable multi-step”
      2. Click “Define…” button and key in the  info as below:
3.  Run the simulation and you get the plot shown – looking at 1pF, 10pF, 100pF, 1nF you see that the best capacitance value for performance is at 10pF. And now you have a complete buffer design for the application stated in Part1 :) . 

Saturday, 22 September 2012

Getting to know simulation - Part9 - Fixing oscillation

  
1.       There are plenty of ways to resolve this, one way is to add a capacitor in parallel with feedback resistor R2. Let’s do this in the schematic and re-do the AC simulation. At this point of time, the value of C2 is arbitrary chosen to be 1nF, we will talk more about this in next session – any way the latest schematic becomes:  
2.       Re-do the simulation for AC with simulation frequency up to 10MHz to see the new closure- you can see now that the rate of closure becomes 20dB / decade – indicating stability has achieved, let’s modify the schematic to re-do the transient
3.       To look at the end result of the fix in time domain, insert 1nF for the transient simulation file:



4.       Re-run of transient simulation shows that so we have solved the problem of oscillation – but the problem is that the output of the buffer takes 4ms to settle to the right value – too slow for our liking – this we will try to solve in next session.

Friday, 14 September 2012

Getting to know simulation - Part8 - Arranging bode plot for AC analysis

1.       The best way to do AC stability analysis to plot Aforw vs 1/beta, plot of 1/beta essentially is the inversion of the beta gain – which is input/output instead of output/input – so let’s reverse the bode plot  and rename the block as shown
2.       So now you can see that the 40dB per decade closure of Aforw and 1/beta is the cause for oscillation


Friday, 7 September 2012

Getting to know simulation - Part7 - Bode Plot from a buffer circuit (that oscillate)





Continue from last post, to solve the problem, we need to acknowledge that the buffer circuit is in fact a feedback loop
To identify which components belong to with block – refer to the blog
Let’s modify the schematic to perform bode plot analysis
1.       Ground non-inverting input – since op-amp input is already high impedance – any voltage source with series resistance is pretty much behaving just like a pure voltage source – for DC voltage source, it is always a AC ground.
2.       Place large inductor, infinite AC coupling capacitor and AC source, configure the AC source as below:
3.       Choose AC analysis:
4.       Your schematic should becomes:
5.       After simulation, you get
6.       But, how to interpret the plot?

Sunday, 2 September 2012

Getting to know simulation - Part6 - Practical circuit consideration

Continue from last simulation done in Part5, the simulation result shows that the circuit is too ideal – in practical PCB, there will be about 10pF of capacitance from op amp input pin to GND, let’s insert this capacitance as below:

Re-run the transient and get:

In this case, we caught the potential issue - oscillation – as to solve it, let’s do it in the next posts.

Saturday, 25 August 2012

Getting to know simulation - Part5 - Transient Simulation

So far so good for DC, but we still need to know the characteristic for fast changing sensor output – what’s the waveform going to be. Let us replace Vsensor from DC 1V to Step 1V by double click on the source and configure the output to be 1V Step voltage with 2ms delay:

To ease subsequent examples about simulation, change some of the op amp settings by double click on it, change as below:


  
To plot the waveform, insert a probe at the output of buffer (short cut “B”)



Then choose Transient analysis:
And you would get nice waveform as shown below:

So far so good - but is it too good to be true?

Getting to know simulation - Part4 - insert basic buffer amplifier


To continue from previous post, let’s modify the circuit above as below
1.       Insert a parameterised opamp from menu Place –> Analog Functions ->  Parameterised Opamp
2.       Insert a +/-15V DC supplies from menu Place –> Voltage Sources ->  Power Supply
3.       Insert off-page connectors from menu Place -> Connection -> Terminal
4.       Wire up the opamp as x2 buffer amp using 1Meg Ohm resistors (so that 1V full scale sensor output will translate to 2V full scale ADC input). Route the circuit accordingly, re-run DCOP simulation and you get:
Now with the buffer – we get pretty good DC result – 1V sensor translated into ~2V adc input. For now, don’t concern yourself with the ~20mV error (2V – 1.97997V), we will cover this some other time.

Saturday, 18 August 2012

Getting to know simulation - Part3 - using DCOP

Let’s look at the reason we need to design the buffer. If we direct connect the sensor to adc input –
We will have 1V * 1k/(100k + 1k) ~= 10mV only, clearly this is not acceptable. Note that in Mindi, instead of using R1, R2 ... you can right click on component and change its name, in this case Radc is the name chosen to represent the ADC.

To simulate – all spice required “Ground” symbol for reference, so let’s insert one as below, double click on V1 and rename it to Vsensor, and change name of R1 to Rout.
We want to know the voltage at ADC input, so place voltage marker on the interconnect node for Rout, Radc to see the voltage



Schematic after placing marker:
Then choose simulation mode to be DCOP
And click “Run”


Now you see the need for buffer circuit. DCOP is the first thing that I recommend for any simulation, since it let you see the DC biasing in the schematic itself  – especially when the circuit is much more complicated than this. You can place as many markers as required.

Getting to know simulation - Part2 - Modeling


Let’s get started by modeling the blocks in schematic – knowing how to model is critical – else it will be GIGO (Garbage-In-Garbage-Out).

1.       Modeling of the sensor to ease design process – if you look at sensors such as microphone, transducer, you would find that most of them if not all do not have “Low output impedance”, which means, you cannot use a voltage source to model it. So let’s model our sensor as below, the values of R1, R2 is not important, which will become clear at this end of the series: in this case, output of the sensor is 1V.
2.       As for the ADC,  to ease design process let’s use a 1kOhm resistor to represent it – it is the load of the buffer circuit, at the end of the series, you will know why this is good enough

Getting to know simulation - Part1 – Introduction

Getting to know simulation - Part1 – Introduction

In circuit design - simulation tools will ease your life a lot - if you know what you are doing. As such I am writing a series of posts that I hope will best help you to understand what you can do with simulation - by using a buffer amplifier design example. The goal is to introduce basic features such as
  1. DCOP
  2. TRAN
  3. AC
  4. Multi-Step
  5. Monte-Carlo
Let’s take an example as below:

1.      Supposed that we need to design something that interface a sensor to ADC, so we have
a.      sensor
b.      The ADC
c.       And something in between – a voltage buffer – and this is what we need to design
2.      To supplement the design example, let’s put some more details
a.      Sensor bandwidth is at least 10kHz
b.      Sensor can swing from 0V to 1V
c.       ADC full range voltage is 0V to 2V.
Since I am a user of Mindi from Microchip, I will use Mindi as examples, but essentially all simulation tools have the basic set of features. If you want, you can install Mindi mentioned from my earlier blog (In this case, you can quickly test out the example)http://electroniccircuitdesignsharing.blogspot.com/2012/03/tools-for-circuit-design.html.

Alternately, you can down load SIMetrix from http://www.simetrix.co.uk/site/demo.html, which is essentially the same thing as Mindi (just the name different as far as I am concerned, same GUI, same file type....)

My advice is to play around with your simulation tools, knowing the capability of what it can do will make your life a lot more fun :). So wait for Part 2 to get started.

Friday, 24 February 2012

Why do we have capacitors at IC supply pins

In analog/digital circuit, we always see capacitors being connected from supply pins to circuit ground, but why?



From my perspective, the two primary reasons for those caps are:

Reason #1:
Connection from supply to IC has impedance - those caps (placed near the IC) will supply most of fast current demand which gives less voltage fluctuation on supply pin when supply current flows


Reason #2:
The supplies  are not ideal, regardless of them being a battery or switch mode supply, there is always internal impedance/resistance, and those capacitors will make sure the IC "see" low impedance supplies across the frequency of its bandwidth (remember that capacitor impedance drops as frequency increase)

Thursday, 16 February 2012

Opamp Circuit: Gain Setting Resistor Type and Package Consideration


Opamp: Gain Setting Resistor Type and Package Consideration


What is the resistor type to use?

In a nutshell:

1.       You would need to know the requirement of your circuit
2.       You need to know what’s available and what’s not in terms of selecting resistor
3.       You need to know how real life resistor deviate from text book

Requirement of circuit:

Ok, to answer this seemingly simple question, we need to know a few aspect of the circuit function
1.       Power rating required?
2.       Accuracy required?
3.       Cost allowed?
4.       Availability?

 

Basic knowledge:

1.       Then you would need to know what’s available in the market, of course the best place to get to know this is through wiki: http://en.wikipedia.org/wiki/Resistor
2.       Some good info on Resistor 101 (www.vishay.com/docs/49873/49873.pdf)
3.       It is extremely rewarding if you understand pros and cons of basic resistor types, as they allow you to make your selection almost immediately in future. Resistor is basic ingredient in most circuit, so your time invested is going to have a pretty good ROI (return of investment J)
4.       Continue from point #2, below are some basic type and common expectation that I have on them (off my mind)
a.       Wirewound
                                                               i.      Expensive – as it takes effort to wind those wire, and just imagine how long the wire to use to get at 1MOhm (to state the obvious wire is always in mOhm range)
                                                             ii.      High inductance – hey, wound wire is almost like a inductor, so if the circuit is of high frequency nature, I would avoid it
                                                            iii.      Precision – not much drift
b.      Thin film
                                                               i.      Accurate
                                                             ii.      Low inductance – no winding of conductor
                                                            iii.      Low noise
                                                           iv.      Low Resistance – how much resistance can a piece of film has
c.       Thick film
                                                               i.      Wide range of value
                                                             ii.      Cannot be as accurate as thin film
d.      Carbon
                                                               i.      Easily available
                                                             ii.      Noisy – compare to other resistor types, the question is how relevant this noise is to application



Real life resistor

1.       Temperature coefficient:
a.       what is means is that the resistance value will change according to temperature, stated as ppm per unit temperate change,
b.      note that temperature of the resistor is in turn depend on the selfheat of the resistor and ambient temperature change. Which means the better the temperature coefficient is, the better the accuracy is (more expensive as well)
c.       The temp coef is readily available in the datasheet, so you are generally know what you are getting

2.       Breakdown voltage
a.       If you have a 0.1Watt 10MOhm resistor, you would expect that the voltage level can go up to P = V^2/R = sqrt (P*R) = sqrt (1M) = 1kV
b.      But the fact is that all resistor will eventually breakdown above certain voltage, and for a typical part, 1kV certainly is too much to bear with. Use of common sense tells you that all 0805, 0603, 0402 has too little clearance between terminals and should not be able to handle it kV – either resistor breakdown or arcing will occur.
c.       This value is generally available in the datasheet, ensure no violation on this spec.



3.       Voltage coefficient
a.       One of the most likely mistake in choosing resistor is that fresh engineer overlook the fact that resistance changes when voltage across them changes. If you are using a voltage divider, this will give you some serious error depend of the resistor type
b.      Resistor that meant for high voltage (above 100V I think) will generally have this spec in the datasheet. If you can’t find this spec, and you intend to use the resistor for 100V or more, good luck.

4.       Power dissipation
a.       Given enough power, you can raise temperature of resistor into > 100degC, as long as that does not go beyond resistor’s rating you are fine, but your resistance will change like crazy
b.      Given too much power, you can burn the resistor, literally.
c.       So always size up the resistor size for the expected power level.
d.      To give an example: a 0.1W 0603 resistor will have power derating curve as below: to get the sense of how much temperate rises for a given operating condition, let’s calculate the thermal impedance of this part.
                                                               i.      Rated power = 0.1Watt
                                                             ii.      Tmax = 155degC (refer to any resistor datasheet for this, in 0603, the curve is labelled as 3E in this particular example)
                                                            iii.      TderatingStart = 70degC
                                                           iv.      Rthermal = (TmaxTderatingStart)/Prated = (155-70)/0.1 = 85degC per Watt






Application of knowledge:

Now that you know about what you can choose from, non-ideal characteristic of resistor and the requirement from your circuit, let’s go through some of it
1.       Power rating required?
a.       Calculate worst case power dissipation
b.      Ensure factor in the ambient temperature of end product
                                                               i.      If your product is going to be used in outdoor of Africa, then be prepare for the maximum ambient temperate
2.       Accuracy required?
a.       If your circuit has calibration, then initial tolerance is less critical, only drift and calibration period matters.
b.      Remember temperature changes of the resistor due to power dissipation or environmental temperature will change the accuracy. For example, a 100ppm part with negligible power dissipation but having 10degC operating temperature changes will have 1000ppm of changes, which is 0.1% of error.
c.       Consider to mount the gain setting resistor close by, such as both will see the same temperature changes. By doing so, both resistor values will drift together, and since the gain is depend on the ratio of the two, total error will be much less. Remember certain part of the PCB will always be hotter than the rest, as high power devices always heat up the region around it.
3.       Cost allowed?
a.       Know how much you are supposed to spend
4.       Availability?
a.       It is useless if you cannot get the resistor in time , or you can’t buy them
b.      If your design cycle is short, always pick those parts that distributor has plenty of stock. Some part lead time can be as long as 16weeks – 4months!!
5.       Others
a.       If you are going to handle the assembly, pick resistor size that is manageable. Personally, it is extremely tough to handle 0402 part
b.      For prototyping or hand build board, 0603 part is extremely useful, as the standard prototyping breadboard will have holes just about 60mils, so you can solder them neatly and tightly.

 

References

www.vishay.com/docs/49873/49873.pdf