Odrv0.axis0.encoder.is_ready is false in CTRL_MODE_VELOCITY_CONTROL odrive motor not moving

I am not able to control the motor and set
odrv0.axis0.controller.vel_setpoint = 120
or any number
this is not working

I am using the AMT102-W encoder, and the calibration sequence seems to be passing with the beep sound

there is an error, please help with the text for this error, where can I find the error text?
In [2]: odrv0.axis0.error
Out[2]: 256

I have a 56V Odrive version 3.6 and I am trying to control the D6374 Odrive motor, there is no documentation on how to use this, I wish there were examples
I have saved the configuration to use

Configure motor

odrv0.axis0.motor.config.current_lim = 15
odrv0.axis0.motor.config.pole_pairs = 7
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT

Brake resistance

odrv0.config.brake_resistance = 2 # Ohms

Encoder

odrv0.axis0.encoder.config.cpr = 4096
odrv0.axis0.encoder.config.use_index = Tru
odrv0.axis0.encoder.config.calib_range = 0.1

Controller configuration

axis = odrv0.axis0
axis.controller.config.vel_limit = 170667
axis.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL

axis.controller.config.pos_gain = 0.0
axis.controller.config.vel_gain = 0.0015
axis.controller.config.vel_ramp_rate = 0
axis.controller.config.vel_integrator_gain = 0.00
axis.controller.config.setpoints_in_cpr = True
axis.controller.vel_ramp_enable = False

Set needed startup procedures to true

axis.config.startup_motor_calibration = True
axis.config.startup_encoder_index_search = True
axis.config.startup_encoder_offset_calibration = True
axis.config.startup_closed_loop_control = True
axis.config.startup_sensorless_control = False

odrv0.save_configuration()

for some reason it says the encoder is not ready ??? I don’t understand why?
odrv0.axis0.encoder.is_ready
Out[6]: False

odrv0.axis0.encoder
Out[22]:
error = 0x0002 (int)
is_ready = False (bool)
index_found = True (bool)
shadow_count = 29692 (int)
count_in_cpr = 1020 (int)
interpolation = 0.5 (float)
phase = 0.9530782699584961 (float)
pos_estimate = 29692.75 (float)
pos_cpr = 1020.75048828125 (float)
hall_state = 0 (int)
vel_estimate = 0.0 (float)
calib_scan_response = 9348.0 (float)
config:
mode = 0 (int)
use_index = True (bool)
find_idx_on_lockin_only = False (bool)
pre_calibrated = False (bool)
zero_count_on_find_idx = True (bool)
cpr = 4096 (int)
offset = 5027 (int)
offset_float = 0.7411249876022339 (float)
enable_phase_interpolation = True (bool)
bandwidth = 1000.0 (float)
calib_range = 0.10000000149011612 (float)
calib_scan_distance = 50.26548385620117 (float)
calib_scan_omega = 12.566370964050293 (float)
idx_search_unidirectional = False (bool)
ignore_illegal_hall_state = False (bool)
set_linear_count(count: int)

after changing the cpr = 8192 (int)
now Odrv0.axis0.encoder.is_ready = true

I have made some progress but
odrv0.axis0.controller.set_vel_setpoint = 20000 is still not working

here is some more encoder data
may be my config is wrong, or may be my vel_setpoint value is wrong, I don’t know

please help

error = 0x0000 (int)
is_ready = True (bool)
index_found = True (bool)
shadow_count = 172 (int)
count_in_cpr = 172 (int)
interpolation = 0.5 (float)
phase = -0.01916980743408203 (float)
pos_estimate = 172.7509765625 (float)
pos_cpr = 172.7509765625 (float)
hall_state = 0 (int)
vel_estimate = 0.0 (float)
calib_scan_response = 9349.0 (float)
config:
mode = 0 (int)
use_index = True (bool)
find_idx_on_lockin_only = False (bool)
pre_calibrated = False (bool)
zero_count_on_find_idx = True (bool)
cpr = 8192 (int)
offset = 4856 (int)
offset_float = 1.213296890258789 (float)
enable_phase_interpolation = True (bool)
bandwidth = 1000.0 (float)
calib_range = 0.10000000149011612 (float)
calib_scan_distance = 50.26548385620117 (float)
calib_scan_omega = 12.566370964050293 (float)
idx_search_unidirectional = False (bool)
ignore_illegal_hall_state = False (bool)
set_linear_count(count: int)

