Kuka inline forms

  • Hello


    Can someone tell me what would be the equivalent in KRL of a kuka motion form?
    For example:


    ;FOLD PTP HOME Vel= 100 % DEFAULT;%{PE}%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT
    $BWDSTART = FALSE
    PDAT_ACT=PDEFAULT
    FDAT_ACT=FHOME
    BAS (#PTP_PARAMS,100 )
    $H_POS=XHOME
    PTP XHOME
    ;ENDFOLD


    How would I program this same motion (taking into acount all the parameters: base, tool, vel, acc...) without using the inline form?


    Btw, I would like to know how you program thees robots, are you using the in line forms or going through the all raw KRL?


    Thank you

  • First of which control and kss version are you using, this matters as stated in "read first".
    Second find the expert programming manual in the manuals section. this is for a KRC2 but a lot is still relevant for the newer KRC4.


    I never use inline forms, so i cant explain all the commands but if wanted to go to home if would program it like so:

    Code
    $TOOL = TOOL_DATA[1] ;selecting right tool
    $BASE = BASE_DATA[2] ;selecting right base
    
    
    PTP XHOME ;point to point movement to home

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

  • Don't forget load:

    Code
    $TOOL = TOOL_DATA[1] ;selecting right tool
    $LOAD = LOAD_DATA[1] ;selecting right tool
    $BASE = BASE_DATA[2] ;selecting right base
    PTP XHOME ;point to point movement to home


    but there is much more to it (speed, acceleration, approximation, interpolation mode etc.).
    This topic is covered in Kuka training "Programming2". To get there one must first go through "Progamming 1"

    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

    3) read 1 and 2

  • Oops i always forget load data. my robots all have the exact same spindle mounted and since the difference between a 6 or 10mm mill is minimal. i never change my load data. :uglyhammer2:

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

  • Briefly: in KRL, any line that begins with a ';' is treated as a comment and ignored by the compiler. However, the user interface treats ;FOLD and ;ENDFOLD as special cases that control how a line is displayed on the pendant, and in certain cases interact with the pendant menu system using inline folds.


    Everything that is between the ;FOLD and ;ENDFOLD lines is a simple KRL command. FDAT_ACT, PDAT_ACT, and LDAT_ACT are global variables that come as part of KRL, and the BAS subroutine uses those variables to set the system variables $TOOL, $BASE, $LOAD, $APO_DIST, etc. If you examine the .DAT file of your module, you will find various E6POS, PDAT, LDAT, FDAT variables that are created every time you create a new point, and are changed whenever you Touch Up a point (E6POS) or change the tool/base/approximation/etc parameters (xDATs).


    That KRL code you quoted basically sets PDAT_ACT, FDAT_ACT, and (for LIN motions) LDAT_ACT to match the variables in your module's DAT file, then BAS() loads them into the $ system variables that actually control the robot's motion.


    The folded code created by the inline forms is "bulky" -- a lot of that code isn't strictly necessary, if you write your own KRL, but in order to enable inline-form programming by people with only basic skills, the inline forms generate all that extra code for every motion command. But once you set $TOOL, $BASE, etc, they retain those settings indefinitely, until another command changes them (or someone does a Program Cancel or something similar, but that's a special case).


    If you were to write your own "raw" KRL, for a series of motions that would all have the same FDAT, PDAT, and LDAT parameters, you could simply set them once, at the top of your program, call BAS() once, then write a series of PTP and LIN commands. On the upside, this saves program memory (not a big issue, usually), but on the downside, you lose the ability to use the Touch Up button to update a point.

  • I also want to evolve out of the inline forms.

    Do I understand correctly that I can specify the velocity, acceleration of the axis, the tool and the base in the DAT file and by using the command BAS() in the SRC file I load these values to be used... as long as the DAT and SRC filenames match?


    Now if I want some of the position changes to be faster than others I need to change the velocity values in the middle of the program again.

    Do I just add these rows in the middle of my program?

    Code
    FOR I=1 TO 6
    $VEL_AXIS[I] = 100 ;all axis velocities to 100%
    ENDFOR

    And if I want to change the base in the middle of my program I add this row?

    Code
    $BASE=BASE_DATA[2]

    There could be a risk there when moving back to points prior to this BASE changing line as these will be completely offset from their original position. Even home in BASE_DATA[1] is completely different from home in BASE_DATA[2].



    EDIT2: Splines in raw KRL.

    SPLINE … ENDSPLINE defines a CP spline block. A CP spline block may contain SLIN, SCIRC and SPL segments

    PTP_SPLINE … ENDSPLINE defines a PTP spline block. A PTP spline block may contain: SPTP segments.


    I don't really understand what the difference is between them.


    Code
    PTP_SPLINE WITH $VEL={CP 1}
    SPTP P1
    SPTP P2
    SPTP P3
    SPTP P4
    ENDSPLINE

    Edited 6 times, last by Koppel ().

  • In KRL, once the system variables for controlling motion ($APO, $VEL, $TOOL, $BASE, etc) have been set, their value is not changed until another command to change their value is executed. The only exception to this is that many of them can be set to "invalid" under special circumstances, like a Program Cancel. This means that those variables must be set to some valid value before the first motion command in a program.


    But, it would be possible to set those parameters once at the beginning of a program, then run a thousand motion commands without every touching those variables again.


    The downside is that, if someone Block Selects past a line that is setting something critical, like $BASE or $TOOL, the next motion command could behave unpredictably. This is one reason that every inline-form programmed motion contains a full set of commands (using BAS, FDAT_ACT, LDAT_ACT, PDAT_ACT, etc) to fully re-define the motion parameters for every motion.


    Home position should not be affected by $TOOL or $BASE, since it is normally declared as an E6AXIS position, and runs as a set of axis angles, not Cartesian coordinates in space.

  • The following code is for old motion,for each motion you can parameterize it differently based on your requirements.

    The diference between PTP spline block and CP spline block is like the diference between PTP and CP motion,they are just 2 diferent motion types.

  • Hi,


    I can create a DAT file with all my points. Make the DAT file public and also make the points GLOBAL

    Code
    DEFDAT MyDatFile PUBLIC
    
    DECL GLOBAL E6POS MyPoint1={X 100, Y 100, Z 100, A 90, B 0, C 180}
    DECL GLOBAL E6POS MyPoint2={X 200, Y 100, Z 100, A 90, B 0, C 180}
    DECL GLOBAL E6POS MyPoint3={X 300, Y 100, Z 100, A 90, B 0, C 180}
    
    ENDDAT


    But when I want to use "MyPoint1" in a new SRC file... like:

    Code
    PTP MyPoint1

    the robot tells me that it has no idea what the variable "MyPoint1" is ... its an undeclared variable or something similar.


    What am I missing here? The points are global and the DAT file is public... Why is the robot not recognizing my points?

  • Add S,T and E1-E6 to your points.They have form as frames not as E6POS in your case.

    That's strongly advised, but not actually required -- KRL will accept them as-is. The issue would be that they lack the S&T disambiguation. The E values can be left out entirely unless the robot actually has external axes. But leaving out those values is not what's causing Koppel's current issue.


    Koppel: are you trying to use those points in an inline form, or a "raw" KRL command? Inline forms automatically add an "X" prefix to the name of any point. But for raw KRL, what you have should work. Are there any linking errors?

  • The following code is for old motion,for each motion you can parameterize it differently based on your requirements.

    Code
    FDAT_ACT.TOOL_NO=1                    ;; Set Tool Data
    FDAT_ACT.TOOL_NO=1                    ;; Set Base Data

    nice example, should include units since for example CP acceleration is not same using BAS and $ACC

    also there seem to be some typos mixing tool and base

    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

    3) read 1 and 2

  • Don't forget load:

    Code
    $TOOL = TOOL_DATA[1] ;selecting right tool
    $LOAD = LOAD_DATA[1] ;selecting right tool
    $BASE = BASE_DATA[2] ;selecting right base
    PTP XHOME ;point to point movement to home

    Dear panic mode,


    I Made a movements folder with the following parameters and i got error message.



    Moreover, i determined several other lines... example.:$VEL.CP,ACC.ORI1,APO.CDIS... and so on.

    When the robot arrived to $ORI_TYPE=#VAR i got the same error message.(I could reach this, cause i commented out the $LOAD_DATA line. I know i should not, i just wanted to test it)


    Can you tell meg please why i get these messages?

  • And you set the data when and where? More of your context please. Submit maybe? Not everything can be altered from inside the submit.


    The message tells you under your current situation/system state the variable is write protected.


    Fubini

  • Thank you for your quick reply.


    AS i think right if i choose $TOOL=TOOL_DATA[1], i should choose $LOAD=LOAD_DATA[1] and this is my load data[1] probably:


    I just write the valuse into the system from CAD and this will be LOAD_DATA[1] if i am right.


    Thanks for your help in advance!


    Mate

Advertising from our partners