question

Kishan Jayakumar avatar image
0 Likes"
Kishan Jayakumar asked Kishan Jayakumar edited

addkinematic travel timing in the processflow is not matching the 3d objects

for instance In process flow it shows 30sec to do the particular kinematic movement(rotation or travel) but in 3d object it takes less than that, help me to figure the mistake which I have made.

thanks in advance

FlexSim 19.1.0
kinematics with process flow
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
2 Likes"
Phil BoBo answered Phil BoBo edited

The addkinematic() command "returns the time that this kinematic operation will finish." (https://docs.flexsim.com/en/19.1/Reference/DeveloperAdvancedUser/Kinematics/#addkinematic)

You need to subtract time() from your label assignments in order to get the amount of time that the kinematic will take rather than the end time of the kinematic.

double rotate2 = addkinematic(label(toolArm, "arm"), 90, 0, 0,20,0,0,0,0,time(),KINEMATIC_ROTATE);
token.labels.assert("rotationTime2").value = rotate2 - time();
5 |100000

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

Steven Hamoen avatar image
2 Likes"
Steven Hamoen answered

@Kishan Jayakumar The addkinematic function returns the endtime of the kinematic and not the time it takes to perform the kinematic. So in your case you should always subtract time() from it. By the way you don't have to use the labels.assert if you just deal with the value of the label. Just token.labelname is enough.

So for instance in Fixturerotation, the last line should read:

token.FixtureRotationTime = FixtureRotation - time();
5 |100000

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