Waiting time vs Processing time for an object

Waiting time vs Processing time for an object

akshay_p
Not applicable
1,009 Views
17 Replies
Message 1 of 18

Waiting time vs Processing time for an object

akshay_p
Not applicable

[ FlexSim 19.1.2 ]

Dear all,

I would like to obtain the statistics regarding the waiting time vs processing time for all my flow-objects in my simulation. I have been reading up in the forum as well as the manual and I have only found state charts (but they seemed to be more focused on TEs as well as fixed resources, but not the objects that are being processed by them).

Can someone tell me which statistics can help me with the above stated problem?

Regards,

Akshay Pundirstatic-tandemadjusted.fsm

0 Likes
Accepted solutions (1)
1,010 Views
17 Replies
Replies (17)
Message 2 of 18

tanner_p
Not applicable
Accepted solution

Hi @Akshay P,

This is a great question. I don't currently know of any templates that do this within the software, and our resident statistics expert is not in the office today, but here's my best attempt at a solution.

I used an Item Trace Gantt chart, which shows where the flow items are at different times in the simulation and looks like the image below.

23538-item-trace-gantt.png

This chart creates a standard Statistics Collector with time values we can use to calculate the waiting time and processing time. The only thing that's missing is we don't know which objects represent either "waiting" or "processing." To include this, I simply put a binary label called "timeType" on each of the queues and processors that indicated whether the object was a 0 - "waiting" or 1 - "processing" type object.

Opening up the statistics collector through the tree as shown below, we can add a data tracker on this "object type" label that listens to the event object and checks the label to see if the item just finished waiting or processing.

23539-objecttype-label.png

From the Stats Collector Properties window, we can go to the General tab and click Export Table after a model run to collect all the data in a CSV file.

23540-export-table-button.png

I couldn't find a good way to aggregate and show this data in FlexSim (I couldn't find a function to calculate the difference in dates), so I took the raw data (shown below) and ran a sql query to aggregate the data to what we need.

23541-downloaded-data.png

The SQL Query I used was the following:

SELECT item, SUM(DATEDIFF(starttime,endtime,"second")) AS timeDiff, objecttype
FROM time_type_test
GROUP BY item, objecttype
ORDER BY item

The results came out to look like this:

23542-sql-query-results.png

As you can see, we now have data that we can work with to see how much time each item spent waiting vs processing. To explain each column:

1) The "item" column is just the number of the item that entered the system in chronological order.

2) The "timeDiff" column is the SUM of the calculated DIFFERENCES between start and finish times GROUPED BY the type of time, whether "waiting time" (=0) or "processing time" (=1).

3) The "objecttype" column tells us whether the object that the flow item entered/exited was a "waiting" type or a "processing" type object.

I know this is a bit of external work to get this data, so hopefully we can find a way to get this within FlexSim, but for now, maybe this will help. Let me know what feedback you have...

Here's the model I used for reference:

time-flow-items.fsm

0 Likes
Message 3 of 18

tanner_p
Not applicable

Additionally, after throwing the SQL Query result back into Excel and running a simple Find and Replace, the data we get looks like this:

23544-processing-vs-waiting.png

0 Likes
Message 4 of 18

akshay_p
Not applicable

Dear @tanner.p,

Thank you for your detailed response and apologies for the late response. I was not able to log into the community due to some unknown reason.

So I went through the answer and applied the same logic, but there is an essential difference between our models. You have a free flowing line where there is an immediate transfer from the processors to the queue (because of which you have assigned the queue a label value of 0), where as in my model I have some waiting at the machine as well (until a robot is free to pick up the product/object from it) and waiting at the queue.

Maybe you can give my model a look and tell me if I am right? The model is attached in the question. Also, can you inform me on how to run SQL queries on FlexSim? I have never done that before, so I have no idea how you ran the one you have mentioned above.

Apart from that, this solution seems quite on point.

Please let me know your thoughts on this and thanks again for the help 🙂

Regards,

Akshay Pundir

0 Likes
Message 5 of 18

tanner_p
Not applicable

Hi @Akshay P,

