I’m currently working on a project that needs very cheap contactless angular position sensing, and I ended up trying to develop a custom solution. SimpleFOC provided a convenient platform for prototyping the concept, so I thought it would be nice to write a sensor driver for this technique to let other people use it easily.
You can have a look at a rough draft for the documentation here if you want a detailed explanation, but this is the TLDR:
Two analog linear hall sensors placed very specifically around the outer edge of a bldc motor can pick up a non-symmetrical waveform from the motor’s own magnets, that the microcontroller can sample and use to find relative shaft angle
- ~20 cents per sensor in single quantity, no cost for magnets
- Off-axis from the motor’s axle
- Specific sensor location for each motor part number (note: not each individual motor though)
- Requires fast and frequent analog sampling
- Requires a computationally expensive trig function
- Many factors can degrade performance of the sensor
Here are some pictures of the setup:
Note the two sot23-3 packages on the perfboard suspended right above the motor, these are the two hall sensors
An oscilloscope trace of the raw analog output signals from the hall sensors
The digitized readings, converted to shaft angle (in degrees) of a motor spinning at constant velocity
I think the main functionality is roughly all implemented, but now it is time to test a bit, clean up the code, and write some documentation.