3 phase sensorless BLDC arduino driver

Hi all,

I have to develop a driver for a 3 phase brushless DC motor @ 24V with max current per phase of 5A.

Is there any hardware / firmware project from I could start?

Thanks

Is Google broken today?

Do you mean driver or controller. Driver only is fairly easy, a 3-phase MOSFET bridge using a MOSFET driver like the
FAN7388.

To control a 3-phase motor takes more. Is this a sensored or sensorless motor?

Hi MarkT,

thank you for your reply.

The motor is sensorless; I was looking at the A4960 or A4963 or something similar.

I would like to find an "easy solution", I mean, for what I understand from A4960 datasheet this chip

only needs 1 PWM signal and it does all the job ( commutating the 6 mosfet with the phase shifting). I

was looking also at the DRV8301 but I don't know how it works ( I think that the mcu has to give the 6

pwm signal, right?)

hope what I'm looking is clear :slight_smile:

All of those chips are "gate drivers". That means it drives the high-current MOSFETS; it does not contain any MOSFETS. I would not choose this unless I had a strange requirement that needed discrete output MOSFETS.

5A is not large. It should not be difficult to find an integrated driver.

But if that's the selection, then the A4963 looks easiest to work with.

MorganS:
All of those chips are "gate drivers". That means it drives the high-current MOSFETS; it does not contain any MOSFETS. I would not choose this unless I had a strange requirement that needed discrete output MOSFETS.

5A is not large. It should not be difficult to find an integrated driver.

But if that's the selection, then the A4963 looks easiest to work with.

No integrated driver can handle 5A without a vast heatsink (and I don't think any handle more than 3A or so
anyway), as DMOS FETs are limited to about 150 to 200 milliohm or greater on-resistance. Typical
discrete MOSFETs are 5 milliohms or nearly two orders of magnitude better. A gate driver with external
MOSFETs can work without any heatsinking at 5A.

Hobby ESC's do 25-50A with an enclosure not much bigger than a lump in the cable.

Without more detail, it's hard to suggest an alternative.

MorganS:
Hobby ESC's do 25-50A with an enclosure not much bigger than a lump in the cable.

Exactly, and they are full of loads of discete MOSFETs in parallel usually: Brushless speed controller teardown and hacking a rotary tool - Projects of Jaanus Kalde

The a4960 and a4963 are very easy. They do commutation logic back emf sense and can be driven from the arduino with fairly simple commands changing their register values through SPI.

The a4960 is for all N channel mosfets. The a4963 is for P channel upper fets and N channel lower. The a4960 is a much better, device IMO and you can make a cheaper design that can handle a higher current using all n fets.

I have made bldc controllers with both but a remember having more issues with the a4963 and its different drive modes. They do need a microcontroller to set them in the right drive mode to operate. I also had issues with the open loop startup sequence on the a4960 on some motors but for the most part was quite easy.

Why do you need to develop the driver yourself, will an off the shelf solution not work for you?

Hi,

For open loop control of sensorless brushless DC motor you can use L6234 Driver. 'L6234 Three Phase Motor Driver' is a half-bridge driver that supports input voltage from 7V and up to 52V and a maximum output current of 5A. 'L6234' driver is a DMOS transistor device; which combines DMOS switches, freewheeling diode, compatible comparators and logic block in the same chip, look to the application note in the following link to know the hardware requirements to control a single BLDC motor.

http://www.st.com/content/ccc/resource/technical/document/application_note.pdf

L6234 has three controllable channels; each channel is used to control a single coil of BLDC motor. Each channel has its own enable and input; in which for three channels, three inputs and three enables are required. The controlling aspect depends on the configuration of BLDC coils such as Y or Detla configuration. The most common way of controlling Y-configuration BLDC motor is to create discrete sinusoidal waves using Pulse Width Modulus (PWM) technique using Arduino and then applying the sinusoidal waves to the three coils of BLDC motor simultaneously, but unfortunately this method causes motor overheating because of the following of the current through the coils all the time.

All the best

