traditional DC motors, but are more difficult to use. Many off-the-shelf products exist for this purpose. For example, there are lots of small BLDCs controllers for RC
airplanes that work really well.
For those wanting to delve more deeply into BLDC control there are also many different micro controllers and other electronic hardware intended for industrial users and
these usually have very good documentation. So far, I have not found any comprehensive descriptions of how to do BLDC control with an Arduino microcontroller. Also, if
you are interested in doing regenerative braking, or using a BLDC for power generation, I have not found many products that are suitable for use with small motors or
much information on how to control a 3-phase generator.
This instructable started out as a demonstration project in a class on real-time computing, and which I continued after the class ended. The idea for the project was to
demonstrate a scale model of a hybrid electric vehicle with flywheel energy storage and regenerative braking. The motors used in the project are small BLDCs
scavenged from broken computer hard drives. This instructable describes how to implement BLDC control with one of these motors, an Arduino microcontroller and Hall-
Effect position sensors, in both motoring and regenerative braking modes. Note that having access to an oscilliscope is extremely helpful, if not essential, to doing this
project. If you don't have access to a scope, I have added some suggestions for how it might be done without one (step 5).
One thing that this project doesn't have that should be included in any practical motor controller is any safety features, such as overcurrent protection. As it is, the worst
thing that can happen is that you burn out the HD motor. However, it would not be too difficult to implement overcurrent protection with the current hardware, and perhaps
I will do it at some point. If you try controlling a larger motor, please do add overcurrent protection, to protect your motor, and for your own safety.
I would like to try using this controller with a larger motor that can do some "real" work, but I don't have a suitable motor yet. I noticed an 86W motor for sale on eBay for
around $40.00 that seems like a good candidate. There's also an RC website called "GoBrushless" that sells kits for putting together your own BLDC. These are not too
expensive and building one is a worthwhile experience. Note that the motors from this web site do not have Hall sensors.
Whew! It was a lot of work to write up this instructable. I hope you find it useful and please post your comments and suggestions.
Remove these ads by
Signing Up















































Visit Our Store »
Go Pro Today »




Other than that, happy spinning!
int motor = 0;
void setup() {
pinMode(motor, OUTPUT); //analog Pin
}
void loop() {
analogWrite(motor, 255);
delay(1000);
analogWrite(motor, 40);
delay(500);
}
But it doesn't work?
Regards and thanks
Here is one instruct able that uses a special chip for controlling motors that will allow you to operate the motor in both directions: http://www.instructables.com/id/Control-your-motors-with-L293D-and-Arduino/?ALLSTEPS
If you only need to run the motor in one direction, then you can use a MOSFETtransistor like this one, which has a link to an arduino tutorial:
https://www.sparkfun.com/products/10213
Good Luck!
I'm gonna start on the Project thanks for your help my friend !
Yes they all support 2A but after some troubleshooting I found that the motor only draws .05A from a working 3 phase controller I have. I did find that one of the hall sensors is not working correctly.
I have tested everything;
I tested that the out puts work High, Low and NC they are fine. I am using 24V and not 12V like you did, does that mean that I should have made some changes with resistors. The one thing I did do was connect both the Sense one and two together and then connected the resistor to GND.
The motor just doesn't seem to spin at all.
Have you tried getting the motor to turn by manually powering the phases (see step 4)
Step 1 2 3 4 5 6
Clockwise: CB, AB, AC, BC, BA, CA
Counter Clockwise: BC, BA, CA, CB, AB, AC]
have you tested the Hall sensors? You should be able to make them go high by putting a magnet near them.
Do you have an oscilloscope? It helps to have that to see if the hall sensors are in synch with the motor (you can spin the motor by hand and watch the sensor output
I keep thinking that it has something to do with the sense 1 and 2. you did say that you needed a 400ohm from sense to GND but mine is 470ohm.
I don't know if it makes a difference to have 470 or 400 ohms on the sense pins.
I need to go back and read the instructable because I have forgotten so much. I will do that when I have time.
Thanks for your help so far i'm very grateful, but if you have any ideas with the new problem I'm happy to hear it.
Thanks again
If you put the motor on a motor controller I have it works fine.
If you just take two of the phases and put them across the positive and negative terminals the motor moves a fraction.
I have a multimeter and when I put it on the terminals I can get a positive and negative and NC reading from each of the 3 phases of the out pins.
I have gotten this motor to turn just using relays it was slow and very noisy but it worked my point is the motor works.
I will list a few of the voltages coming off the L6234 below;
Vs: 24v
VBOOT: 31.7v
VCP: 4.61v
VREF: 9.24v
Sense 1 & 2: 0
I hope this helps. I'm so stuck right now. I don't understand how I can get voltage out of each output but nothing works
I have been trying to follow this instructable and I just cant get it to work.
I have built the electronics but the nothing works. the only difference is that I am using a 24v 2A BLDC and a Arduino UNO R3
Do you know if the code doesn't work with the UNO R3
I wrote the code for a Duemilanove, but I think it should work fine with an UNO. I did this project three years ago, but I can try and help you troubleshoot.
My first question is: Do all of your electronic components support 2A?
Second, you say that nothing works. Why don't you start with an individual step iin the instructable and describe what is happening.
Can I check it by Sanwa Analog Multitester ?
First, connect the sensor as shown in my instructions, and then move a magnet slowly across the sensor. When the sensor works, you will see the voltage go high when it senses the magnetic field. A refrigerator magnet is useful for this, because it has stripes of magnets and as you move it across the sensor, the voltage will go high-low-high-low...
I am designing a parking sensor and need to use the analogWrite() function to control my sensor as the tone() function is tied up somewhere else.
I was wondering if you could run me through how you altered the frequency of the analogWrite() PWM.
Any help would be greatly appreciated.
TCCR2B = TCCR2B & 0b11111000 | 0x02;
- The default for TIMER2 is "0x04"
- If the code is confusing, check out these links for some help:
-http://arduino.cc/en/Reference/Boolean
-http://arduino.cc/en/Reference/BitwiseAnd
-http://arduino.cc/en/Reference/BitwiseXorNot
-http://arduino.cc/en/Reference/Bitshift
This will work on any 'ATmega' or 'ATtiny' that is supported by Arduino (install ATtiny 'cores' to program them with Arduino 0022 or Arduino 1.0)
I did not figure this stuff out myself. I'm just passing the information onward. Check out this page in the Arduino Playground. It's extremely helpful!
-http://arduino.cc/playground/Main/TimerPWMCheatsheet
Thanks for your interest.
Use an ohmeter to figure out which are the three phases and which is the center tap. The resistance between any two phases should be double the resistance between a phase and the center tap.
As far as getting your motor to spin CW or CCW, please read the instructable carefully, as I believe I put detailed instructions on how to do that. If you still have problems, send another comment.
I'm curious, do you have access to an oscilloscope?