Issues with charging AGV battery using the Advanced AGV module

Issues with charging AGV battery using the Advanced AGV module

peter_w8
Not applicable
5 Views
7 Replies
Message 1 of 8

Issues with charging AGV battery using the Advanced AGV module

peter_w8
Not applicable

[ FlexSim 22.1.0 ]

AGV_Grundexempel_Bratt_autosave.fsmHi,

I'm trying to learn the advanced AGV module. I've created a simple model with one source connected to a queue. The queue is connected to a sink. I'm using two AGV's to handle the transports between the queue and sink. So far so good. My issues begin when I try to ad a park point that should act as a charging station for the AGV's. When I run a simulation using only one AGV everything works as expected. However, when I add the second AGV and run the simulation, after a while when the battery level of one of the AGV's has reached the "BatteryRechargeThreshold" the AGV enters the park point but does not exit, no matter how long I wait. When I check "Parking" in Process flow I can see that the token corresponding to the AGV is stuck on "Wait for Battery Charge".

What am I missing?

0 Likes
Accepted solutions (1)
6 Views
7 Replies
Replies (7)
Message 2 of 8

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

According to my test the TaskExecuter1_2 resumes when the battery level reaches 15 - which matches the process flow parameter.

agv-grundexempel-bratt-autosave_jl.fsm

0 Likes
Message 3 of 8

peter_w8
Not applicable

Hmm...

That's strange. I doesn't work for me. In my case when "TaskExecuter1" reaches the park point the simulation stops. I've attached an image of when this occurs. However, I noticed that if i press "stop" and then "run" so that the simulation continues "TaskExecuter1" charges the battery and then leaves the park point as it should.


By the way, I noticed that you added the battery level for each AGV. How did you do that?simulation-stops-when-taskexecuter1-goes-to-parkin.png

0 Likes
Message 4 of 8

jason_lightfootVL7B4
Autodesk
Autodesk

There is a stop time set to 39604.16 which will stop the model running.


The battery level displays are Text visual tools with the following code:

 AGV agv=AGV(current.centerObjects[1]);
sets(textnode,"Battery level:"+agv.batteryLevel);



0 Likes
Message 5 of 8

peter_w8
Not applicable

Jesus, I feel super stupid right now. Thanks for all your help! I'm sure I'll return with more stupid questions as I continue to learn more about Flexsim.

0 Likes
Message 6 of 8

jason_lightfootVL7B4
Autodesk
Autodesk
No problem - we've all done it! Happy to help.
0 Likes
Message 7 of 8

peter_w8
Not applicable

Sorry to bother you again. It works with the file that you sent back to me but when I open the original file it still doesn't work. The simulation doesn't stop but taskexecuter1_2 never leaves the park point.taskexecuter1-never-leaves-park-point.png

0 Likes
Message 8 of 8

jason_lightfootVL7B4
Autodesk
Autodesk

You're right - something is not happening correctly when the AGVs are created by the parameter table - they're not being given any initial charge.

If you're not running scenarios with the number of AGVs then you can change the OnSet code to this which will prevent AGVs from being deleted when the parameter doesn't change. You'll probably need to run and reset before the charging happens on any newly created AGV:

treenode reference = param(1);
Variant newValue = param(2);
Variant oldValue = param(3);
int isReset = param(4);


{ // ************* PickOption Start ************* //
/***popup:ParamSetNodeValue*/
/**Delete and Copy Group Members*/
if (/***tag:condition*//**/isReset/**/) {
    Array objects = reference.as(Group).toFlatArray();
    
    if (objects.length == 0) {
        mpt("Error setting parameter " + c.up.up.name + " - Not enough objects in object set"); mpr();
    } else {
        while (objects.length>newValue){
            objects.pop.destroy();
        }
        treenode firstObj = objects[1];
        while (objects.length<newValue){
            treenode newObj = createcopy(firstObj, firstObj.up);
            objects.push(newObj);
            newObj.name = firstObj.name + "_" + objects.length;
            applicationcommand("recreateObjectConnections", newObj, firstObj);
        }
    }
}


} // ******* PickOption End ******* //


I tried setting the initial battery level to 100 in the process flow but that doesn't work - so it looks like a bug somewhere.

0 Likes