Monday, September 2, 2013

Simple Arduino Robot Arm from 9 gram servos

Greetings once again. I just wanted to take the opportunity to introduce you to my new robot arm. It doesn't have a name, but it is made from house insulation foam and 9 gram servos. I won't do a full tutorial on this because frankly it isn't required. There are tons of this sort of thing out there. Use mine as a starting point for your own design based on what you have sitting around. This is just one example of something that works.


For this project you will need a few things.

The first is an Arduino or other microcontroller. I suppose you could use an RC receiver or some other sort of signal generator, but I will be using an Arduino Mega2560 r3.

Next you will need two HXT900 9gram servos (or similar). These can be purchased  from hobbyking.com (what I recommend), or you can search for 9 gram servos on Ebay. They are common and cheap. I will say that the one's from HobbyKing are pretty decent quality (for a $3 servo). They aren't without fault, but you could do much worse.

For the arm's physical construction I will be using half inch house insulation foam. It is also cheap, but you will probably need to buy a full 4x8 sheet of it. You might be able to use styrofoam or foam board as well. Just make sure it is light. These servos aren't very big.

Last you will need some sort of hinge bracket. I use a part off some old plastic blinds for the base and then just a plain screw for the elbow.

First, cut two lengths of foam about 6.5" x 1". This is about the maximum length that I would use. Beyond that the servos start to get overtaxed when fully extended. Next cut the center cross beam. It is about 1.25" x 1". Basically, make it big enough that your servo and hinge will fit in between the first two pieces.

Next we are going to glue it together. Make sure your servo horn is pointed in the right direction, and hot glue it in place as shown. I use the servo itself along with the plastic blinds bracket as the joint. Again, if you are using a bracket completely dissimilar to mine, you may need to modify this. The spirit of this arm is use what you have.


Next we are going to make the other arm segment. This is about 5" x 1". I cut two of them and then glued them together to make one solid arm.

Next I screwed a screw into the center of the arm about a half inch from the end. This works as my other hinge. The metal on foam is actually pretty fluid.



Next we need to mount the elbow servo in the 1st arm segment. I cut a nice slot in the arm and slid it in. A little hot glue, and it was secured. This is a good time to go ahead and make sure your elbow servo horn is in the correct position. This is important. It will be hard to change later. Place the horn to achieve the desired range of motion.



Now cut a hole in the 1st segment opposite of the servo to create the other side of the hinge. Insert the screw of the 2nd segment and glue the horn in place once you get it straight. You should now have a completed arm without a base.

Go ahead and cut a base. I used a 5" x 5" slab of the same foam. Now just hot glue the servo of the first joint to the base, and you are good to go. Your arm is now done!

The keen eyed observer may not that this arm can't really do much. It can't rotate or pick up things. About the only useful thing I have done with it is tape a sharpie to the end. That is not the point. The point was to build a tool with which I could explore inverse kinematics. That goal is achieved.

Inverse Kinematics is another post; however, you can test your arm with either the sweep or knob example programs. Note that if you have problems, try powering the servos from an external power supply. It is entirely possible that your Arduino just isn't providing enough current.


Maybe this post inspired you. Maybe it didn't. If not, wait around for inverse kinematics(now HERE). That will be more interesting.
-Matthew

Thursday, August 29, 2013

Why Write a Tech Blog?

I have been asked why I began writing this blog. To answer anyone who might want to know, I have decided to write this blog post. I'll just dive in.

1) Writing a blog encourages documentation. I tend to work on things in a scattered manner. Knowing that I will need to post pictures and a summary of the process encourages me to keep my thoughts focused and my records organized. At the very least, I have to finish the project before I forget what I did.

2) Writing a blog helps immortalize documentation. When I hit publish on a blog post, I can (generally speaking) count on Google to put that post out there. If my house catches fire and burns to the ground the next day, all I have to do is go to the library and type in "projectsfromtech.blogspot.com", and all my previous projects are right there. Even if I forget my password, this data will still probably stay out on the inter-webs until long after it has become irrelevant (which isn't that long).

3) Writing a blog helps increase documentation accessibility. Obviously, if I write down my projects on a notepad and tack it to my wall, not too many people will ever see it. What I am doing may be completely useless to some people. However, it may be invaluable to others. When I begin a project, the first thing I do is Google the problem and see if anyone has done it before. My blog just adds to the list of things that have been done. Sure, there is a post on how to run stepper motor x140 out there. But if I want to run a x143 wouldn't a post on running an x143 be helpful too?

"But if everyone posts what they are doing, the internet will become so clogged that no one will be able to find anything!"   Well there again, thank our friends at Google. It isn't easy to get on the first list of hits for a Google search. All we can hope for is that the articles that will help you are there, and the junk ones are off in the weeds.

Technology is advancing faster than ever before. The best technology today is the discarded second of tomorrow. Universities release exciting new papers that are outdated before people have time to read them. Individual men have always been great innovators, but this boom has come about from the share of information. The internet is a fundamental part of the way life is lived and problems are solved. Open source and open hardware projects are a major part of the internet. Something that one man does because it is cool becomes something that another man uses to solve a problem. The internet is a dark and scary place, but no one can deny its profound impact on technology.

So go blog away about your projects. I plan to as long as I can. Will my blog become a trusted resource for hobbyist? Probably not. Will 3,000 people read this post? Probably not. But someone Googling "Why Write a Tech Blog?" might, and that person is this post's intended audience.

Why write a tech blog? I have my reasons. Now it's time to get back to my projects.
-Matthew

Tuesday, August 27, 2013

Introduction to myrobotlab (MRL)

First, let me say that I am a user of myrobotlab. Not a developer. With that in mind, it is also safe to say that I really know very little about the software. This post is just a collection of things I have learned and observations I have made from a user's perspective.

For a while I have been wanting to do a little vision processing, and being a FIRST robotics alumni I had seen a bit of this done. While I had never been actively a part of the programming, I also knew that FIRST teams get a "free" copy of roborealm with their kit every year, and that is what many teams use for vision processing. Well that is all well and good, but I like free. I began looking for a free version of roborealm and found myrobotlab.

Well for those that may be coming from the land of Arduino (like me) MRL is completely foreign. At first glance, it looks all GUI and friendly, then you discover a hidden underworld of features that can only be found by someone who already knows where they are. Regardless, after getting it installed, getting OpenCV (a widely used computer vision library. See HERE) up and running is pretty simple. You can have your camera finding your face in a matter of seconds. Now, doing something with that data is more tricky.

Now like I said, I am in no way a trusted source on this, but this is my take on how MRL works. You have a set of services running within a Java infrastructure. These services can do just about anything. At the time of this writing the main way you link these services together is by a Python service. From there you can set up the links from service outputs to service inputs. There's just one problem. How do you know what each service can input and output?

Well that is where not being a real programmer is a real pain. Basically, play around with stuff. Look at the examples on each service page and HERE. If you encounter a problem, post on the forum or in the chat and ask a developer. With features progressing so quickly, sometimes examples get left behind. One useful forum topic on this is found HERE. In it GroG discusses several ways to look at the various methods for communicating with each service.

That's about all I can say about it. I have been playing around with it, and as someone who learned to "program" on an Arduino less than a year ago I can say that the fog does lift. Play with some examples and ask questions, and you will figure it out. Of course, if you already know Java or are a real programmer, I'm sure you will have no problems with it.

I have been playing around with the serial, keyboard, and opencv services mostly. Hopefully I will be able to post some cool projects with them in the very near future. Until then, check out myrobotlab. Such opensource projects are always neat to check out even if you aren't going to use them. The people on there are always nice, and I'm sure there's room for one more user.

-Matthew