Phoenix hexapod servo problem

hi…

i just finished building my phoenix,standard kit (ssc-32, botboard2, sp2 controller)
after starting up (ps2-start) the whole thing goes up instead of down
wenn I let it walk it pushes its feet down instead of pulling them up
and it looks like all the servos are turning the wrong way around.
is that even possible…

I swaped the legs from left to right
but the horizontal hip servos and the knee servo are still working against each other
servos are FeeTech FS5109M
what am I doing wrong…

Sounds like not quite a standard kit as using different servos…

Don’t know these servos. And not all servos are equal. That is with some, they may go clockwise with a certain pulse and others may go counter clockwise. My guess is your servos go the opposite direction than the Hitec servos.

Also you did not say which program you are using, but I will assume the one shown in tutorial (V2.0). What you should try is to reverse the direction the servos go. You can try this, by updating the code. In the file Phoenix_v20.bas (Part of the project you load). There is a function:

[code]ServoDriver:

;Update Right Legs
for LegIndex = 0 to 2
serout cSSC_OUT, cSSC_BAUD, “#”,dec cCoxaPin(LegIndex) ,“P”,dec (-CoxaAngle1(LegIndex) +900)*1000/1059+650]
serout cSSC_OUT, cSSC_BAUD, “#”,dec cFemurPin(LegIndex),“P”,dec (-FemurAngle1(LegIndex)+900)*1000/1059+650]
serout cSSC_OUT, cSSC_BAUD, “#”,dec cTibiaPin(LegIndex),“P”,dec (-TibiaAngle1(LegIndex)+900)*1000/1059+650]
next

;Update Left Legs
for LegIndex = 3 to 5
serout cSSC_OUT, cSSC_BAUD, “#”,dec cCoxaPin(LegIndex) ,“P”,dec (CoxaAngle1(LegIndex) +900)*1000/1059+650]
serout cSSC_OUT, cSSC_BAUD, “#”,dec cFemurPin(LegIndex),“P”,dec (FemurAngle1(LegIndex)+900)*1000/1059+650]
serout cSSC_OUT, cSSC_BAUD, “#”,dec cTibiaPin(LegIndex),“P”,dec (TibiaAngle1(LegIndex)+900)*1000/1059+650]
next
… [/code]
You will notice the difference between left and right legs is the negation of the values. For your servos, remove the negation of the ones for right legs and negate the ones for left legs.

hi kurt…

thanks for the quick response…
you’re right, standard kit,different servos…
your suggestion…was also right…I altered the code
and de phoenix is walking perfectly…
many, many,thanks for helping me…

I have the same problem. my servo run backwards. only that I have the new botboarduino. What should I change?

Same type fix, depending on which software you are running. The one off my github or the one off of Lynxmotion? Regardless you need to change the same stuff, names may be slightly different…
phoenix_driver_ssc-32.cpp:
Look for function: void ServoDriver::OutputServoInfoForLeg(byte LegIndex, short sCoxaAngle1, short sFemurAngle1, short sTibiaAngle1)
Same type of changes I mentioned above…

My newer stuff up on github (Arduino_Phoenix_Parts especially the Quad support branch), change would be slightly different. That is I have code in the may Phoenix_Code.h that does the inversion before calling off to the different servo drivers.
There are defines like cRRCoxaInv 1 that tells which servos to invert.
You can simply negate all of these values. You can put the negated values directly into your robot config and not have to touch the main code base.

Kurt

sorry, but I did not understand. I’m Italian and I have no programming experience.

I found your file github.com/KurtE/Arduino_Phoeni … nix_Code.h , but I did not understand what should I do.

however, I have this situation

Ok, you have found my Phoenix In Parts project. The link you are showing is in the master branch. The more recent stuff is actually in the Quad support branch, but to start off with, you don’t need for the Phoenix as it is a hex not a quad… There are some other changes in that branch as well, but for now the master should work.

There is a top level readme that is part of this project which hopefully is clear enough to explain that this is a little more complex setup than most sketches. In that I have you install each of the directories into your Arduino Sketch/libraries folder. For example on my machine the Phoenix directory is located at: C:\Users\Kurt\Documents\Arduino\libraries\Phoenix (Obviously unless your login name is Kurt on your machine your patch name will be different.

In that project, there is the servo driver file, which on the github is: github.com/KurtE/Arduino_Phoeni … er_SSC32.h
If you look at about line 309:

if (LegIndex < 3) { wCoxaSSCV = ((long)(-sCoxaAngle1 +900))*1000/cPwmDiv+cPFConst; wFemurSSCV = ((long)(-sFemurAngle1+900))*1000/cPwmDiv+cPFConst; wTibiaSSCV = ((long)(-sTibiaAngle1+900))*1000/cPwmDiv+cPFConst; #ifdef c4DOF wTarsSSCV = ((long)(-sTarsAngle1+900))*1000/cPwmDiv+cPFConst; #endif } else { wCoxaSSCV = ((long)(sCoxaAngle1 +900))*1000/cPwmDiv+cPFConst; wFemurSSCV = ((long)((long)(sFemurAngle1+900))*1000/cPwmDiv+cPFConst); wTibiaSSCV = ((long)(sTibiaAngle1+900))*1000/cPwmDiv+cPFConst; #ifdef c4DOF wTarsSSCV = ((long)(sTarsAngle1+900))*1000/cPwmDiv+cPFConst; #endif }
If you look at the two parts (if and the else), the only difference is in the first branch we negate the angles and 2nd part we don’t. Since your servos are reversed, you need to change that to have the first part not negated and the 2nd part negated. (Or alternatively change the first line test from < 3 to >= 3

As for how many people have used the Botboarduino/SSC32 to control their Phoenix? Quite a few. Note: I only recently converted mine to this combination as I kept my Phoenix in reserve running on the Arc32. So I did most of my earlier testing on CHR-3/T-Hex and what I call THR4 (CHR3 body, with T-Hex 4dof legs). But as Lynxmotion is no longer going to be selling Arc32/BAP28 based systems, I currently have the Phoenix with the Botboarduino/SSC-32, running with a version 1 of the Lynxmotion PS2 controller. (I don’t have any of the version 2 or now version 3 controllers)

Thank :slight_smile: