We have done quite a bit of investigation now into this particular effect, its causes and options to reduce it which is covered below. All the scope plots were recorded by Andy, one of the Duet designers. Throughout the green trace is the voltage under investigation and the purple trace is the heated bed current.
The relevant portion of the schematic is shown here for quick reference, full design files are on Github:
Bed FET Switching Transient Spike
Due to the fast switch off of the MOSFET, combined with the inductance of the PCB heatbed (average measurements 1uH) there is significant ringing (47.8V pp). The FET is avalanching at that point.
|12V at he MOSFET Drain during bed switch off|
This noise is relatively local to the MOSFET though, at the 12V input connector it is down to 750mV pp.
|12V at the input connector|
Once through the buck DC-DC convertor on the 5V line the noise is down to 130mV pp.
|5V at buck output|
and by the time that goes through the 3.3V regulator its down to 63 mV
|3.3V at LDO regulator output|
Mitigating the Spike
Some of these ideas have come form suggestions on the RepRap forums - thanks for the input!
First Andy added an RC snubber across the FET with a 10nF capacitor and a 10R resistor. This removed the ringing but the large spike was still evident. Adding a catch diode across the heat bed contact made a small additional difference
|RC snubber added across FET (10nF + 10R)|
|Snubber + catch diode across heat bed contacts|
|Snubber + catch diode + R18 changed to 470R and 100R added in series with TR2 gate|
|3.3V LDO output during heated bed switching|
Our assessment at this point is that the 12V spike caused by the heated bed switching is not, in of itself, causing any negative effects to the Duet processor. In addition the avalanching causes minimal additional heating to the FET when "Bang, Bang" switching or low speed (<1KHz) PWM is used. High speed PWM is bad due mainly to the slow turn on time which causes significant heating.
During this testing we had 3 Duet boards using PWM on the heated bed for a number of days with no modifications, those processors have been subjected to hundreds of millions of these noise spike without a single crash and hang. That is not saying that its not possible but there are probably other contributory factors, see "Further Work" below
More investigation is needed into the effects of USB ground loops which may be causing some issues. Other USB noise can also cause problems, the investigation by markbee, posted on the forums is a very useful starting point.
The firmware is being continually updated (special thanks to dc42 for all the work he has already done). This has already fixed some causes of Duets hanging so make sure you are using the most up to date firmware if you are having issues.
I must again thank everyone who is contributing so much on the forums!