question

Xu Chunqi avatar image
0 Likes"
Xu Chunqi asked Xu Chunqi commented

How to get current speed when using kinematics

When I use the kinematics to make a customized Basic TE , I want to get its current speed of one axis at any time . What is the command I can use to get the speed ?

FlexSim 18.2.0
speed
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Arun Kr avatar image
2 Likes"
Arun Kr answered Xu Chunqi commented

Hi Shiny Xu,

Use the getkinematics() command.

getkinematics(kinematicnodereference,KINEMATIC_VX); // for speed along x-axis
getkinematics(kinematicnodereference,KINEMATIC_VY); // for speed along y-axis
getkinematics(kinematicnodereference,KINEMATIC_VZ); // for speed along z-axis

Regards,

Arun KR

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Xu Chunqi avatar image Xu Chunqi commented ·

Thank you very much. Can I get the current speed of a ASRSvehicle and its every axis?

0 Likes 0 ·
Arun Kr avatar image Arun Kr Xu Chunqi commented ·

Yes. You have to look at two kinematic nodes in the ASRS vehicle tree and they are forkkinematics and kinematics. So your code will look like this.

treenode kinematics = Model.find("ASRSvehicle1>variables/kinematics");//along the slider
treenode ForkKinematics = Model.find("ASRSvehicle1>variables/forkkinematics");//extender, up and down movement
double Vx = getkinematics(kinematics,KINEMATIC_VX);
double Vy = getkinematics(ForkKinematics,KINEMATIC_VY);
double Vz = getkinematics(ForkKinematics,KINEMATIC_VZ);
print(Vx,Vy,Vz);
1 Like 1 ·
Xu Chunqi avatar image Xu Chunqi Arun Kr commented ·

Thanks for your anwser, it helps a lot.

0 Likes 0 ·