Fanuc Karel REAL variable rounds up. How to avoid?

  • Hi

    We are doing accurate measurements with robot and probe. We are passing robot positions through position register to Karel program. Problems appear with big values and they cause inaccuracy to the end results. In Karel programs values are passed as REAL values.

    For example:

    We want to calculate next expression from position values:

    val = - (x_val ^2 + y_val^2 + z_val^2)

    When measured values are

    x_val: 1554,669 mm

    y_val: -468,354 mm

    z_val: 9,543 mm

    We get from Karel program result: -2 636 442,000

    From excel and wanted value is: -2 636 442,238

    Is there any way to avoid the roundups? We know that the Karel can handle limited size values, but still we those digits shouldn’t be too much?

    (How we see it, our math should be correct in the program :smiling_face: )


    Thanks

    Aleksi

  • excel is not limited to a single precision floating point.


    single precision floats or reals are 32-bit only and you get about 6-7 significant figures.

    to get better result you need either 64-bit math or have to write your own functions that work around 32-bit limit.

    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

  • not sure what you are trying to calculate but sum of squares is square to diagonal distance.

    d=sqrt(x^2+y^2+z^2)


    you are just not calculating root....


    using 32-bit math to get distance, in this case produces error of 0.00007329 mm

    when measurements are in 0.001 mm, it is unreasonable to expect calculated results beyond that.

    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

Advertising from our partners