# Finding 8 different solutions of KUKA robot in KRL programming

• Hello,

Robot: KR6R700-2

Controller: KRC5Microcontroller

KSS: KSS 8.7

I am trying to find a function in KRL, which would help me fetch all the 8 different solutions for a given (xyzabc). Does anyone have any idea?

• Assuming you are searching for axis solutions to a given Cartesian position, Fubini is correct. You will need to call INVERSE several times, sending it a different starting pose (S&T values, mainly), once for each unique solution.

Keep in mind, there will likely not be 8 axis pose solutions for every Cartesian position. Depending on your active \$TOOL and \$BASE values, some Cartesian positions may only have a subset of valid axis poses.

• I am trying to find a function in KRL, which would help me fetch all the 8 different solutions for a given (xyzabc). Does anyone have any idea?

What do you want to achieve?

INVERSE function. Just use forum search with this keyword.

The INVERSE function is one way to get one result

Problem:

your 8 solutions are actually "mechanical solutions" (you can see them by checking the the mechanical position of the robot)

Actually you may have up to 48 solutions (you may or may not reach all of them (your question was not very specific))

How do I get to 48:

A1, A4 and A6 may rotate more than 180 degrees in plus or minus direction

Do you want to get all of them? Or just the one closest to the previous position?

INVERSE will give you only valid values or error message!

I am not working for them!

Using RoboDK with your robot you will be able to find all valid settings (and they could be more than eight)

• You should be able to do that with the free version and just a few lines of code using the API.

Look at this section of our documentation:

Code
``SolveIK(pose, joints_approx=None, tool=None, reference=None)``

You should use this one to get all the results at once:

Code
``SolveIK_All(pose, tool=None, reference=None)``

Should give you what you are looking for.

Jeremy

RoboDK - Simulation and Offline programming software for industrial and collaborative robots.

Visit us at RoboDK.com
Take a look at our tutorial videos on our YouTube channel.

• Hey, i tried this, but i am the robot model i am looking for (KR6-R7002) is not available.

I get 8 valid solutions

Line

1: flange frame

2: seleted solution

Here all the calculated possibilities

• ... i am the robot model looking for (KR6...)

you are, eh? fascinating...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

• Turn:

if axis value < 0.0 then turn = 1 otherwise 0

Status:

You have 8 mechanical (or physical) solutions

Axis 1: Front/Rear

Axis 2: Elbow up/Elbow down

Axis 5: Flip/no Flip

So you have 2*2*2 = 8 solutions

Depending on the software limit switches you may get more solutions:

If the software limites switch for axis 4 is set to +/- 350 deg you will get

2*2*2*2 =16

If the software limites switch for axis 6 is set to +/- 350 deg you will get

2*2*2*2*2 = 32

• is there print statement in krl?

is there any simple 1 can print out all 32 solutions in an easy way ?

• Quote

is there print statement in krl?

Yes, see MessageLib.

Quote

should I keep turn as constant and vary status or

other way around?

Transformation only uses status. Turn is something applied after the transformation is done so start with Status.

Fubini

• There exists a KRL Library which can be very helpful.

Check krl libs for "g2_roblib.src"

Normally you would have Status:

A1: Front

A2 pointing up and A3 pointing down (positive value for A3)

A5: depending on the tool configuration you have