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.