Notifications
Clear all

Resources for Programming the Me Arm?

40 Posts
5 Users
3 Likes
14.7 K Views
Mandy
(@amanda)
Member
Joined: 5 years ago
Posts: 74
 

I hope that solves it.

To eliminate the slop problem I used some elastic bands to pre-load the servos.  You're not going to need much but you can set them to work against gravity on the arm (think springs on an angle poise lamp).  Do you think an elastic band around the gripper would help?

When doing the "smooth" program remember, servos get data at 50Hz so you can not update faster than that.  I made the mistake of trying to loop faster and found I was restarting the PCA9685 before it had sent a full pulse to the servo.  Bad move, bad bad move, servo hit end stop, go boom.

As part of the "smooth" routine you write an "up" routine that brings the gripper directly up/down an axis rather than a rotation around the two arm servos.  That should give you something to bend your mind around.  ? 

The 600 series had rubber skin. We spotted them easy, but these are new. They look human... sweat, bad breath, everything. Very hard to spot.


   
twobits reacted
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

The only important slop error I'm currently having is in the base rotation.   When the arm is fully extended the position of the claw can be up to a full inch off target right or left.   And that will represent the maximum error.  I haven't really noticed any up and down slop in the arm.  That much seems to be pretty consistent.

And yes, the problem of being able to lift things straight up and lower them straight down is precisely the problem I'm hoping to work on.  In fact, that's the problem I'm currently working on when the side-to-side error of the base became a problem.

I'm not going to give up on it just  yet.  I only just worked on this today.  But I don't want to spend all week playing around with this Me Arm.  I have things to do that are actually important. ? 

It's 2:00 am and I'll still playing around with this stupid Me Arm.   I gotta quit.

Thanks for the suggestions, you've been a great help.  I'll go do some other things tomorrow and come back to this Me Arm at some later date.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

RoboPi wrote: And yes, the problem of being able to lift things straight up and lower them straight down is precisely the problem I'm hoping to work on. 

The change in angles required to move along any straight (or curved) path can be computed in real time (no tables required).
The interaction between motors you mention could also be modelled although I would simply make or get a better robotic arm to play with.
This is illustrated in the program I posted that returns the angles for any mx,my position. Instead or using the mouse you could feed it positions from a path generator program and it will output the desired angles which is what I thought you wanted.
The output below is from an actual program I have not used PAINT this time 🙂

armPos1

   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

So here is an output generated by the program for the angles required to move an arm down along the Y axis with the X axis fixed at 150.

X Y Elbow Shoulder
150 10 -123.9968 125.5471
150 20 -123.9758 123.6027
150 30 -124.0217 121.7673
150 40 -124.1305 120.0324
150 50 -124.2989 118.3913
150 60 -124.5239 116.8381
150 70 -124.8033 115.368
150 80 -125.1347 113.9772
150 90 -125.5165 112.662
150 100 -125.9468 111.4197
150 110 -126.4241 110.2477
150 120 -126.9471 109.1439
150 130 -127.5145 108.1065
150 140 -128.125 107.134
150 150 -128.7775 106.2251
150 160 -129.4709 105.3786
150 170 -130.204 104.5936
150 180 -130.9759 103.8692
150 190 -131.7855 103.2047
150 200 -132.6317 102.5996
150 210 -133.5136 102.0534
150 220 -134.4301 101.5656
150 230 -135.3801 101.1359
150 240 -136.3627 100.764
150 250 -137.3768 100.4497
150 260 -138.4214 100.1928
150 270 -139.4954 99.99309
150 280 -140.598 99.85052
150 290 -141.7279 99.76501
150 300 217.1157 99.73652
150 310 215.9338 99.76501
150 320 214.7274 99.85052
150 330 213.4975 99.99309
150 340 212.2449 100.1928
150 350 210.9706 100.4497
150 360 209.6752 100.764
150 370 208.3597 101.1359
150 380 207.0247 101.5656
150 390 205.671 102.0534
150 400 204.299 102.5996
150 410 202.9094 103.2047
150 420 201.5025 103.8692
150 430 200.0787 104.5936
150 440 198.6383 105.3786
150 450 197.1814 106.2251
150 460 195.7081 107.134
150 470 194.2182 108.1065
150 480 192.7116 109.1439
150 490 191.1878 110.2477
150 500 189.6463 111.4197
150 510 188.0864 112.662
150 520 186.507 113.9772
150 530 184.9072 115.368
150 540 183.2852 116.8381
150 550 181.6394 118.3913
150 560 179.9676 120.0324
150 570 178.267 121.7673
150 580 176.5345 123.6027
150 590 174.766 125.5471


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: casey