But with 0.3 ohms per driver transistor, at 5A it has to dissipate over 15 watts, which is pretty abysmal
performance.

For 5A I definitely recommend discrete MOSFETs and a gate driver, such as the A4960 driving 3 CSD88537ND's
(dual discrete MOSFETs in SOIC8 package, as used in the Boost-DRV8711 stepper card). No heatsinking,
much less space and weight...

A little investigation seems to suggest the A4960 is deprecated. The A4963 requires complementary
p- and n-channel output devices, which would suggest using it with 3 dual SOIC mosfets of the p+n
variety...

MarkT:
A little investigation seems to suggest the A4960 is deprecated. The A4963 requires complementary
p- and n-channel output devices, which would suggest using it with 3 dual SOIC mosfets of the p+n
variety...

There are three version of the 4960, I think only one is on the way out.

A4960KJPTR-T - not for new design

A4960KJPTR-A-T - still current
A4960SJPTR-T - still current

Hi guys,

thank you for your reply! :slight_smile:

@ alka, so the A4960 needs only the SPI interface? and also the PWM input?

is there any example code for basic testing?

Thanks

DCloud:
Hi guys,

thank you for your reply! :slight_smile:

@ alka, so the A4960 needs only the SPI interface? and also the PWM input?

is there any example code for basic testing?

Thanks

Yes the SPI and PWM are needed from arduino. The switching of the bridge is based on the the duty cycle and frequency of the PWM input. You wont want to use 500hz or 1khz input, more like 20-32khz.

There is also a tacho output too from the a4960, you can use a pin change interrupt on arduino and get RPM.

With the a4963 you can set the speed also with SPI so no PWM input needed at all but the 4960 is still a better driver.

This is how to set the register to run for example for the a4960 then the pwm input controls the speed.

#include <SPI.h>
const int slaveSelectPin = 4;         // slave select for a4960
#define PWM 3
int motSpeed = 128;

void setup() {
  pinMode (slaveSelectPin, OUTPUT);

  TCCR2B = TCCR2B & 0b11111000 | 0x01;                  // need 32khz pwm for high speed motors

  pinMode( PWM, OUTPUT );
  analogWrite( PWM, 0 );

  SPI.begin();
  // Next section changes the run register.
  // take the SS pin low to select the chip:
  digitalWrite(slaveSelectPin, LOW);
  //  send in the address and value via SPI:
  SPI.transfer(0b11110010);                              // sets restart bit and run bit.
  SPI.transfer(0b00001011);
  // take the SS pin high to de-select the chip:
  digitalWrite(slaveSelectPin, HIGH);
}

void loop() {
  analogWrite(PWM, motSpeed); // to control speed, vary motSpeed to change speed.
}

Hi alka!

Thank you very much! :slight_smile: :slight_smile:

Hi all,

I tried the example sketch but is not working.

This is the schematic of the test board.

Is there something wrong?

Thanks

What are you doing with the STRN pin? that is the chip select pin, or I called it "slaveselect" in the sketch, needs to go to d4.

I had RESETN running to vdd through a 22k resistor (I think, not at home, i'll check later) , if you are connecting that to the arduino you would have to make sure that pin is high to operate.

That example just shows how to set the register and interface with the arduino. You can also read the diagnostic register and see what flags are set, that will tell you whether you are connected properly.

The STRN pin is connected to D10 ( I changed D4 with D10 ) and connected the reset pin on D8 ( HIGH )

The motor starts ( less then a half of a rotation ) and it stops.

I'm sure about the motor because it works with another driver.

DCloud:
The STRN pin is connected to D10 ( I changed D4 with D10 ) and connected the reset pin on D8 ( HIGH )

The motor starts ( less then a half of a rotation ) and it stops.

I'm sure about the motor because it works with another driver.

The diagnostic register will tell you what went wrong hopefully. The fact that the motor starts means the code is setting the run register. With motor drivers the layout is critical. The schematic and code are the easy part. The start sequence may not be suitable for your motor too. Take a pic of your setup and board layout, also what kind of power supply are you using?