In that case the documentation must be misleading. Could you quote the corresponding sentence that seems to contradict your observation?
That was my buildup to the rationalization of why I thought the results from the power cycle were inconsistent. (-0.043846, 0.956176) was within the +/-0.5 range and then after power cycle I received the values: (0.393639, 0.393639) after no movement.
And sorry to ask but just to be sure: are you sure there wasn’t any copying error? Because the values you pasted have fewer digits than in my example, so my guess is you copied the values by hand from another computer, in which case an error could have sneaked in?
Sorry for the confusion. I use my personal ODrive and Discord account to communicate with you, but all of this work is completed on a work laptop. It is a bit of a hassle for me to transfer materials from work computer to personal device, so I took the lazy route and typed the values in. While I may not have the whole value present, I typed in what I thought was a reasonable balance between validation of the values and saving my thumbs the workout of typing all those numbers in on my phone. They are the correct values, though.
Here is some data where I reproduced similar results that I transferred over for a copy/paste to clear things up, because I do understand the desire for clean data.
Reconnected to ODrive Pro 346D364E3330 (firmware v0.6.9) as odrv0
In [40]: odrv0.axis0.pos_vel_mapper.pos_abs
Out[40]: 0.18913604319095612
In [41]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[41]: (0.18909414112567902, 0.18914794921875)
In [42]: odrv0.axis0.requested_state = AxisState.CLOSED_LOOP_CONTROL
In [43]: odrv0.axis0.requested_state = AxisState.IDLE
# Moving the device around to validate values before reboot
In [44]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[44]: (0.18761280179023743, 0.18756103515625)
In [45]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[45]: (0.21916009485721588, 0.21917724609375)
In [46]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[46]: (0.11248677223920822, 0.11248779296875)
In [47]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[47]: (-0.0052558183670043945, 0.99468994140625)
# No movement reboot to validate that it kept position correctly
In [48]: odrv0.reboot()
Oh no odrv0 disappeared
Reconnected to ODrive Pro 346D364E3330 (firmware v0.6.9) as odrv0
In [49]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[49]: (-0.00524979829788208, 0.9947509765625)
# Moving the device around to validate values before power cycle
In [50]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[50]: (0.14578865468502045, 0.14581298828125)
In [51]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[51]: (-0.23104363679885864, 0.76898193359375)
In [52]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[52]: (0.14623048901557922, 0.146240234375)
# Full power cycle, no motor movement
Oh no odrv0 disappeared
In [53]: 13:36:17.149573900 [USB] Could not open USB device: -4
13:36:18.150632400 [USB] Could not open USB device: -4
13:36:19.151790000 [USB] Could not open USB device: -4
Reconnected to ODrive Pro 346D364E3330 (firmware v0.6.9) as odrv0
In [53]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[53]: (0.4587399363517761, 0.458740234375)
# Rebooted with a completely new set of values
In [54]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[54]: (0.45872727036476135, 0.458740234375)
# Try with reboot instead of power cycle
In [55]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[55]: (0.4587182104587555, 0.45867919921875)
In [56]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[56]: (0.0789739191532135, 0.0789794921875)
# No movement reboot
In [57]: odrv0.reboot()
Oh no odrv0 disappeared
Reconnected to ODrive Pro 346D364E3330 (firmware v0.6.9) as odrv0
In [58]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[58]: (0.08125362545251846, 0.08123779296875)
# Values changed slightly, maybe acceptable error?
# No movement reboot
In [59]: odrv0.reboot()
Oh no odrv0 disappeared
Reconnected to ODrive Pro 346D364E3330 (firmware v0.6.9) as odrv0
In [60]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[60]: (0.08127433061599731, 0.081298828125)
# Values changed slightly, maybe acceptable error?
# Moved the mechanism a little to test a different value
In [61]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[61]: (0.45707666873931885, 0.45709228515625)
# No movement reboot
In [62]: odrv0.reboot()
Oh no odrv0 disappeared
Reconnected to ODrive Pro 346D364E3330 (firmware v0.6.9) as odrv0
In [63]: (odrv0.axis0.pos_vel_mapper.pos_abs, odrv0.rs485_encoder_group0.raw)
Out[63]: (0.4569932818412781, 0.45697021484375)
# Values changed slightly, maybe acceptable error?
- Can you confirm that this shift happens with a completely erased ODrive. The only minimal setting you have to configure after erasing is
odrv0.rs485_encoder_group0.config.mode
, so that a value gets reported on raw
. I get that erasing might be a bit intrusive to your application but you can back up the old config before and it would help a lot to bisect the issue.
I attempted to replicate this behavior, however, I was a bit short on time, and did not find a way to replicate the shifted values in this setup.
- Does this only happen on full power cycles, or even if you just reboot the ODrive (via
odrv0.reboot()
)?
I have not observed it on a reboot(), but I have observed it on a save_config() in the past when I was testing settings. In the above code you can see that the reboot()s that I do, the raw value changes slightly almost every time. That may be acceptable error, but I would say I don’t have enough data to prove much as-is.