### Author Topic: Introducing my Hex: Ally  (Read 8030 times)

0 Members and 1 Guest are viewing this topic.

#### parallax

• Full Member
• Posts: 94
##### Re: Introducing my Hex: Ally
« Reply #30 on: April 14, 2010, 09:35:23 AM »
Ally Teaser Video:

Note: I just uploaded this, so YouTube might still be processing it. If it doesn't work, try back in a few minutes

I'll post some technical details tonight
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"

#### dellagd

• Contest Winner
• Supreme Robot
• Posts: 731
• Come to the dark side... We have cookies!
##### Re: Introducing my Hex: Ally
« Reply #31 on: April 14, 2010, 02:49:29 PM »
your robot cant stop looking at you
he knows his master
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking \$100

#### parallax

• Full Member
• Posts: 94
##### Re: Introducing my Hex: Ally
« Reply #32 on: April 15, 2010, 10:10:23 AM »
@dellagd: Indeed she does!

The Update:

What you are seeing in the video is Ally's facial tracking ability. Mathematically it is rather simple, if a bit of a pain to get calibrated just right. What's happening, you might ask?

*Ally snags a frame from the camera's video stream, and converts it to a black and white image for the Haar Classifier.

*Ally finds the face in the image, and draws a bounding rectangle around it. In terms of optimal settings for OpenCV's cvHaarDetectObjects() funtion, I have found that a scale of 1.1, 25 minimum neighbors, and the flag CV_HAAR_FIND_BIGGEST_OBJECT tends to minimize false detections. If you want clarification about what I'm talking about, just ask.

*Ally then calculates the center coordinates of that rectangle, and uses the width of it to estimate her distance away from the face. This works because most faces are roughly the same size.

*Based on the location of the center coordinate of the rectangle from the center of the camera's view (a.k.a. the error), Ally adjusts the pan/tilt mechanism that the camera is on to keep the face centered. Also, based on the width of the bounding rectangle (a.k.a. the distance), Ally adjusts the coxa servo's position to lean forward or backward to try and keep the distance the same.

That is what you are seeing in the video. My next step is to get Ally to walk when either the distance gets to short or to large, or when the face is about to leave her point of view from the right or the left.

The Challenges I'm Facing

The challenges I am running into with this are both mechanical and logical:

Mechanically I am finding that my design of the femur allows too much twisting. This is evident when Ally is up on three legs; the third leg of the tripod tends to bend. My solution is to reinforce the femurs with a "splint" of polycarbonate. This is effectively doubling it's torsion resistance (although don't quote me on that- I'm not a materials expert... I got that information second hand) while adding a minimal amount of weight. Other than that, I am finding the the servos are more than powerful enough, and the poly isn't flexing anywhere else; even under a full payload. It is all so effective that I had Ally doing one legged pushups the other day

Logical challenges are with the implementation of the IK for walking. I *think* I have the math put together on this one. Up until this point, I have abandoned two attempts at coding it so far and am about to try my third. My problem is with the implementation of the mathematical formulas into code. Before I try my third attempt, I am posting two word documents (one with my equations, one with a graph labeling all of the angles) to show you all what I am working with. Right now it is purely a geometric and trigonometric approach. In terms of my math background, I have a semester of Calculus under my belt but I am quick to pick up new things. If someone with hexapod IK experience could weigh in on them and tell me what I am doing wrong or what I could be doing better I would greatly appreciate it!

So that is where Ally is at! I hope you like it, and I would really appreciate the community's help with the IK

Here is the link to those files:
http://forums.trossenrobotics.com/attachment.php?attachmentid=1868&d=1271347738

I have them hosted under my Trossen Robotics profile.

@Admin: Have you looked into the possibility of allowing the attachment of files to posts at SoR?
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"

#### parallax

• Full Member
• Posts: 94
##### Re: Introducing my Hex: Ally
« Reply #33 on: April 15, 2010, 03:19:25 PM »
It has come to my attention that the files I posted above are giving some people issues because they are in .docx format. Here are two alternatives:

In PDF format:
http://forums.trossenrobotics.com/attachment.php?attachmentid=1872&d=1271366362

In DOC format:
http://forums.trossenrobotics.com/attachment.php?attachmentid=1871&d=1271366362

Thanks!
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"

#### parallax

• Full Member
• Posts: 94
##### Re: Introducing my Hex: Ally
« Reply #34 on: April 16, 2010, 11:56:26 PM »
Good news! I got some help with my kinematics issues. Big thanks go out to Inxfergy for his help!    I would like to share his advice here for anyone else that may be trying to derive the kinematics for a hex and are looking at my equations for a reference. This is what he had to say:

----------------------------------------------------------------------------------------------

Most of your equations are more forward kinematics style. To get this turned into a program, you'll have to remember that the angles are the unknowns, and proceed from there.

So, first thing is going to be turn this from a 3D problem into a 2D one, by solving for theta. I would recommend thinking about theta in terms of the tangent function, Xb and Yb. There is a common function called atan2 which is typically used to find theta, given Xb and Yb. So, a single function gets you theta (sweet!).

Now that you have theta, you have two links and two joints left to place (and they are in the same plane), which are your red leg lines:

