Hey Joe, I know this is an old topic, but I thought you might still find it interesting.
Remember a few years back when we realized that even with a robust physics solver, building a self-balancing robot wasn't as straightforward as we expected?
We discovered that contact behavior could become extremely brittle, and we both agreed that the solution likely lay in using a soft contact model.
At the time, I had this idea to modify the contact joint to allow for penetration, thinking that would add the needed softness.
I spent a lot of time trying to make that work, but reality eventually caught up with me, and shoed me that it was a fundamentally flawed approach.
Not just wrong, but flat out boneheaded. Looking back, I’m not sure what I was thinking.
Allowing penetration made no sense, especially for humanoid robots where the contact surface (feet) is so thin. It just didn’t align with the physical realities of the system.
Ironically, I had already solved this problem in a different context: vehicle and track simulations.
These setups use small contact areas too, but they behave just fine. The trick, as it turns out, is that vehicle tires emulate soft contacts not via the contact joint itself, but through the suspension system.
I hadn’t realized that this was essentially the same problem, just tackled from a different angle.
Fast forward to training legged robots: I ran into the same issue again, in the worst possible way. Every time a leg hit the ground, the impulse generated by the contact would completely disrupt the learning process.
To deal with it, I added extra variables to predict foot strike timing and tried to mitigate the impulse, but the results were underwhelming.
Inverse dynamics (ID), based training for target positions performed poorly, while forward dynamics using joint torques yielded slightly better results.
At that point, I started questioning my assumption that inverse dynamics could produce superior outcomes. Maybe I was wrong?
Then, looking at robots from Boston Dynamics and noticed one common feature across all their designs:
a soft pad at the feet.
That’s basically a soft contact, but how to replicate that in simulation?
The breakthrough idea was simple: split the lower leg (calf) and connect it to the foot with a sliding spring.

- Untitled.png (9.9 KiB) Viewed 17958 times
This allows the foot to absorb impact energy via the spring, without compromising the leg’s joint angles solver. The result should be a smoother, more organic motion.
This also helps on the machine learning front.
Neural networks struggle with sharp discontinuities.
One way to handle that is to use large hidden layers, but that introduces a whole new set of challenges.
Now, I think I’ve found a better balance: eliminate the discontinuities at the source using mechanical modeling (soft contacts),
then train using inverse dynamics combining the best of both worlds.