Hello!
I am making a steering wheel and pedals for a racing simulator. The steering wheel requires a motor for feedback, and the motor requires a driver. I already ordered a Double BTS7960 driver module from china, but since I want to improve my electrical engineering skills, I decided to try to make a driver myself.
My DIY driver needs to be able to drive a 12v 3a constant motor. It also needs to be pwm-able at 20kHz from an STM32 mcu. So I watched a few Lewis Loflin videos on youtube, and made up this circuit:
It works nicely if I just apply the 3.3 volts to an optocoupler(through 100ohm resistor). Motor spins, everything is fine. When I try to switch it at 20kHz, or even just 3kHz, things start to go wrong. I saw that it starts to draw about 0.8a at 12v when I try to switch it. So I hooked up my oscilloscope to the gate pins of the transistors.
Here is how they look at about 5% duty cycle. Here, it doesn't draw any current, motor doesn't spin:
Heres how they look at larger duty cycle. Starts to draw a lot of current, Nmos gets REALLY hot, so I haven't tested with motor attached yet:
I don't understand why this is happening, maybe someone can spot an error in my circuit. I see that the other gate pin sags when the switched one tries to rise up. I understand that the rise/fall times are too large, but I don't understand why is that. Should I try to place lower resistance resistors on the gate-source pins? But then it will have an even harder time at lower dutycycles with the fall time. Is the optocoupler not the right choice for me in this situation?
I am a beginner in electrical engineering, but I am hopeful I can learn to do this.
Thanks!
I am making a steering wheel and pedals for a racing simulator. The steering wheel requires a motor for feedback, and the motor requires a driver. I already ordered a Double BTS7960 driver module from china, but since I want to improve my electrical engineering skills, I decided to try to make a driver myself.
My DIY driver needs to be able to drive a 12v 3a constant motor. It also needs to be pwm-able at 20kHz from an STM32 mcu. So I watched a few Lewis Loflin videos on youtube, and made up this circuit:
It works nicely if I just apply the 3.3 volts to an optocoupler(through 100ohm resistor). Motor spins, everything is fine. When I try to switch it at 20kHz, or even just 3kHz, things start to go wrong. I saw that it starts to draw about 0.8a at 12v when I try to switch it. So I hooked up my oscilloscope to the gate pins of the transistors.
Here is how they look at about 5% duty cycle. Here, it doesn't draw any current, motor doesn't spin:
Heres how they look at larger duty cycle. Starts to draw a lot of current, Nmos gets REALLY hot, so I haven't tested with motor attached yet:
I don't understand why this is happening, maybe someone can spot an error in my circuit. I see that the other gate pin sags when the switched one tries to rise up. I understand that the rise/fall times are too large, but I don't understand why is that. Should I try to place lower resistance resistors on the gate-source pins? But then it will have an even harder time at lower dutycycles with the fall time. Is the optocoupler not the right choice for me in this situation?
I am a beginner in electrical engineering, but I am hopeful I can learn to do this.
Thanks!