Arduino - Ramped Velocity Control

I am trying to use ‘ramped velocity control’ using the Arduino.

I opened up ODriveArduino.h and was looking at the list of commands. I noticed that it only has the following;

  • Set position
  • Set velocity
  • Set current
  • Trapezoidal move (to position)

If i wanted to use ramped velocity control would this require a major addition to the library? I am not an expert in Arduino, so just curious. Looking for any answers! Thank you.

Hi Scott,

The ramped velocity control is an “input mode”. To use it, you have to set the input mode to ramped velocity and the control mode to velocity control.

Changing to the ramped velocity mode should look something like this:

serial << "w axis0.controller.config.input_mode 2\n"; // set the input_mode to INPUT_MODE_VEL_RAMP
serial << "w axis0.controller.config.control_mode 2\n"; // set the control mode to CONTROL_MODE_VELOCITY_CONTROL

Where “serial” is the name of the serial interface you are using. For example, in the “ODriveArduinoTest.ino” sketch, it is “odrive_serial”.

Note that the all-caps names up there evaluate to integers. For example, INPUT_MODE_VEL_RAMP is 2 - you can see these values in the source code at tools/odrive/

1 Like

Really appreciate your help. That was the answer, I actually ended up using the python interface to set the mode. Now when I boot the arduino, calibrate, set velocity its on ramped control.

It is good to know that I can set the mode with the arduino interface as well. Thank you.

1 Like