Wiring and Configuration Instruction for Encoder Pulse A & B

I have scooter motor with the following wires:

3 motor wires
5 Hall sensor wires
2 encoder wires (Pulse A and Pulse B)

Motor : https://www.alibaba.com/product-detail/E-tech-DC-brushless-15-inch_60556941948.html?spm=a2700.12243863.0.0.38403e5fzevfw3

Questions:

  1. Which odrive configuration should i use for this motor?
  2. Is there a wiring instruction with hall sensor and encoder?

requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE failed with ENCODER_ERROR_CPR_POLEPAIRS_MISMATCH

Here are my settings that gave above error:

odrv0.axis0.motor.config.pole_pairs = 10
odrv0.axis0.encoder.config.cpr = (1024*4) = 4096

odrv0.axis1.motor.config.pole_pairs = 10
odrv0.axis1.encoder.config.cpr = (1024*4) = 4096

odrv0.save_configuration()
odrv0.reboot()

As a quick check of the encoder - run odrv0.<axisX>.encoder.shadow_count, spin the motor 1 full turn by hand, and then check shadow_count again. It should change by cpr +/- a few counts. Did you connect the hall sensor power wires? It’s likely that the hall effect sensors and the incremental encoder are both powered by the hall sensor power. I don’t know the pinout of your motor, but they are probably red and black for power and ground.

For your questions: 1. What is your application for these motors? 2. ODrive does not currently support using both hall-effect and incremental encoders at the same time.

Thank you for your response. I turned the wheel by a complete cycle and i got 173 which us far from 4096. The doc says its the cpr, while it also said its ppr * 4.

My hall sensor wires are:

+5v red
GND black
A(uu) green
B(Vv) blue
C(Ww) yellow

All are connected to J4.

For that motor, you can use either the hall effect sensors or the incremental encoder (A,B), but not both.

To use the hall effect sensors, follow the hoverboard setup guide from here: https://docs.odriverobotics.com/hoverboard.

For the 4096cpr incremental encoder, connect the hall effect power +5V and GND wires to J4, connect the A and B encoder wires to J4, and leave the hall effect U,V,W wires disconnected.

Thank you. I did according to your instruction and i got the same ENCODER_ERROR_CPR_POLEPAIRS_MISMATCH and ERROR_PHASE_RESISTANCE_OUT_OF_RANGE. My motor is 350W.

I disconnected the hall sensor wires (A, B, C) and then connected incremental encoder A and B wire

Configuration:
cpr = 4096
pole_pair = 20/2 = 10

1 Like