BLDC CONTROLLER PWM HELP !

Go To Last Post
28 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi community wink

Sorry for my bad english, i'm french.

 

Ok, I want to design my own BLDC (brushless motor sensorless) controller, but it's litle bit hard for me... (mosfet explosions, sparks in my home workshop, etc... surprise)

 

This is my design:

 

It work, my motor spin with switching frequency, but, voltage of output U , V or W are always 16V (voltage of my battery). I don't understand, because if I put LED on 74HC08 output, luminosity (and voltage) is almost proportional to duty cycle !

 

Duty cycle = 0% U , V or W = 0V

Duty cycle = 1% U , V or W = 16V

Duty cycle = 100% U , V or W = 16V

 

 

Even by removing the capacitors 100nF on U V W, the same...

Put 10uF on U V W, the same too.

Put resistor 560ohms in serie on mosfet H drain -> 15V...

 

 

Can you help me please ? smiley

Attachment(s): 

Last Edited: Thu. Mar 16, 2017 - 01:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I presume there is a micro involved in this? Any clues as to what it might be up to ? (like source code etc. !)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, connected with ATmega328P (see schema):

uC PWM = 100khz

uC UH = 1

uC UL = 0

uC VH = 0

uC VL = 1

uC WH = 0

uC WL = 0

 

My code is pure C++ with my own library (Module)(without avr etc...).

So, this is just test with UH = 1 and VL = 1 , with 100khz pwm and variable duty cycle (0% to 100%) with knob and button for on/off:

#include "../module/GpioRead.h"
#include "../module/GpioWrite.h"
#include "../module/AnalogRead.h"
#include "../module/InterruptRead.h"
#include "../module/PwmRead.h"
#include "../module/PwmWrite.h"
#include "../module/SoundWrite.h"

#include "../module/Timer.h"
#include "../module/Period.h"
#include "../module/Delay.h"

#include "../module/Math.h"
#include "../module/Iteration.h"
#include "../module/Average.h"
#include "../module/Filter.h"
#include "../module/Hysteresis.h"
#include "../module/Random.h"

#include "../module/Max7219.h"
#include "../module/Mpu6050.h"
#include "../module/Bno055.h"
#include "../module/Hmc5883l.h"
#include "../module/Bmp180.h"
#include "../module/Nrf24l01p.h"

#include "../module/Network.h"

#include "../module/Memory.h"
#include "../module/Power.h"
#include "../module/Tool.h"

int main()
{
	GpioRead button = GpioRead (19, true, 10);
	AnalogRead knob = AnalogRead (20);
	const unsigned int PAUSE = 1;

	_DDRB |= 0b00000010;
	_DDRD = 0b00111111;

	_TCCR1A = 0b00000010;
	_TCCR1B = 0b00011001;

	_ICR1LH = 159;//100khz

	while (true)
	{
		button.read();
		knob.read();

		if (button.continuous == true)
		{
			_TCCR1A |= 0b10000000;
			_OCR1ALH = Math::round (Math::curve (0, knob.value, 1023, 0, 159, 0));
			//pwm = knob%
		}
		else
		{
			_TCCR1A &= ~0b10000000;
			_OCR1ALH = 0;
			//pwm = 0%
		}

		_PORTD = 0b00001001;
		//Timer::pause (PAUSE);

		//_PORTD = 0b00100001;
		//Timer::pause (PAUSE);

		//_PORTD = 0b00100100;
		//Timer::pause (PAUSE);

		//_PORTD = 0b00000110;
		//Timer::pause (PAUSE);

		//_PORTD = 0b00010010;
		//Timer::pause (PAUSE);

		//_PORTD = 0b00011000;
		//Timer::pause (PAUSE);
	}

	return 0;
}

 