RoboPi wrote: And yes, the problem of being able to lift things straight up and lower them straight down is precisely the problem I'm hoping to work on. 

The change in angles required to move along any straight (or curved) path can be computed in real time (no tables required).
The interaction between motors you mention could also be modelled although I would simply make or get a better robotic arm to play with.
This is illustrated in the program I posted that returns the angles for any mx,my position. Instead or using the mouse you could feed it positions from a path generator program and it will output the desired angles which is what I thought you wanted.
The output below is from an actual program I have not used PAINT this time 🙂

armPos1

The problem is that the servo angles on the Me Arm do not represent the actual angles of the arm members.   Although their may be a linear relationship between the servo angle and the upper arm of the Me Arm.  However, the angle of the lower (or outer) arm of the Me Arm appears to me to have an even more complex relationship with the servo angle that drives it.   This is because the actual angle of the outer arm can depend on the position of the upper arm.

None the less there may be ways to create a map between the actual arm angles and the angles of their servo motors.  I'm not at that stage yet.  I'm still trying to get the Me Arm to behave itself. ? 

I have coordinates that I would like to have it run through and I'm currently in the process of programming the Mega to read the position data from the SD card and turn that into actual arm motion.  I'm getting there.  But not quite finished yet.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: casey

So here is an output generated by the program for the angles required to move an arm down along the Y axis with the X axis fixed at 150.

Yes.  And there is also no point in all the decimal places since the servos can only accept integer steps in degrees anyway.

In your example, my program will only need the first and last entries on your list saved to the SD card.   All the intermediate positions will be calculated programmatically using a "Smooth Motion" method.

In fact, without using "Smooth Motion" here is all the data I need to pick an eyedropper straight up out of the test tube rack:

090,000,045,000 <- Home Position
005,070,070,055 <- moves arm to the eyedropper location & opens claw
005,080,090,055 <- moves the arm toward the eyedropper.
005,080,090,000 <- closes the claw
005,075,095,000 <- from here down is the straight up lift.
005,070,100,000
005,065,110,000
005,060,120,000
005,055,130,000
005,050,160,000 <- the eyedropper is now clear of the rack.

This is my first set of motion coordinates.  It works manually, now I'm working on having it done via reading these inputs from the SD card.   I'm working on this software routine as we speak.   So hopefully I'll be able to report back with some success here shortly.

 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

More Success!

I finally got the SD card reading method to work.  Mandy had warned me about using too quick of delays and that was my problem.  I made the delays between each servo update a little longer and now it's working.  Unfortunately it's still not able to pick up even the eyedropper.  The motion of the arm is too jerky without the "Smooth Motion" routine and it slips right off the eyedropper bulb.  I replaced the eyedropper with a cardboard nail file and it lifted the nail file up with no problem. 

I'm going to try finding a more powerful power supply as Mandy had suggested to see if I can give the gripper a bit more holding power.  Other than this the arm went right over to the proper place, and picked up the cardboard nail file.

So I'm making progress.

I need to quit working on this for now as I have real life things falling too far behind! ? 

But this is a good place to stop.  At least I have the arm calibrated and up to the point where it can follow a path described by a data set on the SD card.  That's a far cry further along than I was last week. ? 

Not much to look at I know, but here's the pic.

file (2)

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Mandy
(@amanda)
Member
Joined: 5 years ago
Posts: 74
 

005,080,090,000 <- closes the claw

If the claw is trying to fully closed (get to position 000) but the test tube is in the way the servo will continue to try to close pulling power resulting in a possible overload of the circuit or the claw flexing under load.  This may be why it finds it easy to pick up a thin object rather than the thicker. 

The claw should stop trying to close once it has a grip on the object.

As the test tube is wider at the top you only need to have the claw closed enough to stop the top falling through.

My suggestion would be to fit a MAX471 current sensor on the 5V to the servos (V+), it gives an output of 1V per 1Amp.  Measure the output with an analogue pin and this way you can monitor the current to the servos and stop movement if they pull too much power.  You will be able to monitor the grip on the claw this way. 

I'm not sure about your co-ordinates though, I'm assuming 0 to 55 degrees for the jaw movement, that is not a lot of options for positioning.  Accessing the PCA9685 directly I get steps from 250 to 1300 for 180 degrees of travel or 320 steps over 55 degrees,  nearly six times the resolution.

Does this help?

 

 

This post was modified 5 years ago 2 times by Mandy

The 600 series had rubber skin. We spotted them easy, but these are new. They look human... sweat, bad breath, everything. Very hard to spot.


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: Mandy
 
My suggestion would be to fit a MAX471 current sensor on the 5V to the servos (V+), it gives an output of 1V per 1Amp. Measure the output with an analogue pin and this way you can monitor the current to the servos and stop movement if they pull too much power. You will be able to monitor the grip on the claw this way. 

That definitely sounds interesting.  I'll have to look into that.  I don't have a MAX471 current sensor here but I might be able to rig something up to measure the current using an analog pin.

In the meantime I put a cork in it.

cork

I put a small cork in the test tube and the Me Arm was able to lift the test tube by the cork. ? 

I'm also thinking that I might be able to find some kind of foam or soft rubber around here that I can slip onto the claw jaws.   That will give the servo something to squeeze on.   That should give it a little more of a springy action.

It lifts the test tube out of the rack.  So far so good.  But now to get it to move the test tube over to another hole and put it back into the rack will be an even bigger challenge because that will need to be done with even more accuracy.

This is so much fun!  But my real life is taking a beating in terms of me not getting my chores done.  It's hot and muggy outside so I'm using that as an excuse.   Plus it's the 4th of July weekend.   Gotta be allowed to play with my robot stuff over the 4th right?

DroneBot Workshop Robotics Engineer
James


   
twobits reacted
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

The Magic of the Arduino Map Function:

I finally wrote up a "Smooth Motion" routine to have the program control the Me Arm to lift "straight up".  I put "straight-up" in quotes because it's not prefect, but it's pretty darn close.  In fact, I don't think the Me Arm could be asked to do much better. 

In any case, what is needed is the starting position and the ending position.  So I do need to have those coordinates known.  Although it may be possible later to calculate what a final position needs to be.

In any case. My data set has changed and the SD card now contains the following data:

M,090,000,045,000
M,005,070,070,055
M,005,100,090,055
L,005,100,090,000
L,005,075,160,000

This is actually less data than previously.  But I have also added a leading letter to indicate the action required.  "M" means to just move to that location directly.  No need for smooth motion when just moving from a home position over to the test tube rack.   Just let her rip.  So I start off with three move commands.

The commands that begin with "L" signal a lift command that needs to be lifted straight up.  So when the program see the "L" it calls the smooth motion lifting routine.   Notice that the last two entries in the above table differ by quite a bit in the middle two coordinates.  But the outer coordinates are constant.  This is because when lifting straight up these are the only two numbers that need to change.

So what I needed to do next was to map 100 to 075 with 090 to 160.  And break both of these up into equal parts to generate a bunch of intermediate coordinates.   I do this by calculating the difference of one set and then using that difference to map both coordinates to.   This way they should step along in close proximity with each other.  It worked.

The actual program is quite complicated so I'll just post a serial output routine here to show what's going on.

