agv point to point

agv point to point

a9080109
Observer Observer
60 Views
21 Replies
Message 1 of 22

agv point to point

a9080109
Observer
Observer

[ FlexSim 20.0.10 ]

I want to import the content of this excel into my model. I have to show the product number.

excel.xlsx0826new-2-1-fm.fsm

The x coordinate is to control momcar.

The y coordinate is the control sonccar

The z-coordinate will be transported by elevator!! Please help me

0 Likes
Accepted solutions (1)
61 Views
21 Replies
Replies (21)
Message 2 of 22

moehlmann_fe
Observer
Observer
Accepted solution

Do you mean like this?:

0826new-2-2_fm.fsm

The Dst-values are written to labels on the palettes (see properties of Source2 -> Arrival Schedule)

After they are loaded onto the "SonCar", the distance the task executers travel is based on those labels. (As a result the paths are not used anymore)

1630917932763.png

Which storage the palettes gets unloaded into is decided based on the coordinates (see code in "Decide Storage" assign activity)

1630917900174.png

0 Likes
Message 3 of 22

a9080109
Observer
Observer

Very similar! But what I hope is that the point on the y-axis is the point where the goods are placed!

0 Likes
Message 4 of 22

moehlmann_fe
Observer
Observer
So you don't want to place them in storage objects but rather in the model itself?
0 Likes
Message 5 of 22

a9080109
Observer
Observer

Sorry I misunderstood. My x should be controlling the suncar and y should be controlling the mother car. How should I adjust, and where should the part about x be put down? It’s just that I’m thinking about the visual presentation. I should use rack. To present it or keep it as it is

0 Likes
Message 6 of 22

moehlmann_fe
Observer
Observer

You can of course go through the travel activities and change "DstX" entries to "DstY" and vice versa.

You will still have to adjust the positions of the storage objects to fit your coordinates though.

I switched the values around in the attached model. I also changed the code "Slot Assignment Stratety" of the storages to put the item in the slot closest to the "SonCar". For this, the current coordinates of the car are written onto a label of the palette before it is moved into storage.

0826new-2-3-fm.fsm


0 Likes
Message 7 of 22

a9080109
Observer
Observer

Regarding my child car in the storage object, can I let her arrange it according to my needs?

1630984282014.png

What I mean is that my x is at 9. I should place it in the ninth grid from the left, and then if it is greater than 12, place it on the right and then count from the right.

0 Likes
Message 8 of 22

moehlmann_fe
Observer
Observer

I changed the model, so the "DstX" value determines in which bay the palettes are stored. The logic is located in the custom code of the "Decide Storage" activity.

1630999293421.png

I added comments to the code to explain what each section does.

Not sure if I correctly understood how the counting should go. Below is a screenshot showing how I understood your describtion.

1630999608685.png

(The DstY values do not align with the positions of the storages yet.)

0826new-2-4-fm.fsm

0 Likes
Message 9 of 22

a9080109
Observer
Observer

So if I want to complete a factory modeling as follows, how can I adjust my model? It has about four layers and about 20 rows. Can I give a simple demonstration first? Thank you


0908.fsm

1631108816109.png

I want to know what this is, can you explain it to me?

0 Likes
Message 10 of 22

moehlmann_fe
Observer
Observer

The source uses the label "q" to determine the color in the "OnCreation" trigger. That label doesn't get created currently. The quantity column is renamed to "q", but the name of that column doesn't actually have any effect.

Note how the there are 0 labels added.

1631109020941.png

Add in another column "q" to add the label.

Also the "Dst" values you are adding to the palettes are configured as text (strings). Change them to number to the coordinates are read properly. (Select columns -> right click -> Assign Number Data)

1631109317915.png


0 Likes
Message 11 of 22

a9080109
Observer
Observer

Thank you, but I still have questions to ask, if I want to create more objects to store my goods, how can I change my CODE

0 Likes
Message 12 of 22

moehlmann_fe
Observer
Observer

The only code that would probably have to changed is in the "Decide Storage" activity.

1631197776086.pngBased on the DstX and DstY values, a decision is made which storage object the item will be delivered to. Currently it's a couple nested if-else conditions. If you want to add substantially more storages I would suggest looking up the "switch case" syntax.

Can be found here, along with many other informations on how to code in FlexSim.

https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/WritingLogic/

After the correct storage is determined, the bay is assigend to the item based on the "DstX" value and the distance along the x-axis from the central path the "MomCar" travels on to that bay is determined and stored on the token as the new "DstX" value, which is later used as travel distance for the "SonCar".


The activity you mention above

