r/robotics • • 12d ago

Community Showcase UPDATE: I built a balancing robot with reinforcement learning

Enable HLS to view with audio, or disable this notification

Hi /robotics!

Two months ago I posted a video about this robot and here is an update with improvements and changes!

Updated:

- Improved RL policy
- Custom carbon fiber sandwhiched leg design for stiffness increase (previously too much flex in legs with 3D printed ASA). Currently is still an issue for the wheels.
- Wheel diameter increased from 128mm to 200mm (bought Xiaomi E-scooter tires lol)
- New color ASA for cover + calibration pads on the legs

I also built multiple new robots in the meantime and got a sponsorship from a Chinese manufacturing company, so expect higher quality in the future!

The robot is still trained 100% on synthetic data, so it has never seen the real world, yet adapts perfectly.

It has a lean and level mode (single policy), in level mode it keeps both pitch and roll of the base level at all times, so the legs automatically retract or extend based on the ground below. In lean mode the right joystick of the controller can be used to decrease or increase stance height and leaning left/right at all heights, allowing roll to be non-level.

Main components:

- 6x Xiaomi Cybergear motor (all quasi direct drive, no linkages)
- Teensy 4.1
- 200 Hz policy inference
- 2x CAN bus (left / right leg split)
- BNO086 IMU

Trained in mjlab on single RTX3080 at home, about 7 hours of train time from scratch.

Happy to answer any questions!

Also; I post frequent updates and clips on my Instagram @ meetvertex. I will not post these on Reddit because I do not want to spam this sub.

442 Upvotes

38 comments sorted by

9

u/RemarkableWish2508 12d ago

Is it weird that I hoped the wheel would fall off the curb to see how it handled that?

5

u/Fuchio 12d ago

Haha not weird, I'll make a video soon and add it to the instagram, spamming reddit subs is not really appreciated usually.

0

u/tangyHopz 4d ago

haha same but now im lowkey hoping it happen just to see your reaction

4

u/ReasonablyClever 12d ago

Looks great! I'm working on a hilariously similar bot, also using CG drives, and would love to see how you've done your training curriculum setup!

4

u/Fuchio 12d ago

Hey! I'm currently not at home to check the details exactly, but I can share these later if you want.

Roughly, it's a dual mode single policy setup, where I have one input paramter set to a toggle button on the controller that changes the bot into lean or level mode. In lean mode, it allows leaning to the left and right while in level mode it tries to keep the base level at all times so it will compensate for uneven ground like in this video.

I have 5 curriculums:
- Balance without controller input
- Add little controller input; slow direction change and forward/backward driving + base height increase/decrease
- Add full controller input, learn fast driving, steering while driving, braking etc
- Add lean mode to left and right with randomized base height
- Finally let robot do every option on sloped terrain

0

u/[deleted] 12d ago

[deleted] — view deleted comment

2

u/Fuchio 12d ago

Share a pic :D

0

u/[deleted] 12d ago

[deleted] — view deleted comment

2

u/Fuchio 12d ago

Nice! This really reminds me of the robot built by engineering_tech_01 on instagram!

4

u/hydrocarbons77 12d ago

Can it balance and move on just one leg?

2

u/Fuchio 12d ago

No needs at least abduction for that to do it shortly and upper leg yaw with abduction for possible longer balancing.
That’s super hard though

3

u/Latter-Letter-6942 12d ago

That's awesome! Is the design and colors inspired by the agility robots?

4

u/Fuchio 12d ago

Not really inspired on Agility, it was just the most fun ASA color sold by Bambulab haha

The other options are very plain RGB colors, my previous bot had the normal blue. This makes it a bit more unique

3

u/Latter-Letter-6942 12d ago

Teal is a fantastic color Dave2D ftw lol

2

u/SphericalCowww 12d ago

Man, it really keeps on improving over time! How do you train it on different terrains, though?

3

u/Fuchio 12d ago

It sees different terrains in simulation! Usually comes down to sloped terrain with randomized friction on the wheels :)

2

u/Ensargx 12d ago

Hi, I’m just wondering how big is the AI model and where is it running on?
Are you sending data to computer or is it running inside?

6

u/Fuchio 12d ago

Custom neural architecture running at 200Hz on Teensy 4.1 on board of robot :)

It runs fully standalone, only controller needed for sending input commands

2

u/Ensargx 12d ago

Impressive, the model should be small I assume.

2

u/playingcards_medic 10d ago

nicee, what's the total cost of this project? + Time spent

3

u/Fuchio 10d ago

Hmm I don’t work on this all the time because I am building other bots in the meantime. I’d say total cost for this to be 1200 euros

But if I had to rebuild this exact one again it would be like 700€. Approx time to build 2 months

2

u/GooglesExpert 12d ago

Do you have youtube. Please consider posting on it if not already doing.

What actuators are these?

It really looks very cool. Love it.

3

u/Fuchio 12d ago

Hey!

Yes, I have a Youtube where i post shorts, but Instagram is most active. Both handles are meetvertex

Actuators are 6x Xiaomi CyberGear, but I do not recommend buying these. They are cheap QDDs (relatively) but only have an encoder on the input shaft. Meaning you have to synchronize joints on every power up.

2

u/ConfusedMotion 12d ago

he did a youtube tutorial, there is a 6 part series on that online

2

u/bacon_boat 12d ago

How are you handling the sim2real gap?

7

u/Fuchio 12d ago

Process is roughly like this:

- Convert CAD model with masses and simplified models to simulation format (URDF or MJCF)
- Do system identification on hardware, so measure stuff like stiction (static friction, noise, latency) roughly
- Update URDF / MJCF file with measured sys id values
- In simulation, randomize all these values (frictions, but also center of mass, weights and sensor noise) within a range of +/-30% on every robot spawn (term for this is domain randomization)
- Now robot learns to balance with all these unique sets of variables
- It has never "truly" seen the real world, but after seeing thousands of unique fake worlds, the real world is just n fake worlds + 1

More complex robots often do a teacher-student approach, where the robot learns in a perfect world initially without domain randomization (no noise, no latency, etc.), so it can quickly learn what it should do in a perfect world with data the real robot can never sense. Then after that, this perfect world implementation is used as guided for a student policy which has a subset of input variables and domain randomization added.

2

u/Sample9002 10d ago

Interesting approach.

Did it work in the real work from the start?

If not what were the issues and how did you fix them?

Also interested if you took any safety precautions in the first runs to avoid damaging the robot if something went wrong.

Great work and thanks for sharing!

1

u/disignore 11d ago

does it pass the butter?

1

u/ecoswatt2026 11d ago

The leg design looks like a big improvement. Going from 128mm to 200mm wheels is quite a change too. Really interesting that the policy was trained entirely on synthetic data. How does it handle uneven real-world surfaces so far?

1

u/Elegant_Cream_5848 11d ago

But why? 🤣

1

u/Snoo_42257 9d ago

Why such expensive motors?

1

u/elexresearch2026 9h ago

awesome !!

0

u/JackfruitFeeling8639 7d ago

Great job. Do you plan to put the code on GitHub anytime soon?

5

u/[deleted] 12d ago

[removed] — view removed comment

10

u/Fuchio 12d ago

They are rigid, but I did simplify the model. Instead of an ellipsoid I used a stack of 5 stacked cylindrical primitives. In the image below is the collision model from the old small wheeled bot, but the concept is the same!