# meArm library

14 views

### tebraxin

Jun 25, 2020, 2:47:20 PM6/25/20
to York Hackspace

Hi mr. danieljabailey

I'm Simone from Italy.
I'm trying to use your "meArm" library for a robot arm like in your video.
I need to ask you for a clarification.
I did not understand how did you decide the coordinate system.
i.e. which is X, and in which direction is X + or X-
or is X always positive?
the same for the other axes.

how do you setup ZERO position?
where do you move the servo at the begin
which is the initial position?

Could you send me a schematic or a drawing of how he thought the three aces?
thank you thank you very much
Hello

### Daniel Bailey

Jun 25, 2020, 3:18:29 PM6/25/20
to York Hackspace
Hi there,
Wow it's been a while since I worked on this :)

I suspect Nick will remember better than I can as Nick did all of the code. I'll have to defer to Nick in this case.

Thanks. :)

### tebraxin

Jun 25, 2020, 3:28:46 PM6/25/20
thank you very much to all, if possible I wait for help from Mr. Nick, thanks again !!!

--
You received this message because you are subscribed to the Google Groups "York Hackspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to york-hack-spa...@googlegroups.com.

### Nick Moriarty

Jun 25, 2020, 3:52:48 PM6/25/20
Hi Simone,

From what I can remember from a brief look over the code, with the arm pointing away from you, the axes are as follows:
• The X axis goes horizontally left to right; right is positive
• The Y axis goes horizontally away from you; away is positive
• The Z axis goes vertically upwards; up is positive
The origin is set at the height as the "shoulder" pivot, directly above the turning axis of the "waist" that rotates horizontally.  So, if the waist servo rotates the arm, the Z value is constant (the rotation is in the X-Y plane).  You can see this is the cylindrical coordinates used in part of the code - theta is the rotation in X-Y, and r is the distance from X,Y=0,0.  The rest of the arm is then solved in r,Z coordinates (as if looking at it from the side).

I hope that helps; if you need any further explanation, please let me know, but it has been over 5 years since I worked on it.

Cheers

### tebraxin

Jun 25, 2020, 4:05:22 PM6/25/20
well, first of all thanks for the quick reply,
I saw that the library is old but it's fine with me.
I didn't hope you would answer, it was a pleasant surprise.

so I mean that where there is the rotation point of the base there are the coordinates X = 0 and Y = 0 and Z = 0, correct?
For sure it is clear that Y and Z can only be positive,

>>> but the main question is if going to the left X must be negative.
THANK YOU !!!!

### Nick Moriarty

Jun 25, 2020, 4:18:52 PM6/25/20
On Thu, 25 Jun 2020 at 21:05, tebraxin <tebra...@gmail.com> wrote:
well, first of all thanks for the quick reply,
I saw that the library is old but it's fine with me.
I didn't hope you would answer, it was a pleasant surprise.

so I mean that where there is the rotation point of the base there are the coordinates X = 0 and Y = 0 and Z = 0, correct?
Almost - the rotation point of the base is X=0, Y=0 - but Z=0 is above this, at the height of the servos that move the arm parts.  Z therefore can go (slightly) negative, Y is always positive (unless the arm can rotate so far as to point backwards), and X is as you state.

### tebraxin

Jun 25, 2020, 4:34:55 PM6/25/20
Of course, thank you.

So I try with the last question:

In the library I found where to set the lengths of the arms, but I don't understand how to set the servos angles.

There is this statement:
"....
// Full constructor uses calibration data, or can just give pins
meArm (int sweepMinBase = 180, int sweepMaxBase = 0, float angleMinBase = -pi / 4, float angleMaxBase = pi / 4, .....
... "

And I understand that the corners in RADIANT I don't have to change them, because they serve formulas,
while I have to change the angles in degrees of the SERVO,
but how do I "calibrate" the positions of the servo ???

thanks a lot !!!!
Simone

### Nick Moriarty

Jun 25, 2020, 4:46:28 PM6/25/20
Hmm, I can't remember that, for the base servo you can use x/y values like this:
• Go to XYZ=(-100, 0, 0) or similar.  The arm should go straight left.  If it's not, you need to adjust the base sweep min (might be max)
• Go to XYZ=(100, 0, 0) or similar.  The arm should go straight right.  If it's not, you need to adjust the base sweep max (might be min)
• Check XYZ=(0, 100, 0) is now central in front of the arm.  If not, check the two above steps again
If you want to use the ServoConf stuff, I'd suggest setting up a test program with your servos disconnected from the arm.  You need to run some kind of calibration loop to find the servoconf sweep values that put the servo in the correct positions.  I think the default values should be close enough though; I can't actually remember how that all ties together.

### Daniel Bailey

Jun 25, 2020, 4:47:37 PM6/25/20
I used to have a blog where once posted instructions for calibrating the MeArm and using this library.
The blog is no longer live, but the post is fortunately cached by the web archive, so you can find it here:

Try reading through it and following the instructions there.

I hope that helps :)

You received this message because you are subscribed to a topic in the Google Groups "York Hackspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/york-hack-space/zcHsDq2bYJ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to york-hack-spa...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/york-hack-space/CAKYFRstqigLZz-L1t75L5-zxcFMi%2BYysSFWFdRV%2BO%3DQSS-4W5g%40mail.gmail.com.

### tebraxin

Jun 25, 2020, 4:50:00 PM6/25/20
VERY WELL DONE !!!
Many thanks