Page 1 of 1
Few Question regarding setting initial angular velocity to body?
Posted: Sat Dec 03, 2022 10:32 pm
by amitmisra652
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](./download/file.php?id=6373&sid=28eba0533911d504a0ed750b605fc7ba)
- Screenshot from 2022-12-04 13-24-34.png (284.12 KiB) Viewed 1855 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.
Re: Few Question regarding setting initial angular velocity to body?
Posted: Sun Dec 04, 2022 2:54 pm
by sherm
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.
Re: Few Question regarding setting initial angular velocity to body?
Posted: Sun Dec 04, 2022 3:01 pm
by sherm
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]
Re: Few Question regarding setting initial angular velocity to body?
Posted: Sun Dec 04, 2022 3:16 pm
by sherm
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.
Re: Few Question regarding setting initial angular velocity to body?
Posted: Mon Dec 05, 2022 11:26 am
by harshal3099
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.
Re: Few Question regarding setting initial angular velocity to body?
Posted: Mon Dec 05, 2022 11:41 am
by sherm
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
Re: Few Question regarding setting initial angular velocity to body?
Posted: Tue Dec 06, 2022 7:57 am
by harshal3099
Thank you very much for the clarification, Sherman.