You are here

Hall effect calibration broken on small motors

1 post / 0 new
felixer
Offline
Last seen: 1 year 5 months ago
Joined: 2021-01-28 18:49
Posts: 1
Hall effect calibration broken on small motors

So the setup is a flipsky VESC spinning a tMotor MN5008 with hall effect sensors I have installed on it myself.

ESC: https://flipsky.net/collections/electronic-products/products/torque-esc-...

MOTOR: https://store-en.tmotor.com/goods.php?id=998

HALLS: https://www.digikey.com/en/products/detail/honeywell-sensing-and-product...

24 pole 28 magnet motor, so 14 pole pairs gives a ~8.5 deg spacing between halls. They are spaced at 2x this otherwise they don't fit, and have tried having them lined up with the edges of the magnets as well as against the faces. Regardless the hall sensors are returning nicely spaced pulses that correspond with magnets passing them.

anyway on to the problem. After this is all setup I run the VESC hall calibration and it fails, simply returning BAD FOC ERROR or something like that. Then going to the terminal and running hall_analyze 5 gives a very large maximum deviation/error. The resulting numbers are typically close between hall_analyze tests but seem to change at random sometimes. Increasing the current did not help as suggested in other posts. I finally aligned all of the hall sensors with a known phase using an oscilloscope. So each of the three hall sensors are perfectly aligned with a corresponding phase (phase's back emf is positive when the hall sensor is high). I then took each hall and phase wire and connected them to the ESC to make sure they were all lined up (the matched hall and motor wire were connected to hall1 and the first phase etc).  After doing this running the hall calibration STILL results in a failure and the hall_analyze command still comes back with poor alignment.

So now i'm desperate and just make some assumptions about the hall table. From searching around we found table[0] and [7] are typically 255 and the numbers otherwise correspond to 0-360 degrees transformed to 0-200 in the table (so it'll fit in 8 bits probably?). so the guess is table[1]-[6] are probably the 6 commutation points in degrees and they probably correspond with the 1>3>2>6>4>5 hall value thing I have seen ESCs use. Given that assumption, I made the following table using the fact that the hall effect sensors are all lined up perfectly with the phase they are numbered for:

Hall Table[0] = 255

Hall Table[1] = 0

Hall Table[2] = 66

Hall Table[3] = 33

Hall Table[4] = 133

Hall Table[5] = 166

Hall Table[6] = 100

Hall Table[7] = 255

So a bunch of assumptions later it works. The motor spins perfectly from a stop.

Our Theory is that the motor/magnets are so small compared to the hall sensors they are picking up noise from the stators near it. I'm really not positive what is going on and would love some insight into this so every time we build one of these we don't have to painstakingly align the hall sensors or care which phases are connected where. would imagine that if there was a hall calibration routine that had the user spin the motor by hand it would work. If we are right and the halls are picking up nearby noise maybe the current is too high for this task a hall calibrate function that instead of just using the maximum current instead stepped up slowly from 0Amps to maxAmps attempting the calibration each time and taking some smart average wouldn't break in this situation? Any thoughts on what might be going on?