question

michel.torbey avatar image
0 Likes"
michel.torbey asked 立洲 commented

Kinematics and Model Speed

robotleverbrasv01.fsm

Hello,

I have made this model with kinematics of a robot.

When i run the model on a low constant speed, the robot follows the kinematics as it should.

But when i increase the speed (higher than 200 and lower than maximum speed) the robot doesn't follow the kinematics i have fixed.

Any Idea if it is a flexsim bug or anything i did wrong in my model?

You can find the model in attachement.

Thank you and best regards,

FlexSim 17.2.2
kinematics
· 1
5 |100000

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

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

Your model is not embedding media and you didn't include the custom media files you are using so it is hard to tell what is happening in your model.

0 Likes 0 ·

1 Answer

Phil BoBo avatar image
6 Likes"
Phil BoBo answered 立洲 commented

Here is a quick rundown of how you should structure your kinematics code:

Add a label to the object that stores whether it is currently animating using kinematics. We'll call this animLabel.

Add a label to the object for the kinematics. We'll call this kinNode.

OnReset:

animLabel = 0;
deactivatekinematics(kinNode);

Trigger where kinematics start:

initkinematics(kinNode, current);
addkinematic(kinNode, ...);
addkinematic(kinNode, ...);
double endtime = addkinematic(kinNode, ...);
updatekinematics(kinNode, current);
senddelayedmessage(current, endtime - Model.time, current);
animLabel = 1;

OnMessage:

animLabel = 0;
updatekinematics(kinNode, current);

OnDraw:

if (animLabel)
	updatekinematics(kinNode, current);

The OnMessage should call updatekinematics() one last time at the end of the kinematic so that the object goes to its final position regardless of when the last time OnDraw was called (or if it ever was).

· 16
5 |100000

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

michel.torbey avatar image michel.torbey commented ·

Thank you for your answer.

Here's a version of the model with the embeded files.

Best regards,

kinematicsproblem.fsm

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ michel.torbey commented ·

Update your kinematics code based on the example I posted above.

The problem is that you aren't calling updatekinematics() at the end time of each kinematic.

Fix your code and let us know if you are still having issues or not.

1 Like 1 ·
michel.torbey avatar image michel.torbey commented ·

This solved my problem, thank you

0 Likes 0 ·
立洲 avatar image 立洲 michel.torbey commented ·

請問這個模型是如何通過Shape連接機械臂的所有關節的?

0 Likes 0 ·
Ryan Clark avatar image Ryan Clark 立洲 commented ·

@michel.torbey How does this model connect all the joints of the robotic arm through Shape?

0 Likes 0 ·
Show more comments
michel.torbey avatar image michel.torbey commented ·

Hi @Ryan Clark ,

Sorry I have lost track on this model and don't really udnerstand the question.

Can you please be more specific?

Best regards,

0 Likes 0 ·
立洲 avatar image 立洲 michel.torbey commented ·

在所有的機械臂關節中,如何通過形狀組裝一個完整的機械臂?這是我想知道的問題。

0 Likes 0 ·
Ryan Clark avatar image Ryan Clark 立洲 commented ·
@立洲 Could you please post your comment as a separate question? This will allow us and other FlexSim users to more fully address your question. Thanks!
0 Likes 0 ·
Ryan Clark avatar image Ryan Clark michel.torbey commented ·

@michel.torbey See this other post for additional clarification on @立洲 's question. Thanks!

0 Likes 0 ·
michel.torbey avatar image michel.torbey commented ·

@Ryan Clark @立洲 We were using FlexSim robot and adding knematics to the robot. We did not build our own robot.

0 Likes 0 ·
立洲 avatar image 立洲 michel.torbey commented ·

你能教我你是怎麼做到的嗎

0 Likes 0 ·
立洲 avatar image 立洲 立洲 commented ·

@michel.torbey你能教我你是如何實現的嗎

0 Likes 0 ·
Show more comments
立洲 avatar image 立洲 commented ·

@michel.torbey @Ryan Clark @Phil BoBo 我做到了,但我希望它像你的模型一樣可移動,我該怎麼做會更好

希望這個機械臂能搶到盒子

Please help again, thank you

ROBOT.fsm

0 Likes 0 ·
robot.fsm (1.2 MiB)