Match hall sensor wires to motor phases

Hi All,

Has anyone got a good method of matching the hall sensor wires to the phase wires? Unfortunately the motor I have has no documentation and the hall connector is cut off. The hall wires do not correspond to the colour of the motor phases so I am at a loss in terms of matching the two.

I tried all 6 combinations of the hall pin mappings in software but this yield any good results. The motor runs rough in all combinations occasionally trips my power supply.

Btw i only have a 2 channel scope available

It doesn’t matter. The sensor direction and zero_electric_angle synchronize it to the motor phases regardless of what order you connect them. Most likely the zero angle is a little off from what it should be, due to SimpleFOC’s not-so-great calibration routine. It usually gets within pi/6 of the correct value, but I always have to finetune it by hand. Adjust motor.zero_electric_angle until the maximum speed the motor can reach is the same in both directions.

Oh awesome that makes sense as to why the performance was indentical given the different pin mappings. Cheers!

Interestingly the pole pair check always fails and suggests that it is one higher than it is set at. Do you think this is also a symptom which can be solved via tuning the motor.zero_electric_angle parameter also? Or does this show a larger possible problem?

You can get weird behavior if the pole count is set wrong, but if you’ve double checked that both the BLDCMotor and HallSensor have it set correctly for your motor, then you can probably just ignore that warning.