Force control to find targets

AnaHVAnaHV Sweden
Hello, 
Someone can let me know if already exist some code in RAPID  to use the force control to find the target and make a work object? I need this for a complex geometry.

Comments

  • kocykowatykocykowaty Poland

    There is SearchL instruction. After you have three points, you can create frame using DefFrame instruction and then put this frame in work object.

    The other way to search a point is using code like this:



    ! variables for activating and disactivating chosen force directions (x direction , y direction , z direction , x rotation , y rotation , z rotation). I use it to eliminate any movement in direction different then the one I want to use.

    VAR fcdirections active_Y:=[false,true,false,false,false,false];

    VAR fcdirections active_all:=[true,true,true,true,true,true];


    ! force control process data


    VAR fcprocessdata forcedata1;

    ! Target in which the position of the robot in a moment of a contact will be saved

    VAR robtarget Searched_target;





    WaitTime\InPos,1;

    FCCalib Tool1_LD;

    FCRefForce\Fy:=-10;

    FCCondForce\YMin:=-10\YMax:=10,15;

    FCSetDirections fcdir_active_Y;

    FCAct Tool1\WObj:=wobj_1\ForceFrameRef:=FC_REFFRAME_TOOL\DampingTune:=[9e9,200,9e9,9e9,9e9,9e9];

    FCRefStart;

    FCCondWaitWhile;

    forcedata1:=FCGetProcessData(\DataAtTrigTime);

    IF forcedata1.conditionstatus.force=FALSE THEN

    Searched_target:=CRobT(\Tool:=Tool1\WObj:=Wobj1);

    ELSE

    TPWrite "Error! Tool was not touching the surface";

    Break;

    ENDIF

    FCRefStop;

    FCDeact;

    FCSetDirections fcdir_active_all;

Sign In or Register to comment.