Few Question regarding setting initial angular velocity to body?

Simbody is useful for internal coordinate and coarse grained molecule modeling, large scale mechanical models like skeletons, and anything else that can be modeled as bodies interconnected by joints, acted upon by forces, and restricted by constraints.
POST REPLY
User avatar
Amit Misra
Posts: 9
Joined: Sat Dec 03, 2022 9:34 pm

Few Question regarding setting initial angular velocity to body?

Post by Amit Misra » Sat Dec 03, 2022 10:32 pm

Hi ,

First, I like to say Simbody is an awesome tool for engineering modelling where accuracy is needed. We are using this to create the digital twin of our robot. Thank you for this speed.

I am using simbody for my Project application. When I was playing with the code, I had a few questions.
  • 1. I want to provide Initial angular velocity to the whole body , not one body. is function "setUToFitAngularVelocity" (https://simbody.github.io/3.5.0/classSi ... de27544411), but this function only provide the angular velocity between the parent and body. What happens to the other attached body? Do I need to calculate the angular velocity of other bodies with respect to the ground?

    2. When I was experimenting with the code "DzhanibekovEffect" , when I added from

    Code: Select all

    shaft.setUToFitAngularVelocity(state, Vec3(10,0,1e-10)); // 10 rad/s
    
    to

    Code: Select all

    shaft.setUToFitAngularVelocity(state, Vec3(10,10,1e-10)); // 10 rad/s
    
    Screenshot from 2022-12-04 13-24-34.png
    Screenshot from 2022-12-04 13-24-34.png (284.12 KiB) Viewed 3780 times
    Body starting translation motion. I am confused about how since I have provided only angular velocity and no gravity. How it is getting translation motion.
    3. One more Question is from the example "ExampleMotorWithSpeedControl" ,

    Code: Select all

    MyTorqueLimitedMotor
       (const MobilizedBody& mobod, MobilizerUIndex whichU, 
        Real gain, Real torqueLimit)
    
    What is the use of MobilizeUIndex. According to my understanding U stand for generalized speed, which contains 6 elements ( 3 angular and 3 linear velocities). When you write MobilizerUIndex(0)

    Code: Select all

    new MyTorqueLimitedMotor(leftArm, MobilizerUIndex(0), TorqueGain, MaxTorque);
    
    Does it mean that you are accessing the first elements of 6 element?
I will be really glad if you can answer me.

User avatar
Michael Sherman
Posts: 812
Joined: Fri Apr 01, 2005 6:05 pm

Re: Few Question regarding setting initial angular velocity to body?

Post by Michael Sherman » Sun Dec 04, 2022 2:54 pm

These are great questions, thanks Amit. I'll answer one per post:
I want to provide Initial angular velocity to the whole body , not one body. is function "setUToFitAngularVelocity" (https://simbody.github.io/3.5.0/classSi ... de27544411), but this function only provide the angular velocity between the parent and body. What happens to the other attached body? Do I need to calculate the angular velocity of other bodies with respect to the ground?
I'm not sure what you mean by "the whole body". Do you mean the whole system, that is, the whole tree of bodies? Since Simbody uses relative coordinates, when you set the angular velocity of a body using SetUToFitAngularVelocity() you are setting the angular velocity for all of the outboard ("child" and "ancestor") bodies also.

User avatar
Michael Sherman
Posts: 812
Joined: Fri Apr 01, 2005 6:05 pm

Re: Few Question regarding setting initial angular velocity to body?

Post by Michael Sherman » Sun Dec 04, 2022 3:01 pm

In DzhanibekovEffect, you were surprised that changing the angular velocity from (10, 0, 1e-10) to (10, 10, 1e-10) caused translation to occur. That's because the angular velocity value you chose gave the system center of mass a non-zero translational velocity. You can see that by adding the following just after setting the angular velocity:

Code: Select all

    shaft.setUToFitAngularVelocity(state, Vec3(10,10,1e-10)); // 10 rad/s

    system.realize(state, Stage::Velocity);
    const Vec3 v_com = matter.calcSystemMassCenterVelocityInGround(state);
    std::cout << "v_com=" << v_com << "\n";
Note the z component of COM velocity. When the angular velocity is directed only about the symmetry axis the z component is zero.
v_com=~[0,-4.66667e-12,0.466667]

User avatar
Michael Sherman
Posts: 812
Joined: Fri Apr 01, 2005 6:05 pm

Re: Few Question regarding setting initial angular velocity to body?

Post by Michael Sherman » Sun Dec 04, 2022 3:16 pm

3. From the example "ExampleMotorWithSpeedControl":
MyTorqueLimitedMotor
(const MobilizedBody& mobod, MobilizerUIndex whichU, Real gain, Real torqueLimit)
What is the use of MobilizeUIndex. According to my understanding U stand for generalized speed, which contains 6 elements ( 3 angular and 3 linear velocities). When you write MobilizerUIndex(0)
new MyTorqueLimitedMotor(leftArm, MobilizerUIndex(0), TorqueGain, MaxTorque);
Does it mean that you are accessing the first elements of 6 element?
You are right that u's are generalized speeds, but the number of them is different for each type of mobilizer. A revolute (pin) mobilizer has only one u, while a free mobilizer has 6. In this case the mobilizer of interest is just a pin so has only one u. However, the MobilizedBody methods we call in the example can work with single degrees of freedom of any mobilizer, so those require that we pass in a MobilizerUIndex to say which u we are interested in. In this case it is always u zero, but for pedagogical purposes the example stores the zero in m_whichU which in a more general case might have a non-zero value.

Please let me know if you have further questions.

User avatar
Harshal Mehta
Posts: 5
Joined: Tue Nov 08, 2022 7:53 am

Re: Few Question regarding setting initial angular velocity to body?

Post by Harshal Mehta » Mon Dec 05, 2022 11:26 am

sherm wrote:
Sun Dec 04, 2022 3:01 pm
In DzhanibekovEffect, you were surprised that changing the angular velocity from (10, 0, 1e-10) to (10, 10, 1e-10) caused translation to occur. That's because the angular velocity value you chose gave the system center of mass a non-zero translational velocity. You can see that by adding the following just after setting the angular velocity:

Code: Select all

    shaft.setUToFitAngularVelocity(state, Vec3(10,10,1e-10)); // 10 rad/s

    system.realize(state, Stage::Velocity);
    const Vec3 v_com = matter.calcSystemMassCenterVelocityInGround(state);
    std::cout << "v_com=" << v_com << "\n";
Note the z component of COM velocity. When the angular velocity is directed only about the symmetry axis the z component is zero.
v_com=~[0,-4.66667e-12,0.466667]
Hello Sherman,
Please correct me if I am wrong. I would like to correct my understanding of Simbody interpretation.

Do you mean to say that since the axis of rotation(origin maybe?) is not coinciding with the center of mass (COM) of the system, Simbody applies some torque about the center of mass which causes acceleration and hence the entire system translates?
If yes, please help me understand what is causing the force, since gravity is disabled and the system has an initial rpm right from initialization.

Your answer will help me properly interpret the workings of Simbody. Hence, request you to please elaborate your response, as I am a fresher using Simbody.

User avatar
Michael Sherman
Posts: 812
Joined: Fri Apr 01, 2005 6:05 pm

Re: Few Question regarding setting initial angular velocity to body?

Post by Michael Sherman » Mon Dec 05, 2022 11:41 am

Hi, Harshal.

Simbody is not doing anything. The user applied an angular velocity to one body in the assembly of two bodies (a cylinder and a brick). Every point of both bodies that is not aligned with the angular velocity vector will have a translational velocity also (think of a spinning propeller -- the motion is purely rotation yet the tips of the blades have a high translation velocity). If the system COM is given a translational velocity, the system will translate. There are no forces needed (Newton's first law).

Setting initial conditions does not require forces -- the user is simply declaring that somehow the system is in a particular state. If that state includes system COM velocity then the system will translate.

Regards,
Sherm

User avatar
Harshal Mehta
Posts: 5
Joined: Tue Nov 08, 2022 7:53 am

Re: Few Question regarding setting initial angular velocity to body?

Post by Harshal Mehta » Tue Dec 06, 2022 7:57 am

Thank you very much for the clarification, Sherman.

POST REPLY