Project Phoenix, a hexapod robot

If you want me to modify PEP I need to know whats causing this problem. To be honest I’ve almost never had problems with exporting files. I’m using Excel 2000 (the fastest), and have tested it with 2003 but not with 2007.

I would like to have a copy of the PEP sheet just after you have done a export function that does not work. I also need to know what Excel version you are using. Then I’ll test the export function on my computer to see if the error still occour. Then I hopefully have a chance to fix it. If the error (extra row issue) are caused by MS Excel (not the PEP sheet) it is pretty hard for me to fix it :wink:

Another thing, does this export error occour randomly?

Hi,

I’ve spent some more time studying kinematics lately. I’ve worked more with Xan’s code. If you study the subroutine BodyIK you can see that it takes care of Y-rotation and the pitch and roll rotation. I’m guessing Xan used the formulas I used in the PEP sheet for the roll and pitch calculation.

To be honest I’ve never been pleased with these simplified rotations (pitch and roll), because they are not real body rotation. They only uses FTAN to adjust the BodyIKPosY value.

If you compare these body rotations with the rotations Matt Denton demonstrates on his videos you’ll understand what I mean…

Anyway, I’ve rewrote the BodyIK subroutine:

[code]BodyIK [PosX, PosZ, PosY, BodyOffsetX, BodyOffsetZ, RotationY]

;Calculating totals from center of the body to the feet
TotalZ = BodyOffsetZ+PosZ
TotalX = BodyOffsetX+PosX
;PosY are equal to a “TotalY”

;Successive global rotation matrix:
;Math shorts for rotation: Alfa (A) = Xrotate, Beta (B) = Zrotate, Gamma (G) = Yrotate
;Sinus Alfa = sinA, cosinus Alfa = cosA. and so on…

;First calculate sinus and cosinus for each rotation:
gosub GetSinCos [TOFLOAT(BodyRotX)]
sinG = sinA
cosG = cosA
gosub GetSinCos [TOFLOAT(BodyRotZ)]
sinB = sinA
cosB = cosA
gosub GetSinCos [TOFLOAT(BodyRotY+RotationY)]

;Calcualtion of rotation matrix:
BodyIKPosX = TotalX-TOINT(TOFLOAT(TotalX)cosAcosB - TOFLOAT(TotalZ)cosBsinA + TOFLOAT(PosY)sinB)
BodyIKPosZ = TotalZ-TOINT(TOFLOAT(TotalX)cosGsinA + TOFLOAT(TotalX)cosAsinB
sinG +TOFLOAT(TotalZ)cosAcosG-TOFLOAT(TotalZ)sinAsinBsinG-TOFLOAT(PosY)cosBsinG)
BodyIKPosY = PosY - TOINT(TOFLOAT(TotalX)sinAsinG - TOFLOAT(TotalX)cosAcosG
sinB + TOFLOAT(TotalZ)cosAsinG + TOFLOAT(TotalZ)cosGsinA*sinB + TOFLOAT(PosY)cosBcosG)
return
[/code]

I’ve also modified other parts of the code. I renamed the sinus and cosinus output to sinA (sinus alfa) and cosA (cosinus alfa).

One question: all the TOFLOAT commands, do they steal much processor time? I’m just thinking if it could be done once before the matrix calculation. :unamused:

BTW, I’ve just bought a Futaba 7C 2,4 GHz RC remote control. This gives me much better control. I’m also going to modify the 7C. Posting more info about that later.

Here is a little video demonstration. My wife are holding the cell phone camera :wink: , she was actually impressed this time! :laughing: Sorry for the bad quality. When I find time for it I’ll get my Sony video camera and make a real video/film.

I wrote “PEP needs to be looked at” prematurely. After thinking more it could be anything, (PCproblem, version of XL, etc) and not necessarily PEP. I know the problem Harry is having is progressive, meaning it gets worse and worse, and a reboot fixes it. I don’t know enough to really help, so I will butt out. :smiley:

Wow Zenta … you never cease to amaze.

Zenta, that video looks great!

As to your question: AcidTech could give a better answer, but looking at their generated code, there is a little overhead in using tofloat. It does some move instructions and the like. The only loop is in the normalizing process which shifts the original number to the left until the carry bit is set. Worst case is for the value 1 where the loop could go a maximum of 32 times. However the inner part of the loop is simply: shll (2 clocks), dec.b (2 clocks), bcc (4). So it is hard to say how much you gain by doing it before the matrix operation. It might make the code look a little easier to read. Also if you constantly always converting to floating point to do all of your calculations, I wonder if that should be it’s natural form…

But again it looks great!!!

Hi Zenta,

I’m glad you did it! Impress your wife… Less important but I like the movements as well :wink:
No kidding, really neat!! Where did you get the IK? From the robotics book that you’ve mentioned before?

