I am making my own FOC BLDC driver, but there is a weird problem when I control the gate driver using PWM.
I am using three IR2101 driver IC to drive the six N-FETs, and I am using an STM32 (Blue pill) to output a PWM signal to the driver.
As I desire to implement FOC on my board, I added a NOT gate to the circuit so that I can control three gate drivers using three PWM outputs (instead of six PWM.)
Here is the layout and the schematic of the circuit. (I am using EAGLE to draw my PCB, for detail schematic and layout: https://drive.google.com/drive/folders/1Z0gsHcxjLL6W1_VTVIi84l1lCddZZPOf?usp=sharing)
Here is the problem:
- Every time I output a PWM signal with a specific duty cycle to the B and C phase of the motor, the power supply appears to be over-current. The current then breaks the B-phase low-side MOSFET.
- Here is the code that will lead to an over-current event:
#define INHA PA8 #define INHB PA10 #define INHC PB7
void setup() { pinMode(INHA, OUTPUT); pinMode(INHB, OUTPUT); pinMode(INHC, OUTPUT); }
void loop() { analogWrite(INHC, 126); analogWrite(INHB, 129); }
I have already tried these few things below:
- I have measured the current that goes through the low side MOSFET, which is a large current flow. Therefore, I suspect that the high-side and the low-side MOSFET are enabled at the same time and shorted because of some reason. However, I don't have a two-channel oscilloscope, so I can't monitor both MOSFETs at the same time.
- I have tested each of the phases separately, and each of the phases works just fine independently.
- I once desoldered the bootstrap capacitor of the C-phases, and the over-current problem doesn't occur.
- Except for the duty cycle that I mentioned before in the code (126, 129), other values of the duty cycle work just fine.
I have struggled with this problem for 2 months.