# Fractional pole-pairs?

Hi there,

I’ve been having a great time playing with SimpleFOC with some small gimbal BLDC motors (and using the relatively new Trinamic TMC6300 driver, which is perfect for small motor applications by the way!), but I’ve run into an interesting issue.

I’ve successfully gotten everything working for torque control with a 7 pole-pair motor and magnetic encoder (TLV493d). However, now I’m testing a different motor (still a small outrunner gimbal motor) and it sure seems like the correct “pole-pairs” number would be 10.5. Obviously a fractional pole-pair number is not allowed by the BLDC motor constructor, so that’s where I’m stuck - I’m trying to figure out if this is a misunderstanding on my part, or a limitation of the library.

Here’s how I came to this 10.5 pole-pairs conclusion:

• Created a BLDCMotor with a pole_pairs value of 1, and initFOC with 0 electric zero angle, and a direction of CW
• (I selected pole_pairs = 1 because then electrical angle and the “mechanical angle” I specify for testing should match 1:1, according to the FOCMotor::electricalAngle implementation)
• set the motor into angle_openloop control mode
• motor.move(0) to turn on the motor driver, which will snap the rotor to align with the 0 electrical angle field orientation (and then I pause for a second to wait for this physical movement to settle)
• record the sensor’s starting angle
• slowly move the motor from 0 radians to 21 * 2PI radians; since my pole_pairs is set to 1, this means I am rotating the motor through 21 complete electrical revolutions
• record the sensor’s ending angle

(This is more or less exactly what find_pole_pairs_number does, though with a higher number of electrical revolutions during the search)

When I calculate the ratio between commanded rotation (21 * 2PI radians) and the measured rotation (from the sensor’s start vs end angle), I get a value of 10.50 when calculated to 2 decimal points.

Physically I can watch the motor smoothly rotate exactly 2 revolutions, which also matches the conclusion of 10.5 pole-pairs, since I commanded it to rotate 21=10.5*2 electrical revolutions.

Am I doing something wrong or misunderstanding anything? How can I use SimpleFOC with this motor?

Unfortunately I can’t physically disassemble the motor to view the slot or pole count or winding configuration, it’s simply too small (15mm outrunner OD) and there’s no retaining clip or anything visible from the outside keeping the rotor attached.

Can you x-ray the motor?

That seems a bit odd.

Did you try to disconnect the motor and rotate it by hand by counting the “lumps”?
The number of lumps per revolution will give you the pole pair number.

The cogging torque is very low on this motor, so it’s a little tricky to tell, but I’m pretty sure there are 12 cogging “lumps” when unpowered. (For what it’s worth, when powered with a fixed electrical angle, there are 7 positions that the rotor will snap to)

Just to double check, I ran an angle open-loop test with 210 full electrical revolutions (with pole_pairs set to 1) and confirmed that this resulted in 20 physical revolutions, consistent with a ratio of 10.5:1. And this was also confirmed by the sensor reading, which came out to a calculated 10.50 ratio in this case over those 20 complete revolutions as well.

Running that same test with 240 electrical revolutions resulted in MORE than 20 physical revolutions (and a non-integral number of physical revolutions at that), which means that the ratio of electrical to physical angle on this motor is definitely not 12…

I wish I could see the inside of this motor to figure out how it’s wound. And unfortunately it’s magnetically shielded well enough that I can’t see the poles with magnet viewing film externally either…

Ok, found the problem (it was my code). The correct number of pole-pairs is 7 for this motor.

It turns out I was accidentally hitting the velocity limit of the angle open-loop controller without realizing it, so the motor was essentially falling slightly behind (at a fixed rate) during the entire test rotation resulting in the inflated calculated ratio of electrical angle to mechanical angle. Either increasing the velocity limit or decreasing the angle step size during the calibration test resolves the issue and I consistently get a value of 7 now.

2 Likes