A while ago, a friend of mine implemented hall sensor feedback. He used it to replace the driver on his off-the-shelf electric skateboard, which had hall effect sensors:
I won’t bother to find his code though, since I think it was a fairly unmaintainable bodge. But he did do it in one weekend, just to give you a sense of the work effort involved. He didn’t do sensorless though, just straight hall
-> rotor angle.
Here is how I would do it:
- You can repurpose the encoder pins to be hall effect inputs. You can set up the pins to be interrupt-in pins, and do the hall effect state to rotor angle decoding in software. [EDIT]: GPIO in, and just sample in the control loop, is probably fine.
- Make a PLL (similar to the encoder or sensorless PLLs) to track the rotor velocity
- Use the hall PLL’s velocity, and with some hysteresis, do switching between using the hall rotor angle and the sensorless rotor angle for control.
- It may be a little messy to get all the units to line up, but it should work in principle. My suggestion is to convert the hall state to electrical radians, and do everything in those units.
The voltage is indeed pretty hard-limited at 24V. The first thing you hit is the capacitor ratings at 25V. I don’t think they blow up at higher voltages, but they degrade very quickly. Once you hit the breakdown voltage of the MOSFETS at 30V, they will just conduct the battery voltage straight to ground and let the smoke out.
That competition looks super cool! Reminds me of the Sparkfun autonomous vehicles competition ;D