1. You would typically then find OB using OB^2 = (L1^2 + L2^2)^(1/2). OB, L1, and L2 form a plane, which all our calculations are now on.
2. Now, we notice that the same atan2 function could be used to find alpha (based on Zb and the length of the horizontal projection of OB).
3. You can then solve for (alpha + delta), because you have all three sides of your triangle -- and then subtract the alpha value you just determined to find delta.
4. And now, you have a function to describe phi in your sheet (as acos of a really nasty set of numbers).

----------------------------------------------------------------------------------------------------

Given this perspective I was able to narrow down that big mess I had into a few lines of code for my walking engine. I'll post the results soon
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"

#### parallax

• Full Member
• Posts: 94
##### Re: Introducing my Hex: Ally
« Reply #35 on: July 15, 2010, 09:06:47 PM »
Hey all! So It's been a *long* time since I updated this thread... Been wicked busy finishing up school, participating in the MATE competition and so on and so forth. I got rejected as a transfer to Carnegie Mellon University (my dream school...*sigh*), but was accepted as at Worcester Polytechnic Institute(yes! :-) ). I'm double majoring in computer science and robotics engineering there.

So I will finally be able to take classes specific to robotics- I don't know if you have any idea how much that excites me!

Anyway, I did manage to get Ally walking about, and I have videos. I'll get those posted later tonight when I have a decent internet connection. However I have quickly realized that there are several design flaws in her chassis and hardware. These are:

-Chassis Flex: The one sheet of poly I used for her main chassis allows for too much flex. I have tried reinforcing the major flex points, which helped alleviate the problem to a certain extent, but it still is noticeable when she walks; especially in a tripod gate

-Unbalanced Payload: Her weight distributing is "all-kinds-of-funky" (according to my friend). This contributes to the flex problem mentioned above. Also, her battery is a tight fit underneath the chassis- especially when she gets to walking.

-Mechanical Restraints: Her legs are spaced at uneven (though bilaterally symmetrical) points along her chassis. this means that each leg has a radically different range of motion from the others.

-R/F Interference: I discovered this one by accident. I took Ally to one of my school's labs to show her off, and could barely get a signal from her wireless security camera. It took a minute to track down the problem, but we narrowed it down to the vast amount of cell-phones, laptops, and a wireless access node inside the lab all transmitting at once (this is what you get when you pack a room full of geeks I suppose). This might be a one time fluke and there may be no way around it, but I figured it was important enough to list here.

So here is my to-do list:
-Redesign her chassis
-Find a smaller battery pack
-Investigate options for a new wireless camera system

For rebuilding the chassis I haven't given up on polycarbonate entirely just yet. I may try two pieces of poly: an upper "deck" and lower "deck." For the supports/struts between the two decks I have been playing around with the idea of using balsa wood for its strength to weight ratio. I will also explore the option of aluminum, although I am still lacking a decent shop to work it in.

Right now, I am using a 6 volt NiMH 1600 mAH battery pack to supply power to her servos (this one here: http://www.lynxmotion.com/Product.aspx?productID=331&CategoryID=48). This is turning out to be far bulkier than I would like. Any suggestions for a better option? :-)

For the wireless camera I am looking into something like a WiFi enabled webcam... the wireless security camera I have right now is nice because of its size. I may not need to replace it, but if there is a comparable option out there that doesn't require the use of a video capture cable I will consider it.

I guess that's it for my update! I'll have those videos up later. I also promised a while back to post source code at some point- I need to clean it up and comment it better before I do that- right now it's such a mess that it's embarrassing! :-P
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"

#### Ro-Bot-X

• Contest Winner
• Supreme Robot
• Posts: 1,431
• Store: RoBotXDesigns.ca
##### Re: Introducing my Hex: Ally
« Reply #36 on: July 16, 2010, 05:38:00 AM »
Hey Parallax,

I love your robot and I'm glad you'll get to improve it. This inspires me to build my own, but that might take a while because my wife hates spiders and hexapods give her shivers.

I am not sure if you saw Se.Gu.A.Ro. robot on LMR. It has only 2 DOF per leg, but it moves nicely and it's made out of metal. When walking, make that clanking sound like a Replicator, which I find so cool. This may inspire you to perfect your robot.

Take a look at the video here:
Check out the uBotino robot controller!

#### parallax

• Full Member
• Posts: 94
##### Re: Introducing my Hex: Ally
« Reply #37 on: July 16, 2010, 06:58:00 PM »
@Ro-Bot-X: Thank you very much for your kind words! Hexapods are great and a challenge to build, but they can be creepy ;-) The most common reaction I get from people who Ally tracks with her facial detection is "I keep getting the feeling it's going to jump on me or something!" I get a kick out of it! Also, thanks for sharing that video- what a cool hex!

Here is the long promised and eagerly awaited video of Ally's first steps. I have made some significant improvements since this video was shot, but you can clearly see here the problems I highlighted in my last post. Once I address some of those problems (such as redesigning her chassis) I will shoot an updated video of her refined IK engine as well as put her through some of her paces. She just isn't ready for that yet!

Here is the video: