MacBot-1 (my first ...
 
Notifications
Clear all

MacBot-1 (my first robotic arm)  

  RSS

Macoofer
(@macoofer)
Eminent Member
Joined: 3 weeks ago
Posts: 20
2020-05-10 10:23 pm  

Hiya folks,

 

I figured I might as well post some pics and such on the first robot I'm trying to create from scratch.

I haven't gotten very far yet, I'm waiting for parts, more knowledge on those parts and particularly on howto program the Arduino accordingly, apart from the fact that I started this robot project about 4 weeks ago.

It's a 6-DOF DIY 3D printed robotic arm, that when fully standing upwards is about 46cm tall.

The design is a modified design I found on thingiverse.

This current model is powered by 3 15kg servo motors for the waist, shoulder and elbow and 3 SG90 mini servo motors for the wrist, hand and gripper.

I printed all the parts with an Ender 3D Pro and the code I have so far to test it is a collection of various example codes I analyzed and stuck together to in the attempt to get it to do what I hope it will do 😊 .

20200510 224649

- The first picture is the modified design, made in Autodesk Fusion 360

20200510 224707

- The second picture is the current build, where I have all the servos in place, yet 3 are actually connected atm for testing purposes

20200510 224717

- The third picture is the prototyping wiring: Its based off an Arduino mega and the servos directly managed with the digital outs of the mega (Im waiting for some servo motor drivers to ship in) The current setup has a couple of pot-meters which I can use to move the arm in various positions. On the bottom right of the Breadboard you can see two small pushbuttons; when the left one is pushed it stores the current angles of the servos in an array ( this test setup has 8 memory positions). When the right button is pushed it goes through the 8 stored memory positions sequentially in a loop. 

20200510 224723

- The last picture is has two lcd displays, that spit out various real time data to help me understand the difference of what I think the robot is doing and what the robot is actually doing (I had a lot of errors and crashes due to my bad programming and couldn't explain why, adding these helped a lot)

The small 16x2 lcd displays the pot1 and pot2 values in both the analogue values (0-1023)  and the degrees they were mapped to (0-180)

The large 20x4 lcd displays the memory step it is currently at (n-8) The destination angle of a certain servo (in this case Servo2, the shoulder PD2) Po2 is the old, or last known sent angle to that servo.

and AgR2 (AngleRealtime)  shows the actual angle the servo is at.

(one of the things I noticed eg is that the actual angles slightly deviate from the planned destination angles)

I have gotten to the point where im able to smoothen the movement of the individual servo movements. but they are still all serial (waist->shoulder->elbow->etc) since the arduino has single processing serial output.

The next brainbreaker I'm currently trying to figure out is how to emulate multitasking, so that the arm can move all the servo's at the same time (smooth) with independent speeds, directions and angles. So that when I send a command to move eg. 3 servos in one "movement" or "memory-step" they all start at the same time and all finish at the same time, but due to the different amount of degrees they might all have to travel, one would have to move slower or faster than another.

 

Well, that's how far I've gotten so far!

I will keep you updated on the progress and will most likely knock on the forums' door for some help on tackling my current brainbreaker 


Quote
Topic Tags
bushgeek
(@bushgeek)
Active Member
Joined: 2 weeks ago
Posts: 5
2020-05-20 6:01 am  

I think this is a great project to grind through. Looks like the mechanical part is not difficult for you but the coding is.

I have a few questions for you:

  • Did you try to build a simpler arm as a warm-up? Just wondering.
  • Why do you say:
    Posted by: @macoofer

    the arduino has single processing serial output

    Aren't you controlling the servos directly using PWM pins, not Serial?

  • Are you familiar with using millis() and "tight loops" for timing, as in the built-in sketch BlinkWithoutDelay? This tutorial or similar may help: https://www.programmingelectronics.com/arduino-millis-multiple-things/

ReplyQuote
frogandtoad
(@frogandtoad)
Reputable Member
Joined: 12 months ago
Posts: 452
2020-05-20 6:24 am  

@macoofer

Looking good!

Arduino can kind of perform some parallel writes by manipulating port registers directly.

There is a good reference here: Arduino Port Manipulation

Cheers!


ReplyQuote
Macoofer
(@macoofer)
Eminent Member
Joined: 3 weeks ago
Posts: 20
2020-05-20 10:03 am  

@bushgeek

 

Thanks for the suggestions!

 

Before making this actual robot arm, I made a test setup with just two servos on a breadboard (I still have this setup as a means to quickly try out new code.)

During my searches I came across the millis(), looked into that and found a bunch of examples on using that with servos but in a very unclear way to me. With a very useful link from @robotbuilder, posted in another topic, I managed to get a better grasp of that concept.

I hadn't been able to get back into it due to work, but will very soon.

The "the arduino has single processing serial output" may have been confusing in the way I wrote it.

What I meant by it is that the arduino cannot straight up run parallel tasks and goes through code sequentially (if, for and while loops). In order to break this down, I have to use the suggested millis() or similar.

 

So yah, the mechanical part is not so much my limitation, my newbee knowledge on Arduino's (or any microcontroller) and the programming of them, since I literally just started to learn the code, is my main challenge. 😀 

But, as I was hoping when I joined this forum. There are quite a few people in here (you included 😉 ) that have skills in that, that are far beyond mine and have shown to be willing to help. And already did!

So, I'm going to dive deeper into the millis() section and experiment with that this weekend.

I'll post my findings here 😊 


ReplyQuote
Macoofer
(@macoofer)
Eminent Member
Joined: 3 weeks ago
Posts: 20
2020-05-20 10:11 am  

@frogandtoad

 

Thanks for the link,

However, in my current stage of knowlegde I'm not sure if that is the kind of tweaking-depth I should dive in atm, lol

I got some good links to the millis() function, I just need to fiddle around with that and write some additional dissecting code to calculate the various distances and speeds for each movement on each servo. I know it can be done, since I've seen people use it, now I just have to understand it and do it myself 😉 


ReplyQuote
frogandtoad
(@frogandtoad)
Reputable Member
Joined: 12 months ago
Posts: 452
2020-05-21 12:04 pm  

@macoofer

Posted by: @macoofer

Thanks for the link,

However, in my current stage of knowlegde I'm not sure if that is the kind of tweaking-depth I should dive in atm, lol

Not a problem, I thought you had a grip on it as you mentioned wanting to emulate multitasking... something to look into when you become more comfortable with Arduino.

Cheers!


Macoofer liked
ReplyQuote