Wrong measurement when using interrupt

  • I have this program where it measures the tool lenght of a tool attatched to the robot flange. However when I try to measure a tool it has an overshoot of 50mm to the tool lenght. So my tool is 200mm but the measurment is 250mm.... does anyone know why this is happening? explenation of code: at the starting position for the move along the z axis it get the Z location, then it moves down until it hits a button, where it records that location on the z axis, this location is deducted from the first measured location. this measurment gives a 50mm difference.


    Edited once, last by martenH: explenation added ().

  • that is correct


    btw.


    the way the code is written:

    1. interrupt is active and robot is moving towards P3

    2. interrupt is triggered

    3. interrupt subprogram is called.

    4. interrupt is turned off

    5. robot is told to come to a stop

    6. Z1 is initialized... using $POS_ACT !?


    note that in point 6 (Z1 is initialized), robot position is different from position when interrupt was triggered (point 2).

    why use $POS_ACT instead of $POS_INT inside to get value into Z1?


    this is exactly why $POS_INT exists. in fact that is the only place one can use $POS_INT or $AXIS_INT - inside the interrupt subroutine. which in your case is TOOLM()

    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

  • first of all thank you all for the replies. I changed $POS_ACT in toolm() to $POS_INT however im still getting a wrong reading however its now around 30mm. And yess my tool correction is adjusted to the starting possition i measure it once and then leave it in the program. It can be found in my .DAT file

  • What kind of robot do you have? The measure movement is a PTP movement. With standard Kuka robots you won't get a straight line.

    The movement with 30% is way to fast for measuring, try a much slower and a Lin movement.

    After getting correct values you can increase the speed.

  • Im using the following


    SPECS:

    KRC V5.5.10

    GUI version: 2.0.6.6 b65

    Kernel system version: KS V5.5.64

    Robot:KR16 C2 FLR ZH16


    I adjusted the PTP motion to a LIN this morning right now this is the code, But this shouldnt be the problem at the moment..



  • Are the robot motions really correct?

    If you tell the robot to move 300mm in some direction, does it really move that exact distance?


    If not, check if MADA is is correct and if mastering is correct.

    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

  • yesss I think the motion is correct I measured the distance it traveld by hand and the distance that is calculated by the robot it self and they match with each other i think it has to do with the xyz location of the TCP, i tried to adjust them through setup>measure>tool>numerical. I feel like the the difference is the edge of the flang to the center but I dont know if those thoughts are correct...

  • Yesss i have activated the nullframe as tool for every movement, however I still get a wrong reading.... As shown on the picture it measures 147mm, however that is not the total lenght of the little wooden stick thats only the the leght until the blue line measured from the bottom... so im basically missing like 50mm.... The calculation that im using is: starting position - ending position = toollenght is this the correct way of calculating?

  • All right, let's back up.


    Before anything, you have to calibrate all the elements of this system.

    1. Create a high-accuracy TCP manually, preferably with a fine point.
    2. Use that tool to touch your tool-detect button
      1. Use very low speed for maximum accuracy
      2. Path-to-touch should be perpendicular to the sensor
      3. The sensor should be perpendicular to one of the $BASE planes
        1. That is, the path-to-touch should be aligned with the $BASE X, Y, or Z axes
      4. Path should be LIN
      5. $BASE should be set to the same values as will be used in production
    3. The position at which the calibration TCP activates the button is the location of the button's "trip point" in space


    After this, when you touch the button with your production tools, you need to have the production TCP in the same orientation, and move along the same vector. Your TCP Z axis must be aligned as perfectly as possible to the linear motion.


    The difference in $POS_INT, between the calibration tool contact, and the production tool contact, should give you a correction factor you need to add to your production tool's Z axis. If your touch-path is aligned with $BASE.Z, then $POS_INT.Z will be the value you want to use. If your button is wall-mounted, though, you might need to align with $BASE.X or .Y, and use $POS_INT.X or .Y accordingly.


    It is mathematically possible to do these calculations without aligning the $TOOL, $BASE, and button, but it's much harder and more failure prone. So doing a proper setup initially is key to saving yourself a lot of work, and pain, later on.

  • Little update for the people that were invested in this problem. I got the measuring correct now. i created a calibration tool that i use to measure the working area. I takes the starting possition and the end possiton and makes a work area out of these positions, After that i measure a tool, the calculation that follows is the staring position minus traveled distance on the z axis. This value is then subtracted from the working area, this gives me a pretty accurate reading for a test build made out of ducttape and wooden sticks :D. thank you all for you help with solving this problem!

Advertising from our partners