/*
 * Generic Input Routines
 * by Robot Pi
 * Variables are defined within the methods
 */
 
void setup() {
  Serial.begin(9600); // Use Serial monitor :  
}

void loop() {
   mapping_Test();
}

void mapping_Test()
{
  String str_input;  
  int num_1; int num_2; int num_3; int num_4; // define vars
  Serial.println("Mapping Test");
  Serial.println("Input four 3-digit integers, separated by commas.");
  while (Serial.available() == 0){} // wait for input      
  str_input = Serial.readString();
  // How to count for substring eg. 012,456,890,234 = 012(3)456(7)890(11)234
  // Also converting String.toInt() while here.
  num_1 = str_input.substring(0,3).toInt();
  num_2 = str_input.substring(4,7).toInt();
  num_3 = str_input.substring(8,11).toInt();
  num_4 = str_input.substring(12).toInt();
  // Print results to Serial Monitor
  Serial.print("num_1 = ");  Serial.println(num_1,DEC);
  Serial.print("num_2 = ");  Serial.println(num_2,DEC);
  Serial.print("num_3 = ");  Serial.println(num_3,DEC);
  Serial.print("num_4 = ");  Serial.println(num_4,DEC);

  int diff; // Difference value
  int mapped_answer; 
  diff = abs(num_3-num_4);// Find absolute difference between last two numbers
  // Map out over the difference of the last two numbers.
  for (int map_out = 1; map_out < diff; map_out++)
  {
    mapped_answer = map(map_out, 0, diff, num_1, num_2); // map the first two numbers
    Serial.print(mapped_answer,DEC); Serial.print(" : "); 
    mapped_answer = map(map_out, 0, diff, num_3, num_4); // map the second two numbers
    Serial.println(mapped_answer,DEC);     
  }
  
} 

Putting in the numbers I mentioned above produces the following output:

Mapping Test
Input four 3-digit integers, separated by commas.
num_1 = 100
num_2 = 70
num_3 = 90
num_4 = 160
100 : 91
100 : 92
99 : 93
99 : 94
98 : 95
98 : 96
97 : 97
97 : 98
97 : 99
96 : 100
96 : 101
95 : 102
95 : 103
94 : 104
94 : 105
94 : 106
93 : 107
93 : 108
92 : 109
92 : 110
91 : 111
91 : 112
91 : 113
90 : 114
90 : 115
89 : 116
89 : 117
88 : 118
88 : 119
88 : 120
87 : 121
87 : 122
86 : 123
86 : 124
85 : 125
85 : 126
85 : 127
84 : 128
84 : 129
83 : 130
83 : 131
82 : 132
82 : 133
82 : 134
81 : 135
81 : 136
80 : 137
80 : 138
79 : 139
79 : 140
79 : 141
78 : 142
78 : 143
77 : 144
77 : 145
76 : 146
76 : 147
76 : 148
75 : 149
75 : 150
74 : 151
74 : 152
73 : 153
73 : 154
73 : 155
72 : 156
72 : 157
71 : 158
71 : 159

That would be a lot of data to have to type into a text file.  Not to mention that I wouldn't even know the proper mapping anyway.   So this way the program generates these coordinates using this mapping technique.   And sends them to the Me Arm one after the other to control the Me Arm to lift "straight up".

Like as I say, it's not perfect, but it's pretty darn close and it does work from a practical perspective.  I also don't believe the Me Arm could do much better in any case.  It's just not that precise.

So now, as you can see, with just a very limited amount of coordinates on the SD text file I can generate the missing intermediate coordinates to achieve "Smooth Motion".

As I say, the actual program that does this is quite a bit more complicated but I'll be more than happy to post the code if anyone would like to see it.

I think I'm going to stop at this point and look into creating my own Arduino Libraries so I can place the SD card reading methods and the Smooth Motion method into libraries and clean up the main code a bit.  My 70 year old eyes are starting to bug out at this point.  I need to clean things up a bit. ? 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Page 3 / 3