RobotStudio event

Trajectory in time-domain

Hi,

I want to assign as joint trajectory a trigonometric function in time domain (sine or cosine). How can I do it in RAPID?

 

Thanks

bye!!

Comments

  • Hi,
     

    Here is an example for the IRB140. You can enable "TCP Trace" to view the trajetory.

     

    MODULE Module1<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />

               CONST robtarget pHome:=[[506.291651245987,1.29490239543512E-12,679.5],[0.499999999999998,0,0.866025403784439,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

               CONST robtarget pCenter:=[[554.479956268792,1.73273580794849E-12,533.699988807741],[4.22133561439608E-09,0,1,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

               CONST robtarget pStart:=[[554.479955451763,-200.00000706809,533.699989666025],[1.44838108079029E-08,7.56676097447419E-17,1,-5.22428873538805E-09],[-1,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

    PROC Path_10()

               Reset doTrace;

               MoveJ pHome,v1000,z100,tool0WObj:=wobj0;

               MoveJ pStart,v1000,fine,tool0WObj:=wobj0;

               SetDO doTrace,1;

               MoveSin pStart,v1000,fine,tool0,wb:=wobj0;

               Reset doTrace;

               MoveJ pHome,v1000,z100,tool0WObj:=wobj0;  

    ENDPROC

     

      !*********************************************************

      ! Procedure:  MoveSin

      ! Description:

      !   The robot moves along a sine wave

      !

      !*********************************************************

      PROC MoveSin(

        robtarget StPoint,

        speeddata sp,

        zonedata zn,

        PERS tooldata tl

        PERS wobjdata wb)

     

               VAR robtarget pTmp;

               CONST num n:=100; !steps

               CONST num h:=360/n;

               VAR num offset_x:=0;

               VAR num offset_y:=0; 

               VAR num offset_z:=0;

    !

               CONST num amplitude := 100; !mm

               CONST num wavelength := 400; !mm  

              

               VAR clock clock2;

               VAR num t:=0;

               VAR num t0:=0;

               VAR num t_t0:=0;

               VAR num alpha:=0;

              

              

               ClkReset clock2;

               ClkStart clock2;

               t0 := ClkRead(clock2);

               alpha := 360/6; ! empirical constant

               ConfL Off;

               FOR i FROM 0 TO n DO

                          t := ClkRead(clock2);

                          t_t0 := t - t0;

                          TPWrite "t - t0 = ",Num:=t_t0;

                          TPWrite "(t - t0) * alpha = ",Num:=t_t0*alpha;

                          offset_x := amplitude * Sin(t_t0 * alpha);

                          offset_y := wavelength * i / n;

                          pTmp:=Offs(StPoint,offset_x,offset_y,0);

                          MoveL pTmp,sp,zn,tl,Wobj:=wb;

                          WaitTime 0.01;

                          !!!!!!!    

               ENDFOR

               MoveL pTmp,sp,fine,tl,Wobj:=wb; !fine poitn

      ENDPROC

    PROC main()

               Path_10;

    ENDPROC

     

    ENDMODULE

    Henrik Berlin
    ABB
  • Hi,
    Thank you for your reply.

    I have another question:

    the speed of my trajectory is also a trigonometric function in time domain, it's possible to implementate that in RAPID?
  • Hi,
     

    I haven't tried it but I suppose you can write a FUNC that returns a speedata that you use in the move instruction. Something like

     

    MoveL pTarget1,myspeed(time),fine,tool1,Wobj:=wobj1;

     

    where myspeed is defined like

     

    FUNC speeddata myspeed(num time)

        RETURN v20; ! replace with your speedata calculation

    ENDFUNC

     

    Check the RAPID manuals that are included in RS for reference.

     

     

     

     
    Henrik Berlin
    ABB
  • Hi,

    I tried to give a sine trajectory to the first joint, but I found a problem: the joint stops at every reference point and then restart. So the movement is not accurate, but is jerkily.
    Does it exist a function to do an accurate movement also at high speeds?

     

    Thanks

    Bye.
  • My example above used fine as zonedata. It is defined as a stop point which means that the motion stops for each instruction and then restarts just as you mentioned. You can try to use z0 instead of fine. The zonedata z0 is defined as a fly-by point. Please read about the zonedata datatype in the RAPID reference manual. You can either use any of the pre-defined data or define your own.
    Henrik Berlin
    ABB
  • Hi,
    has it sense to use RRI to give a reference joint position as an application data to the controller??. I use this referential position in a MoveabsJ instruction like this:

    MoveabsJ([[joint_reference,0,0,0,0,0] [9E9,9E9,9E9,9E9,9E9,9E9,]],V1000T:=0.004,z0,tool0);

    in this case i want that the instruction is executed in 0.004 s like the resolution of the data trasmission. But actually the Robot has longer execution time (e.g. 0.05s). How can i reduce this time?

    the rapid program that i use is the following:


    MODULE RRI_MAIN
        PROC main()
            SiConnect TestDevice;

            SiGetCyclic TestDevice, ReplyMessage, SampleRate;
            SiSetCyclic TestDevice, RobotMessage, SampleRate;
           
            WHILE TRUE DO

                MoveAbsJ [[ReplyMessage.App.B1,0,0,0,0,0 [9E9,9E9,9E9,9E9,9E9,9E9]],vmaxT:=0.004,z0,tool0WObj:=wobj0;
            ENDWHILE
           
            SiClose TestDevice;
        ENDPROC
       
    ENDMODULE

    ReplyMessage.App.B1 is the variable which changes every 0.004s.

  • Moved to RobotWare Forum
    Henrik Berlin
    ABB