RobotStudio event

Force control using matlab

i am doing force control on ABB robot , 
currently i have the force values calculations on a matlab program and i would like to send these values to abb robot studio, can somebody help me please to get started .
shall i convert my program to C++ for example and find a way to add in robot studio

Comments

  • What is your goal to get the calculated forces into the simulation?

    The force control interface is connected to the axis computer of the real controller - the virtual controller does use an "axis computer" and this layor of the control loop does therefor not exist in the simulation...

    For information how to create a Robotstudio add-in, please have a look in the Robotstudio API help or the "Develeper Centre" next to this forum... http://developercenter.robotstudio.com/

    regards

    regards
    Christian
  • Hallo , thank you for your reply, that's 100% correct, i have just to see in the simulation that my rapid program has these FCPress instructions where the force values changes according to my matlab program , not on the robot ( on simulation) it self since no sensor can feel the forces during the simulation.

    i have read most of the API Documentation, then i found those RsCreateActionInstruction, i thought i can create my own instruction , so if i create my own instruction and specify it is parameters i can make an instruction which has the same parameters as FCPressL instruction, so i can modify my forces in C# and see it in ABB robot studio program.

    can you suggest something just to see the forces change and not keep them constant all the time?
  • or let me please ask it by another way, do you know how can i create my own instruction in C#  ? because for example i can change the parameters of MoveL instruction and call it Search instruction for example, can i make a new instruction and call it FCPressL which has the same parameters as FCPressL ?
  • You may define your own instructions in RAPID (in the VC), but you must not name it equal to an existing (not possible to overload in RAPID)

    Then you may open the instruction templates, add the new instruction as move instruction (not action instruction) and create a corresponding process for this instruction or a set of (xxxL, xxxC, xxxJ), if you have.

    You need to do this for each Robotstudio station, as this information is stored with the station...

    Then you may use your instruction in RS like the default Move instruction...

    But this is only half of the story - the next step would be to get your data into the VC

    - use IO signals or use PC SDK to write into persitent num values (e.g. PERS num nMyValue:=0;)

     

    hope this helps a bit

    regards

    regards
    Christian

  • Hello Again,
    thank you very much, that was really sophisticated and i tried them but i went back to write to get the help from the API Documentation , i am having my forces in two matrices, one for Fx, the other is Fy , and both are vectors in C# , 
    i declare them to Abb robot studio ( rapid program) using RsGenericDataDeclaration example, but in the example the matrix look like the following :
    // Create a genric DataDeclaration, representing a 3-dimensional matrix
        // where each dimension has 3 entries.
        int[] dimensions = new int[3] { 3, 3, 3 };
        RsGenericDataDeclaration myGenDDMatrix = new RsGenericDataDeclaration("myMatrix", "num", dimensions);
    
        // Set the InitialExpression of the DataDeclaration.
        myGenDDMatrix.InitialExpression = "[[[1,0,1],[0,0,1],[1,1,2]],[[1,2,1],[1,2,2],[1,1,3]],[[1,4,1],[1,1,2],[1,1,3]]]";

    where in my program i need to write :
    int[] vectorFy = new int[] { 5, 6, 8, 9 };
    myGenDDMatrix.InitialExpression = vectorFy;
    i knew that the RsGenericDataDeclaration defines a string name and another string datatype , but i can not guess what is the '' vectorFy '' , i can only write it like the above scenario.
    regards,

  • Ah, but you can !

    The beauty of Rapid is that you can do pretty much anything you want, you just have to figure out how ;)

    You can replicate the already existing rapid instructions exactly as they came out of the factory,
    the challenge is the different tasks/layers (main, built in, background and "raw"). The old(er) manuals
    documented this much better than the curent ones.

    The trick in this case is that you need to replicate all the Force Control instructions (no small feat in itself)
    have them call on a fake Move/force instruction and couple that with a path offset (correction vectors)
    task that applies the Mathlab data into a path offset rather than an actual Force Control input.

    If I remember it correctly you should have the main instruction (MoveL or whatever you want) in the main task,
    that in itself would reference an instruction with a diffrernt name "MoveLLL" that's loaded as a built in module/routine
    and the built in MoveLLL then calls MoveL again..... Because of the structure/layers in rapid, the front layer
    calls your own home made Move L, that calls the custom MoveLLL and that calls the real (system / factory) Move L

    The biggest challenge by doing this is error handling since the system will rely on your error handling and not the normal
    one built in from ABB, but it can be very powerful for simulations and when you need to do "conversions" on site.

    Here's a copy of the ArcL routine I used for a certain customer to convert their non-workobject (wobj0) programs
    to using the correct wobj in the controller, not using RobotStudio.

    system module loaded in the main task (note the ArcL L reference) :

    PROC ArcL(
    \switch On
    |switch Off,
    robtarget ToPoint,
    speeddata Speed
    \num T,
    PERS seamdata Seam,
    PERS welddata Weld,
    PERS weavedata Weave,
    zonedata Zone
    \num Z,
    PERS tooldata Tool
    \PERS wobjdata Wobj
    \PERS trackdata Track
    \string seamname)

    smTMP:=Seam;
    smTMP.ign_sched:=Weld.weld_sched;
    ArcLL\On?On\Off?Off,ToPoint,Speed\T?T,smTMP,Weld,Weave,Zone\Z?Z,Tool\Wobj?Wobj\Track?Track\seamname?seamname;
    ERROR
    RAISE;
    ENDPROC
    ENDMODULE

    Custom Arc L L routine referenceing back to the stock ArcL intruction.


    -File "HOME:/system/ArciFix_BU.sys" -Storage "BUILDIN"

    MODULE ArciFix_BU (SYSMODULE)

    PROC ArcLL(
    \switch On
    |switch Off,
    robtarget ToPoint,
    speeddata Speed
    \num T,
    PERS seamdata Seam,
    PERS welddata Weld,
    PERS weavedata Weave,
    zonedata Zone,
    \num Z,
    PERS tooldata Tool
    \PERS wobjdata Wobj
    \PERS trackdata Track
    \string seamname)

    ArcL\On?On\Off?Off,ToPoint,Speed\T?T,Seam,Weld,Weave,zone\Z?Z,Tool\Wobj?Wobj\Track?track\SeamName?Seamname;



    ENDPROC

    ENDMODULE
    .

    PROC MoveL(
    \switch Conc,
    PERS robtarget ToPoint,
    speeddata Speed
    \num V
    \num T,
    zonedata Zone
    \num Z
    \stoppointdata InPos,
    PERS tooldata Tool
    \PERS wobjdata Wobj
    \switch Corr)

    IF NOT Present(Wobj) THEN
    tempWobj:=wobj0;
    ELSE
    tempWobj:=Wobj;
    ENDIF
    ToPoint:=Translate(ToPoint,tempWobj,Tool);
    ENDPROC

  • Hello 
    Thank you for your reply, can you help me to get  '' The old(er) manuals
    documented this much better than the curent ones.''
    i am trying to apply what you did.
    thanks