Wheel Chair with Joystick (When stop)

I am programming an arduino to move forward with a joystick.
(The wheelchair is moved by sitting on a chair and operating the joystick.)
However, if I return the joystick to 0 while moving forward, I get a shock and almost fall off the chair. (switching from CLOSED LOOP to AXIS_STATE_IDLE)
(In the case of a car, I want to move the gear to neutral just before stopping)
How can I make a smooth transition from driving to neutral?

Hi there,

So there’s a large jolt when setting the ODrive to idle? Or do you mean that when you return the joystick to zero while it’s still in closed loop mode, there’s a sudden deceleration as the speed returns to zero?

1 Like

There is some jolt when switching from closed loop to idle. Any good ideas?

Hmm. That’s strange - which ODrive is this on? Going to IDLE should immediately de-energize the motors (and let you coast). Could you post the Arduino code?

1 Like

You should use VEL_RAMP mode, and once the velocity is approximately 0 you can put it in idle. Keep in mind, you’ll need to apply a parking brake or similar to avoid the integrator windup from releasing (or try setting vel_integrator_gain = 0)

1 Like

Thank you for your valuable advice.
Here is the arduino sketch.
There is a little shock at idle, but it’s not noticeable.
I’m looking for a way to get into neutral smoothly.


if ((Y_POS >= -9)&(Y_POS <= 9)&(X_POS >= -9)&(X_POS <= 9))

Serial.print("Hi-IDLE ");




if ((X_POS < -9)&(-15 <= Y_POS) & (Y_POS <= 15)&(Distance <= 12))
{ if(!done){




Serial.print("FOWORD ");