Problems trying to find number of magnetic poles

Hi All,

I just received my Simple FOC shield last week and I am starting to learn how to use it. My setup is composed by:

    • µC: Blue Pill (STM32F103C8)
    • Sensor: AS5048A
    • Motor driver: Simple FOC shield as driver

I started running the sensor test, and works fine reporting 2 Pi angle measurements each time I turn my motor. It works great 

Then I tried the driver standalone sketch that seems to wok fine as well generating three pwm signals of 50 Khz and duty cycle proportional to .setPWM() method.

In order to guess the number of pole pairs of my BLDC motor I run the utility sketch but it seems that I am doing something wrong or maybe I have chosen an inappropriate motor. In the next video you can see how it performs when I run it.

At the serial monitor:

Estimated PP : 2147483647
PP = Electrical angle / Encoder angle
1080.00/0.00 = inf

PP number very high, possible error.

Motor ready.
Set the target voltage using serial terminal:

Does anyone else experienced this kind of issues and knows how can I overcome it? If its a problem withe the chosen BLDC could you suggest an alternative ?

How big is the phase resistance of your motor? Maybe you’re drawing too much current.

What I would do is try open-loop position control with a small velocity limit and a small voltage limit (like 2V) and guess a pole pair number. If you tell the motor to move 6.28 rads and the pole pair number is correct the motor will spin a full turn. You can try guessing a few pole pair numbers until it spins a full tern when commanded.

1 Like

Hi David ,

Thanks for your quick answer. Accordingly to motor specification I have an Internal resistance 0.076Ω.

Current starts at zero, has a peak about 3 Amp and when the motor stops it gets to about 1 Amp . The L6234 chip start to get very hot, the motor stops moving but keeps “energized” , like it was an stteper motor. If I forze movements i detect 12 “steps” … not sure if this number means something.

I am quite newbee with BLDC motors… Does it means that i have 12 mangentic poles?

I will try try open-loop position control to see if I can obtain any insight.

Thanks again :wink:

That’s a very low resistance! Make sure your voltage limit is low, around 1V. Be careful with the current draw and the L6234.

I would go ahead and try open-loop position control with that twelve number and start from there. Let us know how it goes.

1 Like

That motor isn’t a good match for that board. The advise is to pair it with 10ohm gimbal motor or similar but I’ve cautiously used it with 0.7 Ohm motors at 1v voltage_limit. Your resistance is 10x lower so current will be 10x bigger. I wouldn’t go above 1A on simplefoc board unless it has a heat sink.

1 Like

I had a pair of small spare heatsinks from the CNC drivers (DRV8325) and I managed to place it … there is no place to put something bigger… better than nothing.
Captura de pantalla 2021-01-08 a las 20.29.52

May be I can machine something with aluminio but not sure if its worth… I have just ordered a new motor (BGM4108-130HS) that I hope better suits the requirements.

Thanks for your advise :slight_smile:

At the end I was able to make both open loop examples work :). The movement is not very soft but I guess it is due to the voltage limitations.

Now I can further continue learning with closed loop examples :slight_smile:


Did you find out the number of pole pairs?
You could try to increase the voltage limit while keeping an eye on the current draw and the temp of the shield.

I tested with 12 and 24 as number of pair poles. When I use 24 the motor it makes twice commanded angular distance, … so I guess that the correct number of poles is 12 :slight_smile: … Still do not know why the movement as smooth as I expected, a little bit like a stepper motor jumping from step to step … many things to learned :slight_smile: