Bug in xArm Controller?

It seems there’s a problem with drawing circles? I’m using the latest 1.1 software.
I’m not sure if this is new or not.

I created a program in blockly to draw a 150 mm circle… It then touches one side of
the circle, the center and then the other side. Here’s the problem:

  1. The move commands (the touches) work fine. First a touch to (-75, 0, z),
    then a touch at (0, 0, z), then a touch at (75, 0, z). This proves my piece
    of paper has a correctly sized circle (I also measured it with calipers …)

  2. However, a circle specified with (-75, 0 , z), (0, 75, z) and (75, 0, z) is too big on one side!
    To draw a circle, one specifies three points on it, right? The current position and
    two more, right?

Please check my sanity! I can’t think of what I might be doing wrong …

Thanks,

Andre

Here’s a video of the test (my robot is attached from above):

https://drive.google.com/open?id=1LKj97DjKIFQnR7lxdXQqs_YGoU32Dy1n

Here’s the code produced by blockly:

#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2019, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>

"""
# Notice
#   1. Changes to this file on Studio will not be preserved
#   2. The next conversion will overwrite the file with the same name
"""
import sys
import time
import threading

"""
# xArm-Python-SDK: https://github.com/xArm-Developer/xArm-Python-SDK
# git clone git@github.com:xArm-Developer/xArm-Python-SDK.git
# cd xArm-Python-SDK
# python setup.py install
"""
from xarm import version
from xarm.wrapper import XArmAPI

print('xArm-Python-SDK Version:{}'.format(version.__version__))

arm = XArmAPI('10.2.0.10')
arm.clean_warn()
arm.clean_error()
arm.motion_enable(True)
arm.set_mode(0)
arm.set_state(0)
time.sleep(1)

params = {'speed': 100, 'acc': 2000, 'angle_speed': 20, 'angle_acc': 500, 'events': {}, 'variables': {}}


# Register error/warn changed callback
def error_warn_change_callback(data):
    if data and data['error_code'] != 0:
        arm.set_state(4)
        sys.exit(1)
arm.register_error_warn_changed_callback(error_warn_change_callback)
# Move To Home
print('Moving to Home Pose')
params['speed'] = 100
if arm.error_code == 0:
    arm.reset()
