Hi Luning,

thanks for the clarification about the link coordinate system.
In my example I added the link coordinate system output to verify that it 
is indeed fixed to the global reference frame (see below).

Unfortunately my question remains: Why does the link force vector rotate 
and the torque vector does not ?  

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>()};
rotating_body->SetPos({1.0, 0.0, 0.0});

auto rotation_link{chrono_types::make_shared<ChLinkMotorRotationSpeed>()};
rotation_link->Initialize(rotating_body, fixed_body, ChFrame{});
rotation_link->SetSpeedFunction(chrono_types::make_shared<ChFunction_Const>(1.0));

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

system.Set_G_acc({0.0, 0.0, 10.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.830 *** Force: 0.682  0.731  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.840 *** Force: 0.675  0.738  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.850 *** Force: 0.667  0.745  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.860 *** Force: 0.660  0.751  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.870 *** Force: 0.652  0.758  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.880 *** Force: 0.645  0.764  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.890 *** Force: 0.637  0.771  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.900 *** Force: 0.629  0.777  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.910 *** Force: 0.622  0.783  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.920 *** Force: 0.614  0.790  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.930 *** Force: 0.606  0.796  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.940 *** Force: 0.598  0.802  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.950 *** Force: 0.590  0.808  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.960 *** Force: 0.582  0.813  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.970 *** Force: 0.574  0.819  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.980 *** Force: 0.565  0.825  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000
Time: 0.990 *** Force: 0.557  0.831  10.000 *** Torque: 0.000  -10.000 
 -0.000 *** Link Absolute Coords: 0.000  0.000  0.000  1.000  0.000  0.000 
 0.000


On Thursday, March 9, 2023 at 4:59:13 PM UTC+1 [email protected] wrote:

> Hello Simon,
>
> "As I understand, the link coordinate system is the 'master' body system 
> (Body2)."
> This is not correct. Your link coordinate system is defined here,
>
> rotation_link->Initialize(rotating_body, fixed_body, ChFrame{});
>
> ChFrame{} initialize a reference frame coincide with the global reference 
> frame. Because your Body2 (fixed_body) has the same orientation as the GRF, 
> and it is fixed, it just so happens that your link coordinate system is the 
> same as the 'master' body system. 
>
> You can check the orientation of the  link coordinate system using this: 
> auto quat = rotation_link->GetLinkAbsoluteCoords().rot
>
> Thank you,
> Luning
>
> On Tuesday, March 7, 2023 at 9:45:38 AM UTC-6 Simon wrote:
>
> Hi, 
>
> as per the documentation 
> <https://api.projectchrono.org/classchrono_1_1_ch_link_motor_rotation_speed.html>,
>  
> ChLinkMotorRotationSpeed's member functions Get_react_force() and 
> Get_react_torque() return the respective values in link coordinates.
> As I understand, the link coordinate system is the 'master' body system 
> (Body2).
>
> In the example below a body rotates around the absolute z axis using 
> ChLinkMotorRotationSpeed (the 'master' body is fixed here). As expected, 
> the link reaction force consists of a the constant body weight in z 
> direction and the rotating centrifugal load in the x-y plane. However, the 
> reaction torque (due to gravity) is constant despite the link's rotation. 
> Shouldn't the torque vector also rotate or do I misunderstand something?
>
> Thanks in advance!
> Simon
>
>
> *Code: *
> ChSystemNSC system{};
>
> auto fixed_body{chrono_types::make_shared<ChBody>()};
> fixed_body->SetBodyFixed(true);
> auto rotating_body{chrono_types::make_shared<ChBody>()};
> rotating_body->SetPos({1.0, 0.0, 0.0});
>
> auto rotation_link{chrono_types::make_shared<ChLinkMotorRotationSpeed>()};
> rotation_link->Initialize(rotating_body, fixed_body, ChFrame{});
>
> rotation_link->SetSpeedFunction(chrono_types::make_shared<ChFunction_Const>(1.0));
>
> system.Add(fixed_body);
> system.Add(rotating_body);
> system.Add(rotation_link);
>
> system.Set_G_acc({0.0, 0.0, 10.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()
>               << " *** Moment: " << rotation_link->Get_react_torque() << 
> "\n";
> }
>
>
> *Output: ...*
> Time: 0.810 *** Force: 0.697  0.717  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.820 *** Force: 0.690  0.724  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.830 *** Force: 0.682  0.731  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.840 *** Force: 0.675  0.738  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.850 *** Force: 0.667  0.745  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.860 *** Force: 0.660  0.751  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.870 *** Force: 0.652  0.758  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.880 *** Force: 0.645  0.764  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.890 *** Force: 0.637  0.771  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.900 *** Force: 0.629  0.777  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.910 *** Force: 0.622  0.783  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.920 *** Force: 0.614  0.790  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.930 *** Force: 0.606  0.796  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.940 *** Force: 0.598  0.802  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.950 *** Force: 0.590  0.808  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.960 *** Force: 0.582  0.813  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.970 *** Force: 0.574  0.819  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.980 *** Force: 0.565  0.825  10.000 *** Moment: 0.000  -10.000 
>  -0.000
> Time: 0.990 *** Force: 0.557  0.831  10.000 *** Moment: 0.000  -10.000 
>  -0.000
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/1e6a788d-5b29-4a61-8f6d-1361ce6a5361n%40googlegroups.com.

Reply via email to