3D printed BLDC out runner motor

Hi, I have been working on a 3D printed BLDC outrunner motor. It has 20 poles and 18 slots. I know that it does work because I was able to hook it up to an RC ESC and it worked. I am hoping to use an Arduino UNO as a controller and an L298N as a driver for testing the motor. For sensors, I have hallsensors I know I need 3 spread out evenly. But I don’t know if they need to be put in with the stator or if I should put them on the inside of the case reading the rotor. I also don’t know how I would properly set them up with the Arduino. If you have any thought on what I’m doing wrong or what I can do better comments would be greatly appreciated.
Thank you for reading.

1 Like

Welcome @purple!
20 poles means you have a 10 pole_pair motor - this value is passed to both BLDCMotor and HallSensor constructor.

The purpose of the hall sensors is to determine the 6 electrical sectors of 1 electrical rotation. As you have 10 pole_pairs there will be 10 electrical rotations for each shaft rotation. This will give you 6x10 hall transitions per shaft rotation i.e. a transition every 6 degrees. Your job is to ensure that you get a transition evenly every 6 degrees! You could either do this empirically (with an oscilloscope making adjustments in hall placement) or try to work it out through a bit of maths and a bit of luck.

Hall sequence will be something like this:

H1  H2  H3
-----------
 1   0   0
 1   1   0
 0   1   0
 0   1   1
 0   0   1
 1   0   0

If you think of the 1s as being a north pole and the 0s being a southpole then you can almost see a pole pair (north and south magnet) moving across the hall sensors in the table above!

I might have got the maths wrong but if H1 is at zero then H2 can be placed at 12 degrees (or 12 + (n 36)) and H3 at 24 degrees (or 24 + n36)) where you might choose n > 0 if you wanted to space out your halls a bit.

I’ve never tried to place halls, so would be interested to hear how you get on.

These halls will need pullup resistors otherwise the voltage will only vary between 0V and ~0.2V. I’ve used a pullup of 1 or 2K in the past but this is lower than some people recommend.

The hallsensor example might be a good place to start:


You might need to use a software interrupt for the third hall as I think uno only supports two hardware interrupts.
1 Like

thank you so much for helping me :smile:

1 Like

Awesome project! I’d love to see it spinning with FOC!

I couldn’t add anything to what Owen had to say about Hall sensors, except that they’re better suited for fast-spinning applications, because of the 6° accuracy.

Have you looked at using a magnetic encoder IC? Something like an MA730 or AS5048A will be far more accurate for speeds under 10000RPM, and could be simpler to implement? Typically the motor only has to include a small magnet at its axis, and the sensor is mounted externally.

I think that I will move to use magnetic encoders but I do have some questions. Do I have to worry about the bearing screwing it up because I’m hoping to place it in the middle of it.


Also, where should I buy the encoder from and where should I buy the magnet from.
thank you for helping me out :slightly_smiling_face:

I think that last photo is showing the stator side. The inside of the bearing will be moving with the rotor. Is that a skateboard bearing (22mm outer, 8mm inner). So you’ll have a shaft going through this? I’d glue or attach magnet to end of shaft and then build a shim to hold the magnetic sensor a few mm away from magnet. Probably need some new holes in stator to attach this securely.

Some sensors come with a magnet (as5147?), others do not (ma730). You can pick up a 10x diametric magnet from ebay for £3 e.g.

Hi @purple,
In your case, if star winding, you have to put the Hall1 at 9° from middle of the first slot (phase A), and then at 12° for the followings.
You can also put the Hall1 after the first slot (phase A) between slots and then Hall3 on 6 slots after, and the Hall2 at 6 slots after for a 60° commutation.

Hey - magnets are available all over the place, and are cheap - amazon, eBay, AliExpress will all deliver. Just make double-sure they really are diametrically magnetised, some sellers are a bit vague or unreliable in their descriptions.

6-8mm is a good size for most of the sensors, with 2.5 or 3mm thickness.

For the encoders, be careful on AliExpress or eBay - many of the offerings only have their PWM lines soldered, and you are faced with a very difficult soldering job if you want to use SPI.
If you don’t mind the size, these will work well:



They’re available direct, or also from Mouser, DigiKey etc… Note that these boards already come with the right kind of magnet.

@purple,
Another thing, if your stator is not made of steel lamellas (for the currents of Foucault), your brushless will not work (magnetic circuit).

Even with AS5048, MA730, as5047, Hall sensors,…

I was wondering about that, since it is a bit unclear from the pictures… what are the windings “wound around”? Is there a ferromagnetic core around which the windings are turned?
It is possible to print with metal-containing filaments… is this a technique you’re using?

The stator is not made out of Electrical steel but it will work but with less torque. I have put steel inside of the coils. for printing ferromagnetic PLA it doesn’t seem worth it because 1Kg costs 70 dollars so much more than what I’m going to pay. along with that winding by hand is a pain to do on a real coil. It’s much easier to wind one-third of it at a time on a jig. So if you need to make a new stator you can just take out the coils.

2 Likes

I’m fascinated!

It will be so cool if this works well.

I think it is particularily interesting in combination with 3D printing mechanical designs for things like linkages and hub-wheels, where the motor as a separate unit with housing and its coupling to the 3D printed parts take a significant amount of space. By being able to put rotor and stator directly into the printed parts, you only need to add bearings, and can achieve far more compact designs.

Very cool projekt!

Im sure you have seen the 3D printed BLDC on youtube?

For a outrunner to have any real efficiency, the windings must have a core. Like you mention yourself, the design is not optimal. It would be awesome to integrate a laminated core into your design. I have tried to reach out to this company here : http://www.crazy-motor.com/pd.jsp?id=46#pp=0_304_21-1

Particularly the 15cm dia. nr. 86 (12slot) is interesting. I would not mind doing like 127 turns per coil. I’m not sure i can do it as well as a machine though, have not tried. That crazy-motor company has a coil winding machine…

No reply yet.

Here is another company. Maybe they will answer :smiley:

I also made this before, it really works very well.

3 Likes

That is a pretty cool 3D design. But what kind of torque can it withstand ?

If you had a laminate (metal core) stator and a strong 3D printed rotor, maybe carbon fiber re-enforced filament, naturally it would be more heavy, but the forces would not scatter the plastic.

Ah here is the test statistics: below 1 Nm

Hey purple one

I watched this and thought about your project. It is a bit of work to set up, and you need the right tools. Vacuum chamber for degassing, making of mold. If you don’t want to see the soldering of windings skip to approx. mid vid. https://youtu.be/ZuTsvKQVkcw

If one was to reinforce the stator with carbon fiber compared to glass fiber it would have a higher torque rating, IMO.

There is no iron core in his design, but I don’t se why you couldn’t place some iron in the center of the coils.

This dude uses iron powder mixed with epoxy in a 3d printed mold. https://youtu.be/ZmzD1c7D214

10 € for a kilo iron powder, that’s not too expensive. https://www.laboratoriumdiscounter.nl/en/iron-powder-pure.html?gclid=CjwKCAjw7J6EBhBDEiwA5UUM2tPuUX8WjMcSOPbCUDJyLoAcpASSMAWZRnJltNECrpoY-hA9O1nnuhoCaOEQAvD_BwE

I would probably paint it with some paint for brake calibers.