# Type abc Hall encoder communication

**URL:** <https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164>\
**Category:** ODrive v3 Support\
**Created:** [January 7, 2025, 6:30pm UTC](https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164 "2025-01-07T18:30:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yi\_li](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/yi_li/32/6662_2.png) [@yi\_li](https://discourse.odriverobotics.com/u/yi_li)\
**Post date:** [January 7, 2025, 6:30pm UTC](https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164/1 "2025-01-07T18:30:43Z")

</div>

I am using odriveV3.6 for a robotics project, because of torque needs, I use frameless DC motor, but his encoder’s switch Hall encoder, pin is ha hb hc; I see encoder.cpp defines the Hall encoder, but after the connection, the encoder type is changed according to the instruction, and closed-loop operation cannot be achieved.  
Whether my operation is incorrect, or I want to modify the source code; Any guidance would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![solomondg](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@solomondg](https://discourse.odriverobotics.com/u/solomondg)\
**Post date:** [January 7, 2025, 6:31pm UTC](https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164/2 "2025-01-07T18:31:34Z")

</div>

Hi! The v3.6 does support hall encoders. However, I’m having a bit of difficulty understanding the issue. Can you please show me all of the setup and configuration commands you’re using? I’m guessing this is a configuration issue.

---

<div class="post-metadata">

**Author:** ![yi\_li](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/yi_li/32/6662_2.png) [@yi\_li](https://discourse.odriverobotics.com/u/yi_li)\
**Post date:** [January 8, 2025, 1:04am UTC](https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164/3 "2025-01-08T01:04:57Z")

</div>

Thank you very much for your reply. My configuration command is as follows:  
odrv0.axis0.motor.config.pole\_pairs = 14   
odrv0.axis0.motor.config.calibration\_current = 10   
odrv0.axis0.motor.config.resistance\_calib\_max\_voltage = 5   
odrv0.axis0.motor.config.motor\_type = MOTOR\_TYPE\_HIGH\_CURRENT   
odrv0.axis0.motor.config.current\_lim = 20   
odrv0.axis0.motor.config.requested\_current\_range = 30   
odrv0.save\_configuration()

odrv0.axis0.encoder.config.mode = ENCODER\_MODE\_HALL   
odrv0.axis0.encoder.config.cpr = 84   
odrv0.axis0.encoder.config.bandwidth = 100   
odrv0.save\_configuration()

odrv0.axis0.controller.config.control\_mode = CONTROL\_MODE\_POSITION\_CONTROL   
odrv0.axis0.controller.config.vel\_limit = 20   
odrv0.axis0.controller.config.pos\_gain = 3   
odrv0.axis0.controller.config.vel\_gain = 0.2   
odrv0.axis0.controller.config.vel\_integrator\_gain = 0.1   
odrv0.axis0.controller.config.input\_mode = INPUT\_MODE\_TRAP\_TRAJ   
odrv0.axis0.trap\_traj.config.vel\_limit = 10   
odrv0.axis0.trap\_traj.config.accel\_limit = 2  
odrv0.axis0.trap\_traj.config.decel\_limit = 2  
odrv0.save\_configuration()  
odrv0.reboot()

odrv0.axis0.requested\_state = AXIS\_STATE\_MOTOR\_CALIBRATION   
odrv0.axis0.motor.config.pre\_calibrated = True   
odrv0.axis0.requested\_state = AXIS\_STATE\_ENCODER\_OFFSET\_CALIBRATION   
odrv0.axis0.config.startup\_encoder\_offset\_calibration = True  
odrv0.axis0.requested\_state = AXIS\_STATE\_CLOSED\_LOOP\_CONTROL   
odrv0.axis0.config.startup\_closed\_loop\_control = True  
odrv0.save\_configuration()  
odrv0.reboot()

odrv0.axis0.controller.input\_pos = 50  
odrv0.axis0.controller.input\_pos = 0

And my encoder pin looks like this HA HB  
HC GND VCC

---

<div class="post-metadata">

**Author:** ![solomondg](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@solomondg](https://discourse.odriverobotics.com/u/solomondg)\
**Post date:** [January 8, 2025, 1:43am UTC](https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164/4 "2025-01-08T01:43:34Z")

</div>

Instead of running AXIS\_STATE\_ENCODER\_OFFSET\_CALIBRATION , you need to run ENCODER\_HALL\_POLARITY\_CALIBRATION and then ENCODER\_HALL\_PHASE\_CALIBRATION.

Other than that, this looks generally correct.

---

<div class="post-metadata">

**Author:** ![yi\_li](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/yi_li/32/6662_2.png) [@yi\_li](https://discourse.odriverobotics.com/u/yi_li)\
**Post date:** [January 8, 2025, 1:42pm UTC](https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164/5 "2025-01-08T13:42:47Z")

</div>

Thank you very much for your guidance,  
when running these two commands, the error message is not defined, it should be my firmware version is too low, I am currently using 0.5.1, I am ready to update the firmware.

---

<div class="post-metadata">

**Author:** ![solomondg](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@solomondg](https://discourse.odriverobotics.com/u/solomondg)\
**Post date:** [January 8, 2025, 5:13pm UTC](https://discourse.odriverobotics.com/t/type-abc-hall-encoder-communication/12164/6 "2025-01-08T17:13:24Z")

</div>

Ah, yes you definitely need to update to 0.5.6 🙂