Thanks for the feedback. We spent some time digging into the model you've attached and as we were doing so, we noticed that there are a few bugs with the model that might prevent us from getting the statistics you're looking for.

One of the issues doesn't affect the model too much, but it's worth noting: Each of the robots have an On Load trigger that uses items "Type" labels to look up the capacity for that item in a Global Table. There is an item type 3 that is attempting to look at row 3 in the table, but this row doesn't exist. For this reason, you'll need to either bundle the table and look up the value "3" in column 1 or upgrade to FlexSim 19.2 where there's a function called "getValueByKey" that will search the table for the value "Type".

With that resolved, the next issue is that it looks like the Robots are loading and moving some of the items before they have finished processing. We might have to create some kind of buffer that makes sure the items are done processing before a robot is allowed to move the item. I'm not sure if this is really what's happening, so maybe you could explain how the task list is functioning. I've got a screenshot of the task list to help illustrate my question:

23634-task-list-question.png

At the this time, the Magazine with product_ID "70" is waiting at Oven1 in the 3D model. At the same time, there is a task in the list that is going to attempt to move the Magazine with product_ID "70" (highlighted in red box) from DA2 to Robot1. This means that the Task Executer is going to travel to DA2 but load from Oven1. Am I misinterpreting this or do you think this is something we need to fix? This is happening consistently in the model where the Task List thinks objects are in a different spot than they actually are.

Assuming everything works correctly, I think we can go a different route on setting up statistics. We will assume that Process Flow is synchronized with what's actually going on in the 3D. Then we listen to the creation of the items. Then we will used a tracked variable on the items to indicate when the items are processing (listen for unload at processor and on process finish) and then we'll log the data as "time spent processing / time in model" or something of the like. That way, we'll get accurate statistics based on Process Flow.

For now, let's focus on getting the model to function accurately. If you could help me understand the task list, that would be a great place to start.

0 Likes
Message 6 of 18

akshay_p
Not applicable

Dear @tanner.p,

Thank you so much for your feedback and the indepth analysis of my model. I shall answer both your queries below -

1) Yes, I am aware of that and I will fix it. I actually didn't have the data on the buffer capacities of the robots for the "type 3" product (i.e. a cassette). I forgot that I had labelled it, so thanks for pointing that out. I will fix that issue once I have those numbers and will keep your tip in mind 🙂

