RobotStudio event

How To MoveAbsJ with variable in the jointtarget

Greetings

I am a 3rd year mechatroincs and robotics student in leeds, where I am attempting to control some ABB robotic arms using an Xbox Kinect for my Individual Project.

My first port of call was to learn how to use RobotStudio, then learn how to use Visual Studio (for the Kinect) and then finally Link them up using the PC SDK.

I am having trouble self teaching myself RobotStudio, I have learnt how to teach targets and now moved onto RAPID programming. I have been using MoveAbsJ successfully to manipulate individual joints by a predetermined angle.

The trouble I have is when I try to move the joint by a variable angle (or an angle which is updated every iteration of the loop, as I envision this is how the Kinect will work as it feeds data to RbotStudio).

Here are my specific snippets of code:

VAR num X:=6; !testing how variables can be used for varying angle change

VAR num Y;

VAR num Z;

VAR jointtarget rotJ1_X:=[[Y,0,0,0,0,0],[0, 9E9, 9E9, 9E9, 9E9, 9E9]];

PROC Path_30()! tests looping and variable joint movement

 

MoveAbsJ calib_pos,v1000\T:=3,z100,MyTool\WObj:=wobj0;

 

WHILE(X>0)DO

Z:=Pow(-1,X); !set up variable to change direction dependant on iteration

Y:=Z*75; !move desired angle

MoveAbsJ rotJ1_X, v600,z50,MyTool\WObj:=wobj0;

X:=X-1; ! decrement X

ENDWHILE

MoveAbsJ calib_pos,v1000\T:=3,z100,MyTool\WObj:=wobj0;

ENDPROC The only error I get is "Expression Y is not a constant expression", Y as you can see from the code alternates between 75 and -75 and it is set as a variable, rotJ1_X is also declared a variable. It could be a number of things;  my naivity at basic RAPID programming, jointtarget can never be a variable. The only things I have to teach myself are the brief online tutorials and the reference manuals. Could somebody please help me solve this issue?  Secondly if anybody has any experience marrying the Kinect and RobotStudio/ABB arms any insight would be greatly appreciated as I may be going down the wrong route or wasting time. Kind regards- Mechatronics Student (I cant get rid of the green)

Comments

  • hello,

    you must declare your jointtarget with only values : VAR jointtarget rotJ1_X:=[[0,0,0,0,0,0],[0, 9E9, 9E9, 9E9, 9E9, 9E9]];

    and in your program put the value of Y in the value of axis 1 of the jointtarget : rotJ1_X.robax.rax_1:=Y;

    you must redefine a section of your jointtarget each time you want to change it.

    BR

    Peter

  • thank you peter, that has solved my problem. Do you or anybody know how to mov joints bby relative motion rather than by absolute?

    As in move a joint by +25 degrees from its current position rather than from the 0 position as in MoveAbsJ.

  • Try the RAPID function CJointT that reads the current joint values. Add the offset you want and use as argument for MoveAbsJ. See the manual RAPID Instructions, Functions and Data types that is available in RobotStudio.

    /Henrik

     

     

    Henrik Berlin
    ABB
  • it is oki to do like this...

           VAR num nAxle1;
            VAR num nAxle2;
            VAR num nAxle3;
            VAR num nAxle4;
            VAR num nAxle5;
            VAR num nAxle6;


                nAxle1:=10;
                nAxle2:=20;
                nAxle3:=25;
                nAxle4:=50;
                nAxle5:=80;
                nAxle6:=90;

                MoveAbsJ [[nAxle1,-50,20,nAxle4,nAxle5,nAxle6],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],Speed\T ?T,Zone,Tool\WObj ?WObj;