Saturday, October 31, 2009

Spiderwheels: smaller servos...

Wow, it feels like forever since I've blogged. I learned how to design circuit boards a few weeks ago. It is a lot easier than I thought it would be. While I was waiting for some new bits to come in the mail I started working on my Spiderwheels project again. I've been experiencing issues with my netbook since I got it and just recently found out what was wrong with it. It looks like the graphics card is overheating under normal use and cannot run for more than 20 minutes. I was really upset at first. I'm over it now. EBay is not always the best option.

Considering the netbook I got for this project is non-functional I have decided to look into building a smaller robot without the burden of the 2 lb netbook. This idea hit me when I stumbled across these servos. They weigh 9 grams and cost $3.50. Compared to what I was spending for the larger 55 gram HiTec servos, +/- $30, these are a steal. I went ahead and ordered a few to do some benchmarking. So far I am very impressed. I want to construct a leg and get a feel for accuracy before ordering more. With these prices this project may well produce a six legged walker from the start.

Here they are side by side:



Here is a close up of the 9 gram servo:





Sunday, October 11, 2009

Spiderwheels: I have so much to learn...

I realize this is my first robotics project and I should stick to wire nuts and breadboards but I want to learn as much as I can from this project. Frustratingly enough, this means I must take several steps back and pursue PCB fabrication. I built a mill and am getting close to being able to mill boards. The next step is learning how to design them. This is a very overwhelming subject for me and it is hard to know where to start. I have decided to go with Eagle as my layout editor mainly because the RepRap team uses it and this is all I have to go on when it comes to board fabrication. So, I guess the first step is to follow some tutorials. I have chosen this tutorial because it will also serve as an introduction to the FT232RL chip, which is used in the Arduino. Time to learn.

Monday, October 5, 2009

Mill: starting yet another project...

Every once in a while I get the chance to re-evaluate my vision and the direction my research is going. Every time I get the chance to do so I identify a gaping hole in my current tool set. For the last six months I have had a working 3d printer at my disposal. However, when I started working on my first robotics project I found that it wasn't enough. I am missing an easy and accurate way to fabricate PCBs. Of course I could purchase the chemicals required to etch, but I have a small apartment and I haven't seen much precision out of people who have gone down this route. Since I started building a RepRap I have been aware of CNCs capable of milling PCBs and have even given this a try on my Darwin. I quickly found out that milling on a Darwin isn't the best idea.

Thus, a new project is formed. I don't have a lot of time or motivation these days and so I wanted to be smart about getting a cheap solution up and running with minimal time / resources. I decided to go with a time tested design called the Rockcliff. It's not an open source design, but the plans only cost $20. They are well worth it! Here is an animation of the design I went with:



It is mostly made out of 3/4 inch MDF and 5/8 inch steel rod, which cost $60. You will also need some bearings, motor couplings, stepper motors, and driver boards costing upwards of $400. However, considering I have a 3d printer I was able to print the bearings and couplings. Here is video of what the printed bearings look like:


CNC parts printed on a RepStrap from gavilan on Vimeo.


I am also borrowing the driver boards from my printer while I mill another set.

In total, I think this CNC will cost me around $240. Not bad for 0.003mm precision.

Here is a picture of the mill as it stands.



More to come on my goes at milling PCBs on this Rockcliff.

Sunday, October 4, 2009

RepStrap: a Darwin x motor bracket...

I finally got around to printing my x motor bracket the other day.



There are a few structural weaknesses due to my Z axis, but I think it will hold together. I am getting close to replacing all my hand made parts.

Saturday, August 22, 2009

Spiderwheels: motion...

Here is a video of a proof of concept I put together.


movement experiment of spider leg... from gavilan on Vimeo.


The materials are minimalistic and only for this experiment. You can clearly see that the leg is cycling through (D = 2, H = 3), then (D = 8, H = 3), then (D = 8, H = 4), then (D = 2, H = 4), then back. With two legs mounted on the front of my robot, this would be enough to propel it forward 6 inches per touch down.

Here is the source code:



#define servo2Pin 2
#define servo3Pin 3

int i;

void setup(){
  pinMode(servo2Pin, OUTPUT);
  pinMode(servo3Pin, OUTPUT);

  Serial.begin(9600);
}

float l1 = 4.5;
float l2 = 6;
float d,H;
void loop(){
  H = 3;
  for(d=2;d<8;d=d+0.2){
    for(i=0;i<1;i++){
      goToAngle(servo3Pin, hipAngle(d, H, l1, l2));
      goToAngle(servo2Pin, kneeAngle(d, H, l1, l2));
      delay(20);
    }
  }
  H = 4;
  for(d=8;d>2;d=d-0.2){
    for(i=0;i<1;i++){
      goToAngle(servo3Pin, hipAngle(d, H, l1, l2));
      goToAngle(servo2Pin, kneeAngle(d, H, l1, l2));
      delay(20);
    }
  }
}

