ChLinkLockLock reaction torque

97 views
Skip to first unread message

Simon

unread,
Mar 28, 2023, 9:37:29 AM3/28/23
to ProjectChrono
Hi,

in my example below I apply an external torque to a body that is linked using a ChLinkLockLock with prescribed angle. If the link angle is nonzero, the link reaction torque differs from the applied torque. This is incorrect to my understanding.

Using a ChLinkMotorRotationAngle in place of the ChLinkLockLock leads to the correct link reaction torque. Unfortunately the ChLinkMotorRotation* show a behaviour that is also unexpected to me (see https://groups.google.com/g/projectchrono/c/9K8gKSscqLM).

Is there an option to implement an actuated revolute joint that yields the correct reaction torque?

Thank you,
Simon

Code:

ChSystemNSC system{};

auto fixed_body{chrono_types::make_shared<ChBody>()};
fixed_body->SetBodyFixed(true);
auto rotating_body{chrono_types::make_shared<ChBody>()};

auto rotation_link{chrono_types::make_shared<ChLinkLockLock>()};
rotation_link->Initialize(rotating_body, fixed_body, {});
rotation_link->Set_angleset(chrono::AngleSet::ANGLE_AXIS);
rotation_link->SetMotion_axis({0.0, 0.0, 1.0});

// Set angle
rotation_link->SetMotion_ang(chrono_types::make_shared<ChFunction_Const>(1.0));

// Apply torque to body
rotating_body->Accumulate_torque({0.0, 0.0, 10.0}, false);

system.Add(fixed_body);
system.Add(rotating_body);
system.Add(rotation_link);

system.Set_G_acc({0.0, 0.0, 0.0});

for (double time{}; time < 1.0; time += 0.01)
{
    system.DoFrameDynamics(time);

    std::cout << std::fixed << std::setprecision(3) << "Time: " << system.GetChTime()
              << " *** Force: " << rotation_link->Get_react_force()
              << " *** Torque: " << rotation_link->Get_react_torque()
              << " *** Link Absolute Coords: " << rotation_link->GetLinkAbsoluteCoords() << "\n";
}

Output:
...
Time: 0.970 *** Force: -0.000  -0.000  -0.000 *** Torque: 0.000  0.000  8.776 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000  0.000
Time: 0.980 *** Force: -0.000  -0.000  -0.000 *** Torque: 0.000  0.000  8.776 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000  0.000
Time: 0.990 *** Force: -0.000  -0.000  -0.000 *** Torque: 0.000  0.000  8.776 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000  0.000

Simon

unread,
May 2, 2023, 4:25:03 AM5/2/23
to ProjectChrono
Issue resolved with commit ca81537edc33c128af3dbfb820b9039aac42e00f
Reply all
Reply to author
Forward
0 new messages