question

Patrick Zweekhorst avatar image
0 Likes"
Patrick Zweekhorst asked Patrick Zweekhorst commented

AGV does not arrive at destination after redirecting

Hi,

I have created an example model in which the AGV does not arrive at its final destination (all the way on the right). While traveling to this location the AGV is redirected twice. The problem does seem to be related to this redirecting. Is there any good solution or work around for this?

Thank you for any tips.

Patrick

Redirect_1.fsm

FlexSim 22.0.1
agvagv redirect
redirect-1.fsm (44.0 KiB)
· 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.

Ryan Clark avatar image Ryan Clark commented ·
Hi @Patrick Zweekhorst,

I'm not sure why the redirects are causing issues, but when I removed the second redirect (redirecting to Control Point 5), it worked properly. I assume that the issue is arising because of the relative timing of the redirect command and the travel task causing them to conflict/overwrite each other.

0 Likes 0 ·
Patrick Zweekhorst avatar image Patrick Zweekhorst Ryan Clark commented ·
It definitely has to do with the second redirect, but I don't think it is just an unlucky timing. I had the same problem in my actual model and had no problems in recreating it here. It would be highly appreciated if someone from the development team could take at this.
0 Likes 0 ·
Ryan Clark avatar image Ryan Clark commented ·
@Jordan Johnson @anthony.johnson @Phil BoBo @Matthew Gillespie Would someone on the dev team be able to take a look at this question? Thanks!
0 Likes 0 ·

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Patrick Zweekhorst commented

You give the AGV a task to travel to CP2. Then you give the AGV a task to travel to CP3. Then, shortly after the AGV starts that travel task, you redirect it to CP4 with a CONTINUE_ON_PRE_ARRIVAL.

Then, in the middle of that PreArrival event that is being processed (before it has even finished), you fire code without a breathe that redirects him again to CP5, which will start him traveling towards CP5 once he traverses past the next point.

At this point, he now tries to finish his code that was trying to travel to CP4 as part of the first redirection, and his internal state is all kinds of messed up because you (1) never let him arrive and (2) redirected him before he even finished his first redirection.

Thus, he thinks he's done redirecting because he is trying to finish his first redirection, as the call stack unwinds. And thus, he never gets back to traveling to CP3 because his internal state is in total disarray from getting his functions called all out of order.

Suggestion for a workaround? Before the second redirect, breathe for the duration of time that the AGV requires between his current PreArrival event and his next traversal event so that the AGV can finish processing the first redirection and get back to traveling to CP3 before you redirect him again.

redirect_2.fsm (In this particular model, the amount of time needed to breathe is 1.0 seconds, but if you change the AGV's speed/acceleration/deceleration settings, then that value is going to be different because that will change when the PreArrival event fires relative to the next traversal event.)

Suggestion for a solution? Stop all this crazy preempting and redirection and give him tasks to go where you want him to go when you want him to go, using the end speed of the travel task to determine whether he continues traveling at full speed or whether he slows to a stop between travel tasks.


redirect-2.fsm (44.3 KiB)
· 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.

Patrick Zweekhorst avatar image Patrick Zweekhorst commented ·
Hi @Phil BoBo ,

Thank you for your clear and extensive explanation. I will take a better look at this after my business trip.

0 Likes 0 ·