Design

Resolution good enough for accuracy?

Posted by AnalogAdvocate on June 08, 2010
Design, General / No Comments

You are an experienced design engineer and have done your job well for over 15 years.  Due to new requirements coming down from management in order to obtain government funding, you are suddenly being required to include power measurement in your projects.  How do you measure power, and do so accurately?  Obviously it requires a couple A/D converters to measure voltage and current and a simple current sensor such as a shunt could be used.  However the signals are so small that a very accurate A/D converter must be used.  Is a 16-bit ADC good enough?

To answer this question, let’s start with the most basic assertion: Resolution does not equate to accuracy.  You can have a 16-bit resolution ADC but only have 13-bit accurate measurements.  There are many specifications that can be viewed, but when it comes to actually designing your application, what you need to know is the smallest signal level you need to measure to obtain your accurate measurements.

Let’s start with the current measurement as that is where the biggest dynamic range of the application will occur.  To use a power measurement example, you know from the application requirements that the maximum current input will be 50A.  You also learn that you need at least 2% accuracy at 5A input as the minimum requirement

To determine the smallest signal that we need to measure, let’s look at the smallest current input error.  We know that at 5A we can only have 2% error.  In this case it is equal to 100mA.  This would be the smallest detectable current to be measured in the application.  For practical purposes you would select a value less than this to give some extra head room.

The maximum current input to your application will determine the size of the current shunt.  If the current values are too large, often a shunt cannot be used due to heating.  For 50A maximum current input, a small shunt of 400 µohms can be used.  That would give a voltage reading of 20 mV.  Remember that the smallest current we need to detect is 100mA.  Using our 400 µohm shunt, we would read a value of 40 µV.  That is a very small value.

So how do I determine if my ADC will be able to meet these requirements?  Stay tuned for part 2 when we discuss ADC specifications and how they relate to your measurements.

Tags: , ,

PWM DAC vs. Standalone Part 1

Posted by AnalogAdvocate on April 09, 2010
Design, General / No Comments

In today’s highly competitive electronics environment, designers are constantly looking for ways to reduce overall system costs.  One of the most commonly asked questions that analog specialists at digital microcontroller (MCU) companies hear from customers is, is the almost cost-free Pulse-Width-Modulation (PWM) Digital-to-Analog Converter (DAC) good enough for my application, or do I need a higher-performance, standalone DAC instead?”

The generation of an analog voltage using a digital Pulse-Width-Modulated signal is known as a PWM DAC.  As most designers’ PCB boards have a microcontroller with a built-in PWM-output feature onboard, a simple digital-to-analog data conversion can be easily realized by adding a few passive components at the MCU’s PWM-output pin.  This is an alternative to using a standalone DAC.  In the MCU application environment, system designers can have DAC functionality nearly free of charge.  PWM DACs are widely used in very low-cost applications, where accuracy is not a primary concern.   Standalone DACs, however, are used for applications requiring higher accuracy.

Although the PWM DAC can be realized with the simple addition of a few passive components, implementing a PWM DAC for system applications is not a simple task.  There are many limitations associated with this. Understanding the complexities of using the PWM DAC and its effects can save significant development time and effort.   This article presents a technique for converting a PWM pulse to an analog voltage using a simple, RC low-pass filter. This entry also reviews the PWM DAC’s limitations and its key design constraints on resolution, frequency, ripple, settling time and current consumption are discussed, which are very important design parameters that are largely affected by the R and C values, as well as the PWM duty cycle and frequency.

Standalone DACs

Figure 1 shows an example of a standalone DAC.  Its analog output voltage is given by:

daceq

Where Dn is the digital code.  For example, with a 12-bit DAC, the user can get Vout = 2.5V with Vref = 5V and Dn = 1000-0000-0000.  Typical standalone DAC devices provide good linearity and a short settling time, which is the time required to update each output voltage.

dacfigFigure 1 Configuration of Standalone DAC

How PWM DACs Work

Figure 2 shows a basic configuration of the PWM DAC. The MCU outputs a PWM signal to an RC low pass-filter. The PWM pulse train’s digital value becomes an analog voltage, when it passes through the RC filter.  At a given period of time, the analog output is proportional to the PWM pulse’s high durations.

pwn1Figure 2 Block Diagram of a PWM DAC

A PWM signal is defined as a digital signal with a fixed frequency, but a varying duty cycle.  Figure 3 illustrates a PWM signal.  The PWM period (T) is the time interval required to complete one full PWM cycle.  The duty cycle is the ratio of the high duration (t) to the total period (T).

pwn2Figure 3 PWM Signal

