Motor speed half overall speed

Hello!
This is my first post here. I’m working with DC brushless hub motors from Parallax with hall sensors and I am trying to program them with ODrive S1 motor controllers. The two motors are controlled by a Teensy 4.1 and the hub motors replace the back wheels of a walker to drive the walker at a programmed setpoint speed.

Here’s a picture of the system (motors circled in pink):

For some reason, when I measure the speed of the walker externally with a motion capture system it seems to match the setpoint speed I set for each motor, but the motors encoder values seem to only be half the setpoint speed, and only match the setpoint speed if summed together.

To demonstrate this behavior, here’s a plot of the motor being set to 1.5 m/s over a 0.5 second period and then switched to idle mode. As you may see, the summed speed value (black line) from the right and left motors matches the externally measured speed of the walker (yellow line) as it reaches the setpoint speed (blue line) whereas the two encoder speeds seem to be individually only half the speed of the walker (maroon and green lines):

I am reading through the ODrive community forum now to understand more about other people’s use cases with DC brushless motors and the ODrive controllers. Most posts recommend tuning, specifically reducing the velocity integrator gain (which is used as part of a PI control model for velocity control). I am wondering if there are other recommendations for how to understand or fix the behavior of my system, especially why the motors seem to be half the speed of the overall system?

Sounds like your pole pairs are set as twice what they should be :slight_smile: note 1 pole pair = two poles, I think that motor is 15 pole pairs (30 poles)

I was wondering if I got the count correct.

Here’s a picture of the inside of the motors - I counted 30 pole pairs based on these instructions:

“This is the number of magnet poles in the rotor, divided by two. To find this, you can simply count the number of permanent magnets in the rotor, if you can see them. This is not the same as the number of coils in the stator.”
https://docs.odriverobotics.com/v/latest/guides/odrivetool-setup.html#odrivetool-setup

I counted 30 magnets, maybe I misunderstood the instructions and needed to set odrv0.axis0.config.motor.pole_pairs to 15 not 30?

Yep - here since there’s 30 magnets, you’d set the pole pairs to 15!