This code work fine (by removing the // comments),  and my library too... The problem I think is only hardware design with BSS89 and resistor pull-up, or mosfets...

 

My motor rotate perfectly with imposed switching frequency, but the torque is very strong because output are 16V (like pwmless) and mosfet are hot ! ...

Can you help me please ? smiley

Last Edited: Thu. Mar 16, 2017 - 03:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Electrically, it would appear that your circuit ought to work, but right off the bat you likely have serious issues with the speed at which your power fets are turning on and off.  When this is not happening properly is when you see excessive heating and/or explosions.  It is difficult to build a satisfactory gate drive circuit with discrete components.  I've been to this dance before, my recommendation is to use proper "gate driver" chips which take care of all these issues for you.  Also, use N-fets for both the high side and low side in combination with the gate driver ics such as L6388 or similar.
 

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree with Tpappano.

Power mosfet's have a relative high gate capacitance wich makes it hard to turn them on / off FAST.

Because of this, the gate driver ic's are often used. Some of them can source & sink currents of up to 2A and they do this just to make the fets switch faster.

 

While debugging your circuit it can help a lot to use a lot lower PWM frequency. If you don't have a scope starting with measuring all states with a DMM.

If that works, then use a PWM frequency of 100Hz or zo and start experimenting with turning your motor slowly.

Putting some series resistors in the motor leads will make debugging easyer (less current).

Do you have any heat sinks on the mosFET's?

On a properly working circuit they are maybe overkill, but while debugging it might keep your fet's from releasing the magic smoke.

 

And if you don't have an oscilloscope, my advise is to go buy one or chose another project.

You will probably never get this working without an (at least half decent) oscilloscope.

 

What is your motivation for building your own?

Prices for BLDC motor controllers start @ < USD10

 

https://www.aliexpress.com/whole...

I like the small blue pcb's They have 3 IR2101 mosfet drivers and 6 TO220 mosfets on the back.

Even if you want to build your own buying & study-ing a few of these will be a good starting point.

 

Another (similar) option would be to buy an "ESC" These are motor controllers used with toy cars (quad copters, etc).

A good search term is "simonk".

SimonK is software for an AVR processor (Assembly warning) to control a BLDC motor

 

https://www.aliexpress.com/whole...

https://github.com/search?utf8=%...

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks smiley

 

I understand you but... ...I started design with IR2301 chip with only 6 Nmosfet (I completely respected datasheet schema !! ), but IR2301 burn, don't understand this....

 

My motivation is for my diy quadcopter , I use kiss esc 18A, now I want to use my own design because this is the last part is not my design. And I want to learn !

 

 

Have you an IR2101 (or IR2301) "certified working schema" please ?

 

This post is the next to my last post here

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you looked on www.rcgroups.com ? - you'll find a LOT of prior traffic about own design electronics including ESCs there.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes I looked rcgroups.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I understand you but... ...I started design with IR2301 chip with only 6 Nmosfet (I completely respected datasheet schema !! ), but IR2301 burn, don't understand this....

It is not clear to me if the 2101/2301 parts have shoot-through protection like the ST part.  From the data sheet it looks like they don't.  Could be part of your problem as the circuit would be vulnerable to software "miss-steps" without that protection 8)

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your answer, but:

Is it possible to rephrase "what is protection you speak" because I don't understand all (translating) ?

 

In this IR2301 design effectively, I hadn't put any freewheel diodes because I thought my mosfet had intrinsic diodes...

 

Thanks smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of what I see, many people have problems with the ir21xx: http://microcontrollerslab.com/use-mosfet-driver-1r2110/

 

 

I will try to test a new design with, and I will still pray to avoid the explosion in my head... frown

Last Edited: Fri. Mar 17, 2017 - 08:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maxim integrated 4427 is good for my application or not? -> https://datasheets.maximintegrated.com/en/ds/MAX4426-MAX4428.pdf

 

Datasheet say:

motor controllers

Wide Operating Range: 4.5V to 18V

Shorter Delay Times: t D1 - 10ns vs. 30ns t D2 - 25ns vs. 50ns

 

with IRF840 (or equivalent) -> http://www.vishay.com/docs/91070/sihf840.pdf

 

turn-On Delay Time = 14ns

Rise Time = 23ns

Turn-Off Delay Time = 49ns

Fall Time = 20ns

 

? thanks for your help smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ST Microelectronics do a BLDC driver with an embedded 32- bit ARM Cortex -M0 microcontroller, 2 birds 1 stone? ;) And there's an evaluation board to get you started too (if you're willing to pay $58.80...)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hum... frown

Yeah, this is easy, buy drone 2000$, is integrated bldc esc LOL ...

 

 

No, I want to understand and buy not smd electonics components in my local electronics shop from france. This is my diy goal, not smd and diy pcb&code with ATmega328P.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I test soon my new shit design: laugh * Is this language really necessary? Moderator *

 

 

This circuit use MAX4427 mosfet driver.

And I buy soon oscilloscope...

Last Edited: Sun. Mar 19, 2017 - 11:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't think this is going to work.  The Max4427 is a dual "low side" driver.  You need "high side-low side" drivers like the L6388 or similar.  Your design may have multiple other issues, could you show a schematic?  Seems like a lot of parts to perform a simple straightforward function.

 

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes schematic include extra parts for my mosfet tests + bemf tests.

 

You think that it will not work with this driver?

However, it is in the list of "low side and high side":

-> http://fr.farnell.com/maxim-integrated-products/max4427epa/driver-de-mosfet-hight-low-side/dp/2516370?exaMfpn=true&categoryId=&searchRef=SearchLookAhead&searchView=table&iscrfnonsku=false

 

Datasheet say: Motor Controllers Application

 

I haven't schematic of my design because this is just a test only in pcb view (kicad).

 

 

Really, what is difference between low side / high side driving ? In L6388 datasheet, block diagram show 2 N-MOSFET for HVG and LVG. My previous design work with 3 N-MOSFET and 3 P-MOSFET, but a lot of internet designs works fine with only N-MOSFET.

 

