how can i charge my AGV

how can i charge my AGV

francesco_s2
Not applicable
332 Views
5 Replies
Message 1 of 6

how can i charge my AGV

francesco_s2
Not applicable

[ FlexSim 20.0.1 ]

hi everyone,

in my warehouse i would like that the task executer goes to battery station when the battery goes down 15 % and than it restarts its task.

I show my logic in this picture but the "decide" doesn't work well.

this is the model: elci 2 alb.fsm

33233-immagine4.png

can anybody help me?

0 Likes
Accepted solutions (1)
333 Views
5 Replies
Replies (5)
Message 2 of 6

tanner_p
Not applicable

@FRANCESCO S2,

I don't know if you're aware of this already, but there is an AGV Process Flow template that has the battery/recharging logic built-in. I suggest reviewing that in case it fits your needs. It will save you lots of headaches creating your own logic.

If you're already familiar with the AGV Process Flow template, then let's try and figure out the Decide activity. The Decide activity in the model you uploaded causes the model to crash. I suggest updating the syntax of your AGV reference from this:

AGV(token.Pickers).batteryLevel;

to this:

token.Pickers.as(AGV).batteryLevel;

For whatever reason, this accesses the AGV object in the correct way. (I'm not the person to explain this, but I know the syntax is important.) Try accessing your AGV's battery level in this new way I've explained in both your Decide and Custom Code activities and see if it works better.

33244-1602112147748.png

Hopefully this helps!

0 Likes
Message 3 of 6

tanner_p
Not applicable

You're also going to want to use the code below for recharging the AGV. I don't think batteryLevel works like most variables and so you can't just tell it to be 100 and have that work. At least, I don't think so. Try using this and then a delay activity (like while your AGV is parked).

33236-1602112350015.png

0 Likes
Message 4 of 6

francesco_s2
Not applicable

thank you, but I try to modify the syntax from:

AGV(token.Pickers).batteryLevel;

to:

AGV(token.Pickers).batteryLevel;

in "decide" and also in costum code but it doesn't work and give me the same error:

time: 50.000000 exception: FlexScript exception: MODEL:/Tools/ProcessFlow/ProcessFlow/Decide~2>variables/decision

time: 52.195545 exception: FlexScript exception: MODEL:/Tools/ProcessFlow/ProcessFlow/Custom Code~2>variables/codeNode

than I try also to modify the custom code with:

AGV(current).startRecharge().

but the same i didnt fix the problem.

0 Likes
Message 5 of 6

francesco_s2
Not applicable

I think that the classic logic doesn' t work because my task executer travel with A* navigation logic and maybe it can influence the classic AGV Process Flow template for charging

Message 6 of 6

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

In your script window you can test access to the BatteryLevel using this:

AGV(Model.find("TaskExecuter1")).batteryLevel

or

AGV agv1=AGV(Model.find("TaskExecuter1"));
return agv1.batteryLevel;

You will see it doesn't work unless the Navigator is set to AGVNetwork, and as you state in your comments you're using A*. One key indicator that it will work is if the quick properties of the task executer show AGV Properties like this:

33273-agvquick.png

In your model's case you'll just see this in that area:

33266-astarquick.png