Odrive+Arduino motors not turning after calibration

Hi there,
So i have an Odrive setup with an arduino, So far it works untill after calibration.
I’ll first explain what i did do:
I have an arduino connected to the odrive, sending calibration command will calibrate the motor, for the calibration sequence i use the search for index.
This all works fine, motor is calibrated, and holds it’s position with the current i had set (in arduino)
My arduino code can be found here:

At this point everything works, EXCEPT when i push the command odrive.SetPosition(0,1000);
It won’t move the motor at all, i tried multiple distances but no response whatsoever.
I’m sure the serial connection is good, since i can still recalibrate whenever i want, and ask the odrive for its encoder position.
I also had the odrive connected via usb to odrivetool to see for error messages, but nothing shows up.

Hm two things I notice with your code:

odrive.run_state(atoi(0), requested_state, true);

Don’t use atoi. We used it by mistake in the old example. Check the new example.

    if (c == '+')
      //odrive.SetPosition(0, 1000);
      if(GO_TO_GEAR < 7) {GO_TO_GEAR +=1;  IsShifted = false; Serial.println(GO_TO_GEAR);}    
    if (c == '-')
      //odrive.SetPosition(0, 0);
      if(GO_TO_GEAR > 0) {GO_TO_GEAR -=1;  IsShifted = false;}  

Here odrive.SetPosition is commented out. I don’t know if that’s the mistake, or if the shiftme() code path is what you are using?

Are you able to inspect the UART lines with a logic analyzer?

I’m actually using the shiftme() path to set the positions, the serial events were for my initial tests.
I sadly do not have a logic analyzer to check uart

Can you read odrv0.axis0.controller.pos_setpoint over USB to see if it’s updated? You can also check odrv0.axis0.current_state to see if it’s correctly in closed loop control mode.