?

 

If i want to use 2s to 6s lipo battery, L6388 with 9.6v min is not good.

 

Last Edited: Mon. Mar 20, 2017 - 09:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't run the battery current across the pcb! The problem here is voltage drop. I also suspect your main tracks are not thick enough.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman this is just a test smiley

With 2oz my main track drains ~8A

 

Look current bldc controller on my quadcopter:

 

This is very very small !! But this industrial design drains 18A..

 

 

Ok, for low side and high side I have an answer, High side is just for P-MOS and low side is just for N-MOS (That's what I understood, like my previous design): https://www.maximintegrated.com/en/products/power/power-switching/MAX4427.html/tb_tab1

 

...but many designs work in low side with only N-MOS, so I think it's good.

 

Last Edited: Mon. Mar 20, 2017 - 09:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Still it's a bad design - do not tap 0V from along the 0V track when the main current flows. Use star technique and derive your control logic 0V from the batter terminal. Remember - your tracks are resistors, so you get voltage drops with high currents.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To add to tpappano's warning of why the MAX4427 will not work for high-sided switching...

Drivers that use N-channel MOSFETs for both low sided and high-sided switching usually include an internal charge pump, as in order to use N-channel MOSFETs to switch x amount of volts, you need x amount of volts and then some in order to switch. For example, using a MOSFET with a threshold gate voltage of +3V to switch +12V, would mean you'd need +15V at the gate in order to switch it on.

Without seeing a schematic I can't say for sure, but assuming that you're feeding the MAX4427s with the same voltage as what you're supplying to the motor, then the high sided drivers will never 'switch on' since the maximum output high voltage according to the datasheet is VDD - 25mV, and as I previously mentioned, you need VDD + whatever the gate threshold voltage of your MOSFETs is (at least) to switch on your high sided MOSFETs. 

(and if you're supplying the MAX4427 with +5V as you are for your MOSFET driving logic in the schematic in your initial post then again, the high sided switching will not work.)

 

Edit: typo

Last Edited: Mon. Mar 20, 2017 - 10:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The design is really ugly and durty, but voltage drop is less i think:

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I'm obliged to power the drivers directly via the + battery without step-down? (I use LM7808, my battery is 16V)

Last Edited: Mon. Mar 20, 2017 - 10:59 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, you need to feed the drivers that are switching the high-sided MOSFETs with a voltage that is whatever your battery voltage is + the gate threshold voltage of your MOSFET is. Remeber gate threshold voltage is in reference to the source pin, not ground (unless the source pin is connected to ground of course).

 

 

Okay, so think about just one of the BLDCs phases for the time being, lets call it X since it could be any of the three. For the sake of this example both Q1 and G2 have a gate threshold voltage (Vgs-thresh) of +3V. When switching on Q2 for low-sided switching, you need +3V at least to switch on the MOSFET since the source pin is at ground - easy. 

However for Q1, since you want to switch high that means you want the voltage at the source pin of the FET to be +16V (in truth there will be a very slight drop across the MOSFET due to Rds-on) so in order to switch it on you need a voltage at the gate that is the gate threshold voltage (3V) higher/ more positive than the voltage at the source, which in this case means you'd need +19V).

It's worth nothing noting that typically MOSFETs are turned on which with a higher voltage than the gate threshold voltage, since this is the minimum required. 

 

So you can either have some form of regulator to step up your +16V from the battery to whatever voltage it is you'd need, or you can use a different driver IC that is designed to be used for low-sided and high-sided switching. Personally I'd go with the latter...

 

(Also I'd seriously advise you draw a schematic, it'd be a benefit to you when you come back to this at a later date and it will help anyone reading this understand your circuit rather than taking guesses and making assumptions ;) )

 

Edit: typo

Last Edited: Wed. Mar 22, 2017 - 11:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok thanks.

 

I don't understand why in my 2nd design , p-mosfet drain 16.3v like my battery voltage ?? (current +bat = 16.30v)

 

 

L6388 work if i power this with ~10v than MAX4427 ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

L6387 / 88 circuit , I hope it will work.. cool

 

 

Now drivers are powered with 12V, Vboot capacitor = 100nf ceramic

 

Last Edited: Mon. Mar 20, 2017 - 01:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As soon as this circuit is made, i will notify you if it works or not wink

 

I would have a choice to detect the bemf with my library:
the analog input (AnalogRead) (57us max for 3 bemf) (or 25us max with analog prescaler x2 faster)
digital input (GpioRead) (20us max for 3 bemf)
or interrupt input (InterruptRead)

 

My motor mn2206 spin at 30000rpm max (2000kv x 4s lipo), so 1 commutation = 166us min

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You also don't want to run the 0V as a loop. You want a 'star'. Think of how the current is going to flow in your board.