LDraw.org Discussion Forums
Rotation & angle of universal joint? - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: General (https://forums.ldraw.org/forum-12.html)
+--- Forum: Help (https://forums.ldraw.org/forum-13.html)
+--- Thread: Rotation & angle of universal joint? (/thread-23697.html)

Pages: 1 2 3


Rotation & angle of universal joint? - N. W. Perry - 2019-10-02

Since I got such quick and helpful advice on my piston rod question, here is my next challenge: universal joints!

Specifically, how do I work out the compound angles of a double u-joint connection? See the image below, where I need to connect axle A to axle B by using the short connecting axle that's floating nearby.
[attachment=4067]

Here are some parameters:
  • Axle A is oriented parallel the model's Z axis; axle B is oriented at an angle to it. The connector will have to be rotated in both the X and Y directions, but you can't just set one and then the other, because changing either affects both. I'm guessing the 't' word, trigonometry, will come in again here, but because of the compound angle, I'm not sure where to place the triangles.
  • Axles A and B are rotated 22.5 degrees with respect to their longitudinal axes; my assumption is that the U-joint will transmit the same angle to the connector axle, and that while this rotation needs to be accounted for, it won't change the method needed to determine the connector angle.
  • I guess I need to determine the rotation of the U-joint hubs at A and B, around both of their local X and Y axes. Again, my assumption is that the hubs themselves, however they may be rotated, will always remain at the same coordinates in absolute space; that is, they always form the point around which the connector axle is angled at each end.
  • The end of the axle at B may need to be slid downward along its own longitudinal axis in order to correctly intersect the connector axle; this unknown position makes the trigonometry harder to figure out for me.
Of course, I can (and probably will) just download this model from the OMR and steal the answers from there, but again, I'm keen to know the right way to solve these challenges on my own. And I could also probably work it out by iteratively tweaking each angle until everything appears to line up, but I like to know that I've actually calculated it precisely instead of just doing it by eye.

Looking forward to everyone's suggestions!


RE: Rotation & angle of universal joint? - Philippe Hurbain - 2019-10-02

[Image: thinking-face_1f914.png]
I managed to come to a working method, but it is based on a successive approximation method, far from optimal... (attached).
Note that I haven't found the 853/956 Auto chassis on the OMR, but it's available on Eurobricks. Needed it for basic geometry... but the universal joints are slightly wrong there, the middle connections are badly placed.


RE: Rotation & angle of universal joint? - Eugen - 2019-10-02

(2019-10-02, 3:36)N. W. Perry Wrote: Since I got such quick and helpful advice on my piston rod question, here is my next challenge: universal joints!

Specifically, how do I work out the compound angles of a double u-joint connection?

I would recommend use FLOSS parametric 2D/3D CAD & CAE «SolveSpace» for analyze 2D & 3D mechanism/kinematic: I try recreate all needed parts for creating universal joint assembly from scratch as solid CAD models in SolveSpace.
  • "Technic Universal Joint End (3712.slvs)" done!
    [Image: g78ZGba.png]
  • "Technic Universal Joint Centre Type 1 (3326a.slvs)" done!
    [Image: lHBXfV9.png]
  • WIP!



RE: Rotation & angle of universal joint? - Orion Pobursky - 2019-10-02

The other thing compounding this issue is that real plastic is flexible and digital brick are not. This means that what fits in real life may not on your computer. The single angle u-joints often are off by a few ldu, the double angle u-joints often have a significant length gap.


RE: Rotation & angle of universal joint? - Roland Melkert - 2019-10-02

(2019-10-02, 3:36)N. W. Perry Wrote: Since I got such quick and helpful advice on my piston rod question, here is my next challenge: universal joints!

I don't have the time to go in to details at the moment, but you might want to look at my 8860 animation script (included in LDCad's examples).

It does realtime frame depended universal placements.

Code section of interest:

Code:
    --The universal joints are a bit tricky and need some rotation matrix 'magic'.
    -- As there are two of them a function can be used to apply things on both of them.
    -- This uses the source's known local X and Z axis' to construct the link's orientation by using the also known destination Z-axis (axle length direction).
    -- The orientation of the destination can then be constructed based upon the link's orientation.
    -- We don't have to worry about positions in absolute model space as the aniTools joint mechanics will take care of that.
    local function calcUniAxle(fromAxleOri, dstAxleZ, linkPosOri, dstAxlePosOri)

      --link
      local jntX=fromAxleOri:getOriRow(1)
      local jntZ=fromAxleOri:getOriRow(3)
      local jAngle=jntX:getSignedAngle(dstAxleZ, jntZ)

      local ori=ldc.matrix()
      ori:setRotate(jAngle, jntX)
      jntZ:transform(ori)

      local jntY=jntZ:getCross(jntX)
      ori:setOriRows(jntX, jntY, jntZ)
      ori:mulAB(fromAxleOri:getInvertedOri())
      linkPosOri:set(ori)

      --dst
      jAngle=jntY:getSignedAngle(dstAxleZ, jntZ)
      ori:setRotate(jAngle, jntY)
      jntZ:transform(ori)
      jntX=jntY:getCross(jntZ)
      dstAxlePosOri:setIdentity()
      dstAxlePosOri:setOriRows(jntX, jntY, jntZ)
    end

    local z=self.axle1Joint.orgAbsPosOri:getPos()-self.axle3Joint.orgAbsPosOri:getPos()
    calcUniAxle(self.axle3PosOri.value, z, self.axleJnt2PosOri.value, self.axle2PosOri.value)

    z=self.axle1Joint.obj:getOri():getOriRow(3)
    calcUniAxle(self.axle2PosOri.value, z, self.axleJnt1PosOri.value, self.axle1PosOri.value)



RE: Rotation & angle of universal joint? - N. W. Perry - 2019-10-03

(2019-10-02, 11:33)Philippe Hurbain Wrote: [Image: thinking-face_1f914.png]
I managed to come to a working method, but it is based on a successive approximation method, far from optimal... (attached).
Note that I haven't found the 853/956 Auto chassis on the OMR, but it's available on Eurobricks. Needed it for basic geometry... but the universal joints are slightly wrong there, the middle connections are badly placed.

So, what you're saying is…this one actually is as tricky as it seems?  Tongue

There is also an 853 model at Technicopedia; it looks to be a different one from the Eurobricks model, but your own solution looks at least as accurate!
(2019-10-02, 14:05)Orion Pobursky Wrote: The other thing compounding this issue is that real plastic is flexible and digital brick are not. This means that what fits in real life may not on your computer. The single angle u-joints often are off by a few ldu, the double angle u-joints often have a significant length gap.

This model actually has a few such instances, as do some others from that early Expert Builder period, where connections are made that depend on the natural tolerance of the plastic and the spaces between bricks. I've been meaning to ask in another thread how others have gone about modeling these instances (for example, in the 850 Fork Lift, I made my own custom 2x2 brick that is 1 LDU too short and mixed it in with proper-sized ones, to allow a connection with one beam that's misaligned with another).

