Need help for Odrive S1 UART Setup

Need Help with My ODrive S1 UART Setup

My Setup:

Arduino with UART connection
ODrive S1

What I’ve Accomplished:
Successfully moved the motor to specific positions.

What I Need Help With:

  1. Safety Behavior: When moving from Position A to Position B, I want the motor to go to a safety position (C) if the measured iq exceeds a certain threshold. Is this achievable via UART communication?
  2. Speed/Velocity Control: How can I set a specific speed or velocity for the motor’s movement between positions using UART?

I’ve tried various approaches but haven’t been able to find solutions. Any guidance would be greatly appreciated!

Hi!

  1. This will require some external logic on your Arduino – you could poll for the Iq_measured and then update the position setpoint if it exceeds some value. Should be pretty straightforward!
  2. You can use trajectory control mode, setting vel_limit/accel_limit/decel_limit.

Thank you for your answer!

  1. How do I poll for the iq-measured? I tried to do that but did not get any values in my testings.

odriveSerial.print(“r axis0.motor.current_control.Iq_measured\n”);
delay(10); // Wartezeit für Antwort

  1. Thank you!

You can use the getParameterAsFloat function – e.g.:

float iq_measured = odrive.getParameterAsFloat("axis0.motor.foc.Iq_measured");

Thank you very much! Works!

Great to hear!!

Hi! I hope you can help me with a couple of questions:

  1. Everything is working well so far, but I noticed some jitter in the iq_measured value when observing it in the Inspector. The jitter range is around 0.6 (±0.3). Is there a way to reduce this jitter or perhaps a more precise parameter to use for triggering safety behaviors? Would additional controller tuning or enabling anticogging help address this issue?

  2. For greater precision, is it recommended to perform extra controller tuning, or does running odrive.setState(AXIS_STATE_FULL_CALIBRATION_SEQUENCE); achieve the same result? Also, if extra tuning is necessary, is it a one-time process for each new setup?

Thank you in advance for your assistance!