We have a robot cell where we have integrated a Kuka KR60-HA with a custom-designed dual extruder. Think of the dual extruder as an alternating dual piston system: the first piston goes forward a certain distance, hits a limit switch and while it is retracting the second piston moves forward until it hits its limit switch and vice-versa. The integrator has given us the flags and commands to run the dual extruder (named extruder1 and extruder2). So for example, we can issue:
Q_Extruder1Forward = TRUE ;Set Direction Q_AN_Extruder1Speed = 0.10 ;Set speed to 10% (slow on forward) WAIT FOR I_Ext1ExtendedLimitSw == TRUE ;wait for limit switch Q_Extruder1Forward = FALSE Q_AN_Extruder1Speed = 0 ;Set speed to 0% wait sec 2 Q_Extruder1Reverse = TRUE ;Set Direction Q_AN_Extruder1Speed = 0.35 ;Set speed to 35% (fast on retraction) WAIT FOR I_Ext1RetractedLimitSw == TRUE ;wait for limit switch
My question is how can I combine the above with the movement of the robot so that I get the following logic:
- Start Program
- Extruder 1 starts moving forward. At the same time, the robot starts moving
- While robot is moving, if extruder 1 hits extended limit switch, retract until it hits retracted limit switch and at same time set extruder2 to move forward
- While robot is moving, if extruder 2 hits its extended limit switch, retract it until it hits its retracted limit switch and at same time set extruder 1 to move forward
Is there a way I can recognise the above events (e.g. I_Ext1ExtendedLimitSw) becoming TRUE at any point in the program and take action while the robot continues to move?