Anyone an idea how to IK rig a cardan shaft like shoulder?

Basically I got a robot with a cardan shaft shoulder.

Something like this

I am in a mental deadend currently.
atm I got the shoulder side limited to Y rotation (along the bone)
the upper arm bone is limited to XZ rotation. now the problem is the connector between them. I need to translate the YZ rotation of the upper arm bone over the connector into a Y rotation of the shoulder part, over an full IK chain.

Blender 2.49 btw.

My guess is I am currently too tired and worked myself into a dead end and I am unable to see the obvious solution, therefor I am not posting up my model (NDA´d anyways) however I made a small scene to toy with :wink:

You see the problem. the shoulder part isn´t rotating correctly with the arm, and I really got no idea how to fit the connector in, usually it ends in circular dependencies :smiley:
When it comes to rigging I wish I´d had an organic model, when modeling I wish it was vice versa :smiley:

Thanks to the one unwinding my thoughts. :rolleyes: