Stanford Doggo Project: an ODrive-powered quadruped robot

Hi, the contol loop would look something like this. I am using UART to send pos. Commands and read the measured Current.

image

But i just realized it would be much more simple to use simple PD-control of the ODrive by just setting the integral gain to zero.
However, if i want compliance in cartesian space, i need to constantly update the Gains according to the inverse Jacobian. So fast communcation would still be required.

Also (how) did you compensate for gravity?

Hi rockz, our ODrive firmware already supports cartesian compliance! https://github.com/Nate711/ODrive/blob/master/Firmware/MotorControl/controller.hpp. You can use the functions:

void set_xy_setpoints(float x_setpoint, float y_setpoint);
void set_xy_gains(float kp_x, float kd_x, float kp_y, float kd_y);

These functions are visible to both the odrivetool CLI and the python odrivetool library which work over USB. We haven’t made these functions accessible by UART, but you could use as example the functions set_coupled_setpoints and set_coupled_gains available. You’d then have to modify the teensy firmware in like. The only thing is that we didn’t implement gravity compensation, but that was fine for us since our leg linkages are so light.

And by the way, we first worked out the math for the method you describe, where you constantly update the gains, but for this to work you need to send the odrive a matrix of gains (including off-diagonal gains), which the odrive doesn’t support.

Best,
Nathan

1 Like

hello nathan.I was trying to upload your teensy codes(not the odrive one) to teensy3.5 via VS Code and it said upload was successful.But when I tried Serial Monitor,nothing showed up in the terminal.I also tried to upload codes via Arduino and opened the Serial Window,but the same problem existed.
According to main.cpp,the serial should output somethings like

STATES: Danc(E), (W)alk, (T)rot, (B)ound, §ronk, (S)top, (J)ump, (Y)TurnTrot

So I tried to remove all src codes and replaced it with main.cpp shown below:

#include <Arduino.h>

#include <ODriveArduino.h>

#include <ChRt.h>

#include <SparkFun_BNO080_Arduino_Library.h>

void setup()

{

Serial.begin(115200);

Serial.println( “Ready for input”);

}

void loop()

{

Serial.print(“Hello, world?”);

delay(1000);

}

but nothing showed up in the terminal window.Can you offer me a help?

when I just re-download the libraries and tried the simple main.cpp, it worked.Maybe incorrect libraries is the cause.

So someone actually sells Ben Katz’s mini cheetah motors now: https://www.aliexpress.com/item/32985671853.html?spm=a2g0o.detail.1000060.3.3e102ef5X1lUEN&gps-id=pcDetailBottomMoreThisSeller&scm=1007.13339.146401.0&scm_id=1007.13339.146401.0&scm-url=1007.13339.146401.0&pvid=d1c5eb92-8139-4485-b3b1-950fde3ec261

Awesome! Ben had told me he was working on getting the motor mass manufactured in China. Looks like this is a prototype? I think their long term plan is to manufacture dozens of Mini Cheetah robots for labs or hobby use.

Hi Nathan.

During the process of final assembly, we found that the motor and the magnetic encoder may have bad contact, which may lead to the damage of Odrive. We would like to know whether you will ground the motor in the construction process, and how to do so?What do you do with the wiring of the magnetic encoder?

Hi Nathan,
The param,stance_height, in struct GaitParams is like this?11

Hi leaf.ye, stance_height is the distance from the hip joint (the coaxial tube) to the joint at the foot.
706a924ffe3edaa7a53a2f89b1c6d072ee218b15

Thank you very much ~

Hi Nathan
I use doggo_setup.py configure the odrive successs。Power On calibration motors and encoders success the motors can run.
(Teensy3.5) RX1 – (Odrive3.5-24V )GPIO1
(Teensy3.5) TX1 – (Odrive3.5-24V )GPIO2
Teensy3.5 connect Odrive success(I USE multimeter test it)
I use serials tool send command H, Teensy3.5 return message,but motors can,t run.
(what should i do can let motors run witch command).
The power outout 24V 5A。

1572504935

Another question is the BOM display the odrive is 24V version,but the github say you use the ODrive is 48 whitch is the right version of ODrive.

Hi Nathan
I use doggo_setup.py configure the odrive successs。Power On calibration motors and encoders success the motors can run.
(Teensy3.5) RX1 – (Odrive3.5-24V )GPIO1
(Teensy3.5) TX1 – (Odrive3.5-24V )GPIO2
Teensy3.5 connect Odrive success(I USE multimeter test it)
I use serials tool send command H,receive Teensy3.5 message,but motors can,t run.
(what should i configure with Teensy3.5 can let motors run witch command).
The power outout 24V 5A。

1572504935

Another question is the BOM display the odrive is 24V version,but the github say you use the ODrive is 48 whitch is the right version of ODrive.

Hi kaikai,
I would connect to the ODrives over USB and check that they don’t have any errors.
Both 48V and 24V versions work with 6S Lipos.

Hi Nathan
I use odrivetool command check error
Odrive go to the ERROR _INVALID_STATE。is this problem case ?
what should i do can slove the problem。
1572514110(1) 1572514143(2) 1572514435(3)

encoder_.run_offset_calibration(); return false; so it this let the Odrive have error

Hi kaikai, what encoder are you using? Can you upload a video of it doing the calibration procedure? My guess is that the CPR of your encoder is not actually 2000.

Hi @Nathan. It’s really a great work that inspires us a lot, and my friends and I are majoring in ur great project now.While we are facing a small but serious problem is that we don’t know how to run the script
https://github.com/Nate711/ODrive/blob/master/tools/doggo_setup.py to configure our ODrives.
I’ll appreciate a lot if you can tell me how to deal with it.

Hi Kaikai ,I want to ask for how to use doggo_setup.py configure the odrive. Is it in a python IDE ,or in the anaconda prompt?
I’ll appreciate a lot if u can help me.
Thanks.

Hi AlbertDT!
I use windows,install python3.7,Next use windows CMD, use cd command go to the doggo_setup.py folder。 use python doggo_setup.py set the odrive

Hi Nathan!
I found the problem, The AS5047D use 3.3V connect the ODrive,but i forget chane the AS5047D R1 to R2 ,this is the case cause the encoder error.
Thanks!