BLDC shield for arduino and stand alone controller

Similar projects worth following
This is a build block for the greater Open Rover project. OpenBLDC is a bldc controller with a ros interface. bldc controller with back-emf circuit for closed loop controll of higher current motors.

After failing to fund the OpenRover prototype a couple of years ago, I decided to take a more incremental approach.  OpenBLDC is a shield and eventually an integrated arduino with a ros interface.

  • 3 × 100nf C1206
  • 2 × 22pf C1206
  • 3 × 100pF C1206
  • 3 × MMSD914 Discrete Semiconductors / Diodes and Rectifiers SOD123
  • 3 × IR2101 Power Management ICs / MOSFET, Bridge Drivers and Controllers SOIC8

View all 18 components

  • Major Milestone

    nerd.king06/12/2017 at 00:30 0 comments

    I have built up a couple of the new boards. I figured out a flaw with the voltage regulator circuit and swapped out that part.

    This makes the whole board a lot more stable.

    Using a power supply, I was able to get the hub motor spinning both in forward and reverse.

  • A lot has happened...

    nerd.king05/22/2017 at 12:17 0 comments

    So in the 2+ years since the last update a lot has happened.

    My family expanded by additional boy this year and I am 2 years into my Master's of CS at Georgia Tech.

    Children and school has drained almost all of my free time so OpenBLDC has been a tertiary goal. At the end of 2014 I purchased a hub motor off of alibaba and about a year later I purchased a second motor as well as two batteries and a battery charger. This motor will be a fundamental building block of OpenRover.

    With the impending arrival of boy #2 this spring(2017), I took a semester off of school. The goal was to get the hub motors spinning so that I could submit an elective to build OpenRover over the summer. I was able to get two off the shelf motor controllers eval kits(Monolithic Power Systems EV6532). I spent January and February attempting to get the eval boards working with Hub motor. I hit one roadblock after another and was only able to get the wheels to move an inch before the controller would fault out. There was an ridiculous amount of noise on the circuit feeding back from the motor. I build isolation circuits and separate power regulators but gave up on these controllers.

    My second attempt at off the shelf motor controllers were scooter controllers off of Alibaba. These were pretty low cost and I was able to get them in two weeks. I ordered three controllers so I could take one apart and evaluate the design. When I got the controllers they had about 7 pig tails on them, I could figured out power, motor and hall connectors but the company would not give me any documentation on the controllers.

    So I took one of them apart and I was astounded my how simple the controller is. This design gave me some ideas on how to relayout my shield to handle the higher current(I pop traces on the original shield). Up late at night with my newborn, I was able to layout the new shield and submit them to dirtypcbs.

    I have built one of the new shields and I hope to test it in the coming days. Additional Georgia Tech approve my elective and I was be building and modeling my rover over the summer with a Professor from France :) My hope is that I would be able to turn this project into a Master's thesis. I think I would be the first online student to do this.

  • New motor

    nerd.king12/08/2014 at 19:26 0 comments

    This is a hub motor I found on Alibaba and finally got it in just recently. I build a test fixture for it and I just need to wire up the connector. It is 36V 250 Watts but is supposed to have a low free spinning current. It came with hall effect sensors so I am going to trying to get it working with them first and then might go back and work on the back-emf routine. It was fairly cheap but shipping was killer for just one sample. Hopefully get the cost down with higher volume.

  • Update

    nerd.king10/08/2014 at 16:18 1 comment

    Thanks for the post on Hackaday and I promise that I have not abandoned the project. Been a little distracted recently,

    I promise that is a Hackaday shirt that I got from the Hackaday prize. I have made a really basic current limiting circuit but have not tried it out yet. I hope to get to it once things settle down shortly.

  • Motor spinning

    nerd.king08/21/2014 at 19:58 3 comments

    So I hooked the new motor up the controller and ran it with a 10 ms and 1 ms delays.  Since there are 6 commutation states, I think this correlates to 1000 and 10000 rpm respectively.  If any load is applied, the motor will stop spinning because the states are blinding running.  One issue came up, the motor is rated 24V @ 30 watts but it is pulling 6.5 amps.  I also noticed that the 24V rail was sagging to 12-19V.  With this much current, the motor was getting very warm so I didn't run it very long.

    Here is a video of the new motor running at the above speeds.

  • Latest Updates and Architecture diagram

    nerd.king08/19/2014 at 00:22 1 comment

    So I waited a week to get the new motor only to find out that the old one had toasted some of the FETs and some really odd behavior was occurring.   I decided to build a new shield up from scratch but I had to order some additional FETs.

    So today I got the current board to run through all commutation stages with the LED test fixture.

    Here is the horribly simple architecture diagram.  The pic makes the assumption that the Arduino io will drive the FET drivers.  Hopefully this week I can get the  new motor hooked up and running.

  • Motor spinning kind of

    nerd.king07/25/2014 at 00:29 0 comments

    So I hooked the 3 phase motor I have up to the controller today.  It spins then the power supply over current protection kicks in and the motors stops  this process continues.  I need to find a larger current power supply to see if Open loop control work. Here is some video

  • Christmas Lights

    nerd.king07/23/2014 at 23:53 0 comments

    Progess is being made.  I kind of dead bugged a LM317T onto the side of the shield.  It creates a regulated 13V rail that will power all of the drivers.  I also switched out all of the drivers for new chips that I had just got from digikey.  At first 4 of the 6 commutation stages were working, but then I discovered one of the resistors was not soldered to the board and that solved the issue.    Currently I am cycling through the 6 commutation stages with 100 millisecond delay between each stage.  Here is a short video.

  • Continuing adventures

    nerd.king07/17/2014 at 16:42 0 comments

    So I continue to troubleshoot the PCB.  I hooked up the motor with a variable power supply and got to see the motor jitter a little bit but it caused the power supply to over current and something is just not right with the commutation stages.  One of my coworkers suggested that I make a motor situlation with 3 resistors and 3 bi-color LEDS.  So I hooked this up and I got 1 green, 1 red and a very weak red on the third one.  The drivers seems to be getting too hot or something and shutdown after a while of running so maybe having direct access to the power supply is dangerous for these ICs.  I am going to look into maybe putting a 15V regulator in between them and the 24V rail.  The need 10-25volts to run but I am unsure about how much current they will try to pull especially when driving the fets.

  • 4th of July Fireworks

    nerd.king07/07/2014 at 13:35 1 comment

    So I hauled a bunch of my stuff to my parents for the holiday, much to my wife's dismay.  My goal was to see if I could get the motor spinning open loop control.  I brought a wall wart that output 14V@0.5A and I used three 1k resistors as the load.  I cycled through the commutation phases and could see some voltage on each resistor.  I changed the delay to 1 sec from 100msec and I could see 14V jumping from phase to phase.  I changed the wall wart for the massive 24v@20A supply and I verified that the 24V was moving correctly.  

    I changed the timing back to 100msec and attached the motor.  The motor did not move so I measured the voltage between two of the leads.  As I did this one of the drivers popped, thus ending my testing.  I really wish I had a scope to verify the faster timing voltages.  I might try to see if I can use one at work, after I swap out the toasted chip.  I am at a bit of a loss by the driver fried,  I wouldn't think that the gate of the FET is pulling very much current.  I am also wondering if there is a problem with the motor.  I got it for free and I am thinking of purchasing a small motor just to test and develop the code.  One of the secondary goals is to create a motor profile that can be loaded based on the type of motor being used.

