# Mitsubishi Robot Programming

• Hi

I am new in Mitsubishi Robot programming and need some help. I use at present RT TOOL BOX 3. I want to rotate the joint 6 with "for loop" 10 times(for an example 360/10=36deg each time). How can I rotate the Joint 6 with "for loop"

Thank you.

• hello, you can try something like this

For M1=1 To 10

Jpositon = J_curr

Jposition.6=J_curr+360 'not sure here how joints are adressed

mov Jposition

Next M1

• Hi.

Thank you for your help. I have tried that but it shows the syntex error. I send also a pic of that. The error comes for that line "Jposition.6=J_curr+360".

## Images

• hi, i was writting it from memory, now with rt tool box it looks like this

For M1=1 To 10

Jpositon = J_curr

Jposition.J6=J_curr.J6+360

mov Jposition

Next M1

• Thank you dear.

It helps me lot.

It is working now. Just another question. When I add 30 (or 36 just or examin the program) with Joint 6 it goes out of range. Therefore I set J6 in -360 (current positioning value) and in program add 1, then it rotet joint 6 about 22 deg. Is this becasue that the numerical number,which I add ( Jposition.J6=J_curr.J6+1) is act like mm not as deg.

## Images

• its in RADs.... at least on my RT toolbox... so +1 mean +57degs aprox

EDIT: aslo somewhere in paramaters, therre is moition range for axis, i think 6th axis can be set as you want(ie -3600 to +3600), but not sure now

• Hi.

Thank you dear. You are absolutely right. Joints move in RAD. I got it and thanks a lot for your very helpful contribution. .

• HI

I have one question. Is it possible to write a programm that roboter goes up and joint 6 rotet 1 time then it goes down and comes up same height and then rotet joint 6 again 1 time. this process run may be 10 times. I try with for loop with previous code, but problem is every time joint 6 comes to its initial position and then rotet. I understand the cause behind that. If I try to save the position Upward or downward of the roboter with P_Curr it saves only either upwards or downwards position and joint 6 comes back to its initial position.

Or I need to teach the robot 10 times seperately.

## Images

• you probably should start by doing it in same kind of coords, using only Jxxx or Pxxx

Jxxx is coord saved in joints angles

Pxxx is coord saved in XYZABC

it could be hard for controler to calculate trajectory from Pxxx to Jxxx with big diferences and short distance between

• HI

I tried to write the code in this way ...but not working actually. Behaves very streange

## Images

• HI

I have fixed the problem, just littel bit problem inside. every time it comes more down to actual position. Do you have any idea how I can resolve this problem

## Images

• HI

I have fixed the problem, just littel bit problem inside. every time it comes more down to actual position. Do you have any idea how I can resolve this problem

you are changing Z coord, it has to come lower each cycle, if you want to it go down and back you have to change Z back somewhere in cycle

• Hello!

You can try something like this:

Tool 0

*loop

JCurrPos = J_Curr 'Starting Position

JCurrPos.J6 = Rad(-36) 'Set J6 axis to -36 degrees

Mov JCurrPos 'Rotate J6 aaxis to -36 degrees

'Initialize for loop

M1=1

MEnd = 10

For M1=1 to MEnd

JOffset = SetJnt(0,0,0,0,0,M1*MRotAngle) ' Set offset

Mov JCurrPos + JOffset 'Rotate 6 axis

Dly 1 'Dly for better visualization

Next M1

GoTo *loop

But I don't know if it is the easiest way.

Let me know if you find better one