PP Check always fails

Hello,

I am running a small gimbal motor with the FOC shield on an Ardunio Mega, The encoder is set to 500 ppr. When it runs through the initialisation process I always fails the PP check. the estimated pp comes up as 8.47. I have set the pole pairs to 7 and I am pretty sure that is the correct value.

What am I doing wrong?

Small update.

If I define the Pole pairs to 8 it passes the PP check but the motor does not run.

Very confusing ???

Hey @Rollmop,
This check is more a debuging message. If you’re sure what your people pair number is you can discard the error messages.
The issue might be in your motor’s cogging or something similar.
In my experience, 500ppr is not too low of a resolution and results is a good estimation of the pp number.
Did you try the library example code in the utils > find_pole_pairs_number

Can you run your motor in velocity mode for longer periods of time whole continuously turning?
Which library version are you using?

1 Like

Hi @Antun_Skuric ,

Thanks for the reply,

Yes it runs in velocity mode (with PP set to 7) what do you call a long period of time?

I have run the find pole pairs code before and was get 7 consistantly. But…
I have recently started using an Arudunio Due board and ran the pole pairs test again with this board and got an answer of 21 consistanly.

Mega Board:
Est PP:7
Electrical angle =1080
Encoder angle = 156.96

Due Board:
Est PP:21
Electrical angle = 1080
Encoder angle = 50.76

This is running the same code with the same motor/encoder setup with both board

Just adding to the confusion.

Generally, things are working better with the Due board ( I guess because it is a lot faster)

In velocity mode the motor runs Ok but is very lumpy under 5 rad/s

Hey @Rollmop
I am snot sure, maybe there are some varibales that are not initialized well and add to the confusion, I’ll look into it.

For lower velocities, you’ll need higher ppr number and in general higher gains in your PID controllers. :smiley:

ppr stands for “points per revolution” and only applies to encoders, right? curious if this is something i should be setting with my hall-sensored motor. just started with bldc motors, excuse me if it’s a stupid question.

No, it’s a good question! An encoder has a PPR determined by the encoder hardware, so you specify it explicitly. The CPR is determined by the mode - if it is in quadrature mode, CPR = PPR * 4.

For the Hall Sensor, it also has a CPR, but it is determined by the motor itself - the number of pole pairs determines the number of electrical revolutions per physical, which determines the number of pulses you get from the hall sensors. So here, CPR = PP * 6.
So for the HallSensor class, you just specify the pole pairs, and it works out the CPR…

1 Like

I had a similar problem that I mentioned on the forum, you can find it in my previous posts I am sure, the pole pair check was inconsitent. I used the pole pair checking example and it worked, I cross referenced the code and was able to fix it. You can also check the pole pairs manually by rotating it by hand while it is powered on open loop and seeing how many bumps per full rotation you get, there are instructions elsewhere. That may help you simply set it manually however might not solve the underlying issues.