How can I stop an object with deceleration ?

How can I stop an object with deceleration ?

fabio_g10
Not applicable
54 Views
10 Replies
Message 1 of 11

How can I stop an object with deceleration ?

fabio_g10
Not applicable

[ FlexSim 22.1.3 ]

Hi everbody.

I have a crane that is travelling to a location in a warehouse. How can I perform a 'real' stop of that crane in the middle of travel, with deceleration to zero speed ?

I've tried Object.stop() but is stops immediately (no-deceleration) and I need the crane to decelerates to zero speed.

Thanks

Fabio

0 Likes
Accepted solutions (1)
55 Views
10 Replies
Replies (10)
Message 2 of 11

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

Pretty sure this is not possible unless you control all the kinematics of travel yourself. You could post it as an Idea, to have a change in speed affect current travel, here on the forum on which people can vote.

0 Likes
Message 3 of 11

moehlmann_fe
Observer
Observer

As Jason said, you would have to interrupt the current travel with a preempting task sequence and 'manually' add kinematics to decelerate to a stop.

The attached model shows how this can be done. The stop is triggered by sending a message to the crane (msgparam1 = 0). The process flow reacts to this and interrupts the travel. In the custom code activity, the current velocity of the crane is read from the kinematics. From that the stopping distance is calculated and new kinematics are added.

Another message (msgparam1 = 1) will resume the crane.

crane_decelerationtostop.fsm.pdf

(Rightclick on the file attachment -> Save Link/Target As (might be called differently depending on the browser) -> Set "Save as type" to All Types -> Save with a name ends with .fsm)

Message 4 of 11

fabio_g10
Not applicable
Excellent Felix ! This approach in your attached model worked for me !

Thank you very much !.

Fabio

0 Likes
Message 5 of 11

fabio_g10
Not applicable
Thank you Jason !
0 Likes
Message 6 of 11

boris_m6
Not applicable

This answer was very helpful. but can i preemt it as a task, so i can stop it properly and the start a travel task directed to the other way directly from this code?

To create a task that has all this steps, the stop, then the travel to the opposite direction

0 Likes
Message 7 of 11

moehlmann_fe
Observer
Observer

You can set the preemption setting to abort the active taks. Then, if you know where the crane should travel to next, you can add that travel activity to the process flow.

1662048110832.png

1662048171360.png

0 Likes
Message 8 of 11

boris_m6
Not applicable

I get what you are trying to do but i cannot make it work

i'll put the images of my model

1662467516110.png

1662467529563.png

I preemot and abort all, then i ionsert the kinematics of deacceleration and then i'm tryng to add the travel task there but it gets stucked there where the image shows and the crane doesn't travel anywhere

0 Likes
Message 9 of 11

moehlmann_fe
Observer
Observer
Could you upload a screenshot of the settings of the travel activity (where the token is stuck) and the "Run Sub Flow"?
0 Likes
Message 10 of 11

boris_m6
Not applicable

1662468478054.png

1662468494077.png

is this ok?

0 Likes
Message 11 of 11

moehlmann_fe
Observer
Observer

Yes, thank you for the extra screenshots.

The value in the "Executer/Task Sequence" field of the travel activity should be 'token.taskSequence' (the "Assign to"-value from the Create TS activity). That way the task will be added to the preempting task sequence.

1662469190938.png

Otherwise, by using 'token.crane', the task is treated as its own separate task sequence which gets queued up behind the preempting sequence. As a result both sequences wait for the other to finish which blocks the simulation from advancing.