Hi there,
I have a problem getting started with my ODrive and the AS5047P encoder. I have tried both SPI and ABI, with different errors. I guess I would prefer to have it working over SPI (higher CPR, hence higher resolution?), so let’s start from there.
I have ODrive v3.6.56 with firmware 0.5.4 (ODriveTool running on Ubuntu 18.04 LTS)
I have tested the encoder with an Arduino and it works fine. It seems to work fine also with the ODrive. I have set it up following the user guide, and shadow_count
increases of ~16384 with a full turn. Hence, I have set the CPR to 16384. The spi_error_rate
is very low, i.e. spi_error_rate: 1.992866409976392e-27 (float)
.
After setting the encoder, I have increased to 15 A the calibration_current
and saved the configuration.
At this point, if I do odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
, nothing happens.
In [51]: odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
In [52]: odrv0.axis0.error
Out[52]: 1
In [53]: dump_errors(odrv0)
system: no error
axis0
axis: Error(s):
AXIS_ERROR_INVALID_STATE
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error
Side question: I have set up the number of pole pairs to 7, as I counted 14 permanent magnets in the rotor. Is that correct?
I don’t know if I’m doing something wrong. Any help is appreciated!
Cheers