I'm learning Modelica in openModelica, and have a specific problem in mind to solve. I'd like to model a sphere resting on another sphere, in order to develop a control algorithm to balance the system.
While a sliding interaction is easy, the rolling interaction is eluding me. How should I achieve this? The model need not take into account a loss of friction at at more extreme angles, just the simpler case where the rotation is locked to one another.
Ideally, I'd like to use prefab GUI blocks. It feels like this ought to be well within the bounds of what can be done with the existing classes. The bevel gear module seems promising. Is this the right way to proceed? Do i break the spherical joint down into multiple revolute joints and drive each of those? Should I abandon the hope of using existing classes and need to write my own?
Update1:
Most successful attempt looks like this:
Pulling the relative angle and using that to force a related angle.
For my initial application, this should be fine, but there is a fatal flaw with this method. When the angle wraps around from +180* to -180*, there is momentary force/torque, speeding up the rolling rotation.

I haven't been able to use the idealGear class, but perhaps i should try again on that one.