question

Pinakin K avatar image
0 Likes"
Pinakin K asked Joerg Vogel edited

Is there a Way to plot AGV Speed?

I wan to monitor the agv/vehicle speed. Is there a way to plot the speed vs time so that i can get the instantaneous speed of the vehicle.

The agv/vehicle would be running on the AGV network.

Thank You!

FlexSim 20.0.2
speedflexsim 20.0.2record speedspeed chart
5 |100000

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

Allister Wilson avatar image
2 Likes"
Allister Wilson answered Phil BoBo edited

Seeing Tanner's approach I think I may have misunderstood the question, but here goes anyway.

The AGV class provides a speed property which (as far as I can tell) reflects the current speed of the AGV at any given moment : https://docs.flexsim.com/en/20.1/Reference/CodingInFlexSim/FlexScriptAPIReference/AGV/#Property-speed

You can record the value of that property at whatever interval you want using a statistics collector.

In the attached example, I sampled the AGV's speed every 0.5 seconds :

20200421_track_agv_speed.fsm


· 2
5 |100000

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

Pinakin K avatar image Pinakin K commented ·

@Allister Wilson Thank you for your response. I am aware of this method, but i was looking more for the instantaneous speed rather than the speed at a specified time interval. @tanner.p's response makes more sense.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Pinakin K commented ·

Allister's answer is getting the instantaneous speed of the AGV. That's what the speed property gives you.

The difference between Allister's answer and Tanner's is that Tanner is trying to calculate the speed based on its position every 0.1 seconds because he didn't realize you can just use the speed property to get this data directly.

Allister's example is querying the speed directly using the AGV API every X seconds, where you can specify what value for X you want to use. Allister specified 0.5 in his example, but if you changed that to 0.1, then it will do what Tanner's example is doing but more accurately.

4 Likes 4 ·
tannerp avatar image
1 Like"
tannerp answered Pinakin K commented

Hi @Pinakin K,

Due to FlexSim's nature as a discrete-event simulation software, I don't think calculating instantaneous speed is going to be easy. If you think about how this software works, everything is done in microsecond increments, so that at any given time, the AGV's speed is technically 0. What gives an AGV the appearance of having "speed" is the rate at which the AGV updates its location vs time. Hopefully that makes sense.

Now, if I had to calculate "instantaneous" speed, I think I would use a Statistics Collector that constantly checks the AGV's location and then calculates how far it has traveled in the last time unit.

On a large scale, this would mean that if an AGV traveled from (0,0) on an (x,y) grid to (3,4) in 10 seconds, it covered sqrt(3^2 + 4^2) meters, or 25 meters, in 10 seconds, which is 2.5 m/s. I could then graph a data point that says that the AGV had a "speed" of 2.5 m/s at 10 seconds. Does that make sense? It's a pretty ugly way to do things, but I think it's the only possible think to do. All of the other speed and acceleration calculations happen in the background and only determine the rate at which the AGV object should change its 3D location, not the actual "speed" at which its traveling.

I've tried to create the Statistics Collector in the example model attached. You'll still have to use a calculated table to get the "speed" by using the formula explained above. The data is shown below. Maybe it will spark an idea of what you could do, though. But you'll have to decide if it's worth the effort.

The alternative is to assume that the AGV is moving at its top speed when it's in its "Traveling" state and then other states like "Loading" or "Idle" would indicate a speed of 0. This would be simpler, but it wouldn't have the resolution of an "instantaneous" speed.

Hopefully this helps. Others might have better ideas that I missed, I just couldn't think of one.

calculate speed example.fsm


· 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.

Pinakin K avatar image Pinakin K commented ·

@tanner.p Thanks for your response. yes what you mentioned makes sense. I was not aware of the way the agv is controlled. I'll see if this is a good way to implement the speed time plot.

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.