View all 14 project logs

Enjoy this project?



Vahid M Abdi wrote 10/10/2017 at 18:05 point

hi can you help me please?

I need to replace ir2101 with ir2113 for prototyping... but I need help...

  Are you sure? yes | no

Adarsh Sharma wrote 08/19/2015 at 15:02 point

How to compile OpenBLDC Arduino Sketch ?

  Are you sure? yes | no

nerd.king wrote 08/19/2015 at 15:08 point

It is really just for debugging the library.  Just add the bldc library to your Arduino.  I use softlinks so as I am working on the library it will automatically update.

...Arduino\libraries\BLDC\softlinks to .h and .c files in the repo

  Are you sure? yes | no

Adarsh Sharma wrote 08/19/2015 at 15:15 point

i am getting following error on compiling:

C:\Program Files (x86)\Arduino\libraries\BLDC\bldc.cpp:306:6: error: prototype for 'void BLDC::SetCommutationState(unsigned char)' does not match any in class 'BLDC'
 void BLDC::SetCommutationState(unsigned char state)
In file included from C:\Program Files (x86)\Arduino\libraries\BLDC\bldc.cpp:24:0:
C:\Program Files (x86)\Arduino\libraries\BLDC\bldc.h:36:7: error: candidate is: void BLDC::SetCommutationState(char)
  void SetCommutationState(char state);
Error compiling.

  Are you sure? yes | no

nerd.king wrote 08/19/2015 at 15:48 point

Just removed the unsigned from the prototype.  I update the code as well.  You might have to add the SoftPWM library to the project file.

  Are you sure? yes | no

Adarsh Sharma wrote 08/19/2015 at 17:56 point

Thanks , i am able to compile and load code to Arduino. I am trying to test this code with IRAMS power stage. Do i need to connect Hall sensors or it can work based in backEMF? as in code i do not see much reference to backEMF.  Please elaborate.

  Are you sure? yes | no

Neuromancer2701 wrote 08/20/2015 at 02:06 point

yeah, I got a motor that has hall effect sensors so I started working on that.  There is some code in there from Atmel that can do back emf but you would have to design the filters and voltage dividers for the specific motor.  If you have Hall Effects I would work with that.  Because the algorithm is just a look up table then.

  Are you sure? yes | no

craig-beiferman wrote 05/16/2015 at 21:45 point

It looks like you made a mistake in your latest schematic,

the middle of the voltage divider should go to your microcontrollers analog input,

and the high side should go to the motor connector pins.

My guess is that you most likely burned out the analog port already, unless you are running

the motor at a very low voltage

  Are you sure? yes | no

richardginus wrote 03/31/2015 at 19:22 point

I have another question. Your schematics indicate that you run the ir2101 at 5v vcc. Does this work? I read elsewhere on the internet that it works at a minimum of 10v.

  Are you sure? yes | no

nerd.king wrote 03/31/2015 at 20:17 point

No, I had to added 12V regulator.  I cleaned up the schematic about a month ago but for got to push it.  I removed the pull down resistors and added the regulator.

Have fun.

  Are you sure? yes | no

richardginus wrote 03/31/2015 at 21:01 point

Thanks for the update!

  Are you sure? yes | no

richardginus wrote 03/30/2015 at 14:30 point

So does the back emf circuit work? It seems to measure up to 18 volt isnt this a bit low for a 24 volt motor?

  Are you sure? yes | no

Neuromancer2701 wrote 03/30/2015 at 14:44 point

Yeah, I haven't got that far yet.  I started with a reference design and figured I would have to changed the voltage divider in the back-emf circuit before it was over.  I got a new motor with hall effect sensors and just got a new processor to test would with the new motor.  Once I get that working, I will work on the back-emf circuit and code.  Thanks for the input.

  Are you sure? yes | no

Gregor wrote 12/23/2014 at 15:29 point

Thanks for sharing this. I'd like to build one, and it would really help a lot if the schematic was annotated with component values. I'm sure you have a print-out of the schematic lying somewhere with the final values scribbled on ;) Thanks, and congrats on the "new project" ;)

  Are you sure? yes | no

nerd.king wrote 12/23/2014 at 15:58 point

Right now, the schematic is kind of rough. All the pull down resistors are not needed and you need to dead bug a 12V regulator to power the drivers. You can download the free version of Eagle and get the values there. But I have not verified the back-emf circuit yet, either I the voltage divider might not be high enough. Thanks for the response. I hope to make some progress over the holidays.

  Are you sure? yes | no

J Groff wrote 08/23/2014 at 14:20 point
seriously, just toss a hall interrupt service in there for sensored operation. sensorless is only for flat out running with total jitters at low speed. the trick is that you get may get 2 interrupts per hall service and must read the 2 hall pins and use that reading to produce a 1-6 value that jumps you into a commutation pattern. I really dont see a viable OpenBLDC without a sensored control option, which just mirrors the other comments here. We're not out to get you man, we just want something we all can use. I have working code if u need it

  Are you sure? yes | no

nerd.king wrote 08/24/2014 at 01:15 point
The point of a back emf circuit was to allow for a lower cost motor/motor controller combo. Removing the hall effect senors to allow for a cheaper motor. The motor I have does have hall effect sensors so I could add in hall effect mode later on in the development cycle but my focus right now is the back emf sensing.

