Tuesday, 25 March 2014

-=( Powersupplies and Pwm )=-

One of my many problems with power supplies have been solved by the location of a decent supplier of bulk 180watt power bricks:

these things are advertised with overload protection and short circuit protection, and actually have it in there.

the downside to these power supplies is that it is relatively easy to  trigger the overload protection or hiccup mode as these powers supplies are designed to plug into very specific piece of equipment and usually there are capacitors built into the device.

so Marlins style of low frequency (7hz) pwm may as well be bang bang in this particular application, the solution is to make it do genuine pwm using the avr's pwm module.

after talking to Evdz on #reprap irc it turns out that it's rather simple to make use of the hardware pwm, the reason it's done with the bangbang style in software is because of compatability across the range of boards,

so inside temperature.cpp you will find this line (line number 1075):

if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1); else WRITE(HEATER_BED_PIN,0);

 and replace it with this:

if(soft_pwm_b > 0) analogWrite(HEATER_BED_PIN,soft_pwm_b); else analogWrite(HEATER_BED_PIN,0);

what you should see now is pwm frequency around 500hz on your bed heater output, this will only work provided the output is pwm capable which for me it is on the rumba board , this could also be done on the other heateroutputs and on the fans as well if you really wanted to but i haven't quite gotten that far yet


  1. It's been mentioned that the lack of a flyback diode on the bed mosfet combined with the inductance of bed and wiring puts some stress into the mosfet that will be increased as you raise the frequency. I will be interested if you experience any problem with this new setup.

    I am not entirely sold in how bad that risk as the claim is backed by a circuit simulation which I do not know how accurate is.

  2. so far I've had this running for a while now and no problems, what i've noticed though is the power-supply generally seems to run a lot cooler, which is very interesting,
    the lack of a fly back diode is something i wondered about a while ago , makes be wonder a bit why they don't at least put the pads there in the circuit so you can put one in if you want to drive other devices, after all the cost of a couple extra holes in a pcb is not even marginal