Firmware v0.5.1 Release Candidate Feedback Thread

The Release Candidate for Firmware v0.5.1 is ready! You can find binaries here, and check the instructions “How to flash a custom firmware” here. You can also check out this release on GitHub. This thread is for feedback and discussion about the firmware.
Please let us know in the poll below even if everything works.

Binaries here.


This firmware has breaking changes to the input interface and certain config values.

input_pos and input_vel are now in units of turns and turns/s instead of counts
input_current is now input_torque with units of Nm
motor.config.torque_constant and motor.config.torque_lim have been added.
axis.config.counts_per_step is now axis.config.turns_per_step

These changes allow for the controller gains to be encoder-agnostic, as well as making the controller units easier to interpret in general. torque_lim is disabled (set to infinite) by default. The motor still has a current limit which will still in effect limit the torque.

We added a new way to define the ODrive parameter interface that makes the initial connection to odrivetool much faster. Motor thermistor support has also been added. A complete list of changes is in the changelog.

Migration guide

Previously saved values, like the controller gains, need to be converted into the new units.

torque_constant is approximately equal to 8.27 / (motor KV)

pos_gain remains the same
vel_gain = vel_gain_old * torque_constant * encoder cpr
vel_integrator_gain = vel_integrator_gain_old * torque_constant * encoder cpr
vel_limit = vel_limit_old / encoder cpr

Other parameters are converted in a similar way.

Quick feedback

  • Calibrate motor works
  • Closed loop control works
  • CAN works
  • Incremental encoder works
  • Absolute encoder works
  • Step/dir input works
  • RC PWM input works
  • USB and Python works
  • USB and ASCII protocol works
  • UART and ASCII protocol works

0 voters

If you have any issues, please report it below.

Please note that we are intentionally skipping release of v0.5.0. This is because we wanted to include the unit changes noted above. We don’t anticipate adding any new features now, only bug fixes. Please help us find the bugs!

I think it’s are missing the move of the thermistor read out in the migration guide. I will try this rc out today.

Trying to setup PWM with this firmware but:

odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes['pos_setpoint']

does not work as “endpoint” has been removed!
vel_setpoint and pos_setpoint cannot be set. They produce errors.

Hope someone can help
Many thanks in advance
Mr Anders W

I don’t think ‘endpoint’ has been removed, but you should be using ‘input_pos’ instead of ‘pos_setpoint’.
This is to allow things like input filtering and the new trajectory planner to work. If controller.config.input_mode is set to INPUT_MODE_PASSTHROUGH then it sets pos_setpoint immediately.

1 Like


“endpoint” is missing here but I’ll test what you have write

In [125]: odrv0.config.gpio1_pwm_mapping
min = 0.0 (float)
max = 0.0 (float)

It is a lot to chance i doc.


In [126]: odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH

NameError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\fibre\ in ()
----> 1 odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH

NameError: name ‘INPUT_MODE_PASSTHROUGH’ is not defined

You need to use the odrivetool for rc-v0.5.1 to use the enumerations, sorry. That value works out to “1” though if you just want it to run


What I do not understand is how to connect one PWM (3) to motor 1 and another PWM (4) to motor 2.

Please fix ODrive/issues/478

Thank you!

1 Like

Thanks for new firmware!

I want to mention that change in controller gains lead to very jerky hoverboard motor behavior.
So can you provide some hints on achieving proper motor behavior?

@rodrive rc3 is available with a fix for that issue.

rc4 is available. Fixes sensorless mode and a potential risk of damage for the brake resistor.

rc5 is available with a fix for unintended acceleration in sensorless mode when using INPUT_MODE_VEL_RAMP

Dudes, what have you done to the firmware?
Is there any changes to the controllers? I can now run much slower and smoother in position mode than before. Very nice!

One comment; if I auto-format ascii_protocol.cpp the compilation fails as when including “odrive_main.h” it has to be above “autogen/type_info.hpp”. I spent hours figuring out why it failed (yes, i have made a few modifications to the code which i thought was the problem).

Maybe VScode can be configured not to mess around with the includes, but i added a comment on the line above “autogen/type_infor.hpp” in order to keep it below the rest:
#include “odrive_main.h”
#include “communication.h”
#include “ascii_protocol.hpp”
#include <utils.hpp>
#include <fibre/cpp_utils.hpp>
// commet to keep order correct…
#include “autogen/type_info.hpp”
#include "communication/interface_can.hpp"s

Great work on the new firmware! I love it.

Yeah, check out the .clang-format file. I think there’s some switch for includes that you can modify.

The following changes are not present in the CHANGELOG file. This is already being reviewed in the Update CHANGELOG to mentiond gain unit changes #497 Github issue. add motor.config.torque_lim is also missing from the CHANGELOG I believe.

Also this link to the chagelog file is broken.

1 Like

So, for sure not an expert here, but I was able to use the RC PWM as per the hoverboard instruction page, and I cannot get it to work with new update. Is this something that is known, or am I doing something wrong. Tried the following…

SyntaxEditor Code Snippet

Done it with -2, 2, and with -200, 200 (with new rotations/sec instead of counts/sec) - it just doesn’t change the velocity setpoint. Before updating used with same configuration and it worked.