(2019-10-02, 18:17)Roland Melkert Wrote: I don't have the time to go in to details at the moment, but you might want to look at my 8860 animation script (included in LDCad's examples).

It does realtime frame depended universal placements.

I actually looked at the 8860 script for piston rod/crankshaft placement as well. I recognize that the answer is in there somewhere, but I will probably need some help translating what I'm reading there.  Wink

Meanwhile, I'll see how close I can get with successive approximation—I'll probably try setting the angles in Bricksmith, since I can repeatedly apply an incremental rotation of my choosing until it's as close as can be.


RE: Rotation & angle of universal joint? - Orion Pobursky - 2019-10-03

(2019-10-03, 1:47)N. W. Perry Wrote: This model actually has a few such instances, as do some others from that early Expert Builder period, where connections are made that depend on the natural tolerance of the plastic and the spaces between bricks. I've been meaning to ask in another thread how others have gone about modeling these instances (for example, in the 850 Fork Lift, I made my own custom 2x2 brick that is 1 LDU too short and mixed it in with proper-sized ones, to allow a connection with one beam that's misaligned with another).

I usually just push the connecting axle further into u-joint ends. As long as the error isn't more than 10-15 ldu then its fine and you'd never know since the parts aren't transparent. See my 8448 model for an example.


RE: Rotation & angle of universal joint? - Roland Melkert - 2019-10-03

(2019-10-03, 1:47)N. W. Perry Wrote: I actually looked at the 8860 script for piston rod/crankshaft placement as well. I recognize that the answer is in there somewhere, but I will probably need some help translating what I'm reading there.  Wink
Ok, I had some time to kill (waiting on some progress bar Smile )

I made a very quick and dirty helper macro and added it to the technic.lua script.

Replace
%appdata%\LDCad\scripts\default\global\technic.lua
with the version attached.

Now in your model start a new selection
Select the universal end at A
then (hold ctrl) select the center piece at a (or anywhere)
then (hold ctrl) select the joints second uni end (or one anywhere else)
last (hold ctrl) select the uni end at point B

now execute the new macro from /scripts/technic/Universal joint placement helper

this should place all three uni parts correctly.

Now repeat this for the uni at point B by selecting
uni part at B' axis
center part
another uni part end
center piece at point A

execute the script again.

Made a short clip:
https://youtu.be/ZhCQrLSCNwI


Notes:
It only works with uni ends with an origin at the center piece (like 62520.dat)
I did very little testing.


RE: Rotation & angle of universal joint? - Philippe Hurbain - 2019-10-04

(2019-10-03, 22:27)Roland Melkert Wrote: Notes:
It only works with uni ends with an origin at the center piece (like 62520.dat)
Not a huge restriction, to use universal joint ends with stupid origin (3712 and 575) you only have to translate them by 30 ldu to place their origin at the right place, apply script, and re-translate them in opposite direction (using relative grid).

Quote:I did very little testing.
I indeed think there is something not addressed, configurations where one i/o axle needs to be rotated. If I am not utterly wrong, this occurs when input and output axle do not sit in parallel planes. See attached example.
[attachment=4071]


RE: Rotation & angle of universal joint? - N. W. Perry - 2019-10-04

Yes—it does indeed work! I came up with the same workaround as Philo for the 4L U-joint; here's how it looks…

  1. First, install the U-joint parts onto the axle in the usual manner (without any rotation):
    [attachment=4073]
  2. Next, select the hub part and choose REL editing grid. Then, set the positions of the end parts to 0,0,0 (by removing the 30 LDU offset on the Z-axis):
    [attachment=4074]
  3. Apply the script:
    [attachment=4075]
  4. Now, move the end parts to their proper positions using part snapping or grid plane editing (making sure the the grid orientation is set REL to the axle, not the rotated hub):
    [attachment=4076]
Don't forget to add the 2L axle to the link section! Also, be careful to select the parts in the correct order when applying the script, as the end parts appear reversed from their eventual positions.

There is one tiny quibble with this solution: it doesn't allow placing the end parts tight together on the 2L link section, because that would require sliding the angled axle slightly downward, and we don't know that exact position. I can envision a new feature that would allow such a placement…but I'll post about that another time.  Wink