Thanks for the feedback. I am trying to make the best product as I can with the resources as hand.

  Are you sure? yes | no

Nickson Yap wrote 10/08/2014 at 12:37 point
Hi, one of the most important properties I kept in mind are:
Reverse mode
Low RPM mode (maybe just force the motor to commutate without caring about feedback)
Or allow integration of sensors.
High switching speed (efficiency), heat sink-less?
Small footprint...
External BEC, because some people just don't need it built-in
I hope for these features so that it can be a truly revolutional ESC rather than an alternative ESC.

  Are you sure? yes | no

nerd.king wrote 10/13/2014 at 15:45 point
Thanks for the feedback. Since I have a motor with hall effects in it, I am thinking of added this capability. From my open loop testing, if you blindly jump to the next commutation stage there is risk of the motor slipping. But that could just be that I am apply more torque than the motor can handle.

  Are you sure? yes | no

Mark wrote 08/06/2014 at 07:24 point
This shop has a very wide selection for about as cheap as you will find; from thimble size to 150cc replacements.

  Are you sure? yes | no

Mark wrote 08/06/2014 at 07:30 point
If you are going to use this controller with cars you may want to look into hall sensor closed loop designs. Almost all of the serious hobby grade systems use them due to the need for much faster throttle response than aircraft and boats need.

  Are you sure? yes | no

nerd.king wrote 10/13/2014 at 15:47 point
From my understanding most of the aircraft BLDC motors are run almost full open and are very high RPM. The initial application of this controller is for a ground rover which will probably have some sort of gear box to get a higher torque at a lower RPM.

  Are you sure? yes | no

nerd.king wrote 08/05/2014 at 02:28 point
Just got a new 30 watt motor in the mail, Since the current is not too night I hope this will make testing and development quicken.

  Are you sure? yes | no

nerd.king wrote 07/28/2014 at 03:23 point
Does anyone know where I could get a decent 3 phase BLDC motor? Preferably 24V around 25-35 watts, my current motor is pulls too much current for this phase of development.

  Are you sure? yes | no

Tachyon wrote 07/11/2014 at 14:58 point
Looks great. One comment. For shared projects on sites like Hackaday, Instructables, etc. where you are sharing information publicly, it's always a good idea to expand your acronym's the first time you use them. Remember, everything's new to someone at least once so not everyone will know that a BLDC is a BrushLess DC motor.
Keep up the good work, looking forward to seeing this one finished. Like Adam said, these BLDC motors are the future of hobbying/making so having hackable drivers will be a big deal.

  Are you sure? yes | no

nerd.king wrote 07/11/2014 at 15:03 point
I have a github link above that contains the schematic, gerbers and source code.

  Are you sure? yes | no

Nacht Ritter wrote 08/06/2014 at 17:36 point
Thank you! I was one of the someones that wondered what the heck BLDC stood for! :-)

  Are you sure? yes | no

lunakid wrote 09/13/2014 at 16:22 point
Mee too, thanks, needed to look it up. (Even though I knew it earlier, but forgot.)

  Are you sure? yes | no

pfeffer.marius wrote 07/11/2014 at 09:45 point
Why only as Arduino shield ? It would look much better if you choose a only smd assembly on a smaller pcb with a onboard mcu in my opinion.

  Are you sure? yes | no

nerd.king wrote 07/11/2014 at 11:47 point
My end goal is to have a standalone controller that can communicate to ROS. But I figured getting shield working would be easier.

  Are you sure? yes | no

nerd.king wrote 07/07/2014 at 14:11 point
The original motor that I was given seems to be causing problems so I want to ask the community what kinds of motors they would want to use for with OpenBLDC. I am thinking of just buying one of the outrunners 3-phase motors from amazon or some hobby site. The end goal of this project is to run a motor that will be part of the driver system of a rover.

  Are you sure? yes | no

Adam Fabio wrote 06/19/2014 at 04:17 point
Brushless, sensorless (Back EMF) motors have revolutionized the model industry, along with countless other applications - This is a great project, and thank you for entering it in The Hackaday Prize!
We're about to start our community judging, so keep those updates rolling in!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates