So the magnet ring changes from north to south 64 times and each change is a index, because the encoder chip doesn’t know where it’s on the ring, it only knows knows the magnet field that’s above it and thus give a for count out I think.
Ok so if it changes North/South 60 times per turn, then the encoder will read 60 times 4096 values… which is what SimpleFoc does not handle (if I am right ?).
I have just started to design a timing belt rig to rotate the magnet for an external encoder.
My idea is to glue a timing belt on the cylinder and use it to make the teeth of the gear.
I will have to be acurate when gluing the belt… I will see if it works ! It should as almost no effort is needed on these gears…Only rotate the magnet !
And as the two gears will have exactly the same number of teeth it must work with simpleFoc !
Another link with magnetic ring magnets : Project HoverArm - #9 by madcowswe - Projects - ODrive Community
As far as I can tell an AS5311 sensor with a magnetic ring should work on the incremental output with simplefoc.
I have progressed on the encoder mount.
Seems to be feasible !
I will keep the aluminium plate of the hoverboard and fit the encoder mount on 2 of the 4 screws which fix the motor axis.
And after an hour of printing the result is there !
I have to cut the screw and put the magnet in place on it ; then the encoder will no longer be a problem !
My integration of this magnetic sensor works but is a little “too big”… So starting from @Franz_Schmidt’s idea I have tried something else
reverse the idea to glue the sensor on the bub → glue it on the shaft ![]()
- drill the motor shaft so that you get a “pipe” into which can go the motors wires as well as the sensor’s ones (6 wires for AMS sensor)
- drill the outrunner bell so that you can see the shaft
- design a small pcb on which you will have the difficult task to solder AMS sensor and 6 wires
- glue this on top of the shaft (which is fixed into the bearings)
- then (easy part) design a small cover to fix the magnet on the rotating bell
And here is the result (almost) done !
Still have to solder all this (when AS5147U will come)
and then the tests with simpleFoc library ![]()
JP
That’s actually genius, I’m going to do that on my next hub motors.
With the magnet in place it looks like a new motor !
And it should fly @2mm from the sensor, just into the specifications !
Hi, you mention earlier about B-G431B-ESC1
I am interested on how would you connect that to the STM32F4 board for MMOs. I don’t have the slightest clue on how to use these.










