Pole pair mismatch issue

Hi everyone, I am using a 21 pole pairs motor. I am constantly getting an error saying: Procedure error POLE_PAIR_CPR_MISMATCH. It looks like Motor > Pole Pairs should be 22. Please consult your motor datasheet and update the configuration.

When I recalibrate the motor, it gives me error saying Procedure error POLE_PAIR_CPR_MISMATCH. It looks like Motor > Pole Pairs should be 20.

After recalibrating it couple of times, it works. Any idea regarding why does this keeps happening?

Thank you so much in advance!

What motor and encoder are you using? Can you share your configuration in the GUI, specifically on the motor tab?

Yes, I am using Tmotor U8, and AS5047D encoder. Thank you so much!

Your current limit and calibration current/voltage is very very very low, and your torque limit is miniscule (this will limit the motor to 0.12A). When lock-in spin current is low, the motor won’t be able to turn smoothly during calibration, leading to your error. I would use the following values:

Current limit: 30A
Motor calib. current: 10A
Motor calib. voltage: 2V
Lock-in spin current: 20A

You will additionally need to raise your torque limit, or disable it, in order to get good control in closed loop mode, otherwise the motor will be too weak. A torque limit of 2.481 Nm will correspond to the motor’s maximum current of about 30A.

Hii, my motor’s max continuous current is 8A. I am using the Tmotor U8 100Kv, older version. I am bit confused, won’t it be an issue if I set the current limit higher than that?

Thank you so so much for helping out!

Sorry - can you link the exact motor you’re using? And glad I can help :slight_smile:

Typically the motors have a 180-second current rating, this is fine to hit, especially in calibration. Generally, the current limit you use will vary depending on your load and duty cycle – if your load won’t nominally exceed the continuous current limit, but instead have occasional peaks, that’s usually fine. It always helps to add a thermistor to the motor, if possible – this way, the ODrive can sense and limit the temperature.

Hi, I think they discontinued the model, I am unable to find the link from original website but the below link is from a different website:

I have attached a picture of specifications:

Ah - understood, so that’s a totally different motor. In that case, you can set the current limit to 8A, and also set calib current and lock-in spin current to 8A.

Hi, Thank you so much! It worked!

Great to hear! Best of luck.

1 Like

Hi

I have similar issue of pole pair mismatch.

But for some reason I was able to calibrate it via the odrivetool. When I perform position estimate (using Spi encoder),I get the position values but when I perform input pos to move the motor, the motor does not move. Trying to perform filtered position control .

Should the choice of motor be gimbal or High current?

Using this motor. Could you please suggest the proper motor configuration values for GUI?

Really appreciate the support.

What ODrive are you using, and what bus voltage? Are you calibrating the motor unloaded, and does the motor move during calibration? Does the ODrive throw any errors? Can you share your configuration so far?

I am using an odrive pro.

Yes, I am calibrating it without load. When using the GUI i get the pole pair mismatch error.

The motor rotates while calibration via odrivetool, but not when i apply odrv0.axis0.controller.input_pos = 0.02 (or similar values),the motor does not move to the entered position.

Below are the applied configuration details:

odrv0.config.dc_bus_overvoltage_trip_level = 50
odrv0.config.dc_bus_undervoltage_trip_level = 48
odrv0.config.dc_max_positive_current = 8
odrv0.config.dc_max_negative_current = -0.01
odrv0.axis0.config.motor.motor_type = MotorType.GIMBAL
odrv0.axis0.config.motor.phase_resistance = 0.65
odrv0.axis0.config.motor.phase_resistance_valid = True
odrv0.axis0.config.motor.pole_pairs = 21
odrv0.axis0.config.motor.torque_constant = 10 / 30
odrv0.axis0.config.motor.current_soft_max = 6
odrv0.axis0.config.motor.current_hard_max = 8
odrv0.axis0.config.motor.calibration_current = 6
odrv0.axis0.config.motor.resistance_calib_max_voltage = 8
odrv0.axis0.config.calibration_lockin.current = 6
odrv0.axis0.motor.motor_thermistor.config.enabled = False
odrv0.axis0.controller.config.control_mode = ControlMode.POSITION_CONTROL
odrv0.axis0.controller.config.input_mode = InputMode.POS_FILTER
odrv0.axis0.controller.config.vel_limit = 10
odrv0.axis0.controller.config.vel_limit_tolerance = 1.2
odrv0.axis0.config.torque_soft_min = float(‘-inf’)
odrv0.axis0.config.torque_soft_max = float(‘inf’)
odrv0.axis0.controller.config.input_filter_bandwidth = 20
odrv0.can.config.protocol = Protocol.SIMPLE
odrv0.can.config.baud_rate = 250000
odrv0.axis0.config.can.node_id = 1
odrv0.axis0.config.can.heartbeat_msg_rate_ms = 100
odrv0.axis0.config.can.encoder_msg_rate_ms = 100
odrv0.axis0.config.can.iq_msg_rate_ms = 100
odrv0.axis0.config.can.torques_msg_rate_ms = 100
odrv0.axis0.config.can.error_msg_rate_ms = 100
odrv0.axis0.config.can.temperature_msg_rate_ms = 100
odrv0.axis0.config.can.bus_voltage_msg_rate_ms = 100
odrv0.axis0.config.enable_watchdog = False
odrv0.axis0.config.load_encoder = EncoderId.SPI_ENCODER0
odrv0.axis0.config.commutation_encoder = EncoderId.SPI_ENCODER0
odrv0.spi_encoder0.config.mode = SpiEncoderMode.AMS
odrv0.spi_encoder0.config.ncs_gpio = 17
odrv0.config.enable_uart_a = False

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION

#SPI calibration

odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION

Closed - loop

odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL

odrv0.save_configuration()
odrv0.reboot()

Using below for checking position change.
print(odrv0.axis0.pos_estimate)

Thanks again :slightly_smiling_face:

Hi

I unable to figure out the exact value for the motor configuration for odrive pro.

Help would be really appreciated, thanks again :blush:

Hi, I am getting the same error again, It worked before when I increased the calib current and lock-in spin current. But now it shows the same error again, I am not sure why is this happening.

I would really appreciate the help. Thank you!

Good chance this is due to encoder magnet misalignment. Could you post a picture of how the encoder is mounted above the magnet, and how the magnet is mounted to the motor?

Hi, yes, I have attached the images below.

Thank you so much!





Ah – yeah $20 says this is an encoder mounting issue. Those magnetic encoders really need to be perfectly aligned to the magnet – usually I target +/- 0.5mm, see more here Designing for Magnetic Encoders — ODrive Documentation 0.6.11 documentation

Harmonic calibration is designed to help compensate for offsets, I don’t think we’ve tested it with AMS encoders but I’d expect it would work.

I would recommend, after running step 3 in the configuration flow (the “save to non-volatile memory”), go to the inspector tab, and manually run (by setting the requested_state parameter):

  • MOTOR_CALIBRATION
  • HARMONIC_CALIBRATION
  • ENCODER_OFFSET_CALIBRATION

Then (assuming everything worked) you can go back to the configuration tab and run step 5 (to save the calibration).

I’ll try reducing the distance between the encoder and the magnet and also calibrating it manually. Thank you so much!

No worries, please let me know how it goes!