now I am seeing a motor error, don’t understand why
just to get started is complicated using the odrive motor, odrive board and odrive certified encoder
I wish there were some examples for odrive motors D6374, AMT 102

In [19]: dump_errors(odrv0)
axis0
axis: Error(s):
ERROR_MOTOR_FAILED
motor: Error(s):
ERROR_CURRENT_UNSTABLE
encoder: no error
controller: no error

I am hoping somebody here will understand these errors and help me
I am struggling with this, my memorial day vacation I had set aside for this

In [27]: odrv0.axis0
Out[27]:
error = 0x0040 (int)
step_dir_active = False (bool)
current_state = 1 (int)
requested_state = 0 (int)
loop_counter = 5109184 (int)
lockin_state = 0 (int)
config:
startup_motor_calibration = True (bool)
startup_encoder_index_search = True (bool)
startup_encoder_offset_calibration = True (bool)
startup_closed_loop_control = True (bool)
startup_sensorless_control = False (bool)
enable_step_dir = False (bool)
counts_per_step = 2.0 (float)
watchdog_timeout = 0.0 (float)
step_gpio_pin = 1 (int)
dir_gpio_pin = 2 (int)
calibration_lockin: …
sensorless_ramp: …
general_lockin: …
motor:
error = 0x1000 (int)
armed_state = 0 (int)
is_calibrated = True (bool)
current_meas_phB = 0.21847695112228394 (float)
current_meas_phC = -0.020113110542297363 (float)
DC_calib_phB = -0.6211517453193665 (float)
DC_calib_phC = -0.2617310881614685 (float)
phase_current_rev_gain = 0.02500000037252903 (float)
thermal_current_lim = 68.58551788330078 (float)
get_inverter_temp()
current_control: …
gate_driver: …
timing_log: …
config: …
controller:
error = 0x0000 (int)
pos_setpoint = 194.046875 (float)
vel_setpoint = 0.0 (float)
vel_integrator_current = 0.0 (float)
current_setpoint = 0.0 (float)
vel_ramp_target = 0.0 (float)
vel_ramp_enable = False (bool)
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(pos_setpoint: float)
move_incremental(displacement: float, from_goal_point: bool)
start_anticogging_calibration()
encoder:
error = 0x0000 (int)
is_ready = True (bool)
index_found = True (bool)
shadow_count = 172 (int)
count_in_cpr = 172 (int)
interpolation = 0.5 (float)
phase = -0.01890850067138672 (float)
pos_estimate = 172.75 (float)
pos_cpr = 172.75 (float)
hall_state = 0 (int)
vel_estimate = 0.0 (float)
calib_scan_response = 9348.0 (float)
config: …
set_linear_count(count: int)
sensorless_estimator:
error = 0x0000 (int)
phase = -0.6078318953514099 (float)
pll_pos = -0.6043391227722168 (float)
vel_estimate = -0.8347174525260925 (float)
config: …
trap_traj:
config: …
watchdog_feed()

in motor.hpp
it is pointing to
ERROR_BRAKE_CURRENT_OUT_OF_RANGE = 0x0040,
may be that is the reason the current is unstable
I don’t know what I am doing wrong, I have feeling my config is not correct or something like that…
I just needed an example to set it up using the velocity mode

The D6374 with the AMT102 should work out of the box with no configuration. Try erase_configuration() and reboot() and try again.