Gen7 Research

From RepRap
Revision as of 18:51, 5 November 2012 by Traumflug (talk | contribs) (MOSFET Heat and MOSFET Type)
Jump to: navigation, search

This page shows some of the research done for developing Generation 7 Electronics. It may be helpful for developing other electronics as well.

MOSFET heat and PWM

With heated beds becoming more and more standard, MOSFETs are used to switch currents in excess of 10 Ampéres, sometimes 15 A. While MOSFETs exist which claim to be capable to switch much higher currents, it has been shown they require a careful integration into the electrical design of the electronics. To get to the bottom of this, I've done a few measurement series', measuring heat development of a MOSFET in different configurations.

Markus "Traumflug" Hitter, February 2012


Test setup

The electronics used to do the tests was an older Gen7 v1.2, which first had to be fixed.

The heated bed were two undersized test beds, soldered together. Together they had a cold resistance of about 1.2 Ohms, requesting about 10 A at 12 V.

The power supply was a generic 250 W PC-PSU, specified for 13 A on the 12 V-Rail.

The MOSFET was equipped with a heatsink made of a flat sheet of painted aluminium to give good exposure for a phyrometer, a touchless thermometer. The contact point between MOSFET and heatsink was carefully cleaned from paint, of course, but no thermal paste was applied. It was taken care to not blow against the heatsink to not falsify temperature measurements.

The cross on the heatsink was a mark to ensure the temperature reading was always taken at the same place. The next picture shows how this was done. The red spot is a pointing laser built into the phyrometer.

As the heated bed was undersized, it gained in excess of 150 °C on first tests and started to fume. So a fan was placed underneath to cool it. The maximum temperature reached was something like 80 °C, but not measured.

The firmware in use was Teacup, configured to accept direct PWM commands. The ATmega's PWM scale reaches from 0 to 255, so for example M104 S20 equals 7.8%, M104 S160 equals 63%.

Overall the test equipment wasn't made of precision instruments, but very well in the range of giving qualitative and approximated quantitative results.

Results

To not bore you with long columns of numbers, I've uploaded the spreadsheet used to write all the measurements down on Github. Click on "View Raw", then save it to open it with GNUmeric instead of a text editor.

Common results

While the voltage measured with a simple voltage meter at the heated bed connector varies widely with PWM percentage (this is the whole point of PWM), the voltage always maxed out at about 10.95 Volts, about 1 V below the power supply voltage. This expected and a typical property of voltages goinf through semiconductors.

Each of the charts in the following chapters shows the PWM value on the horizontal axis, bed voltage on the left vertical scale, heatsink temperature on the right one.

Heat vs. PWM Frequency

The MOSFET used was an IRFZ 44N, the current standard of Gen7. The resistor between the ATmega and the MOSFET signal input was 1000 Ohms. The PWM frequency was changed in Teacup between all 5 levels the ATmega offers. The Gen7 is clocked by a 20 MHz crystal, with a 16 MHz crystal you get different frequencies.

One thing which can not be seen in the graphs is, you can hear PWM frequencies in the audible range (20 Hz to 15 kHz) from the power supply and from the heated bed. You have to have a quiet environment to notice this, though, a 12 V fan running calmly on 5 V is louder.

Heat vs. Signal Resistor

The MOSFET used was an IRFZ 44N, the current standard of Gen7. The PWM frequency was 78 kHz in all cases. The resistor between the ATmega and the MOSFET signal input was changed between 1000 Ohms, 180 Ohms, 10 Ohms and 0 Ohms (plain wire).

Cyberwizzard did similar tests and described his findings in a forum post.

Conclusions and Recommendations

