Error of current_limit_violation

hello community,
i have odrive v3.6 of 56v which controls two same motors . well,I am giving both the motors same configurations but still when i give
odrv0.axis0.controller.input_pos = 10 and then 0 alternately
I am getting error of current limit violation in the motor at axis0 . well I tried to increase current control bandwidth and current limit but it was in vain.I also exchanged the axis and motors but then also I am getting current limit violation error

here I have mentioned all the details regarding to it

configurations :-
odrv0.axis0.motor.config.current_lim = 30
odrv0.axis0.motor.config.current_lim_margin = 20
odrv0.axis0.motor.config.calibration_current = 8
odrv0.axis0.motor.config.current_control_bandwidth =2500
odrv0.axis0.encoder.config.cpr = 8192
odrv0.axis0.motor.config.pole_pairs =7

odrv0.axis0.controller.config.vel_limit_tolerance=5
odrv0.axis0.controller.config.vel_limit = 50

odrv0.axis0.controller.config.pos_gain = 40.0
odrv0.axis0.controller.config.vel_gain = 0.2
odrv0.axis0.controller.config.vel_integrator_gain = 1

odrv0.axis0.controller.config.input_mode = InputMode.TRAP_TRAJ
odrv0.axis0.trap_traj.config.vel_limit = 40
odrv0.axis0.trap_traj.config.accel_limit = 50
odrv0.axis0.trap_traj.config.decel_limit = 50

odrv0.axis0.motor.config.resistance_calib_max_voltage = 10 #(phase inductance out of range)
odrv0.axis0.controller.config.spinout_electrical_power_threshold = 1000
odrv0.axis0.controller.config.spinout_mechanical_power_threshold = -1000

odrv0.config.enable_brake_resistor = True
odrv0.config.brake_resistance = 2

uart configuration

odrv0.config.enable_uart_a = True
odrv0.config.gpio1_mode = GpioMode.UART_A
odrv0.config.gpio2_mode = GpioMode.UART_A


odrv0.axis1.motor.config.current_lim = 30
odrv0.axis1.motor.config.current_lim_margin = 20
odrv0.axis1.motor.config.calibration_current = 8
odrv0.axis1.motor.config.current_control_bandwidth =2500
odrv0.axis1.encoder.config.cpr = 8192
odrv0.axis1.motor.config.pole_pairs =7

odrv0.axis1.controller.config.vel_limit_tolerance=5
odrv0.axis1.controller.config.vel_limit = 50

odrv0.axis1.controller.config.pos_gain = 40.0
odrv0.axis1.controller.config.vel_gain = 0.2
odrv0.axis1.controller.config.vel_integrator_gain = 1

odrv0.axis1.controller.config.input_mode = InputMode.TRAP_TRAJ
odrv0.axis1.trap_traj.config.vel_limit = 40
odrv0.axis1.trap_traj.config.accel_limit = 50
odrv0.axis1.trap_traj.config.decel_limit = 50

odrv0.axis1.motor.config.resistance_calib_max_voltage = 10 #(phase inductance out of range)
odrv0.axis1.controller.config.spinout_electrical_power_threshold = 1000
odrv0.axis1.controller.config.spinout_mechanical_power_threshold = -1000

odrv0.config.enable_brake_resistor = True
odrv0.config.brake_resistance = 2#(2 for odesc and 0.5 for odrive)

uart configuration

odrv0.config.enable_uart_a = True
odrv0.config.gpio1_mode = GpioMode.UART_A
odrv0.config.gpio2_mode = GpioMode.UART_A

here are the phase resistance and inductance calculated for it
#phase resistance
axis0 0.07148325443267822
axis1 0.07039767503738403
#phase inductance
axis0 3.077850124100223e-05
axis1 4.213920692563988e-05


motor :-
maytech MTO5055-HA

encoder :-
cui amt 102


thanks :blush:

Hi! Does it still happen if you make the trap traj accel and decel values smaller? It’s likely accelerating too quickly and either losing control or the encoder is slipping on the shaft

yes, I tried to lower the values but it is still happening and I am sure that the encoder is not slipping because I have kept the arrangement of the motor such that it won’t slip encoder