Hoverboard motor with built in encoder


This is my project for my nephew.
Now we are looking forward for the hoverboard motor support:)

I have built in the AS5311 encoder into the wheels using “heat resistant” 3D printed nylon.
I tried first to use the cables already available for the hall sensor, but experienced a bit of noise when I tried to run the motor. I then swapped them for a 4 wire cable with screen, and got much better result.

Here is videos of the encoder signal:

And here is a video of the tractor I’m making.
The throttle is connected to a DC vibration motor though a Teensy 3.2. The motor also has magnets attached to simulate compression in the motor.
An AS5048 magnetic encoder is connected to the motor and is generating a sinus as the motor is rotating. The sinus is then used to make the engine sound. Vibration and sound will always be in sync.


Your nephew is quite lucky!

Do you know the make/model of the shielded cable you ended up using? There are so many types out there it is difficult to know which will work with the type of interference seen in this applications. Also, nice solution for mounting the encoder.

I think any thin screened cable will do. But the one I use and recommend is a TPU jacket cable, which makes it very flexible and durable.
I use this: https://www.digikey.com/product-detail/en/tensility-international-corp/30-00490/T1318-5-ND/5819489
This is one is 32 AWG and very thin, they also have 28, 26, 24 etc.
Remember to only connect the shield to GND at the odrive end, and leave it unconnected at the sensor/motor.

I still need to take apart one of my hoverboard motors. I can’t quite see where you encoder magnet ring is in this configuration? This looks like a real nice way to mount this up though.


You can see the magnet ring and the white nylon holder in the last photo, and also at the end of the first video.

This is awesome! What was your source/PN for the magnet ring?

I requested for samples directly from AMS. Too bad they are not easily available. Also the AS5311 is in backorder everywhere.

Thanks. So no part number then?

They’re not cheap, but I’m curious if renishaw magnet rings would work as well: https://www.rls.si/eng/radial-magnetic-rings

And it also looks like you have a radial ring installed, while the readhead is an axial sensor. Or perhaps AMS just magnetizes differently than Renishaw/RLS.

AMS calls the ring AS5000-MR10-128.
Any ring with pole pairs of the right size placed 0.3mm from the top of the chip will work. Magnets are magnets. Check the encoder specifications…

How do you handle startup? I mean, how does the encoder sync up with the commutation?

Hi thanks for the post,
Do you use multipolar magnet ring?
Or this is a ordinary magnet ring?, i mean one side north and other side south.


Is the motor here with dead axle?

I need to have an encoder into an hub motor but such motor has no spinning axle.


Wondering what settings did you use for the encoder, using a similar setup with same magnet and sensor, but I am stuck in the calibration phase

I am going through a similar setup and found increasing the motor.config.resistance_calib_max_voltage to 10.0 made the calibration work properly with my motor (hoverboard wheel).