Control Modes and Commands

I am currently developing an admittance control for an exoskeleton project. I am using an ODrive 3.6 and I have one shoulder motor to control. I am using a Teensy 4.1 and the Arduino IDE and I am pretty much a beginner when it comes to coding and robotics. This is why my questions probably seem pretty basic to you. For now, the communication between Odrive and Teensy is through Uart.

The basic idea is the following:

For each position of the arm shell of the exoskeleton, a specific force is defined, which is to act between the arm shell and the arm of the user. The actual position of the arm shell is always known from the measured value of the angle sensor. The force sensor in the arm of the exoskeleton measures the actual force and compares it with the target force.
If both forces are equal, the position remains unchanged. If the measured force differs from the target force defined for this position, the position of the end effector is adjusted.

A big part of the code is already developed (in an early state thought), but now it comes to the communication with the Odrive where I am a littlebit confused. Unfortunately the odrive getting started guide is not really helping.

I have multiple questions:

  1. According to the Odrive guide, there are multiple control modes which I can set my Odrive to. Such as position control, filtered position control, trajectory control, circular position control, velocity control, ramped velocity control and torque control.
    Now I am confused: I have to control three parameters of the motor: The new position (angle) it has to move to, the velocity with which it should move to the new position and the torque the motor needs to provide to support the weight the user is carrying.
    How can I control all three of those parameters when i have to decide on one mode to run the ODrive on? Do I even need to decide on one mode or can I just send the three parameters through the Arduino IDE?

  2. I could only find commands to send the velocity and the position online, but not really information about the torque. Also I found different commands to send the velocity and the position and i am not sure now which ones are the best ones. Can someone provide the correct commands, a small code or a source that could help me with that? I just want to update velocity, position and torque with every loop, let the motor execute the movement, measure and send new parameters. I know that seems like a stupid question because duh you can google that, but at this point I am just confused. The commands I found are the following:

Position:
odrive.SetPosition(0, pos_m0);

Velocity:
String command = "v " + String(speed);
odriveSerial.println(command);

Are those the right ones to use?

  1. I am actually confused on how to do the torque part: The idea is to determine the target force via a force-angle curve. This curve is an inverted quadratic function, with its maximum at an arm angle of 90 degrees. However, does that even work with position control? Is it possible to give the motor commands regarding position, velocity and torque at the same time or is that redundant?

As you can see, I am an absolute beginner. So if you know any other resources that might help me, I would really appreciate it if you could share those.

Thank you for your help!