1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

How to turn a turntable continuously at a set velocity

  • mjnewsum
  • January 10, 2023 at 11:33 PM
  • Thread is Unresolved
  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 10, 2023 at 11:33 PM
    • #1

    Hey, I am working with a KRC4 and it has a small turn table in front of it.

    I am trying to write a program that just has the robot stay in place while rotating the turn table continuously so the tool is relatively moving at a set velocity.

    This is a simplified version of the program. The robot does move the turn table without the arm moving, but the turn table slows down to almost a stop between each motion.

    I have tried setting velocity in the loop (which doesn't make sense) and the turn tables just moves very very slowly after the first move.

    I'm not sure what I need to do to get the turn table to keep going at the set speed as it moves through each position.

    Code
    DEF Spin()
        ; PTP to where you already are
        pos = $Pos_Act
        PTP pos
        
        BAS(#Tool, 5)
        BAS(#Base, 0)
    
        ; trying to set velocity and make smooth motion
        $Advance = 5
        BAS(#Vel_Cp, _spinVel)
        
        WHILE true
            pos.E1 = pos.E1 + 90
            LIN pos C_DIS
        ENDWHILE
    END
    Display More
  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 11, 2023 at 1:05 AM
    • #2

    I tried re-writing the program and it still has the same behavior; the robot pauses at the end of each move.

    Code
    DEF noDatSpin ( )
    
        DECL E6POS position
        GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
        INTERRUPT ON 3
        BAS (#INITMOV,0 )
        
        position = $POS_ACT
        
        $BWDSTART = FALSE
        PDAT_ACT = {VEL 15,ACC 100,APO_DIST 50}
        FDAT_ACT = {TOOL_NO 5,BASE_NO 0,IPO_FRAME #BASE}
        BAS (#PTP_PARAMS,15)
        PTP  position
    
        $VEL.CP=0.25
        $ADVANCE=3
    
        WHILE TRUE
            LIN position C_DIS
            position.E1 = position.E1 + 120
        ENDWHILE
    END
    Display More

    I have tried adding and changing $APO.CDIS and $ACC.CP but it doesn't seem to change anything.

  • Online
    SkyeFire
    Reactions Received
    1,038
    Trophies
    12
    Posts
    9,371
    • January 11, 2023 at 2:15 AM
    • #3

    1. What KSS version?

    2. How is E1 configured kinematically?

    3. Why are you using a LIN motion? Have you tried PTP, or SPTP?

    4. Instead of C_DIS, try C_VEL

    5.

  • hermann
    Reactions Received
    403
    Trophies
    9
    Posts
    2,593
    • January 11, 2023 at 7:56 AM
    • #4

    You use base 0, so the turntable is not integrated into transformation.

    Using Lin doesn't make sense in that case (doesn't make sense if turntable is integrated). Look at the xyz coordinates uduring motion, you will see that the cartesian coordinates don't change. So the linear velocity doesn't make sense as the turntable should move from one point to the other in 0 seconds. That's impossible and errors are prevented by Kuka system software, it limits the velocity of the turntable.

    You should use ptp movements, or integrate turntable in transformation and use circ movements.

  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 11, 2023 at 6:09 PM
    • #5

    SkyeFire

    1. KS V8.5.465_HF3

    2. The turntable is typically configured to be the base coordinate system. It works this way when running our typical programs. I am using Base 0 so I can just tell E1 to move without updating the position's XYZ values. I could put in in our normal base, but then I would have to specify XYZ and A with E1 to keep the tool in the same position. Also, the turn table seems to be configured so that a LIN move is more like an Arc. I am not sure how this was setup, but the LIN moves in the program do not move the arm, so if a pen was attached to the tool it would draw an arc on the turn table.

    3. I am using LIN because it actually makes arcs, I could use PTP, but I want to specify the relative velocity at the TCP instead of a percentage of the max rotation speed.

    4. I will try C_VEL. I haven't used this before. I will also try a PTP move to see if it also pauses.


    hermann I am using Base 0 so that the turntable transformations are not taken into consideration. Our other base numbers have the base transformed to the turntable and moving with it, so I would have to specify XYZA and E1 to keep the tool in a fixed location as the turntable rotates (which is how my typical programs run). You do make a good point that the velocity of the LIN move doesn't make sense if I am using Base[0] because the tool doesn't have a calculated relative movement. I will look into this more. It seems like this would be an issue with the velocity, but it shouldn't cause the turntable to pause after each motion (I don't think).

  • Online
    SkyeFire
    Reactions Received
    1,038
    Trophies
    12
    Posts
    9,371
    • January 11, 2023 at 6:35 PM
    • #6
    Quote from mjnewsum

    2. The turntable is typically configured to be the base coordinate system. It works this way when running our typical programs. I am using Base 0 so I can just tell E1 to move without updating the position's XYZ values. I could put in in our normal base, but then I would have to specify XYZ and A with E1 to keep the tool in the same position. Also, the turn table seems to be configured so that a LIN move is more like an Arc. I am not sure how this was setup, but the LIN moves in the program do not move the arm, so if a pen was attached to the tool it would draw an arc on the turn table.

    That sounds like the E1 axis is kinematically integrated, such that it has a particular Base that moves with the turntable. If that's the case, then you may need to bite the bullet and do the full XYZABC + E1 math.

    Assuming your E1 Base is at the dead center of the table (and E1 is set as Rotary or Endless), you might be able to use a series of CIRC commands. Alternatively, you might be able to use the attached ellipse generator to create a series of LIN points on a circle for the TCP, and add in the E1 values to keep the TCP physically stationary while it moves "virtually" relative to the E1 Base.

    Files

    GeneralEllipsoid.zip 107.66 kB – 14 Downloads
  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 11, 2023 at 6:46 PM
    • #7

    SkyeFire, thanks for following up. I am about to go play around with the bot some more to see if I can get it to behave. I think you are right that CIRC moves might be the easiest way to go. I can probably just make each rotation in 2 moves by Negating X and Y, adding 180 to A, and 180 to E1.

    I guess I could LIN to a E6Axis position, with only the E1 changed.... I think. This should even work in our typical base.

    I am still surprised that the robot pauses. I could understand it it was moving the wrong speed, but the pause is still strange to me.

    Also, thank you for the generator program. I will keep this as a backup plan.

    Edited once, last by mjnewsum (January 11, 2023 at 6:53 PM).

  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 11, 2023 at 7:22 PM
    • #8

    SkyeFire I modified the program to use PTP. The turntable did not pause, but I seem to have almost no control of the rotation speed. The turn tables moves very slowly no matter what I set in PDAT_ACT.

    I did notice a very strange behavior in this program. If I Block Select the PDAT_ACT line, the turn table would turn much faster (I am assuming this is the speed I set). The turntable would turn at the faster speed for one move then go back to a painfully slow speed that it would normally go if I did not block select the PDAT_ACT line. Not sure what is going on there.

    Code
    DEF noDatSpin ( )
        DECL E6POS position
        GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
        INTERRUPT ON 3
        BAS (#INITMOV, 0)
        BAS (#TOOL, 5)
        BAS (#BASE, 0)
        ;BAS (#PTP_PARAMS, 15)
        
        position = $POS_ACT
        PTP  position
        
        $ADVANCE = 5
        
        WHILE TRUE
          $BWDSTART = FALSE
          PDAT_ACT = {VEL 100.0000,ACC 100.000,APO_DIST 500.000,APO_MODE #CDIS,GEAR_JERK 100.000,EXAX_IGN 0}
          FDAT_ACT = {TOOL_NO 1,BASE_NO 0,IPO_FRAME #BASE,POINT2[] " "}
          PTP position C_Dis
          position.E1 = position.E2+90
        ENDWHILE
    END
    Display More
  • Online
    SkyeFire
    Reactions Received
    1,038
    Trophies
    12
    Posts
    9,371
    • January 11, 2023 at 8:05 PM
    • #9

    The first move after doing a Block Select is a BCO move (basically, the Advance pointer has been wiped and all path planning has been deleted), and often moves faster than any moves after BCO has been achieved.

    Setting PDAT_ACT and FDAT_ACT have no effect on anything unless you run BAS. BAS copies those variables into the various System Variables like $VEL_PTP, VEL_CP, etc, which actually control motion. PDAT and FDAT are just "helper" variables at the user level, added by KUKA to support Inline Form programming.

    In this case, you should run BAS(#PTP_DAT) to activate your PDAT/FDAT settings. #PTP_PARAMS tells BAS to set the parameters for PTP motion (#CP_PARAMS would be used for LIN or CIRC motion).

  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 11, 2023 at 8:35 PM
    • #10

    Thanks for explaining that @skyfire. Is there any way to set the PTP velocity to be relative to where the TCP is located?

    I was trying to think through another idea of just having the pose as an E6Axis type.

    pose = $AXIS_ACT

    While true

    pose.E1 = pose.E1 + 90

    ; convert E6Axis to E6Pos position using tool and base

    LIN position

    EndWhile

    I am not sure how to convert an E6Axis to an E6Pos. Is that possible?

    Edit - I looked into it more and I think the Forward function should get me the E6POS I am looking for. Trying this next.

    Edited once, last by mjnewsum (January 11, 2023 at 8:44 PM).

  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 11, 2023 at 9:04 PM
    • #11

    Ok, so I tried converting E6Axis to E6Pos, and that motion works well. The robot goes where I want it to.
    But, the robot still pauses at every position. I am not using our typical base. I don't understand why the robot keeps pausing.

    Code
    DEF noDatSpin ( )
        DECL E6POS position
        DECL E6AXIS pose
        DECL int status
    
        GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
        INTERRUPT ON 3
        BAS (#INITMOV, 0)
        BAS (#TOOL, 5)
        BAS (#BASE, 2)
        
        pose = $AXIS_ACT
        status = 0
        PTP  pose
        
        $ADVANCE = 5
        $VEL.CP=0.25
    
        WHILE TRUE
           pose.E1 = pose.E1 + 90
           position = Forward(pose, status)
            
           LIN position
        ENDWHILE
    END
    Display More
  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 11, 2023 at 11:10 PM
    • #12

    I realized I forgot C_DIS after LIN position. Tried that and it didn't change anything. I also tried C_VEL.

    I also tried adding $APO settings, but that didn't do anything either.

    $APO.CDIS = 10.0

    $APO.CVEL = 100

    I am really stumped. I can't figure out why it pauses between each move. It is like $Advance is not actually being read or something.

  • panic mode
    Reactions Received
    1,262
    Trophies
    11
    Posts
    13,027
    • January 11, 2023 at 11:51 PM
    • #13

    Those lines simply define limits. That is not enough...

    Line 23 also need to be told that approximated motion path is needed and what types of approximation motion planner is to consider.

    LIN Position C_DIS

    or

    LIN Position C_DIS C_VEL

    without something of that kind there will be momentary stop at the end of motion.

    Also $ADVANCE need to be greater than 0. Line 8 will set that to default value which is 3 unless someone changed it.

    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

  • hermann
    Reactions Received
    403
    Trophies
    9
    Posts
    2,593
    • January 12, 2023 at 7:46 AM
    • #14
    Quote from mjnewsum

    ... I am using LIN because it actually makes arcs, I could use PTP, but I want to specify the relative velocity at the TCP instead of a percentage of the max rotation speed...

    You can't specify the linear velocity without having the table integrated as base. It's impossible.

    Already told you in my first post: the cartesian position in your program stays fix, so the robot has to move zero mm with the linear speed of, let's say 0.2m/s, but for moving zero mm he needs exact zero seconds, so mathematically he is doing the movement with velocity 0.0/0.0 m/s. I'm not aware of what the path planner does in that case with the axis E1 and blending.

    It's a singularity, they have to handle it in a way that it's working mechanically, but for us as users the behavior is nearly unpredictable.

    You must go the hard way, described by Skyefire. Don't waste your time with ptp, or movements without integrated base coordinates.

    You can't evaluate the speed in T1, you have to use T2 or auto. In T1 the robot makes strange things with the speed.

  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 12, 2023 at 6:03 PM
    • #15

    Ok, I figured out the issue. I was not using BAS(#FRAMES ) and I guess there is something in Frames ( ) that was required to the motion to work correctly in the moving frame of the turntable.

    Here's what I had to do.

    Code
    BAS (#INITMOV, 0)
    ROBOT_FRAME.TOOL_NO = tool
    ROBOT_FRAME.BASE_NO = base
    FDAT_ACT = ROBOT_FRAME
    BAS (#FRAMES )

    Thank you all for the help! This was a very confusing little problem. This was the first time I am making a program from scratch that runs on a robot using a turntable as the coordinate system. I'm not sure what in Frames ( ) made the difference, but I will use the BAS functions more in the future.

    hermann You are totally correct. The last program I posed is using Base[2] which is the integrated base of the turntable. Instead of calculating where the points will be or figuring out the ABC angles, I used an FK E6AXIS pose as the variable that I could modify E1. Then, I used Forward() to get the E6POS position of that pose. Then I can LIN to the position. That way, I get everything other that E1 calculated by the controller (XYZABC). I think it is a nice way to do it. This will let me put the tool in any position and any orientation and still drive the turntable at a set velocity relative to the current tool position.

    Edited 2 times, last by mjnewsum (January 12, 2023 at 6:15 PM).

  • hermann
    Reactions Received
    403
    Trophies
    9
    Posts
    2,593
    • January 12, 2023 at 7:16 PM
    • #16

    If you are satisfied with the movement now it will be ok. But something must be wrong anyway.

    You create a movement where only the external axis moves, the robot should stand still. The two coordinates are 90 degrees away from each other on the turntable.

    You program a linear movement between those two positions.

    If the integration of the external axis is correct, the tcp should move on a straight line on the turntable. When you attach a pencil on the tcp you should see a straight line on the table, as you programmed a linear movement.

    But when the robot stands still and only the turntable moves, you will get a arc with the pencil.

    So I think something is going wrong.

  • mjnewsum
    Reactions Received
    1
    Trophies
    3
    Posts
    60
    • January 12, 2023 at 8:47 PM
    • #17

    hermann that is correct. After getting the turntable integrated correctly into the motion, it did move the arm in and out along the motion. I put in a variable to control the angle that is added to E1 each loop. Right now it is running with 1 degree, but that could be an issue if the robot is very close to the center of the table. I wanted to do this with CIRC moves, but was advised to avoid them without a good reason why. I think lots of people just have had bad experiences with CIRC moves so they linearize the arc at some resolution.

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download