Simplifying Process Flow

Simplifying Process Flow

jpanY7K8B
Explorer Explorer
572 Views
17 Replies
Message 1 of 18

Simplifying Process Flow

jpanY7K8B
Explorer
Explorer

I am working on a complicated assembly process flow, about 500+ different operations and 300+ different equipment. 

Is it possible to let Flexsim follow the process steps, tool dedication to complete the entire processes? I cannot upload real process steps here. But created a example for help. 

 

Thank you

 

0 Likes
Accepted solutions (4)
573 Views
17 Replies
Replies (17)
Message 2 of 18

kavika_faleumu
Autodesk
Autodesk

Hey @jpanY7K8B, I'm a little confused as to what you're asking.

If you're asking if Process Flow can handle the number of operations and equipment you want to simulate, then yes. The example model you've shared can be added to and expounded to much larger scales.

In upscaling, I suggest utilizing sub flows to reuse actions where possible. You may also want to utilize Lists to push and pull items or jobs (depending on your use-case).

0 Likes
Message 3 of 18

jpanY7K8B
Explorer
Explorer

Hello @kavika_faleumu 

Thank you for your reply. I was able to create a new model example to illustrate my simulation need. As you can see from the new model, I currently have two different products (Product001 & Product002. In reality, I will have at least 30 different products.)

The process sequence is defined in the table ProcessRouting, and the process time is defined in the table ProcessInfo. The model logic works fine for now, but it’s not very friendly for future expansion. For example:

  1. Right now, I used individual Sources to create each flowitem. If I scale this up to 30+ products, I would end up with 30+ Sources. Ideally, I would like to use one Source to generate many different products, each with a product label (I’m currently using “Type” as the label) and different arrival rates.

  2. For each Processor, I would like the model to automatically pull the process time from the table based on the label values (“Step” and “ProductName”). For example, in Machina001 I hard-coded step = 1 and type = "Product001". Instead, I’d like to dynamically use the label values for “Step” and “ProductName.”

Do you have suggestions on the best way to structure this so that it’s scalable? Thank you so very much. 

 

0 Likes
Message 4 of 18

kavika_faleumu
Autodesk
Autodesk
Accepted solution

Hey @jpanY7K8B, I've got some ideas on how you could achieve what you want.

  1. I found a post that uses 1 Source to create tokens. Those tokens then create the objects in a loop, delayed by whatever you want the inter-arrival time to be.
  2. You can write a custom code in the Processing Time to lookup table values. Here's an example of what you can do:
    • /**Custom Code*/
      Object current = ownerobject(c);
      Object item = param(1);
      
      int step = item.Step;
      string productName = item.Type;
      Table procInfo = Table("ProcessInfo");
      double procTime = procInfo.getValueByKey(step, "ProcessTime", 2);
      
      print("Machine: ", current.name, "\tItem: ", productName, "\tStep: ", step, "\tProcTime: ", procTime);
      
      return procTime;
    • This code will get the step and product name from the item, then look up the ProcessTime from the table. There's a print statement in there so you can check (in the Debug > Ouput Console) if the values are what you think they should be.
    • Another nice thing is that this code is copyable to all the other machines without having to edit it since it looks up values in the Table. In fact, you could put this code in a table or treenode and have the processors reference that node -- that way, if you want to change the code at some point, you just need to make the change in the 1 place without having to copy/paste it to each processor.

I hope this helps!

0 Likes
Message 5 of 18

jpanY7K8B
Explorer
Explorer

Thank you so very much. @kavika_faleumu 

0 Likes
Message 6 of 18

jpanY7K8B
Explorer
Explorer

@kavika_faleumu 

I copied your custom code to all machines. but it seems all machines in the model picked Machine001's process time, which is 9.06 s. 

Below is Machina003 as an example. how to get this fixed? 

 

Update: I think I am confused the difference between process time and stay time. I appreciate if you can explain the difference. 

 

jpanY7K8B_2-1756494992124.png

 

0 Likes
Message 7 of 18

kavika_faleumu
Autodesk
Autodesk
Accepted solution

Hey @jpanY7K8B, I forgot to limit the table to only look at results from the specific product. I added a SQL query to the code to get a sub-table only with a specific product's times.

/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);

