Pages

Tuesday, February 1, 2011

A MOSFET based fix to the Makerbot extruder motor problem

As described in my previous blog about the first-time experience with the Makerbot, we encountered a problem where the extruder motor would stop moving after a while. Apparently there have been many discussions about this issue, such as here, here, and here. It seems to be generally agreed that the problem originated from the suboptimal performance of the extruder motor, particularly that its resistance can drop to close to 0 during operation, causing an overload current that fails the H-bridge (A3949) on the extruder controller board. I tried connecting a small power resistor in series with the motor and it still failed after a while.

The most commonly used solution seems to be the relay fix by rwensley. This allows the extruder motor to be powered directly from the +12V supply line, avoiding the failure of A3949. But the downside of a relay fix is that PWM is disabled, thus the feed speed cannot be fully controlled. So I started thinking about a MOSFET based fix. The first version is to use a single MOSFET (IRF510) in the place of relay, and this allows the motor to only move forward (which often suffices). The schematic is shown below:



The 1K resistor R1 is a pull-down resistor (1/4W is sufficient). Its value turns out to be important, because the on-board A3949 H-bridge seems to have a pull-up resistor of about 70K. Thus even when the H-bridge is inactive, the motor ports (1A and 1B) are pulled up to +12V, which must be pulled down to well below 2V in order for Q1 (IRF510) to remain off. The 1K value works perfectly (if the value is too large, it won't be able to pull the voltage low enough). The reason IRF510 works is because it allows a high current (20A pulsed) to pass through it, which is much larger than what the A3949 chip can handle.

Using MOSFET, the main benefit is that the PWM works, hence the motor feed speed can be controlled and tuned in order to print out fine details of a 3D model. I was able to print several models with great details that I wasn't able to achieve when PWM had to be fixed to 255 all the time.

After the single MOSFET solution worked, I started thinking how to make the motor move backward as well. It looked like the simplest way is to reproduce an H-bridge using 4 MOSFETs. The schematic is shown below:



It's basically one of the standard H-bridge implementations. Q1 and Q4 are N-channel MOSFETs and should use IRF510 or any alternative(STP16NF06, RFP30N06LE etc.) that supports at least 10A drain-source current; Q2 and Q5 are similar but P-channel, and should use IRF9530 or any suitable alternative (STP12PF06, FQP27P06 etc.)

Note that there is no special mechanism here to handle shoot-through, which is a known issue for H-bridge design. But in this case, even if shoot-through happens, it will be over a very short period of time, and the MOSFETs are able to handle a high impulse current if that happens. I've tested the circuit in continuously printing for several hours and have not encountered any problem. Also note that the kickback protection diodes are ignored as the MOSFETs already have built-in diodes. Here is the small protoboard with all components soldered on it:



With this fix, the extruder motor can now move forward and backward, and PWM works in both directions! I've seen in several places that eventually the extruder motor should use a stepper as it provides much better control. But before that happens, I am sticking with my fix for now.

7 comments:

  1. Great idea. Use the extruder controller's H-bridge as a mere MOSFET driver. Something it can handle. ;-)

    I built mine with IRF510 and IRF9520 because that's what I had handy. If the 10A rating of '30 is really required then I think something has gone horribly wrong! I put mine on a splitter with the extruder (figuring that's where the power draw was before). I do notice a pitch change in the motor when the build platform and hot end heaters switch on. I'm going to try PWM (of other than 255) for the first time and I hope the 12V sag from the PS isn't a bigger effect. Time for a DC-DC converter??

    ReplyDelete
  2. Hi Ben, I am actually using the 4-pin ATX12V cable (the one with 2 yellow and 2 black wires) to feed the power to the extruder motor. I figured that this can help separate the load of the extruder motor with other motors. So far I haven't seen any issue.

    ReplyDelete
  3. I wanted to do that (use the ATX12V) but I wanted to use a connector (rather then solder directly) and all I had that was suitable was a normal molex connector. I'm not even sure how many 12V rails this supply has: Two 20A is common but I don't know the distribution across the connectors.

    BTW Skeinforge "cool by slowing down" was a bust anyway because there's no way to limit the lowest extruder speed. Even though this mod makes it work far below where it did before there's still a cutoff far above 0. If a layer is small enough it will drop below a PWM setting that turns the motor at all. Given the timescales involved I could probably fix it by modifying the firmware to use a much longer PWM pulse.

    ReplyDelete
  4. I found this article interesting to me, since I am concerned with making a MOSFET h-bridge for controlling 24V DC motor.
    I would be grateful in case of providing me with some advices regarding my circuit in terms of:
    1- value of the pull-down, pull-up and gate series resistor.
    2- selection of the flyback diode.

    while using IRF540N & IRF9540N.

    Thanks for help in advance.

    ReplyDelete
  5. @Diaa: if you search for 'mosfet h-brdige' online, you can find plenty of information. In many cases you don't need pull-up or pull-down resistors, unless if you are worried the control signal can be in floating status sometimes. Also, if you are using mosfets, you don't need gate resistor as mosfet is turned on or off by voltage, not current.

    If you are using 5V to control +24V, your circuit needs to be a bit more complicated. See my earlier blog (http://rayshobby.blogspot.com/2010_06_01_archive.html) for an example.

    ReplyDelete
  6. Thanks for the fix. I was having this problem, and using the IRF510 fixed everything (knock on wood).

    ReplyDelete
  7. The blog has moved to a new site
    http://rayshobby.net
    Please leave comments there.

    ReplyDelete

This blog no longer accepts new comments. Please leave comments at the new site http://rayshobby.net/

Note: Only a member of this blog may post a comment.