How would I get these joints simulating correctly?

Have you seen this?
RobotSimulation

see Collection of examples from discourse.threejs.org
https://hofk.de/main/discourse.threejs/2019/index2019.html

original post