I am an engineer working on robotics and considering building a compact tool for BLDC/PMSM motor bring-up and commissioning after having a lot of issues there.
The idea is a device that connects to the motor phases, Hall sensors, and incremental encoder signals. After a short alignment procedure, with one click it would help identify things like:
Correct Hall sequence
Encoder direction
Phase/Hall/encoder mismatch
Hall sector angles
Commutation offset
Possible wiring mistakes
The goal is to make motor bring-up easier, especially when working with Hall sensors and incremental encoders, without having to manually debug everything with an oscilloscope or logic analyzer.
I am still validating whether this is a real need before spending serious time on the hardware.
Would a tool like this be useful in your work or projects?
How do you currently solve Hall/encoder/phase alignment problems?
Any feedback, criticism, or “I would not need this because…” comments would be very helpful.
This feels like something that could be done in software on a motor driver board you already have, not needing any kind of special or dedicated hardware.
On my motor driver boards running custom firmware the sensor calibration sequence is designed for sin/cos encoders (implemented with 2 linear hall sensors) and handles calibrating the offset, direction, and alignment between sensor and motor phases. So basically plug in the motor, set the voltage and speed you want to calibrate at (defaults provided which work for the motors i’ve used but some bigger motors may need a slower speed and smaller motors may need lower voltage), and click calibrate, and after 30 seconds it spits out the calibration constants if successful and the motor is nearly ready to use (after putting in the appropriate FOC PID constants for the motor).
The way it works is first by spinning the motor for around in open loop mode and collecting the sensor data to determine the offset, then it reverses direction a few more times and collects more data and averages the angle offset between the encoder angle and the commanded motor angle for both directions. A check is implemented to make sure the data doesn’t jump around too much implying a disconnected sensor or motor wire or wrong config, and the direction that the encoder passes this check in is the actual encoder direction, and if both directions don’t pass the check it is likely something is wrong with the wiring. Wiring issues like connecting the sensor VCC and GND backwards or mixed up cannot be mitigated in software, although I don’t think this would be very common. My calibration sequence can handle connecting the encoder ENC1 and ENC2 pins in any order, and the 3 motor phases U V W in any order.
This calibration method is easily adapted for incremental encoders and hall sensors (3x digital hall sensors), you just skip the first part calibrating the offset as that is purely analog.
My described calibration sequence does have a few limitations, mainly that it only works with sin/cos encoders and incremental encoders. (I don’t have any motors with incremental encoders so haven’t tested, plus my board doesn’t have a pin for the index pulse so a calibration on boot is mandatory meaning it’s not practical for most use cases) Also it makes the assumption that the encoder revolution is aligned with the electrical revolutions of the motor. It should still be doable in software to identify cases where the electrical revolutions is a integer multiple of the sensor revolutions, and determine hall sector angles for digital hall sensors.
The other limitation with my current approach would be the calibration being done in constant voltage, and if the user sets the voltage too high it could overheat the motor. The reason for the constant voltage approach is because I didn’t want the calibration to depend on the FOC PID constants being correct. I can’t really think of any reliable way to detect the maximum power allowed into the motor which works with all motor sizes. You could try to measure the motor winding resistance to check whether the windings are heating too fast by the resistance increase over time but this feels like an overkill solution.
Basically to get it working well with a wide range of motors and sensors is going to be a big software project and require a ton of validation and you will probably end up buying a ton of motors to test.
The real downside is that external sensorboards always have a bit of wiggle room when you place them. (placing a magnet the same way on all motors could be done)
So whatever you do to align the sensor software-wise, you have to calibrate it in place.
Replace motors and you have to do it again.
I help myself by writing down sensor_align and direction on the motor backplate.
I also mark the direction the sensorboard was placed.
My idea here is to not having a motor driver board, not in a sophisticated way. I need to energize windings to do some measurements and give a summary about your motor/hall/encoder status. This only requires to have no load attached to motor.
My theoretical customer group will be small companies that builds custom motors, maybe some repair businesses that replacing these encoders over time or motors etc. Once you reassemble any of these, there is a calibration needed.
As I said I am still on a research phase and exploring the need on market. Thanks a lot for your inputs!