arm.set_tcp_offset([0, 0, 0, 0, 0, 0])
arm.set_state(0)
if arm.error_code == 0:
    arm.set_position(*[300.0, 0.0, 600.0, 0.0, -90.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
if arm.error_code == 0:
    arm.set_position(*[-148.3, 0.0, 589.6, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
print('At Home Pose')
while True:
    if arm.error_code == 0:
        arm.set_position(*[-30.0, 0.0, 700.0, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
    if arm.error_code == 0:
        arm.set_position(*[0.0, 0.0, 730.0, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
    if arm.error_code == 0:
        arm.set_position(*[30.0, 0.0, 700.0, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
    if arm.error_code == 0:
        arm.set_position(*[75.0, 0.0, 730.0, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
    if arm.error_code == 0:
        arm.set_position(*[-30.0, 0.0, 700.0, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
    if arm.error_code == 0:
        arm.set_position(*[-75.0, 0.0, 730.0, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
    if arm.error_code == 0:
        arm.move_circle([0.0, 75.0, 730.0, 0.0, 0.0, 180.0], [75.0, 0.0, 730.0, 0.0, 0.0, 180.0], 99.72222222222223, speed=params['speed'], mvacc=params['acc'], wait=True)
    if arm.error_code == 0:
        arm.move_circle([0.0, -75.0, 730.0, 0.0, 0.0, 180.0], [0.0, 75.0, 730.0, 0.0, 0.0, 180.0], 99.72222222222223, speed=params['speed'], mvacc=params['acc'], wait=True)
if arm.error_code == 0:
    arm.set_position(*[-148.3, 0.0, 589.6, 0.0, 0.0, 180.0], speed=params['speed'], mvacc=params['acc'], radius=-1.0, wait=True)
if arm.error_code == 0:
    arm.reset()

Any news on this?

Were you able to reproduce it? Or am I doing something wrong? :nerd_face:

Thanks!

Andre


I marked the 3 points used to calculate a circle, for your reference.

Thanks

Hi Daniel,

It appears then that I’m doing it correctly!

So why is xArm drawing the circle incorrectly?

The three points on the circumference (right?) of the circle are:

xyz = (-75,    0,    730)       rpy = (0, 0, 180)
xyz = (   0,  75,    730)       rpy = (0, 0, 180)
xyz = (  75,   0,    730)       rpy = (0, 0, 180)

From these points, my circle should be at x=0, y=0, z=730 with a radius of 75 mm, correct?

But, as seen in the video, the drawn circle extends well outside this 75 mm circle!

The circle does NOT pass through the third point! It misses it by about 20 mm!

This is why I think there’s a bug in the controller. Am I misunderstanding something here?

Thanks,

Andre

Here is a snippet of my program:

The code seems OK, could you send us the SN on the basement of the xArm?

Is it one of these? Is the robot S/N under the base? The robot is already
mounted and I am avoiding having to remove it from its location …

Hi Daniel,

Here is a new experiment I have run.

Note that this one is different from the first video. There, the screwdriver
is mounted at the center of the tool attachment point. In this video, the syringe
is mounted on the side of the tool attachment piece.

Please note, however, that since there is no change in yaw, this offset does not
affect/distort the geometry of the circle. The results are identical to the first video
where the screwdriver is mounted in the center.

Video
https://drive.google.com/file/d/1pCgN7J73vnG4I9_sYaWZMABRzgl6clCm/view?usp=sharing

Generated drawing

Blockly Program Used

Thanks for your help,

Andre Sant’Anna
Director R&D
Applied Anodize, Inc.

Hi Andre, thanks for your feedback. We are on it now, it may need 1-2 weeks to analyze this issue since it’s a bit complicate, I will keep you update. For the moment you could try to adjust the radius to get the circle you need. Thanks.

Hi Daniel,

It’s been 2 weeks since your last message. Please give me an update on your progress in resolving this issue?

BTW, this problem seems to extend beyond just circles.
It seems that it is a deeper problem in your implementation of IK.

If you’d like, I can send you a program that shows that drawing lines from point A to B to C ends up at different final locations when changing only the pose of B.

Without access to your firmware, I can go no further. However, the simplest explanation that comes to mind might be incorrect dimensions in the URDF file (or equivalent) that the controller uses? This is consistent with what I’m seeing but is just a guess

Thank you for your attention to this matter,

André Sant’Anna
Director R&D
Applied Anodize, Inc.

Hi André,
Sorry for the later reply. Yes if you could send us your program it will be better since we tried a few ways but failed to repeat the issue. And could you tell us the xArm Studio version and the firwmare version you are usting to do the test? Thanks

Are you able to reproduce the circle problem?

  • Andre

PS I will send you the line problem program soon.

While preparing the test program to send to you, I realized
that it was using a circle earlier on. The A → B → C experiment
was probably affected by the circle. So maybe the problem
is just with circles? Sorry about that.

Have you been able to reproduce the circle problem?

Here’s my firmware info:

Thanks

PS I will be on vacation next week.

Hi Andre, we known and we could repeat the issue"Drawing lines from point A to B to C ends up at different final locations when changing only the pose of B”, and we are on the process to optimize the issue.
When we use your codes to draw the circle, actually the radius of the circle we got was 75±0.5mm(0.5mm is the minimum unit of the ruler we use) and it keep the same result no matter what direction we measure it. Here is a video about how we test it:https://drive.google.com/open?id=1_e20CnAj4PWymIrkGutynbwpDRXDkSdb
We recommend that try to set the robot floor mounting and try to draw some circles to see if there is a same issue.

Thanks

This seems to be pointing to a problem with my robot?

You use the same program as me and we get different results? Maybe something wrong
with the encoders?

How do we fix this problem?

Do you think the fix for the A-B-C problem might fix this problem too?

Thanks,

Andre Sant’Anna
Director R&D
Applied Anodize, Inc.

Do you think the fix for the A-B-C problem might fix this problem too?
Actually,no. There are different issues.
We think we could optimize(not eliminate) the issue of drawing a circle by getting the xArm back and recalibrating it with our calibration facilty. But if you have another way to solve the issue such as set the center of the circle a bit far from the joint 1, then we do not recommend to send it back since the high cost.
For the A-B-C problem it’s much more complicate since it refers to the whole process of manufacturing, it will take a long time to optimize each process, and that’s what we will do next. We did test this issue with the best robots in the coloborative robot industrial and we find they also have a error of 2-3mm on this issue, and that’s why we always talking about the repeatability instead of (absolute) precision.

Thanks

Daniel,

Thanks for your help so far. I think we should move this discussion off the forum. I imagine most people
don’t care about all this.

I’ll continue through support@ufactory.cc, OK?

Thanks,

Andre

Hi Andre,
We reply you by support Email, pleaes check.
Thanks