2) The second issue was unknown to me, so thanks for pointing that out. I actually included some intermediate buffers in the model as well as my schedule (named "Queue 1" and "Queue 2" in the 3D model. I had also modified my input data to suit that inclusion (as seen here). So the tasks for the product "70" should be executed as follows -

23640-product-70-schedule.png

As you have pointed out in your analysis, the product is in Oven1 where as it is supposed to be at the DA1, which should NOT be the case. Can you tell me what could be the exact reason behind this? I am not able to understand why that would happen.

I hope I have informed you sufficiently here. Just to sum it up, according to my 3D model, the products should move in one direction, from one loop to the other (left to right), while stopping at the intermediate queues to wait there until a TE picks it up.

Please let me know if anything is not clear and I will get back to you as soon as possible.

Thanks again for all the help!

Regards,

Akshay Pundir

0 Likes
Message 7 of 18

akshay_p
Not applicable

Also, how did you know which instance of the task list is running at a particular moment in the simulation? Sorry if its a stupid question but I am a novice at FlexSim, so I thought I might ask. Thanks!

0 Likes
Message 8 of 18

tanner_p
Not applicable

Hi @Akshay P,

To answer your last question about viewing the active task sequence, you can look at a node in the tree under the Robot called "activetasksequence" as shown here:

23673-active-task-sequence.png

As for why the items are in the wrong locations, I think it's a combination of things. The first problem is that the Process Flow doesn't have a way of verifying that a product has been moved or that a process has been completed. What I mean is that if a Robot gets assigned a task of moving an item from Oven1 to Plasma1, it's going to do that immediately based on the Process Flow, even if it's supposed to wait until a certain time or event in the future.

23677-pf-no-checking.png

In addition to that, the table is set up such that different robots are handling the same items at different times. In the case of our Magazine item with product_ID "70", Robot1 is going to unload the Magazine item at DA2.

23679-confused-tasks1.png

Meanwhile, Robot2 is going to load the Magazine item from Queue1 (it's not there, but it will steal it from Robot1) and unload it at Oven1.23678-confused-tasks.png

These screenshots were taken from the same model time. It might be a problem with the table of tasks not executing like you'd want it to. To be honest, this is more micro-managing than I would typically see or recommend in a FlexSim model. Have you considered eliminating the Robot assignment and then using triggers instead to determine which tasks to send to? For example, instead of telling Robot2 to move Magazine item 70 from Queue1 to Oven1, maybe you could have a trigger associated with the Queue that looks up in the table what the next process is and then acquires an available AGV and sends the item there. You could even have it try to acquire a specific AGV.

By doing your logic this way, the AGVs aren't going to override the processing and waiting times in your 3D. There are some instances we noticed that the items appeared to be mid-process when an AGV came along and picked them up to move them. I think we could achieve more accurate statistics going a different route. What do you think?

Once we've got those things sorted out, I'm wondering how you'd like the wait time and processing time measured. Would an average wait and processing times for all flow items work? Like an average? (i.e. 25% waiting, 75% processing) Or would you prefer to have each item's specific wait and processing times? (i.e. Item1 - Waiting: 300 seconds; Processing: 900 seconds)

0 Likes
Message 9 of 18

akshay_p
Not applicable

Dear @tanner.p

Again, I very much appreciate the amount of work and attention you have put into this problem. Thanks for that the response to my queries.

So, to answer your question, the reason I never noticed this is because before I was trying really simple configurations (with the AGVs just flowing in a loop and not specific assignments were needed (ref to the attached model, which is one of the layouts I tried)). But now, I had to look into some specific AGV layouts and simulate one on the same logic in my simulator. The one shown in the current model that you are investigating in, is called a TANDEM configuration, where I am assigning one specific AGV to each loop (as you must've noticed) and trying to handle the material transfer from one loop to the other via intermediate queues. I really want to make this configuration work correctly so that I can see the difference in the performance between this and the other traditional configurations I have tried (which ran correctly). So that is the reason I am micromanaging this model that much, so that I can see if this configuration is worse or better than the others. I hope I have explained it clearly.

Would it be possible to ensure the correct material transfer here? How would these triggers work? If you can help me with that, that would be great. Or if not possible to help me entirely, if you can guide me to a solution that would be fine too. Let me know 🙂

Also, as far as your question about the statistics go, I think it would be nice if I can see per equipment the ratio of waiting time vs processing time, so that I can facilitate a much better analysis on where the potential bottlenecks might be. I guess I can obtain the average if I have individual statistics. And percentage or actual numbers on the waiting times and the processing time, either is fine.

I hope I have answered your questions sufficiently and I'll be looking forward to your reply 🙂

Regards,

Akshay Pundir

staticfinal-alternative-with-exit-lanes.fsm

0 Likes
Message 10 of 18

akshay_p
Not applicable

Hi @tanner.p,

Do you have any leads on the question already? Please let me know 🙂

Regards,

Akshay Pundir

0 Likes
Message 11 of 18

tanner_p
Not applicable

Hi @Akshay P,

I apologize for the delayed response. I haven't forgotten this question, but we had a holiday in the U.S. this last week so I'm just getting back to the office to look at this. I'll try to work on a solution ASAP. Thanks.

0 Likes
Message 12 of 18

tanner_p
Not applicable

@Akshay P

I've been putting some thought into your model and I think I've come up with an idea that we can work with as far as the logic goes for the AGVs. It uses a triggered list system, but is similar to what you already have.

Here's how I would trigger the AGV work based on a table. Starting at the beginning of the example model I've attached, I'll walk through each step.

1) The Queue1 assigns an "ID" label and a "process" label to each box and then pushes all the boxes to a list. The ID label is essentially the type of box and the "process" label indicates which process the item needs to go to next.

2) The Process Flow has 3 tokens (one for each Robot) that pull from the item list.

3) The Assign Labels activity looks at the table using the "ID" and "process" labels to determine which Robot should move the item and to which processor.

