In this tutorial, I will show you how I made a very simple brushless DC (BLDC) motor. This is an "inrunner" type motor that contains one phase, four poles, and four permanent magnets. Not sure what all of that means? Here is a run down of what you need to know:
This refers to all of the non-moving components of the motor. In the case of this particular motor, the stator consists of the PVC housing, and the electromagnets (or "poles"). This motor is called "single phase" because there is only a single wire which wraps around each electromagnet.
This refers to the moving components of the motor. In this design, the rotor is the component in the middle of the stator, with permanent magnets mounted to each of its arms. Since it is contained within the stator, this motor is called an "inrunner" type.
A BLDC motor requires an electronic controller to perform commutation. The word "commutation" refers to the process of changing the direction of current flow through the motor windings in order to switch the polarities of the electromagnets at precisely timed intervals. This ensures that the rotor keeps spinning. Depending on the design requirements, the control circuitry can vary greatly in complexity. For this motor, a very simple H-bridge circuit is used with a Hall effect sensor and Arduino.
Why PVC? Because it's cheap, easy to make modifications to, and does not interfere with magnetic fields!
You may also find the equation for the magnetic field of a solenoid to be helpful:
B = unI
where u (mu) is the magnetic permeability of the core, n is the turn density, and I is the current.
Now let's get started!
Step 1: Shopping List
Below is a list of the materials that I used for my design.
1. 8 3/4" x 3/4" x 1/2" PVC reducer side outlet 90-degree elbows
2. 6 3/4" PVC tees
3. 3/4" PVC pipe (about 10 feet or so)
4. 1/2" PVC pipe (about 5 feet or so)
5. 2 1" 4-way PVC cross connectors
6. 4 6" x 1/2" soft iron rods
7. spool of magnet wire containing 507 Feet of wire
8. 12 1.5" x 1/16" N45 Neodymium disc magnets
9. Loctite Tite Foam Insulating Foam
10. Gorilla Glue
11. 3 6 V lantern batteries
12. 8 3/4" PVC couplings
13. 1 1/2" Slip x MPT (male pipe thread) PVC adapter
14. 1 3/4" x 1/2" PVC reducer bushing
I found most of these items at Home Depot. You can get 10 feet of PVC pipe for just a couple of dollars. The exact amount of pipe that you will need will depend on how large you want the motor to be. I ordered magnet wire from Remington Industries. Soft iron makes for excellent electromagnet cores, but it is not required. Stainless steel should work fine. It is cheaper and easier to come by too. You can find stainless steel rods at your local department store. The Neodymium magnets were ordered through CMS Magnetics. Only 4 magnets are required for this motor, but I purchased 12 so that I could make 4 stacks of 3 to produce stronger magnets. Other types of magnets, such as ceramic magnets, work too. The stronger the magnets, the better. Motors are power-hungry machines, so lantern batteries are a good choice.
Step 2: Doing Some Planning
The next step is to determine the motor's dimensions. As you can see from the sketch, the motor is going to have a box-like structure. I would recommend making the width and length of the base the same.
Before you can determine the width/length for your base, you will need to find out the length of the rotor (the part in the middle of the sketch). To do this, take one of the 1" 4-way connectors and insert one of the 3/4" couplings into each end. Make sure they are in tight. Using a hammer will help. It should be symmetrical on all sides. Now measure the distance between two opposite ends. Take note of this value. Next, determine the width of one of your magnets (they should all be the same). If you are stacking groups of magnets together for each arm of the rotor, multiply this value by twice the number of magnets in each stack (this is to account for symmetry). For example, in my design I split my 12 Neodymium magnets into four stacks of three, which effectively gave me four magnets each with three times the strength of a single magnet by itself. Each of my magnets had a thickness of 1/16", so I multiplied this by 2 x # magnets in each stack = 2 x 3 = 6. So this gives 6 x 1/16" = 6/16" or 3/8". If the width of your rotor without magnets measured 6" across, then with magnets included it would measure a total of 6" + 3/8" = 6.375" across.
Next you will need to determine the size of your air gap between the rotor and stator. In the drawing above, the air gap is the distance between one of the rotor arms and the nearest electromagnet when the rotor is completely aligned with the stator. I would recommend shooting for about 1/2".
Lastly, the electromagnets need to be considered. For the moment, let's assume that your electromagnet cores measure 6" in length. Since the rods being used for the electromagnets will be protruding from the insides of your tee connectors, this means that only 6" minus the height of the tee will actually be wrapped in wire. The height of the 3/4" tee is about 2", so the length that you would use for the solenoid formula would be 6" - 2" = 4". The contribution from the electromagnets to the length/width of your base is 2 x (length of electromagnet + height of tee) or 2 x (length of rod). Remember, the electromagnet is only the part that is wrapped in wire.
Given this information, the total width of the base, W, can be calculated from the equation W = width of rotor with magnets + 2 x air gap + 2 x (length of rod). Remember, the tee connectors are already accounted for in the formula by using the full length of rod. For example, if we are going off all of the measurements above, the total width of your base would be W = 6.375" + 2 x 1/2" + 2 x 6" = 19.375".
We do not have to calculate the height of your motor just yet. For now, this is all we need to get started.
Step 3: Completing the Square
Now you are ready to start building your motor. The first thing to do is to construct the base. Begin with a square much like the one in the above picture. Use one of the PVC elbows for each corner, with the reducer side alwats facing up. Form each side of the square with your 3/4" pipe. Note that you will need a tee connector at the midpoint of two opposing sides. This will make a connection with the rotor, which will sit upright at the center. When the rotor spins, however, it may tend to lean back and forth toward the two unconnected sides. One way to avoid this would be to instead use tee connectors on all four sides of the square. This will further stabilize the motor. Note from the picture that I chose to only use two tee connectors.
Before moving on to the next step, you should have something which looks much like what is in the picture, with either two or four tee connectors.
Step 4: The Rotor
Next we are going to build the rotor. If you haven't already, take one of the 1" PVC 4-way connectors and insert a 3/4" coupling into each end. Make sure they are in all the way. On the underside, drill in a hole through the center that is just big enough for the threaded end of the male adapter piece to fit into. I did this using a tapered drill. Don't worry if you end up drilling through the backside of the 4-way connector as you are doing this. It won't have any effect on the motor. You want it to be a tight fit.
Next, arrange the permanent magnets around the rotor in alternating order. I can't stress enough how important it is that you do this. Tip: usually the North side of the magnets are all marked by the manufacturer. When the magnets are placed around the rotor, the magnets on opposite sides of each other should repel, and magnets adjacent to each other should attract. Note that your magnets need to be large enough to fit over the couplings, but not too large or they will bump against the electromagnets when the rotor spins. My 1.5" Neodymium magnets made a nice fit with the 3/4" couplings. I used gorilla glue to attach the magnets to the rotor. Glue the backside of each magnet (or stack of magnets) and firmly press them against each coupling. Give it some time for the glue to dry. Leaving it out in heat, such as the inside of your car, will speed up the process. Remember that the magnets must be in alternating order.
While waiting for the glue to dry, it is a good idea to start assembling the base and shaft which the rotor will be supported by. For the base, take the other 4-way connector and make sure you have your bushing on hand. Just like before, insert a 3/4" coupling into each end. Next, drill a hole through the center of one side of the 4-way connector just large enough for the bushing to fit into it. Note that this side will face up. Once you have decided how high you want the rotor to be off the ground, cut the desired length of 1/2" PVC pipe. This pipe should make a tight fit with the base bushing. However, you want the rotor to be able to spin around the other end, so more than likely you will need to sand that end down a bit. Don't overdo it, though, or you will cause the rotor to wobble. Sand it some, and then (once the glue has dried) connect it with the rotor via the adapter on its underside. Then try and rotate the rotor to see how well it can spin. Sand it down some more if you think the connection is too tight. If you have some Vaseline, applying a dab of it around the sanded end will help. Once you think you got it, connect the sanded end of the 1/2" pipe with the rotor, and connect the non-sanded end with the base 4-way connector via the bushing. Next connect the base 4-way connector with the rest of the square you constructed in the last step via the tee connectors using 3/4" pipe. Note that if you chose to only use two tee connectors for your square (like what I have), then two opposite arms of the base 4-way connector will not be connected to anything except for the couplings (keeping them there still helps to balance the rotor).
Step 5: Fun With Foam
Each side of the top square (refer to drawing in Step 2 for reference) will contain a tee connector of which an electromagnet will protrude from. You should have four cores/rods of identical size. I am using 6" x 1/2" soft iron rods. Using the bottom square you have already constructed as a reference, cut 3/4" pipes to extend from each of the two opposite ends of each tee connector. You should have a total of 8 pipes (2 for each tee) of about the same length. Do NOT connect them with the tee connectors yet.
Next, we are going to fill each of those pipes you just cut with insulating foam. The reason we are doing this is that eventually we are going to want to apply foam between the inside of the tees and the electromagnets. But if there is just open space inside of the pipes, the foam is going to tend to spread out in each direction before doing what you want it to do. Also, the foam will expand, so you may crack open the pipe. It is best to fill each pipe first, and then let the foam expand and dry. You will probably want to do this over some cardboard or aluminum foil to avoid getting foam on your kitchen table. Once you have filled each pipe and let them sit for a while, you will notice foam has pushed its way out each end of pipe. Using a small razor or a knife, remove the excess foam from the edges. Your pipes should look the same as they did before, with the only difference being that they are now filled with foam inside.
Now we are ready to join the pipes together with the tee connectors. Do this to complete your sides. Then take one of your metal rods and insert it into one of the tees. Obviously, a 1/2" diameter rod by itself doesn't really fit with the 3/4" tee. But with some foam we can establish a solid connection. Make sure you are holding the rod all the way into the bottom of the tee as far down as it will go. It should also be as straight as possible. As you are holding it, use your free hand to fill the gap between the rod and the inside of the tee with foam. The foam will burst out of the opening (toward you), and this is perfectly fine. Continue to hold the rod for about a minute or two as the foam starts to settle. You should be able to let go of the rod now without it falling over. Leave it alone for a few hours (I let it sit overnight). Repeat this process for each rod. After you have let everything dry, again use a razor or a knife to remove all of the excess foam.
You should now have each side of your top square constructed, except for the corners.
Step 6: Completing the Cube
Next, take each side of the top square that you just made in the previous step and join them all together with the elbow connectors as the corners of your square. The reduced outlets of each elbow should not be connected to anything yet. You should now have two squares that are about the same size. Now all you need to do is connect them together to obtain that cubicle shape. The four columns that will be used to connect the bottom and top squares will be formed with 1/2" pipe, since it must fit into the 1/2" outlets of the elbows. You want the electromagnets to be about level with the permanent magnets from the rotor. Based on this, you should be able to figure out what length of 1/2" pipe to cut for each column. Once you have your four columns, connect the two squares together, and you should have something much like in the above picture, with the exception of the magnets not being present in the picture. Also, note that in the photograph here I have a tee connector at the bottom of my rotor. Ignore that! I originally tried using the tee connector, but it was a bad idea. You should have the four-way connector + bushing there that was described previously.
Step 7: Creating the Electromagnets
The next step is to wrap turns of wire around each rod/core. I did 600 turns each. Recall that this is a single-phase BLDC motor. This means that you will use the same wire for every electromagnet. In other words, complete your turns for one electromagnet, and continue with the same wire to the adjacent magnet, and so on, until you have finished with all four electromagnets. IMPORTANT: You must turn the wire in the OPPOSITE direction for each adjacent core. This ensures that whenever there is current, the electromagnets will have alternating polarities. You must do this!!!! When you are finished, then you will have completed your motor. Congrats!
Now for the circuit.
Step 8: Controller (Simple)
NOTE: I am fully aware that there are many different ways to do this part, and I am not even suggesting that my way is the best, but I am just sharing what I did to help those who need it.
For this motor, I created a very simple H-bridge circuit with a hall effect sensor and Arduino. Take a good look at the above schematic and Arduino code. Note that I used MOSFETs for my bridge. Here is a complete list of the circuit components that I used:
1. 3 6 V lantern batteries (18 V in series)
2. 1 motor (the one you just made!)
3. 4 10k ohm resistors
4. 2 2.2k ohm resistors
5. 1 500 ohm resistor
6. 2 PN2222 NPN BJTs
7. 2 IRF9630 P-channel MOSFETs
8. 2 IRF630 N-channel MOSFETs
9. 1 US1881 latching Hall effect sensor
10. 1 LED (I used a blue one)
11. 1 Arduino board (I am using the Arduino Uno)
The LED and 500 ohm resistor in series between the supply pin and the output pin of the US1881 hall sensor are not necessary for the motor to operate. It is just there for debugging purposes. The upper two switches in the H-bridge are the IRF9630 P-channel MOSFETs, and the lower two switches are the IRF630 N-channel MOSFETs. Connected to the gates of the P-channel MOSFETS are the collector terminals of PN2222 BJTs. Being fed into the base of the upper left BJT and the gate of the lower right N-channel MOSFET is one Arduino digital output pin (I used pin 12). The other BJT and N-channel MOSFET are each connected to another Arduino digital output pin (I used pin 11). The 5 V power pin is connected to the voltage supply pin of the hall sensor, and the hall sensor's output is fed into an Arduino digital input pin (I used pin 13). So in total, I used five Arduino pins, including the ground pin.
I'm not going to explain all of the details to how H-bridges and MOSFETs work. There are plenty of great online sources for that. But here is a brief description of how the circuit works:
Whenever the hall sensor sees a South side permanent magnet, it outputs 0 V. This does two things:
1) turns on the LED
2) tells Arduino to output 0 V from pin 12, and output 5 V from pin 11, which turns on the upper right and lower left switches, making current go one direction.
Whenever the hall sensor sees a North side permanent magnet, it outputs 5 V. This does two things:
1) turns off the LED (if it was already on)
2) tells Arduino to output 0 V from pin 11, and output 5 V from pin 12, which turns on the upper left and lower right switches, making current go in the opposite direction.
This is why it was crucial to setup the permanent magnets of the rotor in alternating order. Whenever the rotor spins 90 degrees to try and align itself with the electromagnets, the hall sensor inverts its output, which changes the direction of current flow, switching the polarities of all of the electromagnets. This causes the rotor to rotate by another 90 degrees to try and align itself again. And this process continues on and on....
Note that in the video I had to give the rotor a little bit of a push before it started spinning on its own. This is because initially the rotor was completely aligned with all of the electromagnets, so when current started flowing, a repulsive force generated from the interaction of like-poles and directed through the center of the rotor was exerted equally on each arm of the rotor. This implies zero net torque. The motor will self start if the starting position of the rotor is slightly out of alignment with the electromagnets. Another fix to this problem would have been to adjust the permanent magnets such that they were all titled at a slight angle away from the electromagnets.
Also, it can't be emphasized enough how crucial it is to have your hall sensor at the right position. I soldered the leads of my sensor to some jumper wires so that it could stick out from my breadboard and sit up close to the rotor. You will probably end up having to do a lot of fine-tuning yourself. Now obviously, I was not really going for a permanent design here with this motor. I was more interested in learning more about the basic underlying principles.
There are a number of reasons for why you could be having trouble with your circuit.
1) A wire may have come out of place. This can happen when the motor gets going. If you have your motor on a shaky table, then more than likely the vibrations are going to cause a wire to come out.
2) Batteries. If you are using batteries like mine, which have the spring contacts, then you probably noticed how tedious it can be to keep them all connected with jumper wires. It involves a lot of readjustment. Again, if you have an unstable surface, the vibrations can cause a wire to come out from one of the springs. It's also a good idea to have a voltmeter on hand, so that you can check if your battery is low on juice.
3) You might not have connected the circuit properly. Double check with the schematic, and make sure nothing is getting shorted, or you'll blow something up.
4) You killed one of your transistors. If you start seeing smoke, or you smell something funny, then those are both good signs. If you feel inclined, you can attach some power sinks to the MOSFETs. Thin copper strips should do.
5) You forgot to save your Arduino sketch before trying to run it. You probably didn't make this mistake, but embarrassingly enough, I did.
Hopefully this helps.
Well, that's about it. I hope you enjoyed! I'm sorry for not making the most efficient motor. It's more like a science project. Still, it is by definition a single-phase BLDC motor. I plan on making a more realistic/applicable and compact one in the future. I also probably over complicated some of the earlier sections. Many of the choices I made for components were based on the lack of having the ones I originally wanted available. So I had to invent some things. I encourage you to find ways to improve upon the original design.
Leave a comment, or contact me for any additional questions.