Kuka workvisual sample code

> "I am in the possession of a Kuka KR 30 KC 2"

that is no reason to start conversation in downloads section.

please make sure to post in correct forum section.

> "And I am a complete novice in programming a Kuka"

does that mean you have programming experience on other platforms?

do you understand life and scope of variables, strucures, passing parameters by value and by reference etc?

> "I am looking for a sample program written in KRL to determine how to build a program in KRL."

forum is full of sample programs of every kind.

> "The program should do a sort of contour milling,"

> "where the tool is under an angel of 45 degrees or less."

> "I searched the internet for such a program, with no avail."

of course not, you are looking for a very specific example.

try broadening yours earch then adapt what you find to your needs (45deg or whatever).

you need to learn to walk before you can run or ride unicycle while playing bag pipe

there are no shortcuts.

> "There isn't much to find to learn to program in KRL"

that is just not true. opportunities to learn are all around, one just need to be more atentive.

that includes where to post, how to ask for help, getting documentation, learning basics

such as mesuring tool and base, programming motions using inline form instructions and

moving up step by step. if you want immediate results there is an option:

get professional to do it for you.

check pinned topic READ FIRST and download section (you were already there but did not see manuals)

1) read pinned topic: READ FIRST.

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

Reactions Received 28 Trophies 5 Posts 427

It also helps to be specific on what it stopping you from writing KRL. In the expert programming manual there are a lot of examples of how a basic program is structured. So start there.

But i am in a good mood so i added one of my basic milling programs.

 DECL FRAME box  $APO.CPTP = 15  $APO.CVEL = 50  $APO.CDIS = 15  ;Tool 3 pakken zaag 60x1.5mm  toolwissel(3,15)  frees(12000)  ;FOLD Overgang  PTP C_PTP  PTP C_PTP  PTP ;ENDFOLD  ;FOLD Snede 2 zagen doos  box = $TOOL=TOOL_DATA[3]  $BASE= box  PTP $apo.cdis = 85  $vel.cp = 0.2  LIN C_VEL  LIN C_DIS  LIN C_DIS  LIN C_DIS  LIN C_DIS  LIN C_VEL  $vel.cp = 0.3  LIN C_VEL  LIN C_VEL  LIN C_VEL  $vel.cp = 0.2  LIN C_VEL  LIN C_VEL  LIN C_DIS  LIN C_DIS  LIN C_DIS  LIN C_DIS  LIN C_VEL  $vel.CP = 0.3  ;ENDFOLD  LIN C_VEL  LIN C_VEL  LIN C_VEL  LIN C_VEL  $apo.cdis = 65  $vel.cp = 0.2  LIN C_VEL  LIN C_DIS  LIN C_DIS  LIN C_DIS  LIN C_DIS  LIN C_VEL  $vel.cp = 0.5  frees(0)  LIN C_VEL  ;FOLD overgang  PTP C_PTP  PTP C_PTP  PTP C_PTP  ;ENDFOLD  toolwissel(15,3)  END
Display More

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

Sorry about posting in the wrong section.

For now I take your option in consideration, "get professional to do it for you"

I will try to find some one.

Is there somebody at this forum, willing to do it.

Many thanks, for your milling program.

It will be helpfull.

Reactions Received 1,115 Trophies 11 Posts 12,317

in that case you probably want someone local. Where are you located?

1) read pinned topic: READ FIRST.

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

Location: Raamsdonksveer Netherlands

Reactions Received 28 Trophies 5 Posts 427

O that is close, i am from dongen (originally geertruidenberg )

I am willing to help, but i dont have the time to get onsite and do programming

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

I am living in Hank.

I bought that robot to keep me of the streets (77). That robot is a Kuka KR 30 KC2 build 2009. But I learned a hard lesson programming is much harder than I could imaging.

There is not much to find on the internet to learn KRL. No PDF with samples and my English isn’t that well that I could understand everything what is in the Expert programming.

Reactions Received 28 Trophies 5 Posts 427

Well this will definitely keep you of the streets, because the most important thing you need is time.

My advice is start simple cut a square or round hole or something like that. and build up from there. the sample program i gave is for cutting a square box down to the right size, so this can give you a head start.

By the way, what do you want to mill? and for what purpose?

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

Do you know somebody in the neighborhood who is willing to test my robot.

This with a program build in KRL.

Otherwise I have to go to KUKA Belgium, to ask if they are willing to bring this robot to her originally state.

It's also possible to mail me.

Many thanks in advance.

Reactions Received 28 Trophies 5 Posts 427

I am sorry i don't. Whenever i get stuck somewhere i use this forum or go to kuka belgium myself. That can be a bit expensive but in my case it cost more money to have a not working robot.

But if your robot is functional there is no need to get kuka involved (yet). Although i will always recommend proper kuka training i can understand that if you want to use this robot as a hobby more than a actual job that training might be a bit expensive.

The basics you need to learn/do:

When you can do or have done the steps above you can start thinking about programming krl directly

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

Thanks for answering.

Al these steps I have done, I have no problems.

The problem I focused yet is if I change a tool from vertical to a 30° I run in the next error.

e5 software end stop reached.

Tryed everything to avoid that error, but didn't succeed.

Reactions Received 28 Trophies 5 Posts 427

