Sleek- A Quadruped (with phoenix leg)

LOL :wink:

Oh I dunno… maybe the word hefty is a good alternative… I mean I see 6600mahr packs out there now so it’s just a mater of cash to ante up. :smiling_imp:

Very nice chassis proto type. Good job. 8)

Yes, that tells me that the holes for the servo horn are radial. I was debating whether to orientate them in-line or radial. I went with radial as well, if for no other reason then it looks cool! But it does somewhat determine the “mid-range” position of the servo. I assume your horizontal (coxa) angles are all at 90 degrees then, since your servo center lines are arranged on a square. I’ll have to use a table to get my angles, as they are not simply 60 degrees (Phoenix), nor 90 degrees. No big deal.

Alan KM6VV

Yup, radial it is. :laughing: Radial looks better as it is symetrical around the center point, while inline would make it look mirror, which is not great.

Since the quad will be walking in omnidirection, radial would be more suitable. For that reason, I prefer the leg to sit at 45 deg, but since the body is not square, so it would make about 48.3 deg.

Some updates:
I have the PWM generator up, generating 6 pulse per chip. So I need 2 chips. Currently in the midst of rewriting the code so that it would fit 12 PWM in 1 chip.

Radial does look better! However in-line is also symmetrical about two axis. Your 'bot and mine are also symmetrical about two axis.

It seems a square aspect is the best for an omni-directional 'bot. If the 'bot is “tank” driven, then a rectangular aspect might have it’s advantages.

Doing you’re own R/C servo driver chip(s)! That’s fantastic!

Alan KM6VV

I went to one of the local RC store last Thursday, was looking for battery charger actually (I didn’t buy from Lynxmotion cause over here we use 240V outlet), and somehow bought myself a 2.4ghz Tx and Rx, china product. Relatively cheap, and so it the quality. :unamused:

Manage to get the module up and transmitting, my primary reference came from here DIY custom 2.4ghz RC radio system for robotics….

Here’s the photo during testing, kind of messy. Hehe… :laughing:

http://img40.imageshack.us/img40/6344/p1020171whitebalanced.jpg

And here’s another picture during earlier PWM code development. The LCD let me know which servo I am controlling (up to 6), current position and pulse step in microsec, and to verify that the channels are transmitting…

http://img40.imageshack.us/img40/6844/p1020108.jpg

Messy?? Looks VERY tidy if you ask me :wink:

There were actually waste (wire insulation, jumper wire, etc) scatter outside of this field of vision. :laughing: Anyway, that was just to test the radio module. Back to progress.

Some update, I manage to code 12 PWM into 1 PIC, with accuracy of +/-0.4us. I also manage to squeeze in the IK equation (but only for 1 leg) into the chip. The code still need much work before posting (if anyone interested at all), so I’ll share a brief summary.

In a single cycle of 20ms, this is what was prepared:
0.0 - 2.6ms : simultaneous PWM generation for servo 1, 2, 3
2.6 - 5.2ms : simultaneous PWM generation for servo 4, 5, 6
5.2 - 7.8ms : simultaneous PWM generation for servo 7, 8, 9
7.8 - 10.4ms : simultaneous PWM generation for servo 10, 11, 12
10.4 - 16.6ms: Read from input pin, IK calculation
16.4 - 17.0ms: Post-process the leg position in X, Y, Z (in mm) and display onto LCD.
17.0 - 20.0ms: Spare

From the beginning is was about code optimization and timing, so I observed and timed the execution time using MPLAB Debugged Sim stopwatch. The timing is approximated with tolerance of +/- 0.1ms.

The first code was run on 16F877A @ 10Mhz. For the IK, I prepared a lookup table for cosine with size of 200, and further improved with simple linear interpolation. The accuracy is 0.04 deg (the largest I have encounter). Whats important is that it cutdown the calculation from start to finish in less than 400 instruction cycle (equivalent to 160us).

I have also included cordic division and cordic squareroot into my code. With that, the entire IK calculation takes approximately 5ms. Still not quite there yet. :unamused:

Next, I transfer to PIC18F. Had some very very weird problem with the code, doesn’t seem to be compatible at all. Stuck.

Once I have that figure out, I was hoping to bump the speed to 40Mhz, IK calculation would go down to 1.25ms!!! Which means I can actually solve 4 IK equations in single cycle, with few milisec spare for polling from Rx and do something else!!! Maybe some LED flashing :laughing:

Hi ?,

That’s quite a good start. I coded an 8-servo controller in a pic, along with a simple sequencer, but it’s a jump to go over 8. I see you’ve done it!

If you said, I didn’t find it. I take it you’re using ‘C’? Which compiler?

I’m sure there are several of us that would be interested in studying your code, when you’re ready. Especially the cordic division and cordic squareroot. But, if you need that, then maybe you are using BASIC? Which BASIC? Now you have me curious!

