Wednesday, September 18, 2013

Vias: to tent or not to tent

A question sometimes comes up concerning whether to tent or not tent the vias on a PCB.  Altium by default does not tent the vias.  There are several considerations.  The silkscreen can be visible over the tented vias.  The bare vias can be used as test points and for reworks.  The fanout vias for the BGA pads must be tented, otherwise shorts could happen.  If a via is very close to the SMT pad, it is better to tent otherwise it is harder to solder.  A large via cannot be tented completely.   If only one side is tented, it could trap flux and cleaning fluids. Then there is the subtle question about outgassing: a tented via might outgas.

Fuses in Parallel

Occasionally, we may need fuses in parallel to achieve greater current rating.  For instance, the Mini ATO fuses come maximum 30A; any more than that, two or more fuses are needed.  So are parallel fuses advisable?  Yes, it is better to stick with fuses of the same type and rating.   The current will not distribute precisely equally among the fuses.   But they will not differ two much before the self-balance nature of the fuse resistance.  The circuitry should be as identical as possible.  One company recommends, as a general rule, a minimum reduction in rated current of  10% for 2 fuses in parallel (20% for 3 or 4 fuses in parallel).

Sunday, July 14, 2013

Velocity Control

Consider the simplest case, a body is acted on only by the force that you control.  You want to reach certain speed; how should you control the force.  If we elect to use the proportion gain control, i.e. the force is proportion to the difference between the desired speed and the current speed.  We would have an exponential speed profile, that approaches the desired speed asymptotically with a time constant of m/K, which m is the mass and K is the proportional constant.

If there is a constant force also acting on the body, such as the gravity, and we apply the proportional control, the speed profile is again an exponential with the same time constant.  But now our final asymptotic speed is not the desired speed, but offseted by mg/K.  So the proportional control results in a steady state error.

The common cure is to add another force that is proportional to the accumulated or integrated velocity error.  Now we have a second order system.   If the integrated gain is sufficiently high,  we would have an oscillatory response.

Motor winding current and supply current

When the motor drive operates in the torque mode, a constant torque implies a constant current in the motor winding.  But we see the supply current varies as the motor speed changes.  The supply current is at the lowest when the motor stalls and the highest when the motor moves the fastest.  The total energy provided by a constant voltage source is consumed by the winding resistive loss and the work done by the motor.  When the armature current is constant, the resistive loss is constant.   The work done by the motor is the torque multiplied by the motor speed.

How does the motor drive keep the winding current constant when the supply varies?  When the load is greater than the motor torque, the motor slows down and stalls.  If the drive keeps the same PWM on period, the current would increase; so the PWM duty cycle is reduced to keep the current constant by the current loop.  The PWM duty cycle is proportional to the motor speed (assume the winding resistance is small).  The drive circuit draws current from the supply during the on period of the PWM cycle.  The peak current is same if the constant winding current is maintained.  So the average supply current is smaller when the motor speed is reduced.

Therefore to infer winding current from the supply current, the PWM duty cycle has to be known.

Thursday, March 14, 2013

Noise Gain

The term "noise gain" is used a lot in designs with opamps.  So what is noise gain and how is it useful?

If we model the opamp noise with a noise source at its non-inverting input, the noise gain is the closed-loop gain of the circuit (with signal sources disabled).  Note that the noise gain is the same as the signal gain in the canonical non-inverting configuration.  In the standard feedback configuration, the opamp open-loop gain is A and the feedback factor is b, then the closed-loop gain is A/(1+Ab), which reduces to 1/b when A is large.  The stability of the circuit is depended on Ab; if we denote the noise gain n, we can analyze the stability from A/n, and in a Bode plot, the point of interception of the magnitude of A and n is where the magnitude of A/n equals to 1.  The amount of phase shift at this point determines the stability.  We can do a quick stability check by looking at the rate of closure of A and n: if A and n intercept with 20dB per decade, the circuit is stable; if A and n intercept at 40dB per decade, the circuit is likely unstable because it would have 2 poles contributing total180 degrees phase shifting.