int step = item.Step;
string productName = item.Type;
Table procInfo = Table("ProcessInfo");
Table subTable = Table.query("SELECT * FROM ProcessInfo WHERE ProduceName = $1", productName);
double procTime = subTable.getValueByKey(step, "ProcessTime", 2);

print("Machine: ", current.name, "\tItem: ", productName, "\tStep: ", step, "\tProcTime: ", procTime);

return procTime;

You could also modify the SQL statement to just get process time directly without having to do the "getValueByKey" step. Here's more info on sql queries if you're interested.

After running for a bit, you'll notice that your machines' averages don't align with the table values, but the min/max staytimes probably will. For example, on Machine4,

kavika_faleumu_1-1756831771916.png

The min aligns with Product002 and the Max aligns with Product001.

kavika_faleumu_2-1756831848602.png

This won't always be the case if you have special code that holds items a little longer, does setup time, etc. But at least with this sample model, this is a good way to know if the right products are getting to the right machines and using the right process time.

 

Message 8 of 18

jpanY7K8B
Explorer
Explorer

Thank you. @kavika_faleumu 

0 Likes
Message 9 of 18

jpanY7K8B
Explorer
Explorer

Hello @kavika_faleumu

in the Machine process flow, I used scheduled source as Machine asset. I meant to use Quantity column to control Machine qty in each kind. But it seems does not work the way I wanted. For example, I want to change Machine001 to 3 in Quantity column. Any suggestion on how to modify the model? Thank you 

 

(Attached the model file with updated code that you previously suggested. )

jpanY7K8B_0-1756848781436.png

 

0 Likes
Message 10 of 18

kavika_faleumu
Autodesk
Autodesk

What do you mean by "Machine quantity"? Do you want multiple items to be processed on a Processor at the same time?

0 Likes
Message 11 of 18

jpanY7K8B
Explorer
Explorer

Hello @kavika_faleumu

Sorry about the confusion. "Machine Quantity" in this content means fleet size. For example, I want to have 3 exactly same independent Machina001 to process flowitems simultaneously. 

0 Likes
Message 12 of 18

kavika_faleumu
Autodesk
Autodesk
Accepted solution

I suggest you start by making a group for each Machine you'd like to multiply.

kavika_faleumu_0-1756923734532.png

Then you can add a Parameter Table (I renamed mine to "MachineGroups") to set the desired values you want for each group.

kavika_faleumu_1-1756923780778.png

If you click on the "Value" and then the drop-down arrow, you can set the Reference to the proper Group. Then, in the On Set section, you set it to Delete and Copy Group Members.

kavika_faleumu_2-1756923871670.png

kavika_faleumu_3-1756923886659.png

This option will (1) delete all the copies of the machine except the original, (2) create X number of copies of that machine, and finally (3) place them at whatever offset from the original you have set. For example, if I set my param value to 3 with a Y Offset of 3, then my Machine001 group will look like this. (Objects will be deleted and copied On Reset. To see your changes, reset the model).

kavika_faleumu_4-1756923989761.png

It looks like your WorkCenter group is setup to add them automatically to the group, so that makes things a little easier.

kavika_faleumu_5-1756924063744.png

From here, you'll want to update your Assign Labels activity to choose a WC_Name that probably starts with a particual name (so it chooses any machine in the group). Or you'll have to change your Pull from List activity's query to select something WHERE WC_Name LIKE puller.WC_Name. You'll have to play around with what works for you.

Hope this helps!

0 Likes
Message 13 of 18

jpanY7K8B
Explorer
Explorer

Thank you. @kavika_faleumu 

This is totally new to me. Thank you for sharing. Flexsim is very unlimited!!!! 

Message 14 of 18

jpanY7K8B
Explorer
Explorer

Hi @kavika_faleumu ,

I’ve made a few modifications to the model and wanted to get your thoughts:

  • Added a Queue before each processor, since a processor can only run one part at a time. This lets me track WIP buildup in front of each processor.

  • Made it easier to add/remove processors in each processor group.

However, I ran into two issues:

  1. For Product_A, I want it to move sequentially through the system:

    • Processor1 → Pre_Processor2_Queue2

    • Processor2 → Pre_Processor3_Queue3

    • …and so on.
      But I can’t get this routing to work.

  2. The Initial Start Queue only sends the first two items (to Processor1 and Processor2). The rest just pile up instead of feeding available processors.

