Signal control bidirectional variable conveyor

Hey everyone,

I wanna to model a two-way variable and signal-controlled conveyor,but I failure.Who has a good idea?

Thanks in advance.

Hi,

You can do it with two way path behaviour, boolean signal and python script which changes the path direction on signal events.

Check the attached example. There you can change the conveyor direction by manually setting the signal “Direction” True/False on the signal panel.

Note that the attached line components should also be able to work as both inputs and outputs. In the example the feeder cannot do that so if you change the flow direction backwards the box cannot proceed back to the feeder. But you could put a Shuttle Conveyor for example in between the feeder and the two way conveyor and create a routing rule on it so that it can transfer those boxes back to a different location.

-k

TwoWayConveyor.vcmx (240 KB)

Thanks,Keke. It works. :smiley:

I am learning python, but not good at it.Could you help me integrate the python script into Sensor Conveyor?

 

BR,

Turbo

TwoWayConveyor_example.vcmx (2.11 MB)

Hi,

Well I don’t know how you want to integrate it. But I can give you some pointers:

  • OnRun method on the script is called when simulation starts. On your example that method contains few handle assignments and "while False" -loop. Change that to "while True" to enable the eternal loop (as script comment suggests).
  • Inside the while loop triggerCondition method is basically a gate through which the script execution goes when a part arrives at the sensor. Also part handle is assigned on the next line. After this you can write some custom logic that should happen after part is at the sensor.
  • For example the modification below make the direction of the conveyor change when part arrives at the sensor. Then there is a 3 second delay after which direction is changed back to normal thus creating a perpetual motion machine :)
def OnRun():

sig.signal(True) #signal-controlled

comp = getComponent()
sensorSignal = comp.findBehaviour(‘SensorSignal’)
startStopSignal = comp.findBehaviour(‘StartStop’)

while True: #Change this to while True: if OnRun -loop is needed
triggerCondition(lambda: getTrigger() == sensorSignal and sensorSignal.Value)
part = sensorSignal.Value
# Create your logic here
# …
# …
sig.signal(False)
delay(3)
sig.signal(True)


BTW nice little line you built on the example layout.

-k

 

Hello,keke

Thank you for your help. :smiley:

In addition,could you give me some advice in these problems:

  1. Create a component which behavior like Lifter. It has 3 ports:Port_1 transports IN&OUT,Port_2 only transports OUT,Port_3 only transports IN.

 

  1. Whether it’s a Lifter or a Crossing Conveyor, I don’t want to change the direction of the part as it runs. I want the parts to keep the same direction as they are.

In this simulation:

What i expected:

Please check the attachments.

 

BR,

Turbo

 

Process_.vcmx (1.9 MB)

Hi,

  1. I think you can use Lifter component as a starting point for your custom model. Just copy your custom geometry into the lifter component and delete or hide its original geometries. Then you may need to modify some behavior and frame locations but the logic should be pretty much similar. Finally save component as new component (Modeling/Save as) so that it gets a new VCID.
  2. To keep the orientation when part transitions from a path to another you can check the "RetainOffset" property. That works for your example layout for component "TwoWay_Conveyor #4" and its "TwoWayPath" behavior. For the lifter the "RetainOffset" property you need to check is in the "FlowProxy" behavior. After enabling those your layout should work so that parts keep their orientation.

-k

Nice.Question 2 has been resolved. :wink:

As for question 1, I actually tried to replace the geometry inside the Lifter. Due to the weak Python foundation, the logic of the flow has not been realized, especially from the port3 input, port1 output. I will keep trying.