Hello sir , I am using ODrive v3.5 with firmware 4.7 . I am using a 170 kV motor with pole pairs 20. Also i am using an optical encoder with 1600 counts per revolution mounted on the motor with effective gear ratio between encoder and motor as 2:1. So the cpr for the motor as 3200. But since i am using the motor to operate a leg of the quad pad , hence i am using a gear reduction of 11.35.
This is my motor config:
pre_calibrated = True (bool)
pole_pairs = 227 (int)
calibration_current = 50.0 (float)
resistance_calib_max_voltage = 2.0 (float)
phase_inductance = 7.33741080694017e-06 (float)
phase_resistance = 0.022274766117334366 (float)
direction = -1 (int)
motor_type = 0 (int)
current_lim = 60.0 (float)
requested_current_range = 100.0 (float)
current_control_bandwidth = 1000.0 (float)
I have multiplied the pole_pairs with 11.35 as i have multiplied the same with cpr.
This is my encoder config:
mode = 0 (int)
use_index = False (bool)
pre_calibrated = False (bool)
idx_search_speed = 10.0 (float)
zero_count_on_find_idx = True (bool)
cpr = 36320 (int)
offset = -602 (int)
offset_float = -0.4655000567436218 (float)
bandwidth = 1000.0 (float)
calib_range = 0.019999999552965164 (float)
This is my controller config:
control_mode = 3 (int)
pos_gain = 24.0 (float)
vel_gain = 0.0044999998062849045 (float)
vel_integrator_gain = 0.0 (float)
vel_limit = 65000.0 (float)
vel_limit_tolerance = 1.2000000476837158 (float)
vel_ramp_rate = 10000.0 (float)
setpoints_in_cpr = True (bool)
I am using circular position control and operating the leg in a planned trajectory with time by giving the required position from arduino to odrive via pwm signal. Everything works well for few cycles but after that an error dumps on the axis as “Error Motor Disarm” and on the motor as “Error Control Deadline Missed”.
Sometimes even this error comes just after entering the closed loop control and sometimes when we increase the load on the leg.
Currently we are using axis1 but this error comes on axis0 too. Also out of four legs , this error consistently come on one leg , other three legs are working quite fine. Actually this error was dumped on each leg initially but now after proper tuning , the consistency of error is reduced. But still after three or four cycles , the error is dumped.
This is my axis:
error = 0x0020 (int)
step_dir_active = False (bool)
current_state = 1 (int)
requested_state = 0 (int)
loop_counter = 3152564 (int)
config:
startup_motor_calibration = False (bool)
startup_encoder_index_search = False (bool)
startup_encoder_offset_calibration = False (bool)
startup_closed_loop_control = False (bool)
startup_sensorless_control = False (bool)
enable_step_dir = False (bool)
counts_per_step = 2.0 (float)
step_gpio_pin = 1 (int)
dir_gpio_pin = 2 (int)
ramp_up_time = 0.4000000059604645 (float)
ramp_up_distance = 12.566370964050293 (float)
spin_up_current = 10.0 (float)
spin_up_acceleration = 400.0 (float)
spin_up_target_vel = 400.0 (float)
get_temp()
motor:
error = 0x0010 (int)
armed_state = 0 (int)
is_calibrated = True (bool)
current_meas_phB = -0.044431209564208984 (float)
current_meas_phC = -0.11622047424316406 (float)
DC_calib_phB = -3.5817019939422607 (float)
DC_calib_phC = -3.188002347946167 (float)
phase_current_rev_gain = 0.05000000074505806 (float)
current_control: ...
gate_driver: ...
timing_log: ...
config: ...
controller:
error = 0x0000 (int)
pos_setpoint = 65154.234375 (float)
vel_setpoint = 34000.0 (float)
vel_integrator_current = 1.5368376970291138 (float)
current_setpoint = 0.0 (float)
vel_ramp_target = 0.0 (float)
config: ...
set_pos_setpoint(pos_setpoint: float, vel_feed_forward: float, current_feed_forward: float)
set_vel_setpoint(vel_setpoint: float, current_feed_forward: float)
set_current_setpoint(current_setpoint: float)
move_to_pos(goal_point: float)
start_anticogging_calibration()
encoder:
error = 0x0000 (int)
is_ready = True (bool)
index_found = False (bool)
shadow_count = 75346 (int)
count_in_cpr = 2706 (int)
interpolation = 0.5 (float)
phase = -2.357374668121338 (float)
pos_estimate = 75346.234375 (float)
pos_cpr = 2706.234619140625 (float)
hall_state = 5 (int)
vel_estimate = 0.0 (float)
config: ...
sensorless_estimator:
error = 0x0000 (int)
phase = -3.132059097290039 (float)
pll_pos = -3.1323015689849854 (float)
vel_estimate = 0.0249188095331192 (float)
config: ...
trap_traj:
config: ...
I have a bit of knowledge about this error when i read controller.cpp in the firmware. This error comes when controller can’t send pwm signals when required but i can’t understand why is this error dumping after few cycles.
PS: My position and velocity control are working well with isolated motor i.e, without the leg and gear reduction.
I am having this trouble since several days, searched everywhere but the error can’t be resolved. I have to complete this project under fixed deadline. Hope for a quick reply @madcowswe @Wetmelon . Thanks.