Hi all,
I want to switch from sensorless mode to a hall sensor mode. I integrated a Hall Sensor and wanted to calibrate it. But after switching the odrv0.axis1.encoder.config.mode from ENCODER_MODE_INCREMENTAL to ENCODER_MODE_HALL I can not control the motor anymore. After some iterations, I found an error dump like this: (dump_errors(odrv0) and odrv0.axis1.encoder before and after the switch)
In [224]: dump_errors(odrv0)
axis0
axis: no error
motor: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
encoder: no error
controller: no error
In [225]: odrv0.axis1.requested_state = AXIS_STATE_MOTOR_CALIBRATION
In [226]: odrv0.axis1.encoder
Out[226]:
error = 0x0000 (int)
is_ready = False (bool)
index_found = False (bool)
shadow_count = 0 (int)
count_in_cpr = 0 (int)
interpolation = 0.5 (float)
phase = 0.002684466540813446 (float)
pos_estimate = 0.0 (float)
pos_cpr = 0.0 (float)
hall_state = 7 (int)
vel_estimate = 0.0 (float)
calib_scan_response = 0.0 (float)
config:
mode = 0 (int)
use_index = False (bool)
find_idx_on_lockin_only = False (bool)
pre_calibrated = False (bool)
zero_count_on_find_idx = True (bool)
cpr = 8192 (int)
offset = 0 (int)
offset_float = 0.0 (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)
set_linear_count(count: int)
In [227]: odrv0.axis1.encoder.config.mode = ENCODER_MODE_HALL
In [228]: dump_errors(odrv0)
axis0
axis: no error
motor: no error
encoder: no error
controller: no error
axis1
axis: Error(s):
ERROR_ENCODER_FAILED
motor: no error
encoder: Error(s):
ERROR_ILLEGAL_HALL_STATE
controller: no error
In [229]: odrv0.axis1.encoder
Out[229]:
error = 0x0010 (int)
is_ready = False (bool)
index_found = False (bool)
shadow_count = 0 (int)
count_in_cpr = 0 (int)
interpolation = 0.5 (float)
phase = 0.002684466540813446 (float)
pos_estimate = 0.0 (float)
pos_cpr = 0.0 (float)
hall_state = 7 (int)
vel_estimate = 0.0 (float)
calib_scan_response = 0.0 (float)
config:
mode = 1 (int)
use_index = False (bool)
find_idx_on_lockin_only = False (bool)
pre_calibrated = False (bool)
zero_count_on_find_idx = True (bool)
cpr = 8192 (int)
offset = 0 (int)
offset_float = 0.0 (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)
set_linear_count(count: int)
If I switch back the encoder mode to incremental and reboot, I have no errors.
Further, I tried to enter the Hall mode with and without a connected Hall Sensor and with different filter-capacitors, matching my Sensor. Both times I get the error after switching the encoder mode.
After the switch I can not start any calibration, neither the motor calibration nor the encoder calibration.
I tried the switch to the Hall mode after erasing the configuration and a reboot of the ODrive.
Even then the error dumped.
Hopefully, someone could help me.