This is my (Traumflug's) interpretation of the results.

Conclusions

  1. MOSFETs can heat up considerably if they're integrated poorly into the circuitry and/or are driven with a too high PWM frequency. This is apparently due to losses in the short switching times where the MOSFET is neither fully open nor fully closed.
  2. MOSFET heat due to constant current flowing is a lot less than that of misconfigured switching.
  3. Your heater never receives the full power supply voltage.
  4. PWM frequencies in the hearable range make parts of your setup beep or hum, but this is barely noticeable.
  5. You can check your MOSFET efficieny without waiting for it to heat up by setting the PWM percentage to 80 of 255 and measuring the voltage on the output. The ideal value (no switching losses) would be
full open voltage / 255 * 80
If you get about 90% of the ideal voltage or more, you're sane.

Recommendations

  1. If your MOSFET gets too hot, the most simple way to deal with this is to reduce PWM frequency.
  2. The resistor between ATmega and the MOSFET's gate should be 10 Ohms. More increases switching time and thus increases heat, less gives up protection of the ATmega output at no gain.


MOSFET Heat and MOSFET Type

By Markus " Traumflug" Hitter in August 2012.

Even more obvious than with the previous research, the heat developed by the MOSFET depends much on the type of MOSFET in use. Many recommendations float around in the RepRap community, so I picked the most promising samples and tested them. These were (click on the name for a data sheet):

As some voices suggest MOSFETs vary significantly from individual piece to piece, two samples of each were tested, totalling to a series of 10 runs.

Characteristic Data

Here are some numbers, fetched form the data sheets, which may help to view the differences between all these.

  • ID is usually seen in Fig. 9 at 25 °C package temperature.
  • RDS(on) is usually seen in Fig. 1 at a gate voltage of 5 V, calculate R = U / I in the straight raising part of the curve.
  • Gate Charge can usually be found in Fig. 6, at VDS closest to 12 V and VGS = 5 V.
  • "Miller" can be seen in Fig. 6, too, and is the gate-source voltage where the flat part of the charge curve happens (above that the "Miller"-effect starts). This may give an indication of the minimum voltage required to drive that MOSFET.
ID RDS(on) Rise Time Fall Time Gate Charge Miller
IRFZ 44N 48 A 31 mΩ 60 ns 45 ns 22 nC 5.1 V
IRLZ 34N 30 A 43 mΩ 100 ns 29 ns 14 nC 3.6 V
IRL 3803 140 A 9.5 mΩ 230 ns 35 ns 90 nC 3.7 V
FDP 8870 156 A 3.6 mΩ 105 ns 46 ns 30 nC 3.2 V
IRLB 8743 155 A 3.6 mΩ 92 ns 36 ns 38 nC 3.3 V

Test Setup

A Gen7 v1.4 was configured pretty much in standard configuration with Teacup firmware. The heated bed was configured to have no thermistor, but TT_NONE instead. This way, Teacup allows to set the PWM value directly. Resistor between MOSFET gate and ATmega was 10 Ω, PWM frequency about 78 kHz. Voltage on the 5 V rail, which switches the MOSFETs, was measured to be 5.20 volts.

The extruder thermistor was glued onto a chopped heatsink with Kapton tape. This allowed to change the MOSFET underneath without too much hassle. Nicely, this also allowed the controller to measure and report it's own MOSFET temperature. At least approximately, as the thermistor setup was uncalibrated.

The load was similar to a heated bed and had a resistance of approximately 1.4 Ω

While the test were meant to run in silent air, the nearby heated bed had to be cooled by a fan, so small amounts of air flow may have reached the MOSFET.

Here are some pictures:

Note: the absolute results are not comparable to the measurements of the previous series or to a Gen7 in standard configuration, as the heatsink's surface is existent, but much smaller than that of a usual one.

Test Runs

Each test run was 5 Minutes on each of 100/255, 180/255, 200/255 and 255/255 PWM, so a total of 20 minutes. The results were recorded with a serial terminal. To set the PWM values and trigger the temperature reports, the following script was used:

#!/bin/bash

DEV=/dev/ttyACM1

trap 'echo M140 S0 >${DEV}' EXIT

function minutes() {
  COUNTER=60  # 5 minutes
  while [ ${COUNTER} -gt 0 ]; do
    echo M105 >${DEV}
    let COUNTER=${COUNTER}-1
    sleep 5
  done
}

echo M140 S100
echo M140 S100 >${DEV}
minutes
echo M140 S180
echo M140 S180 >${DEV}
minutes
echo M140 S200
echo M140 S200 >${DEV}
minutes
echo M140 S255
echo M140 S255 >${DEV}
minutes
echo M140 S0
echo M140 S0   >${DEV}

Test results

The test results in raw numbers can be found in the Gen7 repository (click on "view raw"). Also inside this spreadsheet file, there are diagrams visualizing these numbers.

Here's the one for high frequency, 78 kHz:

Gen7 Research MOSFET Types Measurement Results Diagram 78 kHz.png

And this one is for low frequency, 76 Hz:

Gen7 Research MOSFET Types Measurement Results Diagram 76 Hz.png

Interpretation

  • Yes, apparently different MOSFETs of the same type develop different amounts of heat. In a range of about 10%.
  • "Small" MOSFETs develop substantially less heat at low PWM values.
  • High frequency PWM is a burden for all MOSFETs. Even more for the "big" ones. Note: none of the RepRap electronics uses a MOSFET driver, apparently for cost/complexity reasons.
  • In the mid-to-high PWM range (180/255 to 200/255) at 78 kHz, differences between types are at a minimum.
  • "Big" (and more expensive) MOSFETs have an advantage in the "full throttle" mode (always on) or low frequency PWM mode, only.
  • Apparently, rise time and fall time have much more influence in heat development when using high-frequency PWM than any other specification item.
  • Low frequency PWM or even a bang-bang strategy is advised.
  • The "big" types qualify for "barely warm to the touch when switching 10 A" when driven at a low PWM frequency.

No ideal, high-frequency-PWM, heatsink-free, bullet-proof solution in sight. However, demanding a low PWM frequency isn't asking too much. The humming is hearable in a quiet environment only and firmware configuration templates can make this mode the default, so burnt MOSFETs due to high-frequency switching losses should be rare.

Selecting the Thermistor Voltage Divider

By Markus "Traumflug" Hitter in November 2012.

When reviewing each part of the Gen7 circuitry for compliance with the ARM variant, which runs on 3.3 volts only, I also cam across the thermistor voltage divider. Like in about any RepRap electronics, Gen7 makes up a voltage divider with the thermistor and a fixed value resistor. Usually, this fixed resistor is 4.7 kΩ.

Further reading

Hydraraptor: measuring temperature the easy way