Hi! I’m trying to run the anti-cogging calibration sequence on my ODrive Pro board, as I need to get trapezoidal velocity profiles on the motor I’m driving, and just by tuning the velocity gains doesn’t get rid of this problem. The configuration I’m using is the following:ù
odrv0.config.dc_bus_overvoltage_trip_level = 28
odrv0.config.dc_bus_undervoltage_trip_level = 10.5
odrv0.config.dc_max_positive_current = 4
odrv0.config.dc_max_negative_current = -100000
odrv0.axis0.config.motor.motor_type = MotorType.HIGH_CURRENT
odrv0.axis0.config.motor.pole_pairs = 2
odrv0.axis0.config.motor.torque_constant = 0.0567098676541178
odrv0.axis0.config.motor.current_soft_max = 5
odrv0.axis0.config.motor.current_hard_max = 16.5
odrv0.axis0.config.motor.calibration_current = 2
odrv0.axis0.config.motor.resistance_calib_max_voltage = 10
odrv0.axis0.config.calibration_lockin.current = 2
odrv0.axis0.motor.motor_thermistor.config.enabled = False
odrv0.axis0.controller.config.control_mode = ControlMode.VELOCITY_CONTROL
odrv0.axis0.controller.config.input_mode = InputMode.PASSTHROUGH
odrv0.axis0.controller.config.vel_limit = 50
odrv0.axis0.controller.config.vel_limit_tolerance = 1.16
odrv0.axis0.config.torque_soft_min = -100000
odrv0.axis0.config.torque_soft_max = 100000
odrv0.can.config.protocol = Protocol.NONE
odrv0.axis0.config.enable_watchdog = False
odrv0.axis0.config.load_encoder = EncoderId.ONBOARD_ENCODER0
odrv0.axis0.config.commutation_encoder = EncoderId.ONBOARD_ENCODER0
odrv0.config.enable_uart_a = False
odrv0.axis0.config.encoder_bandwidth = 200
odrv0.axis0.controller.config.pos_gain = 20
odrv0.axis0.controller.config.vel_gain = 0.01
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
When I try to run the anti-cogging calibration with the recommended parameters for other motors:
odrv0.axis0.controller.config.vel_gain = 0.8
odrv0.axis0.config.anticogging.max_torque = 0.4
odrv0.axis0.config.anticogging.calib_start_vel = 0.5
odrv0.axis0.config.anticogging.calib_end_vel = 0.05
odrv0.axis0.config.anticogging.calib_coarse_integrator_gain = 25
The rotor starts to vibrate a lot, so I went back to my previous vel_gain = 0.01 and increased the calib_start_vel to 5. With this it starts running fine but after a second the board disarms and dumps the following error:
axis0
active_errors: no error
disarm_reason: Error(s):
ODriveError.TIMING_ERROR
procedure_result: ProcedureResult.DISARMED
last_drv_fault: none
internal issues: 64
details for bug report: [(135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2779, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0), (135270404, 2767, 0, 0)]
Do you know how should I tweak the anticogging calibration parameters to avoid running into this or other errors? Thanks in advance!