Sunday, January 4, 2015

PWM Drive Efficiency

Here we consider a half-bridge circuit, which could be used in a motor drive or synchronous switching regulator.

The first thing to consider is the IR loss from the FET switches, which is simply the RMS current on the $R_{ds}$.  The more ripple current the higher is loss even with the same average current.  This loss is independent of the switching frequency.

The switching loss is consisted of the gate drive and the turning on/off the FETs.  To turn on an FET, the gate capacitance has to be charged.  It is easier to use the total gate charge given in the MOSFET data sheet than dealing with gate capacitance, $C_{gs}$ and $C_{gd}$.  The total energy required to deliver the gate charge $Q_g$ is $\int{VI}dt = V Q_g$.  Note that we do not need to know the exact function of $I(t)$, which is depended on the gate driver and the gate capacitance.  The gate capacitor is charged to $CV^2/2$, but the energy delivered by the supply is $CV^2$, so half of the power is dissipated by charging and the other half is lost during discharging.  So the total power for two FETs switching at Fsw is $2VQ_g F_{sw}$.

The loss in turning on/off the FETs is depended on the rise and fall time.  The current is flowing as the voltage across the switches rises or falls.  Assuming the average current $I$, the power loss is $V I (T_r + T_f) F_{sw}/2$.  The rise and fall time are on the order of 100ns.  This is usually the dominant loss.

To prevent the shoot-through current, a dead time is added between the turning on one FET and the turning off the other.  During the dead time, the current continues to flow because of the inductance.  The conduction goes through the diodes, either the FET's body diodes or external diodes.  So the current flows through one diode drop, this is usually greater than the Rds drop.


Tuesday, December 30, 2014

Human Touch Temperature

A lot times, we use our finger to judge how hot a device is and whether it has adequate heat sink. The late Bob Pease describes a 5-second rule in his well-known book "Troubleshooting Analog Circuits":  "A good rule of thumb is the 5-second rule: If you can hold your finger on a hot device for 5 seconds, the heat sink is about right, and the case temperature is about 85°C."

NASA Johnson Space Center actually conducted a study on human touch temperature, "A New Approach to Defining Human Touch Temperature Standards" by Ungar and Stroud.  The onset of pain threshold is about 44°C.  The touch temperature is material dependent.  For Aluminum, 1 second touch corresponds to about 70°C, and 5-second touch corresponds to about 55°C.  Bob was probably talking about plastic case, 5 seconds is about 85°C, then 1 second is about 140°C, 2 seconds is about 110°C.


Tuesday, December 23, 2014

Temperature dependency

All electronic components have some temperature dependency.
  • Resistance: 
    • Copper wire resistance has a positive temperature coefficient of 3900ppm/°C; for 100°C, the copper resistance changes 40%. 
    • Carbon film resistor has a negative temp co of -200ppm/°C and is worse for larger value resistors.
    • Metal film/Thin film/Thick film resistor has a temp co of +/-10ppm/°C to +/-100ppm/°C.  Testings show that the temp co is valid to -150°C.
  • Capacitance:
    • C0G or NP0 ceramic capacitors have very good temperature co, +/-30ppm/°C.  
    • X7R capacitors have +/-15% variation over the range -55°C to +125°C.  The capacitance typically peaks at the room temperature and falls off at both ends, but it could have very nonlinear temperature dependence.
    • Aluminum electrolytic capacitors have considerable temperature dependence.  The capacitance falls off significantly at low temperature because the viscosity of the electrolyte increases.
    • Solid tantalum capacitors have much less temperature dependence in comparison with aluminum electrolytic capacitors.
  • Inductance:
    • Core materials have nonlinear temperature dependence. 
    • The permeability of a ferrite core is usually maximized around room temperature, but falls off at the extreme temperatures.  At -180°C, the inductance can drop as much as 70%.
    • The powder core holds up well at the lower temperature. 
  • Diode:
    • Silicon PN junction forward voltage decreases with temperature, usually -2.1mV/°C.
    • Silicon PN junction avalanche breakdown voltage increases with temperature.
      • High voltage Zener diode is actually avalanche diode.  1N5245 15V Zener has a temp co of +820ppm/°C and 1N5271 100V +1100ppm/°C.  MMSZ5245B is tested to -150C and has a fairly constant temp co about 1000ppm/°C over temperature.
    • Silicon PN junction Zener voltage decreases with temperature.
      • 1N5221 2.4V Zener diode has a temp co of -850ppm/°C.
      • At around 5V Zener and avalanche balance out.  1N5231 5.1V Zener has a temp co of +/-300ppm/°C.
      • Temperature compensated reference Zener diode can have very low temp co, e.g. 5ppm/°C for 1N829 6.2V.  The temperature compensation is achieved with a forward diode in series.  At 5.6V, the temp co is about 2 mV/°C, similar to that of the forward diode voltage.
    • Schottky junction forward decrease with temperature.
      • -1.2mV/°C (ref 1)
  • Transistor:
    • Bipolar beta
      • Beta increases with temperature.
    • MOSFET threshold
      • Threshold decreases with temperature.
    • MOSFET Kp
      • Kp decreases with temperature.
    • MOSFET breakdown voltage
      • Breakdown voltage increases with temperature.

Reference:
1. Zetex, Temperature Effects On Silicon Semiconductor Devices, June 1995. (http://www.diodes.com/_files/design_note_pdfs/zetex/dn4.pdf) .

Sunday, December 21, 2014

Linux Wine

I'm pleased that some of my old applications actually work.  
What works
  • LTspice IV
    • This is very good. Now I have a superb Spice simulator running on Linux.
  • Adobe Acrobat 6.0 Standard
    • I can edit PDF files, but Linux solution may also exist.
  • Merrian-Webster
    • Works only after installing msvcirt.dll.
    • Matter of convenience with excellent pronunciation. Online dictionaries exist.
  • Viewmate 11.2
    • Good free Gerber viewer.
    • Most parts work except it cannot load directory.  Can load zip file.
  • ExpressPCB
    • An easy to use commercial PCB design tool for simple boards. Can import netlist from LTspice.
What does not
  • Protel 99 SE
    • Fails to start with error message: Unhandled exception 0x0eedfade ... It would be nice if this works. But I can always run it on a virtual machine.
  • Altium Designer Viewer
    • Installs fine, but fails in the middle of starting up.
  • Visio 2014
    • Cannot even install.  Linux alternatives are Dia and xfig.

Monday, November 24, 2014

White LED Light Strip

The white LED light strip    


Three white LEDs in 3258 SMD footprint in series with a 150-Ohm resistor are powered by 12V.  Ten of there are connected in parallel.  They can be cut or soldered together to make short or long string.  On the back is the 3M stick tape, which makes installation easy on any place.  The forward voltage of the white LED is specified 2.8-3.6V at 20mA. In this configuration, the current draw is about 16mA; 20% of the power is wasted as heat dissipation in the resistors.  I suppose such construction is to make the power supply simply, just a constant 12V.

This type of white LED strip is not very bright; it is good for decorative lighting.  For serious illumination, high power LEDs are needed.

Saturday, April 19, 2014

Reducing code size for embedded ARM processors

There are a few options that make the code size smaller when using GCC for embedded ARM processors.

The newlib has a nano version which is optimized for small embedded processor. To activate newlib-nano, add the option -specs=nano.specs to the linker.  The newlib-nano printf does not print floating number format.

Another linker option --gc-sections removes unused sections.  To facilitate gc-section, compile each function and data item into its own section by passing `-ffunction-sections' and -fdata-sections. 

The optimizer can be specified to generate smaller code with the -Os option.

Keil ARM compiler consistently produces much smaller code, often 50% smaller.   Especially the math library is not only much smaller but also much high performance.

Saturday, April 5, 2014

Some considerations in I2C interface

The first thing is the value of the pull-up resistor.  Consider the fast mode 400KHz, or 2.5us period.  The I2C standard calls for a rise time (30%-70%) of 0.3us max.  The RC circuit V(t) = Vdd*(1 - exp(t/τ)), where τ is the RC constant; the rise time is τ*(ln(0.7) - ln(0.3)) = 0.85*a, so τ = 0.35us.  (Note that the scope measures 10%-90% rise time, which is 2.2*τ.)  If the line capacitance is 100pF, the resistance should be less than 3.5KOhms.  I find the usual 10K only good for very short wires, and does not work when I attach a scope probe.  The capacitance between the adjacent wires of a 50mil pitch ribbon cable is ~15pF/ft; twisted pair ~25pF/ft; an IC pin 8pF. The bus driver's minimum current sink capability is 3mA and VOL = 0.4V, so for Vdd = 3.3V, the minimum allowable resistor is 1.0KOhms.  Then the maximum capacitance is 350pF.

If the slave fails to acknowledge within a reasonable amount of time, the master generates stop to release the bus.  Another more serious problem is bus stuck, especially SDA stuck low.  One situation this could arise is that noise in the bus or master reset leaves the device in the middle of transferring data.  To recover, the master has to either reset the device if possible or clock for 9 cycles.  On a microcontroller, the clocking may be done manually in the GPIO mode.