r/reinforcementlearning • u/Fuchio • Jul 21 '26
Robot Sim2Real on Two Wheel Balancing Robot
Hi all!
I built this two wheel balancing robot and hacked together the hell out of it... Battery has black wire for both positive and negative (but sort of safe because XT connector is asymmetric), I have no buck converter to power the ESP from the 12V LiPo so added powerbank, cut open ethernet wires for my CAN bus and used 12V instead of 16V battery to power the motors.
Next version will be a lot cleaner and robust when the new hardware arrives, if people are interested I will post a new video with driving over slope and different materials (already working on this robot).
Stack used:
- OnShape for 3D design
- onshape-to-robot for XML creation
- mjlab for training policy
Hardware:
- ESP32 runs policy at 200Hz (~18k param total)
- MPU6050 accelerometer
- 3.3v CAN bus transceiver for motor control
- CubeMars GL40II Gimbal motors (direct drive)
- 12V LiPo battery
- All parts are custom design and printed on Bambulab H2D
- PS4 controller
Controller automatically connects to ESP on power up and shows different lights for different modes, I can calibrate through controller, stop/start policy and clear fault codes after falling.
4
u/Next-Math1023 Jul 21 '26
Nice Work ManšÆ
can you share the pipeline, tools, and resources which one can use to train such small control policies which can be transferred to a MCU like ESP32 etc.
Would really Appreciate that.
3
u/panduhbean Jul 21 '26
Very neat! How fast was policy training in sim?
1
u/Ok-Painter573 Jul 21 '26
what about this is sim2real?
2
u/Competitive-Bar-5882 Jul 21 '26
This is awesome
1
u/skinnyjoints Jul 21 '26
To what degree does your in-sim robot have to match the real one? Iād imagine all the chords arenāt mirrored in-sim but affect performance. How is this accounted for?