First of all You won’t find here any information on high speed BLDC motor driving. For that purpose You need to know rotor’s position, so You have to measure back-EMF or use Hall sensors (not needed here).

I used specialized triple half bridge IC L6234 (~ 8$). You can make the same spending less money (but more time) with MOSFET transistors or other IC.

But be careful, I found a lot of cases in various forums, where people burned their Arduinos or L6234 chips.

ATTENTION

If You connect L6234 INputs directly to Arduino and OUTputs to low impedance motor – current from Arduino pins will be driven directly through L6234 to the windings and to the ground (without external Vs power applied to L6234). This makes very good chance to burn Your lovely microprocessor.
Also in application note, one sentence is worth to mention – “To avoid overload of the logic INPUTS and ENABLES, voltage should be applied to Vs prior to the logic signal inputs.”

I also very recommend to study (or/and purchase) this open hardware driver board based on L6234 BLDC Motor Driver by Michael Anton. It has input protecting resistors, zeners, power supply/filtering components and even back-EMF sensing circuit with amplifier (not used here).

I added current limiting resistors (1kΩ) to all INputs and ENable pins, a bunch of capacitors recommended in application note and current sensing shunt resistor 0.6Ω (big blue one).

There is main illustration, for basic BLDC driving using 6 step sequence(rectangular current):

It works very well on high speeds. But on slow RPM’s You will have choppy steps. So we need to smooth out driving current to sine waves:

To achieve this, You simply set ENable pins to HIGH (as except few zero moments, voltage is continously changing). And feed the sine-wave modulated PWM (SPWM) to INput pins:

I didn’t tried to force Arduino to make sine calculations. Lookup tables was used instead. Here is a link to OpenOffice spreadsheet: BLDC_SPWM_Lookup_tables
You can generate traditional sine waves (SPWM) and Space-Vector PWMs (SVPWM). Try both and decide which to choose for Yourself.

So, there are 360 “steps” in one electrical revolution, and tested motor had 6 electrical revolutions, per one mechanical. This means 360×6 = 2160 “steps” per mechanical revolution or 0,16(7) degree of precision. If not enough, You can make even 3x more precise lookup table.

Here is some video illustrating results (You have to be very patient to notice movement on last one! )

SVPWM modulation is used in this video. Pot interactively changes delay(); value.

Since I don’t have much of an electrical engineering background I wonder What exactly are the limitations of this compared to a “real” stepper motor. I imagine that the torque is probably pretty low…? Are there any other drawbacks?

I’ve got a motor that doesn’t have any hall sensors, so this looks perfect!

But does it matter which of the 2 switches the pwm is on? For example to adjust the speed, do you change the duty cycle on the high side phase switch, or on the switch connected to the low side? With respect to pwm, I’ve seen references to ‘unipolar’, ‘bipolar’, ‘complimentary’, ‘1-4 quadrant’, but I’m not sure if/how it’s related.

I have some overheating problems while using this control technique. Is there anyone has same or any solition recommendation?

abc
July 21, 2015 at 22:33

I recommend external cooler or blower.

Owen White
March 11, 2017 at 18:40

Yes. One issue is you want to use a gimbal brushless motor. These motors are specifically designed for slow speeds – I believe the trick is they are wound with more wire so they have higher resistance and do not get as hot. The other thing is you can basically change the power delivered to the motor by reducing the PWM frequencies in berryjam’s sine wave array. I created an implementation of this here:

Note, that code is used for a particular motor driver board so the pins are hardwired.

Bill
July 26, 2015 at 12:34

How much torque am i likely to get out of the motor when running at these low speeds. I have an application for such a drive system but I do need torque and was trying to avoid using a gearbox if I can.
Bill

Steve_LS
August 22, 2015 at 08:15

This one is called open-loop v/f control. You apply sin voltage to generate sin current so that the motor can rotate at very low speed depending on the sin frequency. However, the problem of this method is that the applied current may not be at the correct phase. Torque = ea*ia + eb*ib + ec*ic. Suppose e and i are both sin with a phase difference of theta, Torque = 1.5EIcos(theta). You can easily see if theta is big, you need very high current to realize the torque to rotate. I think that’s where the heat problem would occur.