We just consider the non-inverting configuration; for other configurations, the noise gain is not the same as the signal gain, but the noise gain plays the same role in determining the stability.  There are ways to increase the noise gain without changing the signal gain to achieve greater level of stability.

Friday, January 4, 2013

Cheap Cen-Tech Multimeters

The Harbor Freight Cen-Tech multimeter is about $4 or less.  It measures voltage to 1000V DC/750V AC, current to 10A DC, resistance to 2MOhms, diode voltage.  It also has a battery tester (360Ohm load) and transistor tester for measuring gain.  It has 3-1/2 digit LCD display.  It is reasonably accurate (generally within 0.1%) and well worth the money.  But keep in mind the input resistance for the voltage measurement is 1MOhms.  The shunt resistance for 10A is about 0.016 Ohms.

Maybe it is a sign that the price cannot sustain; the more recent model starts to skimp on the probes with smaller conductors, adding 0.5Ohms to each of the probe.  The probe wire feels warm when carrying a few amperes of current. The probe lead will fuse before the fuse does.

The battery tester load is convenient when you just need a small load for testing, such as checking an LED.   The current measurement settings can also let you test connect two nodes with different resistances 1K, 100, 10, 1 and 0.01Ohms.  You can use the 1MOhm input resistance of the voltage measurement settings for a weak pull-up or pull-down.  The resistance settings can source voltages, but they are load dependent.  You can use the 200-Ohm setting to turn on a logic input; it puts out 3V when the input resistance is at 50K or above and 2.5V at about 7K.  Other settings can only output about 0.6V max.  The diode setting outputs 1mA when measuring diode voltage; it outputs 3V max but at 0.5mA.


Wednesday, September 19, 2012

Components Review

Here I give a review of electronic components that I used, particular on their quirks.

Atmega644A
Atmega644A has the same peripherals as Atmega644P, but Atmega644A has the same device signature (1E 96 09) as Atmega644, which is different from Atmega644P (1E 96 0A).  Atmega644 has to be used for device programming with avrdude.  There seems very little difference between Atmega644A and Atmega644PA.

The bootloader based on Atmel app note AVR109 works with avrdude.  Sometimes, the first invocation of avrdude does not work, but the 2nd invocation should work.

By default the clock source is the calibrated internal 8MHz RC clock, and the divide-by-8 bit is enabled, so the system clock is effectively 1MHz.  The JTAGEN is programmed by default, so the side effect is that PORTC2-5 are not I/O ports, DDRC has no control over them.  They have pullups on them.  The JTAGEN fuse should be unprogrammed to enable I/O port for these pins.  The BOOTRST should be programmed to point to the bootloader if used.  The default bootloader size is 4K 16-bit words.  The AVR109 bootloader fits in 1K words.  The 1K bootloader starts at 0xF800.

The I/O port pullup strength is about 38.5K.  The bandgap voltage has some spread, one measured 1.07V and another 1.16V.

The UARTs work at 38400 baud with the internal 8MHz RC clock.  But for reliability the crystal oscillator is still preferred.

The brown-out detection function turns out to be very useful to eliminate bizarre, inexplicable and intermittent behaviors at power on and off.  When the BODLEVEL set to 100, the brownout voltage is 4.3V as specified.

When switching between the ADC channel, ample settling time should be given.

MAX3232
Dual Channel RS232 transceivers output +/-5.4V with 5V supply.

MAX488
RS422 transceiver.

SN74LVC1G86
The single XOR logic gate is in the small SOT23-5 package.  VOL is 0.1V when sinking 12mA with 5V supply.

ADG706
The 16:1 analog mux.

AD8602A
The OpAmp.

LMC6484
This is a general purpose quad CMOS opamp with rail-to-rail I/O.  The maximum voltage is 16V.  The gain-bandwidth product is 1.5MHz.  

AD8210
A current shunt monitor works with common-mode input -2V to 65V at a supply voltage of 5V.  To work below the supply voltage, it uses a pull up on the input, so the common-mode input impedance is only 1.5KOhms.  The side effect is that it injects voltage into the input, which might not desirable.

