There’s a machine where products slowly move in one axis through a working area, so there’s an input area, working area and output area. Machine is always moving at some slow rate, like 20 mm/s.
Robot is placing products into the input of this machine (called buffer area).
Product length can vary between 500...1500 mm (other dimensions don’t matter), products come in randomly from the other conveyor (called input).
Here is the challenge: the robot should always place products as close to the working area as possible. Robot can also add products in the buffer area as long as there is enough space.
As an example:
Robot adds first product right by the end of the buffer. Now the next product should be added with an offset (length of first product + a gap).
Add products until the buffer area is full, at this point it should wait until there’s enough space for the next product (which can have random length).
You can try by adding a RaycastSensor in your process to measure the distance available and create a frame where to place your product that can be moved with a property.
In the FromConveyorProcess you give the Product length, in the ToConveyor Process you measure the available distance and calculate the difference to define where should the frame to place the product be. It is important to move this frame before starting the TransportIn, otherwise it will use the previous position.
@Tilma thanks, I integrated this solution into the scenario I’m currently modelling. In my actual model, there’s the added complexity that new products can arrive to the conveyor from multiple sources, not just one.
So I added the same sort of logic in multiple FromConveyors where they send the product length before it’s picked up.
However, I ran into the following block and I don’t understand if this is a limitation with the process routine or not.
Essentially:
According to the same logic you had, ToConveyor receives product length (let’s say 1500 mm) and arrives at WaitSignal (buffer is quite full, so it’s waiting for the sensor’s distance to indicate that there’s enough space for a new product)
A product arrives at anotherFromConveyor and should be picked up and brought here. That process sends ProductLength → ToConveyor, which might be 350 mm.
At this point SensorDistance might be 959 mm, so the condition should evaluate to True:
<This>::DistanceSignal >= ProductLength + 200
However it doesn’t, because the routine variable ProductLength is still 1500 mm.
I think you have misunderstood the expression syntax, you don’t use <This>::ProductLength, just ProductLength to refer to the value of the ProductLength variable (which is just a property in the process routine in this case)
You should be getting errors in output about the expressions.