I’ve tested this code with Arduino and adapted to to an STM32 and it works as expected. An issue that I’m running into though is that my motors are warming up considerably. I know that as the speed goes down, torque increases which is proportional to the current flowing through the coils but is there any way to reduce the current while still maintaining the low speeds?

Hello guys,
could you help me with code.. my motors arent working.. all connection to the motor driver are connected as mentioned in the datasheet.. but i get output voltage of 0.5V from all three OUT pins of the motor driver..
could you upload the circuit diagram?? Im not figuring whether its the problem of driver or of the code..

Can you tell me the exact model of motor you are using? I’ve duplicated your design using, but I get jerky motion at slow speeds. I’m using an LD-Power Model M2208-80T Gimbal Motor (at least that’s what it seems to be, although I got it on eBay, so perhaps it’s a fake.) I’m using your exact code, but driving the motor with a SN754410NE, Dual H-Bridge. I’ve published a video that shows the jerky motion I get, here:

Looking at it, you might think it was binding on something, but it’s not. The shaft is free to rotate and spins feely when unpowered. Any thoughts?

Wayne

tngotran
December 9, 2016 at 09:54

There is one note about delay() function when someone follow this thread. delay() function only receive an integer parameter. If you want delay(0.5 milisec) you should use the delayMicroseconds(500) instead.

– one period of sin (mentioned as electrical degree as in above pics) will just

– use ollioscopte to see the wave form of IN and OUTPUT pins. You can also compare how good is your DIY driver circuit with other. In my case, I see this link (http://manton.wikidot.com/open:bldc-motor-driver) is much better than in application note.

– With the 360 values sine reference table, the arduino passes 60 pwm values to IN pin to make it finish 1/6 of electrical revolution. mechanical revolution is rotor spinning one circle. One mechanical revolution in this thread contains 6 electrical revolution. One electrical revolution contains 6 control step.
In this link:http://elabz.com/brushless-dc-motor-with-arduino/
electrical revolution is cycle.

– DIY circuit has better quality than one in application note

Ali
January 23, 2017 at 09:51

Hi Dears

I’ve faced with a new nice problem in my thesis.
please help me to solve it.

I have a system which has two parts spinning in opposite direction relative to each other. In other words it is a

dual spin system. Both of them has 4 canted fin that leads to rotate them about their longitudinal axis when the
system is subjected to the wind (like wind turbine). Their spin rate is approximately high and is closed to 50 HZ.

I want to control the position of part1 (roll angle) relative to the Earth horizon (not relative to part2).

I decided to use a BLDC motor as an alternator in this system which its stator is fixed in part1 and its rotor is fixed in part2.

Actually I want to do a brake by this alternator (bldc) for position control of rotor relative to the Earth horizon

Also I can save electricity energy by this configuration as a generator.

Question1 : Is this solution possible?

Qestion2 : What specification shoud this bldc motor have?

Question : Have you ever seen any application in this configuration by BLDC or electric motor?

Thank you so much

Alf
March 4, 2017 at 19:44

Hi …. great work … bought L6234 and connect to arduino mega and to ATmega644 too
…works great but when making it more complex and adding some flashing leds to the script everything goes good until motor is off [ in program I add switch to pull LOW EN1,2,3 ] but when on, motor works nice but leds flashes in random way totally out of control .. any idea why ?

Owen White
March 11, 2017 at 18:37

Greetings people.

Be advised that there are wonderful boards out there that work really well for driving brushless motors.

It’s just a variant of the original code shown on this blog, with some of the pins hardcoded in. Enjoy.

Doga
April 21, 2017 at 10:37

For thos who can’t make it run smoothly at low speeds, try implementing a trapezoidal waveform and a lookup table accordingly. Your motor is likely not to be a sinusoidal EMF motor but trapezoidal EMF motor. That was the case for me.

So, take this into account.

As for schematic. Check the application notes pdf provided in the beginning of the article. It shows all the connections you need.

Hi, nice !
I appreciate your work. I have implemented a svpwm and the motor is chopping when speed reference is very very low. From your feedback, are the speed KP KI only the way to solve the problem ?
Best regards