ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
how to make AGV decrease speed
Could someone provide a solution to this issue:
There are 2 AGVs, travelling on 2 parallel paths, but their direction are opposite. I want to make both AGVs start to decrease their speed when their distance less than 5m, until they have passed away each other. How to build this kind model? I once tried to use collision spheres,but failed. |
#2
|
||||
|
||||
OK, I'm going to first give you the way I would do it in the current version, and then I'll tell you how I would do it in the next version (due out in June), which in my opinion will be much easier.
In the current version I would put some object in the middle that is there to hold a label containing the number of AGVs in the area. Then I'd use way points to increment and decrement the label, and track the set of AGVs currently in the area. Then when the label gets to 2 or above, I would preempt all the AGVs in the area and get them to restart their travel again, and use the initialize travel field to set their load type to something that says they need to travel slower. In the next version I would do the same thing in regards to preempting the AGVs, but I would track it all through process flow. In the next version, control areas and control points will have several events that can be subscribed to through process flow. Specifically, I would listen to a control area's OnAllocated and OnDeallocated events to track who is in the control area. And I would listen to the control area's OnAllocationCountChange event to listen for when the number of AGVs in the area gets above 1. When that happens I would preempt all the AGVs in the area, and get them to use a new load type. The first example is doable, but would require a good amount of code. The second you could do without much code at all. |
The Following 3 Users Say Thank You to Anthony Johnson For This Useful Post: | ||
syseo (04-24-2016) |
#3
|
|||
|
|||
Hi Anthony,
I think you may misunderstand what Zhang want to do. The 2 agvs will decrease their speed "when their distance less than 5m" rather than "all in an area". So agv will slow down in any path. I think we should detect the distance of 2 agvs in real-time. Inspired by Anthony's post, I use preempt task to do it. Since distancetotravel() command can not work in AGV path during any running time, I try to use the xloc() to find out the distance between agv and object which only works in staright path. Maybe collision spheres will be better to find out distance between 2 agvs. Attached is the model (Version2016) I made and hope it helps. BTW, I'm looking for a command like distancetotravel() can easily get the distance in AGV path, can anyone help me? or distancetotravel() can work in next version? |
The Following User Says Thank You to Jing Chen For This Useful Post: | ||
Anthony Johnson (04-25-2016) |
#4
|
|||
|
|||
Jing,
Careful. Your model is showing different results depending on the Run Speed (refresh rate). You need to call updatelocations() before querying the location of an object in motion. |
The Following 3 Users Say Thank You to Kris Geisberger For This Useful Post: | ||
RalfGruber (05-16-2016) |
#6
|
|||
|
|||
Hi,Jing
I feel confused about this line code in your model:"if(distance <= slowDown && !flag)"(model 1,line 26),don't quite understand what this mean,why need to judge condition"!flag"? What does this mean to? Is it to determine whether label"flag" exists or not, or whether the value of label"flag" is NULL? Actually,I always feel confused about this kind of "if" condition,could you please say a little more on this? Thanks a lot. |
#7
|
|||
|
|||
Hi, Xing
Try to use model2 in #5. Model1 still has many problems unsolved and the code is also much more and complicated. PS. label"flag" is used for judge the speed of agvs which you can find in initialize travel field. |
The Following User Says Thank You to Jing Chen For This Useful Post: | ||
SayedMohammad Ayati (05-16-2016) |
#8
|
|||
|
|||
Jing Chen,
according to your reply, unfortunately I could not open your codes, in my case I would set a condition which is returning the Task Execute to a specific object after passing a certain distance, but it does not work, could you please help me. |
#9
|
|||
|
|||
Hi,SayedMohammad
I don't know why you can not open my model, my model is built by Version 2016. I need more information or describe about your model. Otherwise, you can check this thread https://www.flexsim.com/community/fo...ead.php?t=3147 , maybe it can help. |
Thread | Thread Starter | Forum | Replies | Last Post |
Decrease waiting time for taskexecuter | Johanna Klietz | Q&A | 2 | 01-18-2016 08:03 AM |
Need help in programmatically increase operators and decrease process time | Raju Jampani | Flexsim Student Forum | 2 | 04-10-2015 12:34 PM |
Set up end speed for travel | Yiheng Feng | Q&A | 2 | 05-27-2013 09:36 AM |
About run speed of Flexsim | dalin cai | Gripes and Goodies | 2 | 01-27-2011 06:51 AM |
operators working together to decrease process time | Alex Christensen | Tips and Tricks | 4 | 07-14-2008 09:22 AM |