"Your current position should be 0!"

Hi there,
I kind of got my odrive to work, but man this so strange documented, I really struggle !

I use HTerm to emulate an arduino

after some initials:
w axis0.motor.config.current_lim 60
w axis0.controller.config.vel_limit 1000000
w axis0.trap_traj.config.vel_limit 500000
w axis0.trap_traj.config.accel_limit 1000000
w axis0.trap_traj.config.decel_limit 1000000

I go with:
t 0 819200
for example to do moves analoge to the steps

now I want to set the counter to “0” or I want to go incremental with my commands.

no command gives me any feedback,
“w axis0.encoder.set_linear_count(0)” doesn’t do anything but gives me a feedback:
“invalid property”

I really need a good documentation of the commands, is there a hidden list ? :rofl:

Have you tried doing the same over the USB interface using the odrivetool Python program?
This is the main configuration interface for the drive - much easier to use and much more richly documented than the serial interface.

Thx but the device has to work with the serial interface.
If I can change the setup of the board to incemental move-commands permanently with python, this would be ok.

could it still work with the “t 0 819200” command ?


What I mean is, use the USB for initial configuration and test, then call save_configuration() and then use serial for control.

Unfortunately there is no way to use this specific feature over the UART interface. You will need to measure and store an offset value in the controller and use that to correctly send future position commands.

1 Like

Oh, I understand what @Groppo was asking for now. set_linear_count is intended for use during initial setting up only, not for control.
As robopilot said, just have the arduino remember the position, and add your increment to that… There is no “move relative” command.

OK thx a lot, is there a highest number I can give to the odrive? It should work in a long time testing system for weeks

What’s the application? Maybe you should be in velocity control mode?

The number is interpreted as a 32-bit floating point value.
The maximum is very high (3x10^38) but the precision drops as the value increases.

It needs to go an exact amount of rotations, the test verifies a rotation-counter but the precition within one rotation can be much less. Am I able to drop the resolution of the angel sensor to 20 steps/rotation or something like that ?

There’s currently no way (AFAIK) to decimate the encoder counts except for using a lower resolution encoder.
However I think you should be fine. How many revolutions does it need to go in total?

Integers between 2^n and 2^(n+1) round to a multiple of 2^(n-23) [WP]
2^(32-23) = 512
Therefore you’d have at least 2^31 counts i.e. a quarter million turns of an 8192 count encoder such as the CUI, until the precision drops below 1/20 of a turn i.e. 409 counts

In future there should be support for setting a position in real units such as metres or turns. i.e. adding a scale factor to the encoder counts.

Good, thats ok for me

I have a question.
I would like to run this on microcontroller.


In the code, If I run the this, it works.

serial_ << “w axis” << axis << ".requested_state " << requested_state << ‘\n’;

It’s same with this:

odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

The requested_state is a number so I tried 2 solutions but nothing works.
I tried this…

and these.

Do anyone has a tip or solution?

you have to use the development branch to get set_linear_count on ASCII. The command is esl <axis> <value>

I have the v0.5.1-dev installed and I am trying to set_linear_count to 0 using ASCII commands with an Arduino. does V0.5.1-dev have the esl function? If so, is there something wrong with how I am attempting to use it?


This is the syntax I’m using as you suggested for setting linear counts to 0. Is there anything else to it?

Any help with this would be greatly appreciated.

Thank You!

The version called 0.5.1-dev that you can download directly from github does not have esl 0 0. You will need to compile from source

1 Like

Where can I get the source files?

Here, of course! GitHub - odriverobotics/ODrive: High performance motor control

1 Like

I am looking to reset my encoder position using UART command over GPIO 1 and 2.

I understand I need to run the esl 0 0 as it is the equivalent ASCII function for odrv0.axis0.encoder.set_linear_count(0).

However, I have updated my firmware to the “archived-devel” one and since then, I cannot perform my calibration sequence.

Could you help to choose appropriate development branch to get calibration and “esl 0 0” work on an Odrive 3.6 V56?