# Help with Kuka Kr120 r2700 EA baseframe for milling

• Hello Robot professionals,

Please be nice to me as I am in my first year of robotics programming for a Kuka Milling cell. I have figured out the inputs and outputs for my robot, and they are running perfectly with my spindle, I am trying to figure out when I define a planar surface using the 3 point method, my robot does not follow this. Let me paint a picture, I need to mill out a rectangle 0.5" deep, but the robot cuts this in an uneven angle. If I have an imaginary "box" in space, how do I get my Kuka to mill exactly perpendicular to that surface.

I was thrown into this position.

Mike

• ## HawkMEJul 20th 2023

• Well lets start with the basics. which control are you using. preferably with the software version. This is clearly stated in the topic "Read first".

Have you correctly calibrated your tool?

If you have then you can continue with base calibration. Measuring a base works best on a big surface. you start with x,y zero. then move to a positive point on the x-axis (as far as you can from zero). and last move to a positive point in the X/y plane. Again the further from zero the better.

to check if tool and base are calibrated correctly, you can manually select them and then jog over the surface. Your tool TCP (tool center point) should move parallel to the surface when jogging in x and y.

In your program check if you have the right tool and base selected.

Every problem has a solution, that isn't the problem. The problem is the solution.

• Okay, I have followed the instructions correctly then. When I have that baseframe selected, the tcp of the robot perfectly follows the path I require.

So when I start a milling program, I just have to make sure this base is selected? for some reason when I run my program the base frame changes to a ?

Maybe I need to write something into my program to tell the robot to load that baseframe. Is this correct?

Thank you for your response, I look forward to hearing from you!

• no... you do not "select base" yourself. your program needs to select and use that base.

in fact that is not enough. you also need to have program select correct tool as well.

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

• Depends on how you're writing your program. We kind of need to see a sample.

On KUKAbots, there are two different ways to write KRL code. "Raw" KRL code, where you type out entire commands, and "Inline Forms" (ILFs), where you create commands (mostly motions and other simple commands) using the menus on the pendant.

A motion programmed using ILFs "bundles" a command to set the active Base. That command is retentive -- that is, once a command to set the active Base has been executed, that Base stays active until another Base is activated.

This all works fine when using "raw" KRL or using ILFs. But it can get tricky if you start mixing both types of code in the same program.

• Here is an example of a milling project where I had to recess back a panel in a large piece of granite. I did the 3 point method and the TCP ran perfectly parallel to the surface, but I am not sure how to incorporate my tool tcp and my base frame in the code. I am using a Professional version of RoboDK I purchased.

&ACCESS RVP
&REL 1
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
DEF RECESSED_PAN_1_T ( )

; GLOBAL INTERRUPT DECL 3 WHEN \$STOPMESS==TRUE DO IR_STOPM ( )
; INTERRUPT ON 3