I bet he did! :smiling_imp:

This is still in my todo list (on top of my code) :wink: I know that the constant conversion between floats and integers is not the best way to do but I didn’t find a decent way to work around that. I did look at a byte array some time ago but if I want to get the same precision the array would be really large. Maybe there is another way that I don’t know. What do you mean by matrix calculation? Is this the byte array or some cool math method? :confused:

If you have a good idea about this, let me know! Maybe we can figure this out together…

With every move on the video there is one thing going through my mind! “Damn, that is what you call precise and accurate control!â€

Hi,

Thanks A-Bot, Kurt and Xan!

Yes, the rotation kinematics are from the book “Theory of applied Robotics kinematics, dynamics and control” by Reza N.Jazar. In chapter 2 (Rotation Kinematics) page 39 you’ll find the global rotation matrix:

Global rotation matrix  =
cAcB			-cBsA			sB
cGsA+cAsBsG	cAcG-sAsBsG	-cBsG
sAsG-cAcGsB	cAsG+cGsAsB	cBcG

Where c=cosinus and s=sinus. As soon as I figured out how to calculate the matrix it was pretty straight forward to make the code. At first I tested it out in Excel and compared it with the results in the PEP sheet, then I tried it in your code.

What I ment is the math formula i used in the code to get the BodyIKPos values.

I have the answers…

The empty cell is not generated by PEP directly, but the fact that PEP is not copying the Project name on each row it’s generating an empty row in SEQ when importing. So to fix it you must copy the project name on each row of the csv. SEQ manual is clear about this, csv row must contain; Project name, sequence and step on each row. If this is not in place, the database could crash because the error is about the database key. However, the empty row will cause damage only in rare cases. Laurent thinks the empty row would take the place of a real step…so if you think if you import a 16 steps csv it could result in a 15 steps + 1 empty row project. When you import a 1000 step sequence it’s not noticed that it’s only 999 steps. :wink:

I know you and Laurent know what the problem was, but for the rest of us. When exporting using PEP it creates a new sheet in Excel that you need to “save as” to be able to select the “csv” format into Excel (because by default it’s “xls”) but after that you need to close the new sheet in Excel, else the “saved as” file is still reserved by Excel and SEQ can’t open it.

Hi Jim,

That part are fixed now. When exporting files the project name are copied to all rows! I just sent you a new version (ver 2.02 beta).

Since I have seen this book mentioned a couple of times now, I ordered it from Amazon.com. It arrived today :laughing: Looks like I need to dust some of the math cobwebs out of my brain :blush: . Probably the last time I did any matrix operations was maybe 25-30 years ago. Any suggestions on where to start?

Thanks,
Kurt

Rotation matrix? I can’t seem to get past 2+2… :laughing:

Congratz with the book, I know the “dusty” feeling when opening the book :wink:

Where to start? With the beginning of the book I think? :wink:
I didn’t know much about matrix calculation at first, so for me it was a good start to study that part first.

Thanks :laughing: , I usually like to start at the end of a book and work backwords :wink:, but maybe this time I will try it the other way.

However what I was earlier trying to ask :blush: was did you find any primers (either books or web sites) that made it easier for you to digest this information? I used to be very good in math (only a couple of math classes away from a dual degree, but that was a few years ago (back when Carter was president).

Kurt

What I did was to search for my old and dusty school books. Tom-chang79 gave me a tip about this website regarding matrix multiplication.

It sounds like your math skills (education) are way over mine!

Hi,

I’m finished doing some modifications with the Futaba T7C 2,4 GHz RC remote. I’ll soon make a tutorial on how I did it with pictures and schematics. Here is a rather long video of Phoenix doing combinations of walking and rotations. Also translations and a few GP sequences (no new sequences yet).

A picture of the modified Futaba:

I wanted it to look as normal as possible, I’ll post more info later…

Hi Zenta,

You did a great job with the remote! The video shows again how solid and precise the remote works! I’m looking forward to see the tutorial!

Xan

Thanks Xan!

I’m thinking of making a tutorial at the TRC tutorial section.

BTW: Yesterday I had a demonstration of my LM Phoenix at work. She was a bit shy with 35 people around her :laughing: But she performed very well and got great applause at the end. I also demonstrated her at my local RC-shop, they where pretty impressed too. They had never seen something like this before… :smiley:

I bet that got a big applause! and she deserved it 8)

I brought BlackWido to work when I just completed the mechanical part. Now I’m getting the same question about every week. “Is it walking already?â€

Especially some of the ladies thought Phoenix was a bit scary… :smiling_imp: But you should see their faces when I played some of the GP sequences :open_mouth:

Yeah, it’s fun with some audience!