AGV comsumption per meter

AGV comsumption per meter

mapo19
Participant Participant
569 Views
3 Replies
Message 1 of 4

AGV comsumption per meter

mapo19
Participant
Participant

[ FlexSim 24.1.0 ]

Hello!

How do I create an AGV where its battery consumption/production is based on which path it drives on? For example, if it drives on a straight path, consumption is 1 Wh/m, uphill consumption is 20 Wh/m, and downhill consumption is -5 Wh/m (production 5 Wh/m). Likewise, it would be sufficient to pull these numbers from an Excel sheet.

0 Likes
Accepted solutions (1)
570 Views
3 Replies
Replies (3)
Message 2 of 4

arunTTT2P
Collaborator
Collaborator
Accepted solution

Flexsim records the total travel distance by a task executor using the method.

TaskExecRef.as(TaskExecuter).stats.totalTravelDistance;

You can store this info into a tracked variable. And by using process flow you can listen to the tracked variable changes every 1 metre. Depending on the path that the agv is traveling, for every 1 m deduct the different battery consumption rates. In this case, since the battery charge depends on the distance traveled, the battery charge level can be a tracked variable label on the AGV.

To update the tracked variable as the travel distance updates. Add the total travel distance dashboard from the statistics toolbar. Install the statistics collector corresponding to it. Then add the abovementioned code in the statistics collector for updating the tracked variable. [ Note: When you do this method of tracked variable updation always keep the dashboard chart open, then only the tracked variable value gets updated. You can also try this kind of tracked variable updation in the OnDraw trigger of the agv.]


1711165474028.pngAdd Chart

Create the process flow for listening to the tracked variable changes and deduct the battery level depending on the path. Create a global table that lists the battery consumption levels based on the path. Access this table in the process flow for deduction.

Here's the code.

Table BatteryInfo = Table("BatteryInfo_DistanceBased")
AGV agv = AGV(current);
Object Path = agv.currentTravelPathSection.path;// Gets the current path
int PathNum = Path.find(">variables/pathType").value;
string PathName = Model.find("AGVNetwork>variables/pathTypes").subnodes[PathNum].name;
double RateValue = Table.query("SELECT * FROM BatteryInfo_DistanceBased WHERE PathType = $1",PathName)[1][2];
current.labels["BatteryLevel"].value = current.labels["BatteryLevel"].value - RateValue;

When the battery level reaches a threshold value or zero, add a recharge logic by adding additional process flow activities. agvSupport.fsm

Regards,

Arun KR


0 Likes
Message 3 of 4

jason_lightfoot_adsk
Autodesk
Autodesk

Note that this method will not work in an experiment and possibly is run-speed dependent.

0 Likes
Message 4 of 4

mapo19
Participant
Participant
Thank you @Arun Kr! I will test the model and see how it works :)
0 Likes