4) The designated Robot is acquired, it delivers the item, and then the "process" label is incremented.

This model still manages the order of operations for the process, but it does so while eliminating any chance an item will be taken pre-maturely from a processor by a Robot. This is because the items don't show up on the list until the processes are finished. What do you think about going this route? Would it be possible with your Global Table to convert it to something like in the attached example?

I'm still working on the statistics because as it is, there's not really an easy way to define an item as "waiting". Do all items go through all the processes and for equal processing times?

akshay-pf-alternate.fsm

0 Likes
Message 13 of 18

akshay_p
Not applicable

Hi @tanner.p,

I hope you had a nice vacation and it is good to hear from you again on the problem. Really appreciate it!

As far as the model you suggested goes, it seems to be working on the same lines as the one I have for my problem, except the fact that there is only one kind of task here which is a transfer task, so maybe that simplifies the AGV control. I don't know if you have noticed in my model yet, but my global table is made up of three different task types, namely 1 (travel task), 2 (charging task) and 3 (transfer task). However, the inclusion of the "process" label does seem to be something that can be useful for ensuring the correct material flow. Would it be possible for you to implement this fix for the case of my model if you have the time? Please let me know if you can.

As far as your second question goes, not all the items go through all processing times. Some items are done earlier with a few operations and thus they exit the line and some stay in for longer and get processed at a lot more machines. The processing times are dependent on the item type i.e., whether it is a "magazine", "cassette" or "LF-box". Of course, all machines have their own processing times as well.

I hope I have sufficiently answered your questions and once again, thanks for taking the time out for looking into this issue for me. If there is any more information needed with regards to this, please don't hesitate to contact me.

Regards,

Akshay Pundir

0 Likes
Message 14 of 18

akshay_p
Not applicable

@tanner.p

Also, I would like to bring to your notice that after some investigation, I have found out that I am facing this issue only for a Tandem configuration and not a regular loop flow. Please see the attached model, where I ran the schedule for a different, simpler configuration and it worked fine.

staticfinal-alternative-design-1.fsm

Maybe there is an issue with the way the table is read for this configuration (Tandem)?

0 Likes
Message 15 of 18

akshay_p
Not applicable

@tanner.p

Can you share any updates/comments you have on the above (if you have any)?

Thanks!

0 Likes
Message 16 of 18

tanner_p
Not applicable

Hi @Akshay P,

I apologize I haven't had much time to devote to this question until today. It's a busy time of year. And unfortunately, I don't know how much else I have to offer for this model. I haven't been able to solve the tandem configuration issues we found, although I completely understand what you're going for.

The main problem that I see with this model is that the Global Table pushes all the tasks to the list and then there is nothing restricting when those tasks are released to the AGVs to be executed. Conversely, in the default AGV template (step 7 of the TO DO), the tasks are not pushed to a list until the fixed resources push them, meaning the tasks are ready to be executed. This Global Table of tasks I think is what is hindering the model. I would suggest moving away from the setup you currently have and taking the path of each item type and putting that into the Global Table. Then, you can use the fixed resources to look at the table when they finish processing, identify what the next operation should be, and push that tasks to the list. This way, you avoid what is happening with the pre-mature loading and moving of flow items.

Sorry I don't have more to offer right now, I'd really like to make this work, but I'm afraid I've exhausted a lot of my ideas.

0 Likes
Message 17 of 18

akshay_p
Not applicable

@tanner.p

Apologies for the delayed response and thanks for all the time and effort you have devoted to this problem.

I will try to implement the suggested approach or pursue another direction and keep the forum updated in case of any developments.

Wish you a happy holiday season and a happy new year as well 🙂

Regards,

Akshay Pundir

0 Likes
Message 18 of 18

shankar_narayan
Not applicable

Hello @Akshay P

Can this original question not be answered simply by using Milestone charts? We use that a lot to paint the various Sankey diagrams which is essentially tracking flow items through it's life cycle in the system at various stages. Each milestone captures all the stats you want and the Sankey is a great way to tell the story. Not sure if this applies to your specific model situation.