PWM Not Driving to VDD/GND

Hello,

I'm trying to control a motor via a mosfet. Setting the mosfet on/off with pin assignment works great, however pwm at any value other than 0 or max burn out the mosfet.

After looking into it, my current theory is that this is because the pwm does not behave like a proper square wave. And at intermediate voltages the mosfets are not properly on/off and get burnt out due to high resistance.

At pwm=max I see VDD as expected

(Apologies for the image quality)

When the pwm is 1/4 max, however, the voltage does not go to VDD or to GND

I have tried setting PWM to high drive via:

NRF_P0->PIN_CNF[< pin number on port 0 >] |= (GPIO_PIN_CNF_DRIVE_H0H1 << GPIO_PIN_CNF_DRIVE_Pos)

But that did not seem to change the behavior. I have observed this behavior both on my custom pcb and an nrf52 dev kit. I haven't been able to rule out this being due to my scope.

Any suggestions would be welcome!

  • Hi Brendan

    It is true that more power will be burnt in the transistor when it is in the linear region, compared to when it is fully leading or off, but it is a bit odd that the PWM signal would never hit ground or VDD. 

    What is your PWM frequency?

    The gate of a mosfet capacitor does act as a capacitor, which will filter the PWM signal and increase the rise and fall times. Using a lower PWM frequency should reduce the issue, and so should enabling high drive mode on the pin. 

    This stackoverflow answer gives a lot of good advice on controlling a DC motor using a MOSFET, including a discussion around the gate capacitance, and the need for a reverse diode on the motor. 

    Best regards
    Torbjørn

Related