Do you have suggestions on how to fix the routing so objects flow queue → processor → next queue properly, and the initial queue continues feeding available processors?

 

Thank you very much. 

0 Likes
Message 15 of 18

kavika_faleumu
Autodesk
Autodesk

Hey @jpanY7K8B

Regarding the pileup, that's due to your Process Flow pulling the two initial Queues but not Pushing them back onto the list. If you want to make sure that they're always available to be pulled, you can check the "Leave Entries on List" box. That way, even when they get pulled due to a query, they'll stay on the list for other tokens to pull. Then you don't need to worry about pushing them back on.

kavika_faleumu_0-1758125310497.png

With regards to your Process, I think I see where the issue is. You're moving boxes to the correct Queue, but then your Wait for Event is waiting for those boxes to exit the Queue after they've already left to be processed. So that token never gets processed.

You don't want to wait for boxes to leave the Queue -- you want them to finish processing first. From there, there are several ways you could move items to their next PreProcessing Queue. You could push them to an ItemList then have the Initial Start pull from that List. You could move the items straight to the next Queue using Process Flow or Input/Output/A-Connections in the 3D view.

Attached is an example model modified to use one of these ways.

 

Firstly, you've got conflicting logic in 3D and Process Flow. I'll move the incrementing of the "Step" label to Process Flow. That way, when items enter and a new token is created, we can be sure to increment once.

kavika_faleumu_1-1758128191021.png

After we've setup the token and we determine that it still has steps to do, we can pull a Queue (while leaving it on the list). Then, we'll let the 3D objects handle it until the last Processor finishes.

kavika_faleumu_3-1758128306050.png

 

It will push it to an ItemList. In Process Flow, we'll wait to pull an item from the ItemList so we can move it back to the Initial Start.

kavika_faleumu_2-1758128286042.png

 

Hope this helps!

 

0 Likes
Message 16 of 18

jpanY7K8B
Explorer
Explorer

@kavika_faleumu 

Thank you for updating the model with detail explanation. When I test run the model, I encountered issue: 

  • After successfully processed 21 boxes, processor 1, 2, 3 stopped with processed boxes. and rest of the WIP start pilling up. Also, System console has the follow error message. I guess this error is related to MTBF. Once I disable MTBF, no issue to run the model. But I have to idea how to setup MTBF correctly. 
time: 3961.030532 exception: Exception Caught in Processor::onTimerEvent(treenode involved, int code, char *datastr) object: /Processor4
time: 3961.030532 exception: Exception Caught in ObjectFunction246__project_library_FlexSimObject_behaviour_eventfunctions_OnTimerEvent object: /Processor4 class: /Processor4

time: 3961.030532 exception: Exception caught in TreeNode::receivemessage()
time: 3961.030532 exception: Exception caught in Executive::processeventinlist().
  • Can you please also explain why the model redirect token back to "Delay". In the attached file, I removed MTBF. As you can see I added to other methods to compare with "original Product Creation". Method 2 works. but not method 3. Did I miss something? Please correct me. Thank you very much. 

jpanY7K8B_0-1758177321078.png

 

0 Likes
Message 17 of 18

kavika_faleumu
Autodesk
Autodesk
Accepted solution

Hey @jpanY7K8B,

To fix the first issue, I believe it was a problem with the "Pull Finished Item" activity. The "Assign To" property was `token.pulled`. I changed it to `token.Item` since the subsequent "Move Item Back to Initial Start" uses `token.Item`. (Of course you could do the opposite as well, changing the variable in the Move activity to be `token.pulled`.

kavika_faleumu_0-1758208024414.png

For your second question, the reason we loop back to a Delay is to avoid creating more tokens and to simplify creation. The original item creation method simply created 2 tokens and would use those to create items every `token.Interval`. Of course, it's fine to also used Inter-Arrival Sources to spawn new tokens every X seconds and then send them to a sink. For the 2nd method, you would need an Inter-Arrival Source for every different time interval you want to spawn a token at.

0 Likes
Message 18 of 18

jpanY7K8B
Explorer
Explorer

Thank you. Problem was solved. 

0 Likes