Alan KM6VV

I lost you there. Was there something you are looking for that was not include in my post? I’m using CCS Compiler.

Here’s the cordic squareroot code (about 2600 instructions, 1ms), mostly consumed by the squaring):

[code]long sqrt(int32 value)
{
int i;
long j = 0;
long k = 16384;
int32 test;

for(i=0;i<14;i++)
{
j = j + k;
test = square(j);

if(test > value)
j = j - k;
k = k >> 1;
}
return j;

}[/code]

and the sub routine code for square.

[code]int32 square(long value)
{
int low, high;
long test1, test2, test3;
int32 test;

high = make8(value,1);
low = make8(value,0);
test1 = (long)lowlow;
test2 = (long)2
lowhigh;
test3 = (long)high
high;
test = make32(test3,test1) + (make32(test2) <<8);

return test;
}[/code]

and cordic division, (about 1000 instructions, 400us).

[code]long div(int32 numerator, long divisor)
{
int i;
int count = 0;
int32 j;
int32 k;
long result = 0;
long var;

k = divisor;
j = numerator;

while(k < numerator)
{k = k << 1;
count++;
}

var = 0x01<<count;

for(i=0; i<=count; i++)
{
if(k <= j)
{j = j - k;
result = result+(var>>i);
}
k = k >> 1;
}
return result;
}[/code]

It must have been late! I had to re-read what I wrote a few times to figure out what I meant. That’s bad!

What I was trying to say was that if you had previously mentioned what compiler you were using, I couldn’t find it in your previous posts.

Thanks for the code snippets! I’ll give them a look.

I bought the CCS compiler several years ago, but I’ve since moved on to HighTec, since they were using it at work.

Thanks!

Alan KM6VV

Some photo updates.

http://img527.imageshack.us/img527/6585/p1020179.jpg
http://img43.imageshack.us/img43/2659/lcdcopy.jpg

I made a video as well, IK test for single leg. youtube.com/watch?v=e3ZQkYqQSOo

I upgrade from 16F877A to 18F458, still using 10 Mhz. It polls input from the tack switches, display on LCD, compute the IK calculation, generates 3 PWMs and position the leg. At this stage, I’m still using 1 leg for debugging and troubleshooting.

After seeing innerbreed photos and video, I too got the legs up. :smiling_imp: It looks empty without the electronics though, and lacking of some paint job. Anyway, I bumped the frequency to 40Mhz and it works! :smiley:

http://img41.imageshack.us/img41/7880/p1020223b.jpg
http://img529.imageshack.us/img529/7965/p1020202.jpg

Great progress and pictures!

Good to see that your IK works too, nice video and smooth servo movement. Looking forward to see more of Phoenix’s little sister :wink:

Great to see some movement.
very interested to see all this come together… get building! :wink:

wish i knew electronics like that.

custom is the key.
again great vid and pictures.

look forward to next update. 8)

I attempted to etch my own PCB using toner transfer method. The first try didn’t go well, with some missing pattern at the bottom. One thing I discover here is that toner transfer work well up to 0.012".
http://img218.imageshack.us/img218/7223/p1020956resizer.jpg

The second attempt was a lot better, all the pattern was transfered to the PCB, except for some irregularity on the surface of the large traces.
http://img222.imageshack.us/img222/7575/p1020959resize.jpg

The round pad is too small for me. I saw some youtube video where people increase the pad size by adding width to left and right of the hole, something like this:
http://img81.imageshack.us/img81/3062/multiservocontroller.jpg

This is my first time designing PCB, and for playing it safe, I put a lot of space between the traces, and no common ground as well.

I’m using the same mounting from phoenix, so the board is also sized accordingly. Eventually I have to drop some component and split the board into 2; mainly due to the board size, and lack of space for trace since I’m using single side PCB. I don’t want to increase the quad body size either, any bigger and it won’t look that aggressive. It was a very tough decision. :unamused:

For now, I need to find that 0.8mm drill bit, which is a bit difficult. If not have to settle with 1.0mm. That’ll be the plan for next weekend. :wink:

Nice job on the board!

I’ve been isolation milling small boards for my projects on my CNC’d Sherline mill.

Alan KM6VV

Wish I have that kind of machine. Anyway, the PCB I got is typical. I wanted 2oz, but the owner isn’t sure of the thickness. End up asking and searching over 20+ shops asking the same question and got the same answer. :imp:

Anyway, I just simply bought one, end up with large traces on the PCB. Any idea how to test the thickness?

So how would you drill the holes in the board? this is something I was concerned about because I do not own a drill press.

Brandon C.

Use a micrometer, or even a dial caliper.

Measure board + trace, subtract board.

Alan KM6VV