you’re welcome.lol
Hey…i haven’t finished the tutorial yet!
Well I guess the rest of the tutorial must be right, it works…and understandable, even i got it to work. Wauw this is a great piece of code! I have got to do a lot of tweaking and calibrating…and then a lot of final assembly.
First two questions:
Is there anyway to make the deadzone for the joystick larger, i thought i have seen it somewhere, but can’t seem to find it anymore in the code?
What is the easiest way in the code to invert a servo?
Tnx
PS: where to put all that excess servo cabling?
Agree!
Thanks to Xan for his great Phoenix code! 8)
What I like with his code is that its relative easy to understand and to modify/hack. A-Pod, T-Hex, Archer or MorpHex would probably not be a reality without this code. Also Kurt deserve credit for all his effort on making this code available on different platforms + much more!
- Look for the
cTravelDeadZone con 4
in the core file. Normally its not necessary to change this value. - e.g. NewPWMvalue = 3000-OldPWMvalue
Yes, indeed…the phoenix-code made me understand IK in the first place. In this code I especially like the option of centering bodymove around the head or tail, just great!
Tnx, for pointing out the deadzone…i saw it, but couldn’t find it anymore. It’s neccesary because in bodymove mode the hex keeps moving. Like you said, it’s alive…a bit too alive.
About the inverting of some servo signals. I thought that because i put the femurservo in the leg different from the original Apod i should invert the servo signals. You can see my legdesign in the next image (yes it’s upside down):
So, should i invert them?
It’s a bit hard to see why you should need to reverse the servo as long as you are using Hitec servos. And as long as the servo horn are pointing forward it shouldn’t be necessary. Those this picture show the leg from behind or front?
I am a bit confused. In the Apod the femurservo is directly connected to the coxaservo. In my design the the femurservo is connected throught an c-bracket. So i would expect it to work the opposite way. Yes it is a really bad photo , upside down AND you see the backside of the leg. Perhaps from above:
And i have all servohorns pointing forward if possible.
Oh… I see, my fault. Yes, the femur servo must be reversed.
I believe in the core file you could reverse the femur by doing this:
GetPWMValues [LegIndex]
#IFNDEF UseCodeOffsets
;Update Right Legs
if LegIndex <= 2 then
CoxaPWM = (-CoxaAngle1(LegIndex) +900)*1000/cPwmDiv+cPFConst
FemurPWM = (FemurAngle1(LegIndex)+900)*1000/cPwmDiv+cPFConst ;Femur reversed
TibiaPWM = (-TibiaAngle1(LegIndex)+900)*1000/cPwmDiv+cPFConst
#ifdef c4DOF
IF cTarsLength(LegIndex) THEN ; This leg has the 4th degree?
TarsPWM = (-TarsAngle1(LegIndex)+900)*1000/cPwmDiv+cPFConst
ENDIF
#endif
else
;Update Left Legs
CoxaPWM = (CoxaAngle1(LegIndex) +900)*1000/cPwmDiv+cPFConst
FemurPWM = (-FemurAngle1(LegIndex)+900)*1000/cPwmDiv+cPFConst ;Femur reversed
TibiaPWM = (TibiaAngle1(LegIndex)+900)*1000/cPwmDiv+cPFConst
#ifdef c4DOF
IF cTarsLength(LegIndex) THEN ; This leg has the 4th degree?
TarsPWM = (TarsAngle1(LegIndex)+900)*1000/cPwmDiv+cPFConst
ENDIF
#endif
endif
Its just a matter of +/- to the angle.
First of all, thank you Kåre for helping me this way.
I am perhaps even more confused, because after inverting the femur servo’s I did some real testing. And it didn’t work, so i changed back to original. And then it looks like you can see in the video. I have a 20 degree servo ofset on the femur by the way.
Next thing is going to be these parts. The bodydimensions i put in seem to be right to me, but the startposition feet always gave me a hard time in the phoenix code. A thought these positions could be described as the restingposition of the tibia-tip. But with the same distance to coxa as when standing in neutral position. Is this correct?
So especially these:
cHexInitPosY con 128 ;Global start hight
cHexInitXZ con 98
CHexInitY con 22
I don’t really understand.
The global startheight is measured in neutral stance from femurpivot to ground?
What is cHexInitXZ
The global startheight is measured in rest from femurpivot to ground?
Is there i good way for measuring or calculating the InitPos for each leg?
;--------------------------------------------------------------------
;[BODY DIMENSIONS]
cRRCoxaAngle1 con -450 ;Default Coxa setup angle, decimals = 1
cRMCoxaAngle1 con -100 ;Default Coxa setup angle, decimals = 1
cRFCoxaAngle1 con 250 ;Default Coxa setup angle, decimals = 1
cLRCoxaAngle1 con -450 ;Default Coxa setup angle, decimals = 1
cLMCoxaAngle1 con -100 ;Default Coxa setup angle, decimals = 1
cLFCoxaAngle1 con 250 ;Default Coxa setup angle, decimals = 1
cRROffsetX con -30 ;Distance X from center of the body to the Right Rear coxa
cRROffsetZ con 75 ;Distance Z from center of the body to the Right Rear coxa
cRMOffsetX con -50 ;Distance X from center of the body to the Right Middle coxa
cRMOffsetZ con 0 ;Distance Z from center of the body to the Right Middle coxa
cRFOffsetX con -30 ;Distance X from center of the body to the Right Front coxa
cRFOffsetZ con -75 ;Distance Z from center of the body to the Right Front coxa
cLROffsetX con 30 ;Distance X from center of the body to the Left Rear coxa
cLROffsetZ con 75 ;Distance Z from center of the body to the Left Rear coxa
cLMOffsetX con 50 ;Distance X from center of the body to the Left Middle coxa
cLMOffsetZ con 0 ;Distance Z from center of the body to the Left Middle coxa
cLFOffsetX con 30 ;Distance X from center of the body to the Left Front coxa
cLFOffsetZ con -75 ;Distance Z from center of the body to the Left Front coxa
;--------------------------------------------------------------------
;[START POSITIONS FEET]
cHexInitPosY con 140 ;Global start hight
cHexInitXZ con 98
CHexInitY con 22
cRRInitPosX con 113 ;Start positions of the Right Rear leg
cRRInitPosY con CHexInitY
cRRInitPosZ con 113
cRMInitPosX con 158 ;Start positions of the Right Middle leg
cRMInitPosY con CHexInitY
cRMInitPosZ con 28
cRFInitPosX con 145 ;Start positions of the Right Front leg
cRFInitPosY con CHexInitY
cRFInitPosZ con -67
cLRInitPosX con 113 ;Start positions of the Left Rear leg
cLRInitPosY con CHexInitY
cLRInitPosZ con 113
cLMInitPosX con 158 ;Start positions of the Left Middle leg
cLMInitPosY con CHexInitY
cLMInitPosZ con 28
cLFInitPosX con 145 ;Start positions of the Left Front leg
cLFInitPosY con CHexInitY
cLFInitPosZ con -67
I can see the similarities…but um…why did’nt it walk?
Hi,
At first the video looked ok, but there is something that’s not correct I think. I noticed this when you did a little head rotation in head tracking mode?. Does walking work fine?
The cHexInitXZ is not in use for A-Pod, its something me and Kurt used for the round body. Don’t pay attention to it.
Sorry, but I don’t think the cHexInitPosY is in use either…
Just the CHexInitY that describe the start/init height of the tars in relative to the femur joint.
For understanding the Init values it does help (or confuse) to use PEP, its a Excel sheet I made many years ago. I use PEP to find the values I want to use on a new hex. But I don’t think Xan do the same.
Your 20 deg femur offset is just mechanical (not completely sure what you mean by the offset), the calibration should be the same though. The femur and tibia joint must be parallel to ground when calibrated.
The init positions doesn’t necessary mean the footprint of a neutral hexapod, but its often close though.
You must be right, because this is actually a first tist without really looking at al variables and code etc… A proof of concept, i can get it to work. Indeed walking does not work very good at the moment.
I did do the calibrating like described. What i meant by a 20 degree ofset is:
cXXFemurHornOffset con 200 ;Default no servo horn offsets
As we were talking about the legdesign it should be the case that they are inverted in my case. But in the video i didn’t. So…
I really have to go over the whole proces of calibrating and setting all the values more precise. And getting to know the code better.
But what did you think. I could make more video if it helps.
It was built before the Atom Pro existed, before the Phoenix code, It was ahead of it’s time. lol
Would like to see it walk though. And about the code…how much luck can one have, discovering that the code for your particular hex config is just been written. lol*lol.
If I were you, I would rush out and purchase a lottery ticket. lol
Be right back, lol
Yeah!!! - In case anyone missed this posting earlier. It is great news to hear that the A-Pod is about to be released… I know it must be very close as there is now a link to the product up under the Hexapod kits: lynxmotion.com/c-154-a-pod.aspx
And a section in the assembly instructions for the Apod, including a tutorial and code that was adapted from the latest phoenix code for the PS2 with special controls to manipulate the additional things on the A-Pod!!! (lynxmotion.com/driver.aspx?Topic=assem04)
Again this is great news!
Kurt
May I ask why you are using this offset? This offset are meant to be used if you need a large offset by “snapping” out the horn one, two or three clicks, (15,30 or 45 deg). In other words; of you calibrate the femur parallel to ground and then snap out the horn one click upwards this offset must be set to 150.
Well, experimenting around…and with femur 20 degrees up the leg in my design seems to be standing straight and remember my rather long tibia’s, i wanted the body to be somewhat lower. But then i would normally have to give tibia also a 20 degree offset. A least i was used to do that in the old hexengine. But i wonder whether this is possible in this code, found only femur and tar offset. So does it automatically correct the tibia for the femuroffset? Or should i manually give the tibia one click (=15 degrees) as well if i give the femur one click.
I did have it moving and even walking quit good by the way and in this case i had offsets at zero. Only thing i really still don’t get is that everything seems to be working pretty good in the last tests and i did NOT invert the femurservo’s?!? That’s odd isn’t it?
Other question. Looking at the code it is theoretically possible to build the Apod 4-Dof as wel and still have exactly the same functionality? Or is this a really crazy idea? I could change the 6 coxa 645’s for 6 475’s, it hink for the shoulder this would’t be to much of a problem and that’s what i have and put 6 tars on it. Too heavy perhaps?