Hi, this is my first post, but I’m struggling to figure out how can I have drive my BLDC via ODrive motor driver.
I think I wired up successfully, and setup my driver by odrive-tools.
I’m sure there’re no errors, and my encoder works correctly, and the position can be monitored by live-plotter when I rotate my motor by my hand.
Along the document, I set up the driver and successfully completed calibration by typing (it beeps and rotates for both direction):
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
But after that, I can’t feel any brake or holding force, though I can feel very very weak vibration, after when I type :
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
And I can’t drive my motor by any CONTROL_MODE, position, torque, nor velocity, either.
My command is like:
odrv0.axis0.controller.config.input_mode = CONTROL_MODE_POSITION_CONTROL
In [6]: odrv0.axis0.controller.input_pos = 1
In [7]: odrv0.axis0.controller.input_pos = 0.1
The motor wouldn’t move!
I hope someone can help me…
Here’s my environment and odrive-tools status:
OS:Ubuntu18.04
odrive-tool version : ODrive control utility v0.5.1.post0 (I’m sure I updated it by “odrivetool dfu”)
My motor(type is KV280) : https://ja.aliexpress.com/item/32729435818.html?spm=a2g0s.9042311.0.0.7b154c4dIjUOQV
My encoder : https://www.digikey.jp/product-detail/ja/ams/AS5048A-TS_EK_AB/AS5048A-AB-1.0-ND/3188612
In [11]: dump_errors(odrv0)
axis0
axis: no error
motor: no error
fet_thermistor: no error
motor_thermistor: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
fet_thermistor: no error
motor_thermistor: no error
encoder: no error
controller: no error
In [12]: odrv0.axis0.motor.config
Out[12]:
pre_calibrated = False (bool)
pole_pairs = 7 (int)
calibration_current = 5.0 (float)
resistance_calib_max_voltage = 2.0 (float)
phase_inductance = 2.8769496566383168e-05 (float)
phase_resistance = 0.0807584673166275 (float)
torque_constant = 0.02953571453690529 (float)
direction = 1 (int)
motor_type = 0 (int)
current_lim = 20.0 (float)
current_lim_margin = 8.0 (float)
torque_lim = inf (float)
inverter_temp_limit_lower = 100.0 (float)
inverter_temp_limit_upper = 120.0 (float)
requested_current_range = 60.0 (float)
current_control_bandwidth = 1000.0 (float)
acim_slip_velocity = 14.706000328063965 (float)
acim_gain_min_flux = 10.0 (float)
acim_autoflux_min_Id = 10.0 (float)
acim_autoflux_enable = False (bool)
acim_autoflux_attack_gain = 10.0 (float)
acim_autoflux_decay_gain = 1.0 (float)
In [14]: odrv0.axis0.encoder.config
Out[14]:
mode = 257 (int)
use_index = False (bool)
find_idx_on_lockin_only = False (bool)
abs_spi_cs_gpio_pin = 4 (int)
zero_count_on_find_idx = True (bool)
cpr = 16384 (int)
offset = 18950 (int)
pre_calibrated = False (bool)
offset_float = 1.0753750801086426 (float)
enable_phase_interpolation = True (bool)
bandwidth = 1000.0 (float)
calib_range = 0.019999999552965164 (float)
calib_scan_distance = 50.26548385620117 (float)
calib_scan_omega = 12.566370964050293 (float)
idx_search_unidirectional = False (bool)
ignore_illegal_hall_state = False (bool)
sincos_gpio_pin_sin = 3 (int)
sincos_gpio_pin_cos = 4 (int)
In [16]: odrv0.axis0.config
Out[16]:
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)
startup_homing = False (bool)
enable_step_dir = False (bool)
step_dir_always_on = False (bool)
turns_per_step = 0.0009765625 (float)
watchdog_timeout = 0.0 (float)
enable_watchdog = False (bool)
step_gpio_pin = 1 (int)
dir_gpio_pin = 2 (int)
calibration_lockin:
current = 10.0 (float)
ramp_time = 0.4000000059604645 (float)
ramp_distance = 3.1415927410125732 (float)
accel = 20.0 (float)
vel = 40.0 (float)
sensorless_ramp:
current = 10.0 (float)
ramp_time = 0.4000000059604645 (float)
ramp_distance = 3.1415927410125732 (float)
accel = 200.0 (float)
vel = 400.0 (float)
finish_distance = 100.0 (float)
finish_on_vel = True (bool)
finish_on_distance = False (bool)
finish_on_enc_idx = False (bool)
general_lockin:
current = 10.0 (float)
ramp_time = 0.4000000059604645 (float)
ramp_distance = 3.1415927410125732 (float)
accel = 20.0 (float)
vel = 40.0 (float)
finish_distance = 100.0 (float)
finish_on_vel = False (bool)
finish_on_distance = False (bool)
finish_on_enc_idx = False (bool)
can_node_id = 0 (int)
can_node_id_extended = False (bool)
can_heartbeat_rate_ms = 100 (int)
In [17]: odrv0.axis0.controller.config
Out[17]:
gain_scheduling_width = 10.0 (float)
enable_vel_limit = True (bool)
enable_current_mode_vel_limit = False (bool)
enable_gain_scheduling = False (bool)
enable_overspeed_error = True (bool)
control_mode = 1 (int)
input_mode = 3 (int)
pos_gain = 20.0 (float)
vel_gain = 0.1599999964237213 (float)
vel_integrator_gain = 0.3199999928474426 (float)
vel_limit = 1000.0 (float)
vel_limit_tolerance = 1.2000000476837158 (float)
vel_ramp_rate = 10000.0 (float)
torque_ramp_rate = 0.009999999776482582 (float)
circular_setpoints = False (bool)
circular_setpoint_range = 1.0 (float)
homing_speed = 0.25 (float)
inertia = 1.0 (float)
axis_to_mirror = 255 (int)
mirror_ratio = 1.0 (float)
load_encoder_axis = 0 (int)
input_filter_bandwidth = 2.0 (float)
anticogging:
index = 0 (int)
pre_calibrated = False (bool)
calib_anticogging = False (bool)
calib_pos_threshold = 1.0 (float)
calib_vel_threshold = 1.0 (float)
cogging_ratio = 1.0 (float)
anticogging_enabled = True (bool)