The PWM signal and RC-filter circuit parameters affect the analog output’s resolution, amplitude, settling time and ripple.  The PWM DAC’s limitations are clearly demonstrated by analyzing the interaction of the PWM parameters and the RC filter.  A better understanding of the relationship between these parameters enables designers to optimize the PWM to best suit their application’s requirements, while minimizing design time.

PWM DAC Bit Resolution

The PWM counter length (L) and the smallest duty-cycle change in the PWM counter (C) determine the PWM DAC’s bit resolution.  The following equation expresses the maximum bit resolution of the PWM DAC:
pwneq

For example, if the system generates an analog output voltage from a PWM DAC with a counter of 4096 (L) and a minimum count step of one (C), the PWM DAC’s bit resolution is 12-bits.

When the PWM resolution is determined, it is possible to calculate the Least Significant Bit (LSB) size.  The LSB size is dependant upon the PWM resolution and the PWM’s output-high level voltage (VOH), and can be calculated using the following equation.
pwneq2

For example, a 12-bit PWM DAC with a VOH of 5V has an LSB size of 1.2mV.

The move to Multi-phase

Posted by AnalogAdvocate on March 17, 2010
Design, General / No Comments

As computer speed increases, supply voltage goes down, and supply current goes up, designers have many design challenges for today’s, high current, and fast transient response processors. In less than two years, the peak output current has risen from ~14A to ~120A. As processor DC RMS and peak current requirements rise, the need for more phases increases. Typically 15 to 20 A must be handled per phase. Designers are required to design DC-DC converters in about the same amount of space as previous designs. DC/DC step-down voltage conversion is almost exclusively based on the synchronous buck topology. The multi-phase buck topology has inherent advantages over the single-phase buck topology and is used in applications where lower supply voltages and greater load-current are required. Multiphase converters distribute the total current across phase-shifted PWM channels, output MOSFETs, and inductors. Multiphase spread heat and lower stress on components.  Multiphase also operates at higher frequencies that allow the use of miniature passives reducing PCB area and cost. Reduced input and output ripple current is also achieved by phase shifting the PWM channels. This reduces the ripple RMS current requirement on input capacitors and output voltage ripple. Ceramic capacitors can be used for output filtering thus reducing the output inductance allowing for faster transient response .

With processor demands approaching 100A at low voltages (~1V), the need for using 3, and more phases is necessary.  Multiphase PCB interleaved layouts are used for PC and server applications where high output current and fast transient response is important. Interleaving multi-layer VCC and ground planes layers will minimize trace inductance. Two copper traces one inch long with a spacing of 20 mils has a total trace inductance of approximately 640 pH. Four interleaved layers have a trace inductance of approximately 210 pH. Interleaving can drastically reduce trace inductance and increase transient response performance. Not using interleaving and using a single layer will result in a trace inductance of approximately 10 nH. This approach may also be used in lower current applications where transient and thermal performance is important. Single-Phase Synchronous Buck converter has the efficiency versus switching frequency trade-off. The multi-phase interleaved buck topology can solve this problem.

Amplifier Design Pitfalls

Posted by AnalogAdvocate on March 04, 2010
Design, General / No Comments

Today’s blog lists common problems associated with using an op amp with a power supply and an input signal on a PC Board. It is divided into four categories: General Suggestions, Input State Problems, Bandwidth Issues, and Single Supply Pitfalls. We would like to hear from you, if you have any other inputs from experience.

In General

1. Be careful of the supply pins. Don’t make them too high per the amplifier specification sheet and don’t make them too low. High supplies will damage the part. In contrast, low supplies won’t bias the internal transistors and the amplifier won’t work or it may not operate properly.

2. Make sure the negative supply (usually ground) is in fact tied to a low impedance potential. Additionally, make sure the positive supply is the voltage you expect when it is referenced to the negative supply pin of the op amp. Placing a volt meter across the negative and positive supply pins will verify that you have the right relationship between the pins.

3. Ground can’t be trusted, especially in digital circuits. Plan your grounding scheme carefully. If the circuit has a lot of digital circuitry, consider separate ground and power planes. It is very difficult, if not impossible, to remove digital switching noise from an analog signal.

4. Decouple the amplifier power supplies with by-pass capacitors as close to the amplifier as possible. For CMOS amplifiers, a 0.1ìF capacitor is usually recommended. Also decouple the power supply with a 10ìF capacitor.

5. Use short lead lengths to the inputs of the amplifier. If you have a tendency to use the white perf. boards for prototyping, be aware that they can cause noise and oscillation. There is a good chance that these problems won’t be a problem with the PCB implementation of the circuit.

6. Amplifiers are static sensitive! If they are damaged, they may fail immediately or exhibit a soft error (like offset voltage or input bias current changes) that will get worse over time.

Input Stage Problems

