I have bought ODrive3.6ver 56V clone version from Alibaba. I flashed 0.5.6 firmware version. I connected two 0.5Ohm 50W in series for brake resistance. In the M0, i connected 6 inch hoverboard BLDC wheel and
give 24V DC power supply to ODrive 3.6
In the each Hall sensor wires A,B and C is soldered 22nF capacitor to GND.
I configured the my wheel with the following parameters
— axis0 = RIGHT wheel (confirmed wiring location) —
dev0.axis0.motor.config.motor_type = 0 # High Current
dev0.axis0.motor.config.pole_pairs = 15 # 10 # 15 # confirmed via shadow_count measurement
dev0.axis0.motor.config.resistance_calib_max_voltage = 4 # 15 old
dev0.axis0.motor.config.requested_current_range = 25 # 60 need to change
dev0.axis0.motor.config.current_control_bandwidth = 100
dev0.axis0.motor.config.torque_constant = 8.27/16 # 8.27/37.5 #8.27/16.0 #need to change 8.27/16 # 0.2205
dev0.axis0.motor.config.current_lim = 15
dev0.axis0.motor.config.calibration_current = 5
— THE CRITICAL FIX — required for Hall mode on fw 0.5.2+, was missing —
dev0.config.gpio9_mode = GPIO_MODE_DIGITAL
dev0.config.gpio10_mode = GPIO_MODE_DIGITAL
dev0.config.gpio11_mode = GPIO_MODE_DIGITAL
dev0.axis0.encoder.config.mode = ENCODER_MODE_HALL
dev0.axis0.encoder.config.cpr = 6*dev0.axis0.motor.config.pole_pairs # 6 x 10, matches confirmed pole_pairs
dev0.axis0.encoder.config.calib_scan_distance = 150
dev0.axis0.encoder.config.bandwidth = 100
dev0.axis0.controller.config.pos_gain =1 #6 # OLD VALEU1
dev0.axis0.controller.config.vel_gain = 0.02 * dev0.axis0.motor.config.torque_constant * dev0.axis0.encoder.config.cpr
dev0.axis0.controller.config.vel_integrator_gain = 0.1 * dev0.axis0.motor.config.torque_constant * dev0.axis0.encoder.config.cpr
dev0.axis0.controller.config.vel_limit = 3 #10
dev0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL # CONTROL_MODE_POSITION_CONTROL # CONTROL_MODE_VELOCITY_CONTROL
dev0.config.brake_resistance = 1.0
dev0.config.enable_brake_resistor = True
dev0.config.dc_bus_overvoltage_trip_level = 29.0
dev0.config.dc_bus_undervoltage_trip_level = 21.0
After successfully configured, I give the following calibration paramters
dev0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
time.sleep(20)
print(dev0.axis0.motor)
time.sleep(20)
print(f"motor error: {dev0.axis0.motor.error}, is_calibrated: {dev0.axis0.motor.is_calibrated}")
dump_errors(dev0)
if dev0.axis0.motor.is_calibrated:
print(“Starting encoder offset calibration — watch the wheel now…”)
dev0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
time.sleep(15)
print(f"encoder error: {dev0.axis0.encoder.error}, is_ready: {dev0.axis0.encoder.is_ready}")
dump_errors(dev0)
if dev0.axis0.encoder.is_ready:
print("Saving...")
try:
dev0.save_configuration()
except Exception:
pass
print(" Calibration saved.")
else:
print("Encoder calibration failed.")
else:
print(" Motor calibration failed.")
I heared beep sound. But wheel is not rotating.
In the terminal window, I got an error Encoder Error 512 and is_ready: False