question

Philip Diem avatar image
0 Likes"
Philip Diem asked Philip Diem answered

agv trailer does not detach properly

I would like to do the following thing:

  1. A trailer is transported to a location, AGV detaches trailer is freed up to do other stuff.
  2. An Operator loads up that trailer and calls the AGV to collect the Trailer.
  3. The AGV attaches the trailer and brings it o another location and detaches again to go do other stuff.

I use racks as trailer and it works well.
My Problem is, that often (not always) the AGV detaches from the trailer and drives back to its parking space, but as soon as I reset the model, the trailer jumps back to the AGV and stays with it when moving. Although it does not do that 100% of the time.

The Trailers aka Racks are controlled by their own processflow which puts it on their parking spots when the simulation starts (similar to the AGV example processflow).

I tried to find any remaining connection between the two objects to hunt down where i need to cut the cord, but I couldn`t find it.

I attached a file where it does that most of the times.

AGV_Systemtest.fsm

Thanks in Advance
Phil

FlexSim 20.1.0
agvflexsim 20.1.0trailerdetach
agv-systemtest.fsm (142.7 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.

Phil BoBo avatar image
0 Likes"
Phil BoBo answered Philip Diem commented

The rack (FTS Wagen38) is connected to the control point (FTSParking) as if it were a traveler AGV. Thus, when reset it called, it moves its position to that control point.

If you delete that coupling from the tree so that the AGV Network doesn't think that it is an AGV, and you set a reset position for the rack to go where you want it to be on reset, then it will behave the way you want.

agv-systemtest_1.fsm


1593454431023.png (287.0 KiB)
agv-systemtest-1.fsm (142.8 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.

Philip Diem avatar image Philip Diem commented ·

Hi Phil.bobo
Thanks, i figured that connection out by myself in the meantime.
I didn`t place that connection myself, but i assume it comes from a previous version where i coupled the racks as trains instead of attaching it as trailer and flexsim somehow thinks that rack is an agv as well?

I still have the problem, that often the trailer gets detached visibly in the model, but behind the curtains it stays connected to the agv like you pointed out with the tree.
I can`t pinpoint why that is, but i implemented a code snippet that just detaches all remeining trailers at model reset.
That works, but still i don't understand why it can happen that the trailer stays connected to the agv in the tree when in the model run it visibly gets detached and the agv does other stuff without it.

Thanks anyway, you helped me to get it to work. :)
Phil

0 Likes 0 ·
Philip Diem avatar image
0 Likes"
Philip Diem answered

This is what I figured out:
If you stop a simulation run while agvs still have trailers attached, these trailers will stay linked to the agv (visible only in the tree) even if you reset the Model.
When you just let the model run without detaching the trailers manually, this will causes the trailers to become attached multiple times to the agv over time.


Here is how I hacked it together in the end. This is the OnReset-trigger of the ProcessFlow where I model the behavior of the AGVs:

treenode agv_node  = getvarnode(Model.find("AGVNetwork"), "agvs");
int trailerCount;
for(int i = 1; i <= agv_node .subnodes.length; i++)
    {
        trailerCount = Model.find("AGVNetwork>variables/agvs/"+agv_node .subnodes[i].name+"/trailers").subnodes.length;
        AGV agv = AGV(agv_node .subnodes[i]);
        for(int j=1; j <= trailerCount; j++)
        
        {
            agv.detachTrailer(Model.find("AGVNetwork>variables/agvs/"+agv_node .subnodes[i].name+"/trailers").subnodes[j]);
        }
    }
5 |100000

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