# Constraints for shafts with a universal joint

I'm very new to Blender and have run into a Constraint problem.

I want to design a couple of shafts with a universal joint that can have its output shaft repositioned by a half sphere on its local Z axis at 45 degrees.

I have been able to get the Copy Rotation constraint for the input & output shafts working so I can rotate the lower input shaft about its Z axis, the upper output shaft will copy the input shafts rotation.

The difficulty I face is how to constrain the upper output shaft to follow the half sphere's rotation about its local Z axis.

• Hi Please use a title that reflects the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that users can at a glance understand what your post is about. Use the edit link below your post and avoid anything not strictly essential to the post. Remember, your title is the first thing potential visitors will see, and makes your question findable for future users. See "What is the problem with posting an image or link and asking “How do I do this?"" Commented May 20, 2022 at 16:07
• do you mean like this? [1]: i.sstatic.net/I3QFz.gif Commented May 20, 2022 at 16:50

It's not super clear to me what you're after. From your file, it appears that you want Cylinder.001 to inherit rotation from Cylinder.004, then rotate so that it passes through the hole in ring gear, regardless of what the orientation of ring gear is.

There's actually a few different ways to rotate into that hole, and they're all different in the way they act. The simplest is to tell Cylinder.001 to damped track a marker placed in that hole, which is parented to ring gear:

I made an empty in the middle of the hole, I parented that empty to ring gear, and then I gave Cylinder.001 a damped track constraint targeting that empty. I set the track axis of the constraint to Z, since we want Cylinder.001's Z axis to be pointing at that hole, not the default Y axis.

What are the other ways, and how are they different? Damped track rotates via the shortest possible rotation to that position-- the "swing angle", like a great circle. We could also do locked, in order rotations to reach that same position, which will give us a different Z axis rotation at the end:

Locked tracks on the left, damped track on the right, otherwise identical transforms. If we locked track in a different order, we'll get a third different twist. This is very similar to how Euler order matters for orientations, with damped track being the quaternion version.

Which one you should choose depends on the precise kind of joint you have, and the mesh here isn't detailed enough for me to tell. Many mechanical devices do 3D rotation not in a single universal joint, but via consecutive hinges. The ideal way to handle these kinds of joints is not with a single object as an Euler, possibly with locked tracks, but as two or more different objects, each with their own axes of rotation. In cases where a joint is actually universal, ie a ball joint, the damped track version is the correct solution.

Note that here, I probably wouldn't be using a copy rotation constraint to inherit rotation from Cylinder.003, but simple parenting instead. But what you're doing so far isn't wrong, just unusual.

• Thanks much Nathan ...that's quite alot for me to absorb, but it gives me quite alot of things to learn about - at least I know this little design project can be done in Blender. Commented May 21, 2022 at 17:16
• I'm still trying to figure out this Q/A interface... I wish I could add an image that might help. Did you make that gif example Nathan? The example gif isn't quite what I'm going for. I want to position the upper output shaft by rotating the ring gear about its Z axis which is 45 degrees about the X axis. here's a link to a picture; photos.app.goo.gl/Ly6EptNza5RwbdTL8 Commented May 21, 2022 at 17:28
• I'm not sure what you mean. If you build the stuff I mentioned, you can position ring gear however you want and the upper output shaft will follow. If you want to rotate the ring gear about its Z axis, rotate it about its Z axis. I didn't make that gif, but it's similar to what you'd get with what I offered. Commented May 21, 2022 at 17:42
• Ok Great Nathan - Thanks ...that tracking a marker thing looks perfect and very flexible for all kinds of things. Lots to learn here. Commented May 21, 2022 at 19:19
• Dang that worked so well. At first it wouldn't work because when I copied the ring gear & cylinder from my project file I brought along the copy rotation constraint to the lower cylinder, which I didn't copy as well. Deleting that constraint did the trick, but when I copied the working ring gear, cylinder, & empty back to my project file, I had to delete the old copy rotation constraint & add it back. And Viola it lives! ...learn from the mistakes & smarts of others. Thanks again Nathan! Commented May 21, 2022 at 20:15