Can you post your program? then it would be easier to see where it goes wrong.

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

Sorry for the big image.

Must be smaller one.

I wrote this piece of code and that works for the big part.

 DEF Magazijn_Laden( )  INT A  ;INT X,Y,Z  EXT BAS (BAS_COMMAND :IN,REAL :IN )  DECL AXIS HOME1  ;REAL X,Y,Z  ;FOLD INI  BAS (#INITMOV,0 )  ;ENDFOLD (INI)  A=0  ;FOLD STARTPOS  $BWDSTART = FALSE  PDAT_ACT = PDEFAULT  BAS(#PTP_DAT)  FDAT_ACT = BAS(#FRAMES)  ;ENDFOLD  ;FOLD SET DEFAULT SPEED  $VEL.CP=0.2  BAS(#VEL_PTP,100)  BAS(#TOOL,0)  BAS(#BASE,0)  ;ENDFOLD  $ADVANCE = 1 ;Was 5  PTP $AXIS_ACT ; skip BCO quickly  HOME1= ;$BASE = ;$TOOL = 7  $BASE =BASE_DATA[4] ; Wrk  $TOOL =TOOL_DATA[10] ;Balpen_001  LOOP  PTP HOME1  $VEL.CP =1.0000  PTP $OUT[27]=TRUE  WAIT SEC 1  $OUT[27]=FALSE  PTP $OUT[28]=TRUE  WAIT SEC 1  $OUT[28]=FALSE  PTP ;300  PTP PTP PTP $VEL.CP = 0.05  PTP CIRC , CIRC , $VEL.CP = 1.000  PTP PTP PTP $VEL.CP = 0.05  PTP LIN CIRC , LIN LIN CIRC , LIN PTP $VEL.CP = 0.5  LIN LIN PTP PTP ;HALT  ;$TOOL = TOOL_DATA[8]  $BASE = BASE_DATA[X] ;Moet 30° worden   PTP ;PTP LIN ;Was 84  $OUT[28]=TRUE ;Gripper open  LIN WAIT SEC 0.5  $OUT[50]=FALSE ;Reset Cilinder in  $OUT[49]=FALSE ;Reset Cilinder out  PTP $OUT[50]=TRUE ;Cilinder In.  WAIT SEC 1  PTP $OUT[50]=FALSE ;Reset Cilinder in  WAIT SEC 1  PTP $OUT[27]=FALSE ;ResetGripper  $OUT[28]=FALSE ;Reset Gripper  WAIT SEC 1  PTP $OUT[28]=TRUE ;Gripper open.  $OUT[28]=FALSE ;Gripper Reset  WAIT SEC 1  PTP $OUT[49]=TRUE ;Cilinder uit  WAIT SEC 3  PTP $OUT[27]=TRUE ;Gripper dicht.  WAIT SEC 2  PTP $OUT[49]=FALSE ;Reset Cilinder uit  WAIT SEC 1  PTP $OUT[50]=TRUE ;Cilinder in.  WAIT SEC 1  PTP $OUT[50]=FALSE ;Reset Cilinder in  LIN LIN LIN LIN ;LIN_REL $OUT[27]=FALSE ;Reset Gripper Dicht  WAIT SEC 1  $OUT[28]=TRUE ;Gripper open  WAIT SEC 1  $OUT[28]=FALSE ;Reset Gripper open  LIN_REL LIN PTP $BASE = BASE_DATA[X] ;$TOOL =TOOL_DATA[9] Moet 45° worden.  Magazijn_Slijpen  $TOOL =TOOL_DATA[10] ;Balpen_001  $VEL.CP = 1  A=A+1  IF A ==3 THEN  EXIT  ENDIF  ENDLOOP  PTP HOME1  END 
Display More

The program I send there are a few minor faults in it .

If you need a program without faults let me know.

Reactions Received 1,115 Trophies 11 Posts 12,317

you need to initialize X so that base assignment in line 167 can work

1) read pinned topic: READ FIRST.

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

Panic mode, Thanks for answering,

My problem now is. To change the tool from vertical into 30° end the next time into 45° and back to Vertikal at last.

Reactions Received 1,115 Trophies 11 Posts 12,317

i see that you were trying to change base. not sure why change base if wanted change is related to tool.

well, if you need to change tool, then. change tool. either physically different tool or alter tool data for exising tool so robot would reposition or reorient it..

 DECL INT tool_number  ; if tools are not defined, compute them using whatever suitable offsets you need  ; maybe rotate about center of flange:  tool_data[11]=:tool_data[10]  tool_data[12]=:tool_data[10]  tool_data[13]=:tool_data[10]  tool_data[14]=:tool_data[10]  tool_data[15]=tool_data[10]  ; or rotate about TCP (alternative to previous calculation):  tool_data[11]=tool_data[10]: tool_data[12]=tool_data[10]: tool_data[13]=tool_data[10]: tool_data[14]=tool_data[10]: tool_data[15]=tool_data[10]  FOR tool number = 10 to 15 ; do some motions, then change tool and repeat   $BASE = base_data[4]   $TOOL = tool_data[tool_number]   LIN xP1   LIN xP2   LIN xP3   LIN xP4  ENDFOR
Display More

1) read pinned topic: READ FIRST.

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