LMP8602
It is superior to AD8210 in many ways. The bias current is smaller, the quiescent current is lower, the common-mode input range is wider, the specified supply voltage range is wider.  The 50x gain reduces the power dissipation on the sense resistor.  It has a more flexible output structure with accessible node between the two gain stages.  The dynamic response is slower than AD8210.

INA282
This current monitor has switched capacitor input with offset cancellation.  But the performance is not as good as advertised.

ACS713
This is a Hall-effect current sensor.  The main advantage is the very low resistance 1.2mOhms.  But the gain and offset are not as good.  The gain has some more nonlinearity and temperature dependency than the shunt current monitor type.   After running high current through it for a while, the offset would change especially noticeable when the current is reduced back to near zero.  I'm not sure if it is just a temperature effect or some sort of magnetic remanence.

LTC4357
The oring controllers can replace oring diodes.  It tries to servo the FET drop to 30mV; the actual drop will depend on the power FET.  It enables loading sharing.  But unlike diodes, it does consume current, about 2mA, and when two are used to form diode OR, they will consume 4mA which could be significant.

LT1910
The N-FET driver includes a charge pump to generate the gate voltage.  It has over-current protection with a external current sensing resistor.  When it is off, it draws about 2mA current which could be significant for low power operations.

LM317
A classic voltage regulator designed by the legendary Bob Widlar can take a maximum input voltage of 40V and output the maximum current of 1.5A.

The LM317DCYR is the TI clone in SOT-223 with top marking L3, retailed for $0.71 a piece.  The reference voltage is measured at 1.251V.  With two 1% resistors (with good tracking), the output can be set to within 0.5%.  Because the adjust pin sources a small current, the voltage setting resistors should not be too large.  

V7809-500
This switching regulator is a drop in replacement for the popular fixed-voltage regulator LM7809.  The specified maximum input voltage is only 32V.  I took it up to 36V and it still regulated and no damage was done it.  The output contains switching noise at the frequency of 312KHz 30-40mVp-p, which can be reduced by the post linear regulator and ferrite beads.  It can also be configured as an inverting regulator (buck-boost), generating -9V.  It has built-in short protection; I accidentally shorted the output, no harm was done to it.

VYB15W-Q24-S5
The isolated DC/DC converter module outputs 5V/3A.  It has low quiescent current.

UHE-15/2000-Q12-C
The isolated DC/DC converter module outputs 15V/2A.  The no load current seems high and it gets hot without loading.

PS710B
A solid-state relay can handle 5A nicely when the two photo-FETs are paralleled.

IRFR1018
The N-Channel power FET has 8mOhms Rds-on.

SUD50P06-15
The P-Channel power FET has 15mOhms Rds-on.

SUM110P06-07
The P-Channel power FET in the D2PAK(TO-263) package has specified 6.9mOhms Rds-on.  At 12A load, the Vds drop is less than 70mV with Vgs at -13V.  It maintains low Rds even with Vgs at -4V.  The Vgs has maximum range of +/-20V.

BSS138
A N-Channel FET in SOT-23 package has low threshold and low Rds-on.

CPC1117N
This is a solid-state relay that is normally closed with resistance of 5Ohms.  It turns off when 0.23mA current is applied with voltage around 1.13V.  I use it to turn on/off a P-channel power FET; it would have the fast turn-off and slow turn-on feature.

LVK24
The 1W 4-terminal current sense resistor comes in 1% and 0.5% tolerance.  I accidentally pulsed it with a large current (by shorting the output); the resistance is off a little since.

DS2E-ML2-DC24V
This two-coil latching relay has the coil resistances of 1.59K and 1.55K Ohms.  Rated at 24V, one coil actuates at minimum 11V and the other coil at minimum 13V.  It can be used as one-bit nonvolatile memory.

SSL-LX5093BYD
This is a blinking yellow LED.  At about 3V, it draws about 6mA when it is on.  It is sometimes convenient to have a blinking LED without having to add an oscillator, but the blinking frequency is fixed about 1-2Hz and is voltage dependent.