Type abc Hall encoder communication

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

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.

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

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.

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.

Ah, yes you definitely need to update to 0.5.6 :slight_smile: