I am making a 3 part mechanical joint, with the different axis of rotation being in 3 different places. This is fairly easy to make a basic rig for:
The problem is that i'd like to control this with a single bone. In this setup, each of the deform bones is using copy rotation to copy the corresponding local axis of the big control bone. It works if I'm only rotating one axis at a time, but once I already have rotation on one, it stops working correctly as the axis become desynched.
What is the proper way to make this work?
I have seen some IK setups for similar joints. I have tried that, but they don't seem to work with this join order. I have the order Z, Y, X. With an IK setup, I can't control the Y roll. If I had the order Z, X, Y, then i'd be able to by putting a copy rotation or something on the final bone. But you can't influence the rotation of a bone in the middle of an IK chain without problems.
UPDATE: Some answers have used 1 less joint, but the 3rd is necessary. The cylinder was a stand-in for a 2 part joint. The cylinder can't be allowed to rotate on X. Here's a picture showing what the desired joint is like.