1. Know what input range is required from your amplifier. If either inputs of the amplifier go beyond the specified input range, the output will typically be driven to one of the power supply rails.

2. If you have a high gain circuit, be aware of the offset voltage of the amplifier. That offset is gained with the rest of your signal and it might dominate the results at the output of the amplifier.

3. Don’t use rail-to-rail input stage amplifiers unless it is necessary. By the way, they are only needed when a buffer amplifier circuit is used or possibly an instrumentation amplifier configuration. Any circuit with gain will drive the output of the amplifier into the rail before the input has a problem.

Do You Have the Bandwidth?

1. Account for the bandwidth of the amplifier when sending signals through the circuit. You may have designed an amplifier for a gain of 10 and find that the AC output signal is much lower than expected. If this is the case, you may have to look for an amplifier with a wider bandwidth.

2. Instability problems can usually be solved by adding a capacitor in parallel with the feedback resistor around the amplifier. This does mean typically and not always. If an amplifier circuit is unstable, a quick stability analysis will show the problem and probably the solution.

Single Supply Rail-to-Rail

1. Operational Amplifier output drivers are capable of driving a limited amount of current to the load.

2. Capacitive loading an amplifier is risky business. Make sure the amplifier is specified to handle any loads that you may have.

3. It is very rare that a single supply amplifier will truly swing rail-to-rail. In reality, the output of most of these amplifiers can only come within 50 to 200mV from each rail. Check the product data sheets of your amplifier.

Related Links

Using Single Supply Operational Amplifiers in Embedded Systems

Compensating ESR to use ceramic capacitors with older LDOs

Posted by AnalogAdvocate on February 12, 2010
Design, General / No Comments

Ceramic capacitors offer low cost, small size, and can offer improved reliability over tantalum and aluminum capacitors. The ultra-low ESR attribute of ceramic capacitors, however, does effect choice of LDO when used at the output as most older LDOs require the ESR of a capacitor on its output for loop stability.  Although almost all newer designs include loop compensation so that they can be used with ceramic capacitors,  there’s still hope for ones favorite older workhorse LDO (or dirt cheap).  Simply add a small resistance in series with desired ceramic capacitor.

ldocircuitThe region of stability is shown in the graph above (in this case for a TC1017).  Any decent datasheet will provide this graph.  Selecting the lowest value for the ESR, while keeping in mind resistor tolerance, is best to minimize load transients.

ldo-stable

Figure 1 Region of Stability of ESR vs Load Current


Related Links

LDOs

Tags: , ,

Using an ADC for Battery Voltage Measurement

Posted by AnalogAdvocate on January 13, 2010
Design / No Comments

In the previous post we talked about the charging and discharging behavior or a Li-ion battery.   On our way to a full fledged fuel gauge we need to first measure battery voltage.   Figure 1 shows the battery voltage measurement circuit using and ADC, in this case a MCP3421 18-bit ADC (U1).

battery-voltage

Figure 1 Battery Voltage Measurement

Since the MCP3421 device has an internal reference voltage, the measurable maximum input voltage range is limited to the internal voltage reference voltage of up to 2.048V.  To measure the input voltage higher than the internal reference, a voltage divider is used, which is formed by R1, R2, and R3.  The R3 is optional and is used to calibrate the R1 and R2 component tolerance.  By choosing the series resistance value of the voltage divider to be very high (> 1 MΩ), the current losses due to the voltage divider is negligible.

In the example circuit as shown in Figure 1, the ADC is configured as single ended by connecting the positive input pin (VIN+) to the battery voltage, while the negative input pin (VIN-) to the VSS.   The ADC output is available to the MCU via the I2C bus line.
Figure 2 shows the discharge curve of a 3.7V Li-Polymer battery (3.7V, 170 mAH).  The curve shows that the battery voltage reduces linearly until it reaches about 80% of its full capacity.

battery-voltage-dischargingFigure 2 Li-Polymer Battery Voltage Discharging Curve
Since the battery discharging characteristics are very linear until the point where the curve falls off sharply, measuring only the battery voltage is an alternative low-cost method to estimate the current status of the battery. In this case, the measured battery voltage can be compared with the fuel values in the lookup table in the MCU firmware.
The circuit shown can be used for measuring the battery voltage of any battery type. When the circuit is used, the voltage divider (R1, R2, R3) must be properly adjusted in order to keep the maximum input voltage (or the voltage at VIN+ pin when the battery is fully charged) to the ADC device is less than the ADC internal reference voltage (2.048V).
Although using the voltage alone is not sufficient to represent the battery fuel status, this method is widely used for simple and cost-sensitive applications because of its straightforward implementation.

Related Links

Battery Management

Delta-Sigma Analog-to-Digital Converters

Tags: , , , , ,

Ohm

