Differences between odrivetool and ASCII protocol (Arduino)

I try to control the motor with torque control.
In odrivetool I type:

odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_torque = 0.9
... and eventually I stop it after some time
odrv0.axis0.controller.input_torque = 0

The start/stop work smoothly … like a ramp.

But in Arduino I call

int requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL;
Serial << "Axis" << 0 << ": Requesting state " << requested_state << '\n';
if(!odrive.run_state(0, requested_state, false /*don't wait*/)) return;

Serial.println("Executing forward");
odrive.SetCurrent(0, 0.9);
delay(5);

//and eventually I stop it after some time
odrive.SetCurrent(0, 0.0);

But the stop is too abrupt. It is not as smooth as in Odrivetool.

Why is that?

I would check that you’re actually in torque control and passthrough when you’re using the Arduino, and not e.g. accidentally in velocity control. There shouldn’t be any difference in behavior.

I do this at begining:

  for (int axis = 0; axis < 2; ++axis) {
    odrive_serial << "w axis" << axis << ".controller.config.vel_limit " << 2.0f << '\n';
    odrive_serial << "w axis" << axis << ".motor.config.current_lim " << 11.0f << '\n';

    odrive_serial << "w axis" << axis << ".controller.config.input_mode " << INPUT_MODE_PASSTHROUGH << '\n';
    odrive_serial << "w axis" << axis << ".controller.control_mode " << CONTROL_MODE_TORQUE_CONTROL << '\n';
  }

Is there something else what I should check?
encoder.config.bandwidth is set to 100 as per the documentation for hoverboard motors.

P.S. I have ODrive 3.6 with the latest firmware.