Hi Luning,
Thanks for the reply. I have looked into links and how they are used by simulating different options for a short amount of time. I am a little confused as testing different options did not seem to make much sense.
For a prismatic joint is defined as:
prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), QUNIT));
The motion is allowed in the Z-dir. However, in the SingleWheel demo, the joint is defined as:
prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), Q_from_AngY(CH_C_PI_2)));
which results in the motion being allowed in both the x and z directions (two directions). However, when changing the input to this
prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), Q_from_AngX(CH_C_PI_2)));
The motion becomes restricted in both x and y and only free in z. Why is that?
To try to navigate through this, I started by removing the actuator completely from my implementation as I only added it to be able to extract the forces on the screw (Is there a way to extract the forces on the screw without having to use an actuator?). Then, I have only two prismatic joints left ( one between the ground and the chassis and one between the chassis and axle). I started my tests by having the input for my prismatic joint as Q_from_AngY(CH_C_PI_2). This resulted in my screw moving in the z and x directions as expected. Then, I changed the input to Q_from_AngX(CH_C_PI_2), and also as expected, the screw was allowed to move in z-direction but not in x and y. As a result, I started thinking that maybe the second joint is what is preventing my screw from moving in certain directions. As a result, I tried the following combinations:
1 - prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), Q_from_AngY(CH_C_PI_2)));
prismatic2->Initialize(chassis, axle, ChCoordsys<>(chassis->GetPos(), QUNIT));
( screw moved in both x and z)
2- prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), QUNIT));
prismatic2->Initialize(chassis, axle, ChCoordsys<>(chassis->GetPos(), Q_from_AngY(CH_C_PI_2)));
(screw moved in x and z)
3- prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), QUNIT));
prismatic2->Initialize(chassis, axle, ChCoordsys<>(chassis->GetPos(), QUNIT));
(screw moved only in z)
4 - prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), Q_from_AngXCH_C_PI_2)));
prismatic2->Initialize(chassis, axle, ChCoordsys<>(chassis->GetPos(), QUNIT));
( screw moved only in z)
5- prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(), QUNIT));
prismatic2->Initialize(chassis, axle, ChCoordsys<>(chassis->GetPos(), Q_from_AngX(CH_C_PI_2)));
( screw moved only in z)
6- prismatic1->Initialize(ground, chassis, ChCoordsys<>(chassis->GetPos(),
Q_from_AngX(CH_C_PI_2) ));
prismatic2->Initialize(chassis, axle, ChCoordsys<>(chassis->GetPos(), Q_from_AngX(CH_C_PI_2)));
( no movement)
I then thought that maybe the type of link I was using was not correct. I looked into different links (
Project Chrono: Links) and could not find one that seems appropriate. I have also looked at the demos you specified to try to better understand (crank demo) and it does not look like the prismatic link is used there. However, the ChLinkLockPointLine link seems like something that can be used in my case but I cannot tell what the difference is between this link and the prismatic link. As for the motor, the motor seems to work well so far as the screw rotates about its axis as it is supposed to.
One final note, I have multiplied the mass obtained with ComputeMassProperties() by the screw density and got 0.9888. This is still quite different from what my CAD provides (1.71kg). Any insight about this? The inertia values are also off.
Sorry about the very long message and thank you so much for all your help,