Posted by AnalogAdvocate on September 30, 2009
Design / 1 Comment

From XKCD

IrDA: The Forgotten Wireless Protocol

Posted by AnalogAdvocate on August 19, 2009
Design, General / 3 Comments

Radio Frequency (RF) communication protocols have been growing in both media popularity and real-world applications for many years.  Most consumers have probably heard of or are even familiar with terms like GSM, TDMA, CDMA, UMTS, IEEE802.11/WiFi, IEEE802.15.4/ZigBee, WiMax, MiWi and a host of others.  These are all terms or acronyms for different industry-standard RF communications protocols that have enjoyed commercial success.  One of the main reasons RF communications is attractive to consumers is that no wires are required to connect from on system to another.  For example, when cell phones first started offering hands-free headsets, they were connected to the phone via a connector and a wire from the earpiece/microphone.  Now most new mobile phones include Bluetooth wireless connectivity built-in.  One can buy a Bluetooth-enabled wireless headset and it automatically synchronizes with the phone, enabling one to talk on their mobile phone wirelessly while the phone is in a pocket or purse.  This wireless connectivity is very convenient.

Another technology used for wireless communication is infrared or light waves.  An example of a very simple application using infrared technology is a TV remote control.  In the remote control there is an infrared (IR) Light Emitting Diode (LED) that shoots IR light pulses towards the TV.  On the TV, there are IR photodiodes that receive the light pulses and convert them into digital signals that tell the TV to change the channel, increase/decrease the volume, or any other command necessary to adjust the TV without getting up from one seat.

One industry-standard wireless communications protocol that uses infrared light as it communication medium is IrDA.  This protocol was implemented in laptop PCs, mobile phones, smart phones and PDAs long before RF protocols like WiFi or Bluetooth were the norm.  IrDA is also implemented in scanners, printers, keyboards, mice, cameras, scanners, vending machines, payment systems, etc.  There are some useful advantages to selecting IrDA as a wireless connectivity solution and some of the key ones are shown below.

•    IrDA is inexpensive to implement.  Free IrDA stacks are available from numerous MCU suppliers and IrDA transceivers are << 1.00usd in volume.
•    No regulatory restrictions for use of the infrared frequencies used by IrDA
•    No Radio Frequency spectrum power output restrictions or fees
•    IrDA has fast data transfer rates (currently up to 16Mbps and soon much higher)
•    IrDA is Secure.  Light waves are focused and directional which makes snooping difficult.  Line of sight is required from transmitter to receiver to connect.  In addition, infrared light cannot go through walls or objects.

While industry-standard RF wireless protocols have become standard on many large volume consumer applications today, the fact remains that IrDA is secure low-cost, convenient cable replacement technology that is an excellent choice for many applications.  This is especially true for applications that are sensitive to cost, regulatory restrictions and/or fees, or security of data transfer.

Related Links:

IrDA Design Resources

Tags: ,

Stopping PEDs (Personal Electronic/Explosive Devices)

Posted by AnalogAdvocate on August 11, 2009
Design, General / No Comments

We have all heard the horror stories of laptop batteries blowing up or favorite tunes players burning a hole through someone’s jeans. The reasons for the magic smoke escapes vary from poor battery cell construction to overheating and poor charging mechanisms, yet all agree: magic smoke should stay inside our electronics.  While it is up to battery manufacturers to cage the magic smoke inside the batteries, plenty can be done outside the battery to prevent smoke escapes from other parts of the electronic device.

Case in point: Overvoltage Protection (OVP) on a battery charger circuit. OVP allows the battery charger to shut down in case the input voltage goes too high and prevents the circuit from overheating. And, as we know, overheating is smokes’ most notorious escape accomplice.  The value added by battery chargers with this feature is fast making it a standard so in your next design make sure OVP is on the feature list.

Tags: , ,

New 4 channel Non-Volatile DAC minimizes system start up times

Posted by AnalogAdvocate on July 17, 2009
Design, General, Product Reviews / No Comments

How you ask…..well…..

Non-volatile EEPROM provides designers the flexibility to Program DAC input codes, Configuration bits and I2C™ address bits to the EEPROM using I2C serial-interface commands.  The result is that this data is held during power-off time, making the MCP4728 DAC’s configuration and outputs available immediately after power-up.

What DAC has the power to do this?

The new MCP4728 Quad DAC w/EEPROM.  In addition here are some other benefits related to power consumption:

Each channel in the MCP4728 DAC can be individually shut down, thereby reducing power consumption to as low as 0.04 microamperes, which helps to extend battery life. Further, the on-chip precision output amplifier enables a rail-to-rail analog output, for utilization of the entire voltage range.

Want to learn more?

MCP4728

Tags: ,