I’m new to odrives, building OpenDog from youtube.
I’m trying to setup the motor, a Eaglepower LA8308 KV90 - with a AMS AS5047P encoder.
The motor tunes with the first…
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
command, but never again.
Here is everything I did:
n [2]: odrv0.axis0.motor.config.pole_pairs = 20
In [3]: odrv0.axis0.motor.config.torque_constant = 0.09188
In [4]: odrv0.axis0.motor.config.motor_type = 0
In [5]: odrv0.axis0.encoder.config.cpr = 16384
In [6]: odrv0.save_configuration()
In [7]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
In [8]: odrv0.axis0.controller.input_pos = 1
In [9]: odrv0.axis0.encoder.config.mode = ENCODER_MODE_INCREMENTAL
In [10]: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
In [11]: odrv0.axis0.controller.input_vel 1.5
File “”, line 1
odrv0.axis0.controller.input_vel 1.5
^
SyntaxError: invalid syntax
In [12]: odrv0.axis0.controller.input_vel = 1.5
In [13]: odrv0.axis0.requested_state = AXIS_STATE_IDLE
In [14]: odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
In [15]: odrv0.axis0.motor.config.calib_range = 0.05
AttributeError Traceback (most recent call last)
~\anaconda3\Lib\site-packages\odrive\pyfibre\fibre\shell.py in
----> 1 odrv0.axis0.motor.config.calib_range = 0.05
~\anaconda3\Lib\site-packages\odrive\pyfibre\fibre\libfibre.py in setattr(self, key, value)
671 def setattr(self, key, value):
672 if self.sealed and not key in dir(self) and not hasattr(self, key):
→ 673 raise AttributeError(“Attribute {} not found”.format(key))
674 object.setattr(self, key, value)
675
AttributeError: Attribute calib_range not found
In [16]: odrv0.axis0.encoder.config.calib_range = 0.05
In [17]: odrv0.axis0.motor.config.calibration_current = 10.0
In [18]: odrv0.axis0.motor.config.resistance_calib_max_voltage = 12.0
In [19]: odrv0.axis0.controller.config.vel_limit = 5
In [20]: odrv0.axis0.encoder.config.mode = ENCODER_MODE_SPI_ABS_AMS
In [21]: odrv0.reboot()
Oh no odrv0 disappeared
Reconnected to ODrive 2071307D534B as odrv0
In [22]: odrv0.axis0.encoder.config.use_index = True
In [23]: odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH
In [24]: odrv0.axis0.error
Out[24]: 1
At line 7 in runs in one direction buy never runs in the other direction like it says it should.
And it will move under this same command if I disconnect power and reconnect. Same thing again, one direction only.
In [52]: dump_errors(odrv0)
system: not found
axis0
axis: Error(s):
UNKNOWN ERROR: 0x00000100
motor: no error
sensorless_estimator: no error
encoder: Error(s):
ENCODER_ERROR_ABS_SPI_COM_FAIL
controller: no error
axis1
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error
What did I leave out or do wrong? tia