43681-1631108816109.png(sorry, didn't notice that comment) assigns the current model coordinates of the son car to a label on the item. This was used in a different iteration to determine the needed travel distance and is actually not needed in the current model.

0 Likes
Message 13 of 22

a9080109
Observer
Observer

0826new-2-4-fm_1_2.fsm

So I want to use this model as a template. How can I fix it?

Can you teach me

0 Likes
Message 14 of 22

moehlmann_fe
Observer
Observer

Hi @霈倫,

I changed your model to better accomodate the large number of storage objects. The assumption was that the "DstY" value denotes the row number of the storage the pallet should be transported to.

Most of the code is still in the "Decide Storage" activity. I'll also post it below. The comments should hopefully explain what each part of the code does.

Furthermore I replaced almost all direct references to the cars by assigning the correct the ones to token labels based on the destination. This should make adding cars for the fourth level easier.

The "MomCar" can be a copy of one of the three existing one with the name "MOM CAR4". The "SonCar" must be connected to the "MomCar" with a center connection (s-connection).

Because the references to the transporters are updated according to the destination, a single process flow can handle all transports. I also added the MomCars as a resource so the model can be expanded to allow for multiple simultaneous transports more easily.

If you have a specific questions about the code or other parts of the model feel free to ask.

0826new-2-4-fm-1-3.fsm

"Decide Storage" Code:

**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
Variant assignTo = param(4);
string labelName = param(5);
treenode processFlow = ownerobject(activity);

Object FloorStorage; // This will store the floor storage the pallet should be stored in

/*
The assumption for this code is that the name of the floor storage can be reconstructed from the Dst values on the pallet.
DstX determines whether the floor storage is on the left or right (L or R), DstY the first number and DstZ the floor number.
-> The name takes the form of "FloorStorage_ + (L or R depending on DstX) + DstY + _ + DstZ + F"

DstX furthermore determines the bayID of slot, values of the 1-13 belong to the left storage and correspond to the bayID, 14-26
belong to the right storage and count the bayID from the right (14 -> ID 13, 15 -> ID 12, ...)
*/

string StorageName = "FloorStorage_"; // We start with the common part of the floor storage name

// Now we add the variable parts to the string (text) variable
// First the side, if DstX is larger than 13, we add an R to the name, otherwise an L
if(token.DstX > 13)
{
StorageName = StorageName + "R";
}
else
{
StorageName = StorageName + "L";
}

// Now add the y coordinate, the number value must first be converted into a string (text) value. We also add the second underscore to the name here.
StorageName = StorageName + string.fromNum(token.DstY, 0) + "_";

// Finally, add the floor number. Similar to the y coordinate we must convert the variable type
StorageName = StorageName + string.fromNum(token.DstZ, 0) + "F";

// Now we have the final name of the destination storage and can use it to get a reference to the storage object in the model
FloorStorage = Model.find(StorageName);

// Next, we assign the bayID.
int bayID = token.DstX;
if(bayID > 13)
{
// If right side, DstX counts from right
bayID = 13 - (token.DstX - 14);
}

/*
Now we can assign the item to the correct slot. There are two ways to move an item into a specific slot of a storage object.
The first is to use the "Slot Assignment Strategy" of the storage object ("Storage Object" tab in its properties window). The option
"By Bay, Level, Slot ID" allows to define the slot the item should enter via labels on the item itself.
As we want to get the actual 3D position of the slot so we can have the cars drive there, we need to get a reference to the slot anyway and can
use the second way to assign a specific slot: Set it in code before item enters the storage object
*/

// Get reference to slot class object, as there is only one slot per level and one level per bay, the bayID directly defines the slot
Storage.Slot slot = FloorStorage.as(Storage.Object).bays[bayID].levels[1].slots[1];

// Create storage.item class object for pallet. This is an internal representation of the item to keep of track of where in the storage system it is.
Storage.Item storageItem = Storage.Item(token.PulledItem);

// This storage.item can then be assigned the slot it is bound for. If the item now enters the respective storage object, it will overwrite the Slot Assignment strategy
storageItem.assignedSlot = slot;

// Assign MomCar to token label, so we can reference it more easily in the travel activities. We again use the DstZ value to get the name of the Mom Car.
// As such it is important that they are numbered from 1 to 4 in their names
token.MomCar = Model.find("MOM CAR" + string.fromNum(token.DstZ, 0));

// The SonCar is connected to each MomCar via an s-connection and can thusly be referenced that way.
token.SonCar = token.MomCar.as(Object).centerObjects[1];

// Get distance between slot and MomCar on x-axis (distance SonCar has to travel)
token.DstX = -(token.MomCar.as(Object).getLocation(0.5, 0.5, 0).x - slot.getLocation(0.5, 0.5, 0.5).project(FloorStorage, model()).as(Vec3).x);

// Assign y-location of slot
token.DstY = slot.getLocation(0.5, 0.5, 0.5).project(FloorStorage, model()).as(Vec3).y - 1;

return FloorStorage;
0 Likes
Message 15 of 22

a9080109
Observer
Observer
But the car can't go back to the next job0914.fsm
0 Likes
Message 16 of 22

a9080109
Observer
Observer

But the car can't go back to the next job

0914.fsm

0 Likes
Message 17 of 22

moehlmann_fe
Observer
Observer

Yes it does. As soon as there is another pallet to pick up it will travel back, like in your original model. You don't create enough items to fill a fourth pallet (Type 1 is missing).


Here is a version where the MomCar returns right away and the cars can transport pallets simultaneously.

0914_simultaneous.fsm

0 Likes
Message 18 of 22

ryan_c10
Not applicable

Hi @霈倫 , was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes
Message 19 of 22

a9080109
Observer
Observer

I have an idea. I want to create another production line below. It must have the same function as the one above, but I need to let the mother car automatically determine which is the best path, for example, y>11 mother. The car will go to the elevator below to receive the goods! Thank you1003.fsm

0 Likes
Message 20 of 22

ryan_c10
Not applicable
0 Likes