Getting position, torque information from ODRIVE V3.6

Hi. I’m trying to make a quadruped and I really doesn’t know well about motor control. (My background is mostly neuroscience and physics)
I’m asking this question because I want to purchase the product right.

What I’m trying to do is getting the position and torque value from the motor so that i don’t need any external force or position sensor.
And also controlling 12 motor with two raspberry pi every 25 milli-second.

First question:

The two value I want to have is:

  1. absolute motor position (So that I can know how the limb is currently located)
  2. torque that the motor is currently generating even when the motor is not moving. (not necessarily a torque but some value proportional to torque)

Can I send the value of 1 and 2 to raspberry pi with these products?:

Second question:
Should I buy any ADC or DAC to receive and control the motors with raspberry pi?

It would be very nice to get the answer to these questions.
Also I want to thank ODrive team and the community for making such an excellent platform.

I have recently built a quadruped using 6 odrives and, with respect, if your questions are this basic, your chances of success are low. Then again, perhaps you are a genius on the software side and you just need some help with the hardware and you will take it from there. If I was a betting man, I would guess it’s the former, but perhaps I am wrong.

First of all, using a raspberry pi for real-time motor control is typically considered a bad idea, because you are likely running the default OS (raspbian) which is a fairly ordinary linux distribution in that it has preemptive multi-tasking and therefore is unable to guarantee uninterrupted execution of any process. A quick google search indicates that real-time OS options like ChibiOS/RT are available for the raspberry pi, but a proper microcontroller (such as the Teensy 4) is probably far more suitable.

Second, I’m not sure what kind of performance you’re hoping to get from this quadruped, but a control loop with a period of 25ms yields a 40hz control frequency, which is going to give you abysmal results. Your motion planning/execution will be coarse and, worse still, your robot’s response to torque/current changes will be clumsy.

To your questions:

  1. Can I send the value of 1 and 2 to raspberry pi with these products?

Yes, you can; the simplest way to do it is via the UART interface; the serial protocol is detailed in the odrive documentation. You may also be interested in the recent discussion I posted here, specifically about doing high frequency (~500hz) control & position/current feedback with 6 odrives: Teensy 4 + 6 odrives - optimal communication protocol for high frequency control


This is a poor choice for a quadruped; what you want is a motor with a large diameter and a short stator/rotor. This is what maximizes torque output, which in turns makes it viable to use a modest (5-10x) reduction gearbox, which is itself critical for actuator force transparency (which allows your actuator to detect and respond to external forces).

Should I buy any ADC or DAC to receive and control the motors with raspberry pi?

No, but the fact that you are asking this question suggests that this project may be too ambitious for your present level of expertise.

1 Like

Just a general word of advice: If you really want to do this project, you should start with getting one motor, one encoder, one controller, etc. If you reach the point where the motor behaves the way you want it and there are no more open questions about the control, increase the size of your project slowly by getting a second motor to build one lcomplete eg. If that leg behaves as you expect it, get the rest. The chance of wasting a lot of money will be much smaller.

1 Like