Mosfet Driver For 120 Degree BLDC Driver.

Thread Starter

AmirZia

Joined May 13, 2019
22
I'm designing a BLDC Driver.
so I'm Pulse Width Modulating High side MOSFETS and commutating low side MOSFETs and this is the waveform of the gates.
low.jpghigh.jpg
red is Low side GateSource Voltage/ Yellow is High Side GateSource Voltage

I think this happens because of parasitic Gate Drain Capacitance.
and when I add a 50 nF capacitor Between the gate and source the problem goes away(gate resistor is 22 Ohms)(but rise time and fall time increases)! why is this happening? how can I fix this?
 

Attachments

KeithWalker

Joined Jul 10, 2017
902
A small mall resistanceshould be connected in series with the gate. This is because the gate inputs are highly capacitive with almost no losses. Some stray inductance of wiring may however be present. This stray inductance and the MOSFET capacitance can give rise to unwanted high frequency oscillation of the gate voltage. You may have to experiment to find the lowest effective value. Usually it is somewhere in the order of 20 ohms.
Regards
Keith.
 

Thread Starter

AmirZia

Joined May 13, 2019
22
Thanks for your help.
The schematic I uploaded is showing the basic way(without gate resistor and nothing!) I surely put a 22-ohm resistor for the gate and 10k ohm resistor for gate-source. The current passing drain-source is about 40 Amps.
Low side MOSFET in arm one is turned on and high side MOSFET in arm two is pulse width modulating! ( Imagine the switching frequency in the low side (arm 1)is 100 Hz and switching frequency in the high side (arm 2) is 16 kHz! (They are affected by each other)

here are the results when I add a 20 nF Between Gate and Source! ( i Assume it reduces the gate-drain capacitance effect!)
The Mosfet is irf3205 and the gate resistor is 5 ohm (the datasheet Recommends 4.5ohm)
(i know this is the simulation. but results are similar)
new results.jpg
Yellow is Highside arm one(16khz PWM)- Red is LowSide arm two(1000 Hz here!)
High side Rise time(700nS) and Fall Time(1000nS) (I'm using MMBT8050 and 8550 complementary for Push_Pull )
Update!: When I increase Cgs/Cgd or when I use a MOSFET with lower Crss (Cgd) those spikes will Damp. is that usual to use a 10nF or 20nF cap between Gate and source?
 
Last edited:

shortbus

Joined Sep 30, 2009
7,691
is that usual to use a 10nF or 20nF cap between Gate and source?
I never heard of adding extra capacitors in parallel to a mosfet gate. Can you give a reference to why you would ever do that? To my knowledge that would slow down the turn on time of the mosfet.
 

shortbus

Joined Sep 30, 2009
7,691
when I add a 50 nF capacitor Between the gate and source the problem goes away(gate resistor is 22 Ohms)(but rise time and fall time increases)! why is this happening?
This is due to the added capacitance. Show your whole schematic, as you have built it. Or is this just a simulation? Or if it is actually built is it on bread board?
 

Thread Starter

AmirZia

Joined May 13, 2019
22
This is due to the added capacitance. Show your whole schematic, as you have built it. Or is this just a simulation? Or if it is actually built is it on bread board?
I designed the pcb and tested it.(on pcb)
I hear random sounds (a single short taa noise)from the motor but when i add 50 nf caps to high sides( gate and source) no longer random taaa noise.
 

Thread Starter

AmirZia

Joined May 13, 2019
22
I know! the problem is I don't want to add another capacitance to parasitic capacitance!
actually I don't want to use IC Drivers for MOSFET. and I want to design a driver using BJT. my Switching method is a little bit different. I'm not switching complementary in an arm. (it's more like commercial ESC's Method of switching)
I designed the PCB and tested it. (on PCB)
I hear random sounds (a single short taa noise every random second when the load increases in low and medium duty cycles) from the motor but when I add 50 nf caps to high sides( gate and source) no longer random taaa noise. ( When duty-cycle is 100 percent there is no noise) I can upload the video if u need it.
this is my simple code for atmega328:
Code:
/*
* OxaESC_36V_1500W_V1.1.c
*
* Created: 5/18/2020 11:48:38 PM
* Author : Amir Zia
*/


#define F_CPU 8000000UL
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
int DutyCycle=0;
int HALL;
int Brake;
int main(void)
    {
     
    DDRC= 0b11111011;
    PORTC=0b00000000;
    DDRD= 0b11111000;
    PORTD=0b00000000;
    DDRB= 0b11111111;
    PORTB=0b00000000;
 
 
    //CLKPR=0b00000000;
    ADMUX= 0b01000010; //DutyCycle Part
    ADCSRA=0b10000001; //prescaler
 
    DIDR0= 0b00010000;
 
 
    GTCCR = (1<<TSM)|(1<<PSRASY)|(1<<PSRSYNC);
 
 
    //TCCR0A=0b10100001;//com0a1-com0a0-com0b1-com0b0-0-0-wgm01-wgm00
    TCCR0B=0b00000001;//foc0a-foc0b-0-0-wgm02-cs02-cs01-cs00
    //TCCR1A=0b10100001;//com1a1-com1a0-com1b1-com1b0-0-0-wgm11-wgm10
    TCCR1B=0b00000001;//ICNC1-ICES1-0-WGM13-WGM12-CS12-CS11-CS10
    //TCCR2A=0b10100001;//com2a1-com2a0-com2b1-com2b0-0-0-wgm21-wgm20
    TCCR2B=0b00000001;//foc2a-foc2b-0-0-wgm22-cs22-cs21-cs20
 
     
     
    PCMSK2=0b00000111;//pin change int
    PCICR= 0b00000100;
    //PCIFR=0b00000010;
 
 
    TCNT0 = 0; // set timer0 to 0
    TCNT1H= 0; // set timer1 high byte to 0
    TCNT1L= 0; // set timer1 low byte to 0
    TCNT2 = 0; // set timer2 to 0

    GTCCR = 0; // release all timers
    //firstturn();
    //void firstturn()
    //first Turn
    //{
    //}
    ADCSRA=0b11000001;
    DutyCycle=ADC/4;
        _delay_us(1);
    sei();
 
 
 
while (1)
{
 
}//while(1)

}//main


ISR(PCINT2_vect)
{
    ADCSRA=0b11000001;
    DutyCycle=ADC/4;
 
    if(DutyCycle>240) {DutyCycle=255;}
        OCR0A=255;
        OCR1A=255;
        OCR2A=255;
        OCR0B=DutyCycle;
        OCR1B=DutyCycle;
        OCR2B=DutyCycle;
     
        HALL=PIND & 0b00000111;
        switch (HALL)
        //d6-low1
        //d5-high1
     
        //b1-low2
        //b2-high2
     
        //b3-low3
        //d3-high3
     
        //gas!
     
        {
         
            case 0b110:
         
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_us(1);
            TCCR0A=0b10000001;
            TCCR1A=0b00100001;
            break;
         
         
            case 0b100:
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_us(1);
            TCCR0A=0b10000001;
            TCCR2A=0b00100001;
            break;
         
         
            case 0b101:
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_us(1);
            TCCR1A=0b10000001;
            TCCR2A=0b00100001;
            break;
         
         
            case 0b1:
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_us(1);
            TCCR1A=0b10000001;
            TCCR0A=0b00100001;
            break;
         
         
            case 0b11:
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_us(1);
            TCCR2A=0b10000001;
            TCCR0A=0b00100001;
            break;
         
         
            case 0b10:
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_us(1);
            TCCR2A=0b10000001;
            TCCR1A=0b00100001;
            break;
         
         
         
            //INCASE!
            case 0b0:
         
            PORTD=0b00000000;
            PORTB=0b00000000;
         
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_ms(5000);
            break;
         
            case 0b111:
         
            PORTD=0b00000000;
            PORTB=0b00000000;
         
            TCCR0A=0b00000001;
            TCCR1A=0b00000001;
            TCCR2A=0b00000001;
            _delay_ms(5000);
            break;
         
        }//Switch

}//isr
 
Last edited:

Thread Starter

AmirZia

Joined May 13, 2019
22
This is due to the added capacitance. Show your whole schematic, as you have built it. Or is this just a simulation? Or if it is actually built is it on bread board?
here is the SCH for High and Low sides. if I don't put those nonsense and stupid Caps Between Gate and source, I get Some short RANDOM noise that I can't understand what causes that! (think I observed everything! but I don't have a good scope! (have an old analog one)

Low and High Circuit.jpg
 

Thread Starter

AmirZia

Joined May 13, 2019
22
Just guessing at answers now. Why not use a real half bridge driver for the mosfets? Your not turning on high and low mosfets on a phase, at the same time are you?

While not a micro controller based model, this application note does show how the actual control of a BLDC should work. https://www.onsemi.com/pub/Collateral/AN1046-D.PDF
I'm not that noob.
thanks for the app note. I read many ofem. my problem is driving Mosfets with BJTs. if you have a working circuit that can handle 2 amps (half-bridge driver) I'll be happy to take a look at it. Thanks.
 
Last edited:

shortbus

Joined Sep 30, 2009
7,691
I'm not that noob.
thanks for the app note. I read many ofem. my problem is driving Mosfets with BJTs. if you have a working circuit that can handle 2 amps (half-bridge driver) I'll be happy to take a look at it. Thanks.
Not meaning to offend you, just trying to help.

Many people don't know that the distance from the driver, BJT or otherwise, is kind of critical, should be kept less that 1 inch/25mm.

I like the FAN7390 https://www.onsemi.com/products/discretes-drivers/gate-drivers/fan7390 for mosfet driver.
 

Thread Starter

AmirZia

Joined May 13, 2019
22
Not meaning to offend you, just trying to help.

Many people don't know that the distance from the driver, BJT or otherwise, is kind of critical, should be kept less that 1 inch/25mm.

I like the FAN7390 https://www.onsemi.com/products/discretes-drivers/gate-drivers/fan7390 for mosfet driver.
Yep Thanks for your help Dude!
I designed MOSFET drivers as little as possible(sot23 and 0805 parts) and as close as possible to gates! just test something! design an H-bridge and turn on low MOSFET on the first arm and PWM high MOSFET on the second arm... even if you pull down the gate of low side on the second arm with 10-ohm resistor it will spike up and down due to its high side turning on and off! high side switching affects low sides gate. please test that in simulation to know what is my problem and what i mean!
look at this design! chinese bldc driver .jpg
look at the low side driver in this design(and also high side). they pulled down the gate directly with a BJT(without any resistor) and it will cause no spikes when its turned off. but in my design, I used a push-pull (complementary BJTs) and used a resistor(22 ohms) for gate. I guess I have to put a parallel diode (parallel to gates resistor) to the discharge gate without any resistance to prevent spikes on gate.
I'm convinced this Chinese BJT mosfet driver is better than using the same push pules with a gate resistor for low and high sides.(like the picture below. ignore gate to source caps.)
Low and High Circuit.jpg
 
Last edited:

shortbus

Joined Sep 30, 2009
7,691
While I'm trying to help you, I am no expert in this. But have been thinking about your problem.

In your first schematic(in post 13), The resistor R29 makes no sense to me. It is a shunt to ground when the high side mosfet is on.
design an H-bridge and turn on low MOSFET on the first arm and PWM high MOSFET on the second arm... even if you pull down the gate of low side on the second arm with 10-ohm resistor it will spike up and down due to its high side turning on and off!
What you described is called "shoot through", something that very much needs to be avoided, and is happening to a small amount with R29. A H-bridge should never have both mosfets on the same side on at the same time. And R29 is just replicating that, without actually turning the mosfet on. If the mosfet was on it would fail fast. From what your saying it is seeming like you are turning on both mosfets on each "arm"(your term, phase would be the proper term) at the same time. That should never be done.

What I thought about last night is, did you size your high side 'boot strap capacitor' to work with the mosfet you chose? If you boot strap isn't big enough it may cause the pulsing your seeing. As it discharges and recharges to keep the high side on.

I designed MOSFET drivers as little as possible(sot23 and 0805 parts)
If your trying to DIY a controller as small as a store bought one you would also need to use the same board conventions they do, like multi layer boards and copper pours for ground planes. Even using those small components, I doubt very much if the board real estate would be smaller than using a surface mount half bridge driver.
 

Thread Starter

AmirZia

Joined May 13, 2019
22
While I'm trying to help you, I am no expert in this. But have been thinking about your problem.

In your first schematic(in post 13), The resistor R29 makes no sense to me. It is a shunt to ground when the high side mosfet is on.


What you described is called "shoot through", something that very much needs to be avoided, and is happening to a small amount with R29. A H-bridge should never have both mosfets on the same side on at the same time. And R29 is just replicating that, without actually turning the mosfet on. If the mosfet was on it would fail fast. From what your saying it is seeming like you are turning on both mosfets on each "arm"(your term, phase would be the proper term) at the same time. That should never be done.

What I thought about last night is, did you size your high side 'boot strap capacitor' to work with the mosfet you chose? If you boot strap isn't big enough it may cause the pulsing your seeing. As it discharges and recharges to keep the high side on.



If your trying to DIY a controller as small as a store bought one you would also need to use the same board conventions they do, like multi layer boards and copper pours for ground planes. Even using those small components, I doubt very much if the board real estate would be smaller than using a surface mount half bridge driver.
In your first schematic(in post 13), The resistor R29 makes no sense to me. It is a shunt to ground when the high side mosfet is on.
Its 10k! not 10 ohms. its nothing relative to the resistance of motor coils(about 400 milliohms).
What I thought about last night is, did you size your high side 'bootstrap capacitor' to work with the mosfet you chose?
of course, I did! the bootstrap capacitor is not the issue I'm checking pulses with scope(sketchy check due to my old scope) but the bootstrap cap's voltage is not getting lower than 14 volts( I'm driving gates with 15 volts) even at low speeds.
I doubt very much if the board real estate would be smaller than using a surface mount half bridge driver.
I'm not trying to shrink the board. I'm just trying to lower the costs(by Designing a BJT Half Bridge Driver instead of IC Half-Bridge Drivers) and I'm using a multilayer Board with copper pours for ground planes. But I need to double-check the PCB.
actually I'm developing my little simple driver... I don't know what else component is needed to have a Good High Side Mosfet Driver!
THANKS FOR UR HELP ;):)
 

shortbus

Joined Sep 30, 2009
7,691
Just went back and reread the whole post and caught this in the first one the opening post -
Yellow is Highside arm one(16khz PWM)- Red is LowSide arm two(1000 Hz here!)
Why are you pulsing the low side ("arm two") when the high side one is on? That may be your problem right there. You are having two different pulsations on one part of the circuit at the same time, I can't see that as a good thing. The corresponding low side for a high side should be static "on" when that phase is being commutated. When the low side pulses off there will be an inductive spike in that part of the circuit.

Its 10k! not 10 ohms. its nothing relative to the resistance of motor coils(about 400 milliohms).
It like much of what your doing isn't like any motor driver I've seen before. I've seen fast diodes where R29 is but never a resistor. Just because a circuit is shown online doesn't mean it is good or that it works.
 

Thread Starter

AmirZia

Joined May 13, 2019
22
Just went back and reread the whole post and caught this in the first one the opening post -

Why are you pulsing the low side ("arm two") when the high side one is on? That may be your problem right there. You are having two different pulsations on one part of the circuit at the same time, I can't see that as a good thing. The corresponding low side for a high side should be static "on" when that phase is being commutated. When the low side pulses off there will be an inductive spike in that part of the circuit.



It like much of what your doing isn't like any motor driver I've seen before. I've seen fast diodes where R29 is but never a resistor. Just because a circuit is shown online doesn't mean it is good or that it works.
hello! Welcome back! ;)
I'm not pulsing the Low Side. when the position of the rotor changes, the hall sensor tells the microcontroller to do a commutation
when commutation occurs, some MOSFETs turn off and some MOSFETs turn on(low side just turns on or off but high side starts PWMing or turns off). That's why it looks like I'm pulsing the low sides(actually rotor is spinning! so low sides have to turn on and off Regularly ). I know what I'm doing... I'm studying Power Electronics and Electric Machines :D
I'm not saying that R29 is a good thing I'm not using that! my circuit is not like that(the online thing)!but it works its re-engineered by someone trustable I know there is online trash but this circuit is not one of them(I'm not using that just saying, what I'm using is shown in the second picture of post 13 ) my problem is not programming, commutation, and other stuff.it works and I can ride my scooter without any big problem but my problem is just Random ONE Short (microseconds) TAAAT Sound every about 5 to 10 seconds when the duty cycle is not 100! and I assume it is caused by PCB Errors. (10nf caps everywhere for smooth 5V and 15V rails. the bootstrap cap is big enough. the components that I'm using are original. and I observed LowPass filters for hall sensors and other sensors.I'll resolder everything on a new PCB tonight and share the results
Thanks for following the Topic.
 
Last edited:

Thread Starter

AmirZia

Joined May 13, 2019
22
Hello there! Problem is gone. I guess bad quality homemade pcb was causing the noise.(the scooter is for testing purposes only :))))). )
20200606_202737.jpg
 
Top