Velocity output

  • Krc2 5.6.8.


    We are trying to output the real time TCP velocity of CP moves not simply as the path velocity $VEL_ACT, but as a 3D vector velocity. So we want to end up with three real variables say VEL_X, VEL_Y and VEL_Z which would also have sign, which $VEL_ACT does not, as it is the forward path velocity which is always positive. (Unless $VEL_ACT is minus when pressing start minus??)


    These VEL_ variables would then be output with three ANOUT instructions. The problem seems to be how to realise the task. Ideally we would need to build a Tech function that could run synchronously in the 12ms interpolation time, but the Function Generator documentation does not give many clues to how this could be accomplished. The other alternative would be to interrogate $POS_ACT cyclically within the SPS and to use the delta of each coordinate to generate the value, but it's doubtful whether such a method would be accurate enough.


    Have any of our KUKA Experts got any ideas?

  • what for and how 'real time' it should be?


    you can track current cartesian position and compute instantaneous velocities in each of three axes. perhaps something like:




    XYZ_Velocity.SRC




    XYZ_Velocity.DAT

    Code
    DEFDAT XYZ_Velocity PUBLIC
      DECL CONST REAL dt=0.012 ; seconds
      DECL REAL Old_X
      DECL REAL Old_Y
      DECL REAL Old_Z
      DECL GLOBAL REAL Vx
      DECL GLOBAL REAL Vy
      DECL GLOBAL REAL Vz
    ENDDAT


    this is just an idea, i would measure time separately to acommodate for any scan time changes instead of using fixed 12ms.

    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

  • Thanks Panic Mode,


    I used your suggestion with minor modifications and it works perfectly. My version looks like this:-


    It runs in the SPS.SUB in a while loop as long as the flag is active and the programme where the ANOUT instructions are called is in the correct state.


    The ANOUT call in the programme looks like this:-

    Code
    ANOUT ON CHANNEL_3=1.0*VelX
      ANOUT ON CHANNEL_4=1.0*VelY
      ANOUT ON CHANNEL_5=1.0*VelZ


    The variables are declared in the $config.dat and are initialised in the programme like this:-


    We are using the analogue outputs via Profibus to drive Beckhoff KL2521 Pulse Train Output Terminals to emulate pulse encoders. Up to 1 M/s on a 500 mm path the accuracy is quite good and better than 0.2mm. Using the while loop in the SPS seems to give a consistent cycle time of 12ms which means we are synchronous with the interpolation cycle.


    I understand there is an option with KRC4 to also be able to do this encoder emulation faster but this method on KRC2 with a 12ms IPO seems to be adequate for our purposes.

Advertising from our partners