I'm trying to make this supposedly simple motor controller.
Here's a brief history of past events, though I'm not sure they're related to what I'm facing now.
I've built the schematic half on perfboard half deadbug-ish. If you want to cry blood, check out this picture (which is missing the transistors as they are already blown.)
I have checked the connections I don't know how many times already and everything seems to be as in the schematic. I believe there are no mistakes in that department. Furthermore I added an LED with 3 kΩ resistance on the output (MP-MN
) and when I vary DRIVE_PWM
I see the LED change brightness so I'm assuming everything is wired correctly.
As soon as I connect my motor, though, (1 kW, ~30 A, brushed) and apply 5% pulse width on DRIVE_PWM
my motor instantly starts spinning at full speed and applying 0 on DRIVE_PWM
then does nothing. Disconnecting power and checking the transistor via the diode option on the multimeter (positive lead to source, negative to drain) I read 0 V.
I was running at 1 kHz so I thought the on time was enough to allow a lot of current to flow through, even though IRLZ44N should be good for up to 160A and my motor should definitely be far from that. I increased the frequency to 15kHz and got the same results.
I also tried starting off from 1% duty cycle and for whatever it's worth 10% and 15% but the results were again the same. I burned through about 10 transistors and I gave up. There is clearly something that I'm not aware of that's going on.
The motor was unloaded in all tests. The cable from the battery to the "controller" is about 0.5 m and the cable going to the motor is about 2 m in length. Both are 11 AWG or 4 mm^2.
EDIT:
I decided to try just applying 5 V to DRIVE_PWM
to find whether my problem has anything to do with PWM. What happened is exactly as in my previous attempts, the FET smoked and motor was running full throttle.
So I added a 3 Ω 100 W resistor in series with the motor, replaced the FET and gave it 5 V and at last the transistor did not die. I was able to start and stop the motor by physically applying 5 V to the DRIVE_PWM
terminal. At this point I'm guessing the reason the transistors were dying was a huge inrush current, but as already stated these particular ones should be good for up to 160 A, so what the heck? Surely inrush current can't be that high especially on an unloaded motor. I tried again measuring with my DC current clamp but it can only tell me so much, highest I saw on the screen was 5 A.
Next step I tried powering it through my controller, and no matter what duty cycle I supplied the result seemed to always be the same - the motor would start and either continue running or stop immediately (in less than a second). I found out my controller is getting either reset or being put in some weird frozen state where I'd need to pull it's reset low (at which point the motor would stop running) in order to bring it back to life. I instantaneously assumed the supply voltage is sagging, so I added a 100uF cap on the breadboard where my microcontroller lives for now. I also added a 1000 uF cap to the driver board across 36V
and GND
, as suggested in the comments. Sadly these didn't help.
My micro controller is getting its power from a raspberry pi's 5 V pin, so if supply was sagging I would definitely see either the pi resetting as well or at least having warnings in the system log, which there aren't. So I thought there must be something happening on the DRIVE_PWM
line that's causing the micro controller to reset. I decided to add a diode like below, unfortunately I only had 1N400x diodes at hand, so I also reduced the PWM frequency to 60 Hz just for this test.
And again I saw the same behavior, as soon as the motor starts the micro controller resets.
I'm not sure if this is not turning into a separate question already, but I'm adding it here because I already have probably 10 questions about this controller I feel like I should stop spamming new questions about it, don't want to get banned or something...