int kneeAngle(float d, float H, float l1, float l2){
  return ((acos((l1*l1 + l2*l2 - d*d - H*H)/(2*l1*l2))*180)/PI);
}

int hipAngle(float d, float H, float l1, int l2){
  return 180 - (atan(d/H) + acos((l1*l1 - l2*l2 + d*d + H*H)/(2*l1*sqrt(d*d + H*H))))*180/PI;
}

void goToAngle(int pinNumber, int angle){
  if(angle <= 180 && angle >= 0){
    sendPulse(pinNumber, (600+(angle*9.72)));
  }
}

void sendPulse(int pinNumber, int pulseWidth){
  digitalWrite(pinNumber, HIGH);
  delayMicroseconds(pulseWidth);
  digitalWrite(pinNumber, LOW);
}


Fun stuff! 50 or so lines can do quite a bit!

Spiderwheels: algebra, geometry, and trigonometry...

I've been wanting to build a spider robot for a log time. I remember looking around the internet years ago to see if other people have done this. One project really stands out in my mind.



You can read all about the how on Zenta's blog.

The fluid movements of Zenta's six legged robot has inspired me to really put some thought into the mathematics behind the movement of a spider before I get too far with design and coding. After a few days of diagrams, equations, and some proofs of concept I have come up with some trigonometric functions that describe a subset of the movement of a spider. Now, let's dive in.

Consider the following:




Yes. That is correct. Spiders have legs. Now, consider the following:




A picture says a thousand words. What I am trying to convey with this one is that the joints that make up the leg of a spider have ranges of motion. At one given point in time the position of this leg can be described by two angles, i.e. the hip and knee, angles. These angles are key because they are "servo speak".

Now, wouldn't be good fun if we could describe the position of the leg in terms D and H in the following diagram?




Considering I will be building these legs I will know L1 and L2. So, given L1, L2, D, and H, how do we find a1 and a2.

The first step is to find k. According to Pythagoras, a2 + b2 = c2.




So...

k2 = D2 + H2
k = sqrt(D2 + H2).

Once we have k we can use the Law Of Cosines to find a2.

k2 = L12 + L22 - (2 * L1 * L2 * cos(a2))
cos(a2) = (L12 + L22 - D2 - H2) / (2 * L1 * L2)
a2 = cos-1( (L12 + L22 - D2 - H2) / (2 * L1 * L2) ).

Similarly, we can find a4.

a4 = cos-1( (L12 - L22 + D2 + H2) / (2 * L1 * sqrt(D2 + H2)) ).

We also know that

tan(a3) = D / H
a3 = tan-1(D / H).

Finally, we can solve for a1.

a1 = 180� - a3 - a4
a1 = 180� - tan-1(D / H) - cos-1( (L12 - L22 + D2 + H2) / (2 * L1 * sqrt(D2 + H2)) ).

In my next blog entry I will show a video of some proof of concept work, as well as share the source code that makes it all happen.

Sunday, August 16, 2009

Spiderwheels: a step in the right direction...

If you've read some of my other blogs you will know that I have been attempting to get into robotics since I graduated college in 2008. This journey lead me to create my own 3d printer with help from the RepRap team. Though I am still working to improve the quality and speed of my prints I have passed the point where it requires intellectual work. I must move on. With what I currently know about robotics (which isn't a whole lot) I've put together an idea for my first robot. This project should sharpen my abilities in writing c / c++ applications under Linux. It should give me an introduction into streaming image processing, skin detection, face detection, and potentially face recognition. It will also be a good project for getting experience using micro-controllers, and servos. Finally, and I'm not 100% sure on this, it may be a good platform for starting an open-source project.

Now that I've laid out all of these very lofty goals let me step back and describe the project that I have envisioned and where it came from.

Every interesting robot has the following characteristics:

  • sensors

  • a brain

  • interaction

In terms of hardware this implies processing power, motors, camera... among other things. I've spent quite some time thinking through the best platform for my first robot when I stumbled across the following:



Above is a picture of an MSI Wind U100-420US Netbook. The amazing thing about a Wind is it weighs 2 lbs and can be purchased off the shelf for under $300. I was fortunate enough to find one on ebay for under $200. Built into this machine is a 1+ hr power supply, 1.6Ghrz processor, 1.3Mpix webcam, mic, speakers, wifi, and a 10 inch screen. Thus, this machine alone can supply a large amount of portable computing power, vision, hearing, speaking, wireless communication, and visual expression. The only gaping hole between this machine and an interesting robot is interaction. This is where my new friend the adruino microcontroller comes in.



This micro-controller is opensource and inexpensive. It is also really easy to program. I know of it because it is the brain for the Reprap. Micro-controllers, among other things, can tell servo motors what to do. A few lines of C, and a bunch of these



and you can have pretty cool interaction. My end goal is to build a six legged spider with these parts, but the servos alone cost $30 a piece. Considering three are needed per leg your are looking at a bit of saving up. I am going to start with only two legs and some wheels.