question

Fred E avatar image
0 Likes"
Fred E asked Fred E commented

AGV custom parking logic

Hello,
I want to add some parking logic to my model. I want to park the AGVs every time they don't have any task to do.
I can't find the right trigger event to send the AGV to the parking spots.
I'm trying it with the "event trigger source OnStaytimeChange" but then I get weird events where the AGVs park from one parking spot to another. Sometimes it happens that the AGV has no tasks and stops at the last control point, and the event trigger source does not send it to the parking spot.
1658148782391.png

my model: test160.fsm

Hope you understand my question.
Thank you in advance for your answers.
Best regards

FlexSim 21.2.4
agvevent triggerparking pointparkign
1658148782391.png (328.2 KiB)
test160.fsm (149.6 KiB)
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

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Fred E commented

You can try OnResourceAvailable and check that NextTS is Null.

· 5
5 |100000

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

Fred E avatar image Fred E commented ·

I don't think I understand which OnResourceAvailable should I apply. Could you help me with some screenshots please?

1658154321807.png

or

1658154353723.png

0 Likes 0 ·
1658154321807.png (18.0 KiB)
1658154353723.png (48.5 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ Fred E commented ·

1658156920740.png

You'll need to test that you're not already parked and that nextTS is NULL.

0 Likes 0 ·
1658156920740.png (18.0 KiB)
Fred E avatar image Fred E commented ·

Flexsim crashed after a few seconds of simulation. I think this is caused because resource AGV is acquired by other tasks. So I don't even know how to test this function.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Fred E commented ·

I believe you are running into an infinite loop. The 'OnResourceAvailable' fires again once the AGV arrives at the parking point. Because you also push the parking cp back to list immediately after arrival, the token that is created by that new event can pull it again and travel there in zero time. Which then fires the event again, and so on.

Some modifications you should make:

- Apart from checking if the AGV has another pending task sequence, you should also check if it already is at a parking point. In either case, it does not need to travel to a parking point.

- Only push the parking point back to the list once the AGV actually resumes its tasks. Listening to 'OnAGVTravelStart' can be used for this.

- Finally, at the start of the model the AGVs currently start at parking points without having pulled them from the list. This means if one stayed idle, another AGV returning to the parking area could in theory pull the already occupied position. This probably won't happen with how the model is currently set up, but I would still have them start at some other control points next to the parking points, so they get pulled at the start. Even if just as good practise for future models.

test160_fm.fsm

2 Likes 2 ·
test160-fm.fsm (152.1 KiB)
Fred E avatar image Fred E Felix Möhlmann commented ·

This will solve my problem. Thank you for all your tips and comprehensive answers. I learn a lot from your answers.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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