I am running into issue on setting the analog mapping endpoint. Every time I give it a parameter it freezes and I can’t do anything until after a power cycle. I am using a potentiometer as the input analog signal and can read it properly with the get_adc_voltage(3) function.
I think it’s a bug or something wrong with the analog_mapping function. When I swapped to using a rc controller and pwm_mapping it works fine. Now my workaround is going to be using an arduino to convert the analog signal into a digital one since I won’t be able to use the RC controller in the final project.
Not sure if this is related, but now I get this error.
It fails to dump the gpio4_pwm_mapping configurations and then when i try to set it to None it won’t let me do it.
The KeyError
is a known bug in PyFibre and I just pushed a fix to fw-v0.5.3.
As for the hang issue, I can’t reproduce this. Can you check if it still occurs with an erased configuration and without the liveplotter running? Here’s what I did:
In [1]: odrv0.erase_configuration()
Oh no odrv0 disappeared
Reconnected to ODrive 20703595524B as odrv0
In [2]: odrv0.config.gpio3_analog_mapping
Out[2]:
endpoint: None (object_ref)
max: 0.0 (float)
min: 0.0 (float)
In [3]: odrv0.config.gpio3_analog_mapping.min = -1
In [4]: odrv0.config.gpio3_analog_mapping.max = 1
In [5]: odrv0.config.gpio3_analog_mapping
Out[5]:
endpoint: None (object_ref)
max: 1.0 (float)
min: -1.0 (float)
In [6]: odrv0.config.gpio3_analog_mapping.endpoint = odrv0.axis0.controller._input_pos_property
In [7]: odrv0.config.gpio3_analog_mapping
Out[7]:
endpoint: odrv0.axis0.controller._input_pos_property (object_ref)
max: 1.0 (float)
min: -1.0 (float)
This is with odrivetool v0.5.3.dev (sudo pip3 install --pre --no-cache-dir --upgrade odrive
).