;FOLD Initialise and set default speed
BAS (#INITMOV,0)
BAS (#VEL_PTP,100)
BAS (#ACC_PTP,20)
\$VEL.CP=0.2
BAS (#TOOL,0)
BAS (#BASE,0)
;ENDFOLD

;;FOLD STARTPOS
;\$BWDSTART = FALSE
;PDAT_ACT = PDEFAULT
;BAS(#PTP_DAT)
;FDAT_ACT = {TOOL_NO 0,BASE_NO 0,IPO_FRAME #BASE}
;BAS(#FRAMES)
;;ENDFOLD

;FOLD ---- Quickly skip BCO ----
; PTP \$AXIS_ACT
;ENDFOLD

;FOLD ---- GO HOME ----
; PTP {A1 0.000, A2 -90.000, A3 90.000, A4 0.000, A5 0.000, A6 0.000, E1 0, E2 0, E3 0, E4 0, E5 0, E6 0}
;ENDFOLD

; Program generated by RoboDK v5.5.3 for KUKA KR 120 R2700 HA on 05/07/2023 16:44:03
; Using nominal kinematics.
\$APO.CPTP = 1.000
\$APO.CDIS = 1.000
Wait for StrClear(\$LOOP_MSG[])
\$LOOP_CONT = TRUE

Wait for StrClear(\$LOOP_MSG[])
\$LOOP_CONT = TRUE

SPINDLE_FWD(4400)
\$VEL.CP = 1.00000
; ---- Setting reference (Base) ----
; BASE_DATA[2] = {FRAME: X -1.905,Y 1918.810,Z 835.684,A -0.000,B -10.001,C -0.001}
\$BASE = {FRAME: X -1.905,Y 1918.810,Z 835.684,A -0.000,B -10.001,C -0.001}
; \$BASE = BASE_DATA[2]
; --------------------------
; ---- Setting tool (TCP) ----
\$TOOL = {FRAME: X -24.372,Y 0.610,Z 511.476,A 180.000,B -30.000,C 0.000}
; --------------------------
; Show TOOL TCP
PTP {A1 -95.31830,A2 -95.12420,A3 105.88400,A4 14.69880,A5 50.60840,A6 -9.09005,E1 0.00000} C_PTP
LIN {X -3.108,Y -122.042,Z 15.000,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
\$VEL.CP = 1.00000
LIN {X -3.108,Y -122.042,Z 5.000,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
\$VEL.CP = 0.00556
LIN {X -2.979,Y -122.006,Z 3.974,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -2.603,Y -121.896,Z 3.016,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -2.005,Y -121.714,Z 2.192,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -1.229,Y -121.463,Z 1.555,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.329,Y -121.153,Z 1.149,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X 0.631,Y -120.797,Z 1.041,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
; Splitting circular movement in 133 (instruction 41:MoveC 31)
LIN {X 0.604,Y -120.727,Z 2.038,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X 0.568,Y -120.635,Z 3.033,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X 0.525,Y -120.522,Z 4.025,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X 0.474,Y -120.388,Z 5.014,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X 0.414,Y -120.233,Z 6.000,A 90.000,B 0.000,C 180.000,E1 0.00000} C_DIS
LIN {X 0.347,Y -120.057,Z 6.981,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X 0.271,Y -119.860,Z 7.958,A 90.000,B 0.000,C 180.000,E1 0.00000} C_DIS
LIN {X 0.187,Y -119.643,Z 8.930,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X 0.096,Y -119.404,Z 9.897,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.003,Y -119.146,Z 10.857,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.111,Y -118.866,Z 11.811,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.226,Y -118.567,Z 12.758,A 90.000,B 0.000,C 180.000,E1 0.00000} C_DIS
LIN {X -0.348,Y -118.247,Z 13.697,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.479,Y -117.908,Z 14.628,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.616,Y -117.549,Z 15.550,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.762,Y -117.170,Z 16.464,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -0.915,Y -116.771,Z 17.368,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -1.075,Y -116.354,Z 18.262,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -1.242,Y -115.918,Z 19.146,A 90.000,B 0.000,C 180.000,E1 0.00000} C_DIS
LIN {X -1.417,Y -115.463,Z 20.018,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -1.599,Y -114.989,Z 20.880,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS
LIN {X -1.788,Y -114.498,Z 21.729,A 90.000,B 0.000,C 180.000,E1 0.00000} C_DIS
LIN {X -1.983,Y -113.988,Z 22.567,A 90.000,B 0.000,C -180.000,E1 0.00000} C_DIS

• This is just the first part of the program, it goes on for another 2000+ lines with a spindle and water stop.

• at the begin of your program you have

BAS (#TOOL,0)
BAS (#BASE,0)

they set nullframe as tool and base. so robot is moving using WORLD instead of base and using FLANGE instead of tool. no wonder you are seeing things as they are.

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

• I will redo this this from scratch again using your advise. I really appreciate you guys chiming in on a beginners issues.

Back to the drawing board for me.

I will post again soon with an update. any other tips would be appreciated in the mean time.

• actually i see the base is later also assigned using, but every said still applies - to use Cartesian coordinate system you need correctly measured tool and base.

\$BASE = {FRAME: X -1.905,Y 1918.810,Z 835.684,A -0.000,B -10.001,C -0.001}

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

• Seems that you use cad/cam tool. There you have configured a base and tool, which is set in the lines \$tool=.. and \$base=..

There you have to change the values to the values you measured on the real robot. Or you can change the lines to, let's say bas(#tool, 1) and bas(#base, 2) if you have calibrated tool no 1 and base no 2 on your robot.

• It would have helped if you had mentioned this program was generated by RoboDK.

Anyway, these lines are where the program sets the active TCP and Base. In your RoboDK simulation, you must have a base/reference frame and a tool frame active, and RDK is simply transcribing those values into the program.

If you then hand-taught a TCP and/or Base on the real robot, you need a way to bring the real robot and RDK into alignment -- either you need to copy the real robot's TCP and Base XYZABC values into the RDK configuration, or you need to change the \$TOOL= and \$BASE= lines in the program to use the hand-taught Tool and Base. For example, if you hand-taught Tool 5 and Base 7, you would replace the RDK output with:

\$TOOL=TOOL_DATA[5]

\$BASE=BASE_DATA[7]

Because when you teach a Tool or Base on the pendant through the menu system, the XYZABC values are saved into the TOOL_DATA and BASE_DATA arrays.

• This is really great information for me. Thank you again for all of these tips, I know all of you have been at the point where the robot does one thing and it absolutely does something else! Great tips on this thread.

• This is absolutely the case! I was pointing the robot to the start point by connecting to the robot and copying these values. The job ran perfectly but the job was not following the correct base frame. So the workpiece was not completely level with the table, this then made the cut not perfectly flat. We hand finished it with a grinder. THANKY YOU! I am new to RoboDK and I have talked with Albert Nubiola MANY times, I just don't was to keep bugging the poor guy, he is not here to teach everyone, he is running a company. I LOVE ROBODK though. Best purchase of software we have made so far. Worth EVERY PENNY.