Reading $VEL_ACT for 3D printing application

  • Hello,


    I have a kuka robot KR210-L150 Series 2000 (KRC 2) with a mounted extruder for 3D printing applications. Everything is connected trough a FieldBus so I can turn on and off the extruder directly in the KRL code.


    At the moment I started doing the first printing test at low velocity (100% T2 0.06 m/s) and everything seems fine but I am worried that to achieve high quality printing I need to be able to control the robot TCP speed during the printing process. I read in the forum that I should pair the robot velocity with the feed rate of the extruder. I know that I can call the $VEL_ACT to get the velocity but how do I connected it to the extruder feed rate? And do you think I can read the robot velocity while I am printing to see how much the velocity changes (example on an external screen?


    Thank you

  • The extruder's velocity needs to be controlled from the robot, and the robot should run in constant velocity mode - look up how LIN C_VEL works.
    In 3D printers the extruder is the fourth axis, driven synchronously from the motion controller. On the robot that may not be possible, since you don't have a hard realtime option, but just setting the extrusion speed and then moving the robot in continuous velocity mode should be fine.


  • The extruder's velocity needs to be controlled from the robot, and the robot should run in constant velocity mode - look up how LIN C_VEL works.
    In 3D printers the extruder is the fourth axis, driven synchronously from the motion controller. On the robot that may not be possible, since you don't have a hard realtime option, but just setting the extrusion speed and then moving the robot in continuous velocity mode should be fine.


    Thank you for your reply!
    So do you think that by just having continuous motions I will not encounter any problems with the velocity? I was reading this post (https://www.robot-forum.com/robotforum/kuka-robot-forum/sending-$vel_act-out-via-rsi-udp/ )and it seemed that everyone that are doing 3D printing are connecting extruder and velocity in someway, but not sure 100%.
    Anyway these are my settings at the moment, and I run the robot at 100% T2:
    $VEL.CP = 0.06
    $ACC.CP = 0.06
    $APO.CVEL = 50


    $ORI_TYPE = #JOINT



    $OUT[33]= TRUE ;Extruder On
    $ANOUT[1]= 0.04 ;Extruder FeedRate
    WAIT SEC 0.1
    $OUT[34]= TRUE ;Extruder Direction



    LIN {E6POS: X 75.0, Y 0.0, Z 7.0, A 110.0, B 90.0, C -60.0, E1 0.0, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E6 0.0} C_VEL
    LIN {E6POS: X 74.409, Y 9.4, Z 7.0, A 110.0, B 90.0, C -60.0, E1 0.0, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E6 0.0} C_VEL
    LIN {E6POS: X 72.644, Y 18.652, Z 7.0, A 110.0, B 90.0, C -60.0, E1 0.0, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E6 0.0} C_VEL
    LIN {E6POS: X 69.733, Y 27.609, Z 7.0, A 110.0, B 90.0, C -60.0, E1 0.0, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E6 0.0} C_VEL
    LIN {E6POS: X 65.723, Y 36.132, Z 7.0, A 110.0, B 90.0, C -60.0, E1 0.0, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E6 0.0} C_VEL
    ....


    Do you think they are ok?

  • It's going to depend on your print path. If you're driving the robot through paths that have a lot of accel/decel, you may end up needing to link your extruder rate to $VEL_ACT. If you avoid that (say, something like running the slicer in "vase" mode), you might be able to get away with setting a fixed feed rate.


    C_VEL will cause the robot to attempt to maintain a constant speed during approximations, but it's not guaranteed. Again, sharp corners or "hairpin" turns will force the robot to decel, regardless of what commands you use. You could end up being forced to limit your overall speed. Bottom line here is that the robot has much more mass and inertia in play than any typical 3D printer, and even regular 3D printers have to take their print-head inertia into account for those motions.


    $APO.CVEL of 50 is 50 millimeters -- do you actually want the robot rounding your corners that much?


    You could look into Spline motion blocks, if your KSS version supports it, but that could get pretty tricky.



  • I am just doing some tests at the moment I'll change the values later on regarding the approximation, but thank you for pointing out! I figure out how to pair velocity and feedrate in this way:


    SIGNAL FEEDRATE $ANOUT[1]
    ANOUT ON FEEDRATE = 0.58 * $VEL_ACT


    Do you have any experience with this syntax? The problem is that if I put a variable I get an error message (ANOUT ON FEEDRATE = X * $VEL_ACT


  • $APO.CVEL of 50 is 50 millimeters -- do you actually want the robot rounding your corners that much?



    $APO.CVEL 50 is < 50% of programmed velocity begin approximation....APO.CDIS 50 is 50mm. I know you know this but just thought I'd fix the confusion. :beerchug:


  • First: what is the exact syntax of the error message?


    Second: Where is the variable declared and initialized?


    This is my code where I declared the variable X and I get an error message that states that the variable is not declared. Attached you can find a picture of the error message from the Teach Pendant. I really don't know why is not possible to insert a variable within the ANOUT ON.


    Thank you!


    &ACCESS RVEO
    &REL 7
    DEF test20190207velocity()
    ;------- Declaration section -------
    ;FOLD DECL
    DECL E6AXIS HOME
    SIGNAL FEEDRATE $ANOUT[1] ;Set Feedrate Variable
    DECL REAL TFD
    DECL REAL TVEL
    DECL REAL X
    ;ENDFOLD
    ;------- Initialization ---------
    TFD = 0.03
    TVEL = 0.06
    X = TFD / TVEL
    BAS (#INITMOV,0)
    BAS(#VEL_PTP, 30)
    $VEL.CP = TVEL
    $ACC.CP = TVEL
    $APO.CVEL = 3
    $APO.CDIS = 200
    $BASE = BASE_DATA[3]
    $TOOL = TOOL_DATA[2]
    $ORI_TYPE = #JOINT
    HOME = {A1 0, A2 -80, A3 100, A4 10, A5 -20, A6 0, E1 0, E2 0, E3 0, E4 0, E5 0, E6 0}
    $ANOUT[1] = 0 ;Set Feedrate to zero
    ;----------- Main section ----------
    PTP HOME


    $OUT[33]= FALSE
    $OUT[34]= FALSE
    $OUT[35]= FALSE


    ANOUT ON FEEDRATE = X * $VEL_ACT DELAY = -0.12


    LIN {POS: X 75.0, Y 0.0, Z 400.0, A 110.0, B 90.0, C -60.0}


    ANOUT OFF FEEDRATE


    LIN {POS: X 70.0, Y 0.0, Z 400.0, A 110, B 90.0, C -60.0}
    END

  • .... I get an error message that states that the variable is not declared.





    wrong... why can't you just read the message...?



    it does not say "variable not declared"
    it says very specifically "variable not declared in data list"




    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


  • Sorry I thought it was the same, I don't know the difference between the two. I am not that expert in the KRL, I am trying to learn a bit more for making the code working. Could you explain me what's the problem with this syntax?


    Thank you

  • variables can be declared in different places. where they get declared affects live and scope. to use variable with ANOUT command, variable must be declared in a data list (DAT file). Your declaration is in SRC file.

    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


  • variables can be declared in different places. where they get declared affects live and scope. to use variable with ANOUT command, variable must be declared in a data list (DAT file). Your declaration is in SRC file.


    Thank you Panic mode, I declared the variable in the DAT file and this fixed the problem. However, now I am trying to power the velocity by 2 (or multiply twice) but I get another error message. Do you know if I can do this? I am just trying to have a formula to pair extrusion feedrate and robot speed.

Advertising from our partners