How to rig this mechanism

Hello, I am looking for some help on rigging the locking device I have crudely represented in the attached. The thing moves by a force rotating the two drives (pink) which affect the lever/cam (blue, yellow) and rotates the keyed lock ring (green). This gives you two positions, a locked position (cam/lever full extension) and an unlocked position( cam/lever approx 45 deg abduction). Ideally, I would like to have one circular control bone planar to the key lock that could be rotated for open and close positions. I managed a very ugly version to work with IK on the cams and some copy rotation constraints to rotate the ring but I know there must be a better way. Any help would be appreciated, thanks in advance.

I’m not sure I understand the structure perfectly. From my understanding, the rotation of green is entirely determined by the rotation of pink-- or, conversely, the rotation of pink is entirely determined by the rotation of green. Based on the lengths of green, blue, yellow in your pic, this is not a full range of motion, but limited.

If that’s the case, you can simply use IK on blue+yellow targeting bones that are parented to green. Pink doesn’t matter in your diagram (because it is a cylinder, radially symmetric) but if you want, you can include it in the IK chain with IK angle limits, or you can keep it outside the chain and locked track yellow’s head/blue’s tail (lock Y, to Z or X depending on your axis choices.)

Green has limited rotation based on the dimensions you’re showing. Because you’re only ever rotating in a single local axis, it’s safe to deal with these with a limit rotation constraint on green. (Might want to change green axes such that its “normal” is its X axis, so the Euler order is always dealing with the first Euler angle-- but I don’t know, they might have created “order” field for that constraint, so I’m not sure it matters any more.) This can be tuned to eye, or you can figure it out with some trig that depends on the lengths of green, blue, and yellow.

All of that leaves you with a structure where you can rotate green directly, without any special controls. I don’t know why you’d want to copy rotation onto anything. Copy rotation + IK on two chains doesn’t sound ugly to me anyways; it sounds like something close to the bare minimum you’d need for mechanical structures.

Thanks for the reply, bandage. Your assessment is spot on, I think aligning to Euler order is definitely a good technique. Eventually, this will go to a game engine so I wanted to explore a possible armature export solution to avoid baking. Thanks again!