Abort target motion and continue to the next taget
pavpav
✭
in RobotStudio
Hi
I would like the robot to abort a motion as it recieves a collision signal, and continue to the next target.
Example:
1. Robot is making a downward motion to place an object
2. As it feels a collision it aborts the downward motion
3. Robot drops the object and starts moving upwards to the next target
I checked stopMove and clearPath functions but not sure if thats the right way to do it.
Is there a good way to do this in RAPID?
/pav
0
Comments
-
Hello Pav,One thing you might be looking for is the use of triggers, interrupts and traps.You can create a triggdata which you can link to an interrupt. This interrupt should be linked to a trap that you want executed once the interrupt occurs.You can move the robot towards the point and when it reaches an X distance from the point, the trigger triggers and activates the interrupt. The code would look somewhat like this:TRAP tTrap ! Defined the trap! Do what you want to be done, stop movement and drop objectENDTRAPPROC Trigger()VAR triggdata Trigger;VAR intnum interrupt;VAR num X;VAR robtarget endPoint;X := 5; ! amount of millimeters you want the robot to stop near your place pointCONNECT interrupt WITH tTrap; ! Connecting the interrupt with the trapTriggInt Trigger, X, interrupt; ! Trigger occurs when robot passes the virtual sphere with diameter X around endpoint.! You can also define this trigger to trigger when the robot passes a virtual sphere with diameter X around startpoint.! You can do this with the following statement: "TriggInt Trigger, X \Start, interrupt;" Please check ABB documentation! for more info on triggers and uses for these triggers.TriggL endPoint, v10, Trigger, fine, tool0 \wobj wobj0;! Replace speed, zone, tool and workobject with the ones you're currently using.ENDPROCIn this code i gave some explanation in the comments.The way this code is executed is as follows:The function creates the trigger, interrupt and other vars needed (you can use the variables you're using in your code).It connects the interruptnumber interrupt with trap tTrap, meaning whenever the interrupt gets activated, the program pointer will jump to tTrap and execute this one.Then the trigger Trigger will be linked to the interruptNumber Interrupt. whenever the robot gets within X millimeter around the endpoint, the trigger will occur and activate the interrupt (which will lead the program pointer to enter the trap tTrap).The robot gets moved with the TriggL function. This is comparable with the MoveL function (TriggJ and MoveJ, check ABB Documentation for more).Whenever the robot moves within X mm around the destination (endPoint), it will trigger Trigger.I hope this helps!Cheers1
-
Unfortunately i have no permission to edit my own posts, so I will add a little piece here:The Diameter described in the comments should be radius* sorry...0
-
Hello B_Baan and thank u for the reply.I am using a smart component(collision sensor) that sends a DI signal to the robot and notifies it when to cancel the motion.I managed to get the robot to do what i want by following the example under clearPath in the RAPID manual.However, it seems that stopMove \Quick command is slow at restarting because the robot is stuck insided the conveyer for about 1 second before continueing with the upward motion.PROC Path_place()CONNECT collision_gripper WITH TRAP_collision;ISignalDI \Single, DI_collision, 1, collision_gripper;MoveJ DW_MOTION,v300,z100,TCP_Gripper\WObj:=wobj0;ENDPROCTRAP TRAP_collisionStopMove \Quick;ClearPath;IDelete collision_gripper;StorePath;MoveJ UW_MOTION,v3000,z100,TCP_Gripper\WObj:=wobj0;RestoPath;StartMove;ENDTRAPI would like the robot to continue to the upward motion quickly after the collision, and not be stuck in the conveyer for 1 sec.Can it be done with a trigger?Thank you/pavPost edited by pavpav on0
-
pavpav said:1. Robot is making a downward motion to place an object2. As it feels a collision it aborts the downward motion3. Robot drops the object and starts moving upwards to the next target
1 -
Hello Pav,I do not know why it is not possible to move out once the robot has dropped the object.You could do something like this:TRAP tTrap ! Defined the trap! Do what you want to be done, stop movement and drop objectStopMove;DropObject; ! Drop the object, however you wish to do itWaitDI(ObjectDropped,1);StartMoveMoveL Offs(CRobT(CurrentTool, CurrentWobj), 0,0,X), v10, fine, CurrentTool \wobj:=CurrentWobj; ! Where X is the required Height to moveIDelete Interrupt;ENDTRAPPROC Trigger()VAR triggdata Trigger;VAR intnum interrupt;VAR num X;VAR robtarget endPoint;X := 5; ! amount of millimeters you want the robot to stop near your place pointCONNECT interrupt WITH tTrap; ! Connecting the interrupt with the trapTriggInt Trigger, X, interrupt; ! Trigger occurs when robot passes the virtual sphere with diameter X around endpoint.! You can also define this trigger to trigger when the robot passes a virtual sphere with diameter X around startpoint.! You can do this with the following statement: "TriggInt Trigger, X \Start, interrupt;" Please check ABB documentation! for more info on triggers and uses for these triggers.TriggL endPoint, v10, Trigger, fine, tool0 \wobj wobj0;! Replace speed, zone, tool and workobject with the ones you're currently using.ENDPROCI do not see why the instructions storepath and restopath should be used, try something similar to this.0
-
Hi soup and thanksIt seems SearchL is working quite well with the stiff stop. Too bad you didnt give me the advice before i started messing with clearPath for a whole day :P/pav0
-
Hello B_BaanI will keep your method in mind if i want to drop objects. What im trying to do is to place an object on a surface that can vary in height. So the endpoint is never at the same z coord, thats why i need a collision to trigger the dropping.Store and restore path did not need to be used, but i got some error that StorePath is expected even though the robot made its motion without it.RegardsPav0
-
Hello Pav,Its strange that the robot generates that error.Also, the height that you can setup your trigger with is variable, so that shouldn't be a big issue aswell.Anyway, good luck with your project!Cheers0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings