uARM calibration Issues and inaccurate movement

I have the uARM Metal, and have been trying to program it using

  _x = uarm.getCalX(); _

_ y = uarm.getCalY();_
_ z = uarm.getCalZ();_

to retrieve coordinates and then using

  _uarm.moveTo(x,y,z);_ 

to replay these coordinates.

When replaying the coordinates the unit is always missing the proper position by 3-5cm to the right. I figured this was a calibration issue and tried calibrating agian using the ‘Calibration’ Arduino sketch. However this did not fix it. I am not sure if I am calibrating this right, the documentation is terrible for this step and the youtube videos are hard to follow. There are multiple links saying to refer here: http://developer.ufactory.cc/quickstart/

for calibration instructions however calibration is never references outside of that 3 picture diagram.

Please help me with this issue, I am starting to regret this purchase.

#EDIT:
To clarify after calibration is done, and the arm returns to CENTER position, the arm is lined up slightly to the left. During the manual stage of calibration for the 45 degree position, I lined up the arm with the front left leg on the uARM (front left leg when you are facing the uarm).

#EDIT#2:

After further testing I noticed that LINK1 and LINK2 have some drift to them:

#Test 1: Test limits of Link 1 and Link 2

The current location is 0 , -27 , 8 #Link 1 and Link2 all the way back position
The current location is 0 , -7 , 17#Manually moved to random position

The current location is 0 , -9 , 18 #Position reported after moving to (0 , -27 , 8)

#Test#2 only move base servo.

The current location is -6 , -6 , 18 #starting position

moved only units X axis (Servo 1) and then told unit to move to (-6 , -6 , 18 )

The current location is -6 , -7 , 19 #Different position reported after moving.

Here are the results of more testing:

In this file the variables are (servo1 angle, servo 2 angle, servo 3 angle)

I am moving all servos to the specified angles and then reading back the angles. Then under ‘Error:’ I am showing how innaccurate the movement actually was.

You should be using the library, calibration code and examples from here:

And, if so, should be calibrating with this method

and then no need to calibrate again unless you calibrate with the older “learning mode” method.

Is this already what you are doing?

Yes, this is what I was doing. Also the Calibrate.ino sketch is no longer in the link youve provided me. However I had already installed this library a few days ago.

To test my calibration I positioned the arm manually and then ran calXYZ(), then I moved the arm manually to a different position and ran moveTo(x,y,z)(with the coordinates I recieved from calXYZ(). The arm moved to ALMOST the same place as before. However when I ran calXYZ() again the arm returned slightly different coordinates than what i used in moveTo(x,y,z).

I also tried this in Python as well by using the following steps:

After I did this, I followed these instructions for using Python:

http://developer.ufactory.cc/api/python/

I installed the pyfirmata library and the uarm python library as well as uploading this sketch to the uarm FIRMATA-EEPROM-StandardFirmataEEPROM.ino (no longer on github as well today).

I also noticed the same thing. Also the documentation on http://developer.ufactory.cc/api/python/ did not explain must about using:
servoAttach(servo_number)
servoDetach(servo_number)

or
uarmAttach()
uarmDetach()

What would be best practice for when to attach and detatch servos and also for uarmAttach() \ uarmDetach(). What is the difference between attaching the servo and attaching the arm?

Thanks for your help!

Hi Mike,

I suspect things actually may be working as intended for you. There are two main kinds of errors that I have discovered in working with the uArm.

The first is simple the mechanical error that includes both the ‘play’ of the joints as well as the fact that these are 8-bit servos, using less than half of their span. Thus, there are only 128 actual positions that the arm could be in even if it were perfectly accurate.

Second, and much more significant, is the error produced in ‘sensing’ the position of the arm. This is because a potentiometer is used to sense the servo positions and the response of that pot is non-linear and only moderately accurate. We recently made changes to the code to make it so that this error is only introduced when the servos are detached and reattached. So long as you do not detach the servos you should only have to deal with the first error type.

Regarding your questions around Attach/Detach, you should only need to use these functions if you wish to manually move the uArm (for example, to determine the XYZ coords of a physical orientation. Note that because of the error, if you Detach, move the arm, take an XYZ reading and then move the arm to that XYZ position (automatically Attach’ing the servos), the arm will now likely read a different XYZ position.

The best practice is to get an idea of the positions you want to note for the arm by uarmDetach’ing, manually moving the arm, reading XYZ with a sketch. Then, during operation, perform all of your final arm moves without detaching the servos. This will give you the minimum error which is generally < 1cm. (Alternately, you can write a sketch from which you can enter coordinates and adjust the arm without manually moving it.)

I am not familiar with the Python library, but it should be the case that uarmAttach/Detach simply does an Attach/Detach of all the servos while servoAttach/Detach allows access to each servo individually. You should not need to use the individual servoAttach/Detach functions unless you have very specific needs.

Dave

This makes sense, thanks. I will try to rewrite my program with this in mind. Thanks you for your help!

Hey David, I’m just nitpicking, but if there’s 128 positions per servo, shouldn’t there be 128^3 (2097152) positions possible for the end defector?

Yep, actually more because the base ROT servo can move a full 180. The other two servos actually have 110 and 100 positions (a bit less than what I wrote earlier). That makes 1,980,000 positions and while It can’t actually reach all of those, your point is valid. uARM can reach near two-million discrete positions in 3D space.

However, my point was different, and perhaps better illustrated in this example:

  1. To get to a certain position, the arm servos are calculated to be (90, 40.55, 45.52).
  2. The servos are mapped to the integers (90, 41, 46)
  3. If you now calculate the XYZ position of the arm from these values, you will find that the y value is off by almost 2cm.

And that’s what I’m talking about. Normally, the error is <1cm but I chose an extreme example. It is simply the error resulting from the conversion of the float servo angle to integer. :slight_smile:

Let me know if you still have questions,
Dave