Arduino Based 10DOF Biped (BIG)

[size=2]Wow… Iv not posted here since 2013!! [/size]
Hello old friends and newcomers.

Back in the day, we were controlling robots with Mbasic and PS2 remotes.
Has that changed much in the last 4 years?

So to cut to it…
I am looking to redesign a Biped which is inspired by agility robotics
The Biped has a 10dof setup and will run using 10x Savox SV-0236MG Servos and i will be looking to control it with an Arduino and RC transmitter.

I have looked at porting old scout code or hexapod over from .bas to .ino but my programming skills are limited. With that said i am not looking for someone to completely write my code as i do have some uses in programming and i can hack hexapod code to work with a biped. however i would like to control using Arduino and my RC transmitter.

This is the design that is still on going. currently standing at 80cm
https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/22528462_10214565748836364_1950342016720541224_n.jpg?oh=ad5ad9b0ae8958ad710aa5de77f51ed2&oe=5A63CCD5
https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/22555011_10214567250153896_3445188470390285083_n.jpg?oh=2da9f0eb8e510ad4d07469259ded219c&oe=5A631F09

https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/22490192_10214565749156372_2549070167567643137_n.jpg?oh=6cb7c71cee7008cdbcadba7b85959d3d&oe=5A84F150

What i would like to control is the Leg starting pos, Body rotations/height/XYZ etc, Gait travel.

Is such an Arduino Based - RC controlled base file i can hack to work with this. Whether its hexapod, quad, or biped i would like to have a look at it please.

Amazing design already - you’ve set the bar quite high. Everything 3D printed?
Can’t say I have anything in my back pocket, but ideally motion would be equation based and account for center of mass?

Hi Coleman Great to chat with you again.

Yes the bar has been set high i guess. I have been away for a while and i have had some great opportunities working in Animatronics for a few production firms and i now have a small steady business selling animatronics and freelancing on set.

So i guess this project is on per with some of the challenges i have had to face recently.

Yes most of the parts, casing etc i’ll print at home but some components can be brought of the shelf.

Im keeping all the weigh in the hips and away from the end effector. The reason for this is to keep the inertia that the legs will have on the walking to a minimum.

As for the walking, That’s where i am rusty.
Having built a number of hexapods and bipeds from the same code with MBasic and PS2 i am now having problems finding an Arduino code with RC_Input.

I have been leaning towards Kurt’s converted files but i am a little confused by all the files so any help there would be great.
I just simply need the files required to run a project. with all the others its a little confusing?

A teacher I knew at McGill is an Executive R&D Imagineer with Walt Disney’s Imagineering. I could see you thriving in that environment.
Why go RC? Just use serial to send commands. Think you’ll need a pendulum effect for walking in order to balance on each foot?
Is this project for personal interest or a contract?

I have a few transmitters and i want to utilize them. also range is another reason.
This one a personal project. one of many i am currently working on. lol

here is another one i am doing. will possibly start a thread on that. youtube.com/watch?v=M0oQ4ibAPWY

Hollywood really needs to use your talent more. I can imagine a “paranoid” lead actor in a movie thinking the government is spying on him, looking up at a bird in a tree, which is looking down at him, only to somehow discover it’s actually robotic.

lol. If only those dreams would happen. Im not sure i have the talent for such a large company. I was offered a job in tennessee with robotics/animatronics company however i am located in the UK and that commute would have been a long one lol. I wish i had taken it on to be honest but life doesn’t always work the way we want it to.
I have posted my bird project here: animatronic-walking-macaw-t16692

ok so i have begun porting over the phoenix code supplied by Kurte on Github.
It is an Arduino port that ill be running with an SSC32_PS2 and Botboarduino.

Im changing the leg configuration and i need to add an axis *HipRoll *to the IK.

So far i have gone through and added the axis to the various parts in the code but i am having a little brain fart understanding how the code will recognize the location and function of the HipRoll

Some of the dimensions are just guesses at this point and are not true as i dont have it assembled so i cannot bench test.
But this just shows the configuration i am going for. PLEASE NOTE I HAVE CHANGED COXA TO HipYaw BUT ALSO ADDED HipRoll.



image.ibb.co/gxMn36/Capture.png
image.ibb.co/gprWVm/Capture2.png

[code]//--------------------------------------------------------------------
//[LEG DIMENSIONS] (in mm)
//Right leg
#define RightHipRollLength 29
#define RightHipYawLength 29 //coxa
#define RightFemurLength 80
#define RightTibiaLength 80
#define RightFootLength 80

//Left leg
#define LeftHipRollLength 29
#define LeftHipYawLength 29 //coxa
#define LeftFemurLength 80
#define LeftTibiaLength 80
#define LeftFootLength 80

//--------------------------------------------------------------------
//[BODY DIMENSIONS]

#define RightHipRollAngle1 0 //Default HipYaw setup angle, decimals = 1
#define RightHipYawAngle1 0 //Default HipYaw setup angle, decimals = 1

#define LeftHipRollAngle1 0 //Default HipYaw setup angle, decimals = 1
#define LeftHipYawAngle1 0 //Default HipYaw setup angle, decimals = 1

#define RightOffsetX -50 //Distance X from center of the body to the Right Front HipYaw
#define RightOffsetZ 0 //Distance Z from center of the body to the Right Front HipYaw

#define LeftOffsetX 50 //Distance X from center of the body to the Left Front HipYaw
#define LeftOffsetZ 0 //Distance Z from center of the body to the Left Front HipYaw

//--------------------------------------------------------------------
//[START POSITIONS FEET] (COS) and (SIN) = BipedInitXZ Value x (0.5) and (0.866)
#define BipedInitXZ 75
#define BipedInitXZCos60 38 // COS(60) = .5
#define BipedInitXZSin60 65 // sin(60) = .866
#define BipedInitY 75
//Start positions of the Right leg
#define RightInitPosX 0
#define RightInitPosY 75
#define RightInitPosZ -10
//Start positions of the Left leg
#define LeftInitPosX 0
#define LeftInitPosY 75
#define LeftInitPosZ -10
//--------------------------------------------------------------------
//[Foot factors used in formula to calc Foot angle relative to the ground]
#define cFootConst 720
#define cFootMulti 2
#define cFootFactorA 70
#define cFootFactorB 60
#define cFootFactorC 50
[/code]

I am not sure i have added it to the index correctly?


for (LegIndex = 0; LegIndex <=1; LegIndex++)
{  
HipRollAngle1[LegIndex]  = min(max(HipRollAngle1[LegIndex], (short)pgm_read_word(&cHipRollMin1[LegIndex])), 
(short)pgm_read_word(&cHipRollMax1[LegIndex]));
HipYawAngle1[LegIndex]  = min(max(HipYawAngle1[LegIndex], (short)pgm_read_word(&cHipYawMin1[LegIndex])), 
(short)pgm_read_word(&cHipYawMax1[LegIndex]));
FemurAngle1[LegIndex] = min(max(FemurAngle1[LegIndex], (short)pgm_read_word(&cFemurMin1[LegIndex])),
(short)pgm_read_word(&cFemurMax1[LegIndex]));
TibiaAngle1[LegIndex] = min(max(TibiaAngle1[LegIndex], (short)pgm_read_word(&cTibiaMin1[LegIndex])),
(short)pgm_read_word(&cTibiaMax1[LegIndex]));
#ifdef c5thDOF
if ((byte)pgm_read_byte(&cFootLength[LegIndex])) {    // We allow mix of 3 and 4 DOF legs...
FootAngle1[LegIndex] = min(max(FootAngle1[LegIndex], (short)pgm_read_word(&cFootMin1[LegIndex])),
(short)pgm_read_word(&cFootMax1[LegIndex]));
}
#endif


//.........................................................>

//Default leg angle
const short cHipRollAngle1] PROGMEM = {RightHipRollAngle1, LeftHipRollAngle1};
const short cHipYawAngle1] PROGMEM = {RightHipYawAngle1, LeftHipYawAngle1};

I see in the part that handles the IK that the calculations are from the Coxa (HipYaw) to the Foot. Do i need to change that to HipRoll or do i need to add it elsewhere?

[code]//Calculate IKHipYawAngle and IKFeetPosXZ
GetATan2 (IKFeetPosX, IKFeetPosZ);
HipYawAngle1[LegIKLegNr] = (((long)Atan4*180) / 3141) + (short)pgm_read_word(&cHipYawAngle1[LegIKLegNr]);

//Using GetAtan2 for solving IKA1 and IKSW
//IKA14 - Angle between SW line and the ground in radians
IKA14 = GetATan2 (IKFeetPosY-FootOffsetY, IKFeetPosXZ-(byte)pgm_read_byte(&cHipYawLength[LegIKLegNr])-FootOffsetXZ);
[/code]

Any help would be good at this point. Once i have all the parts ordered and printed it will make this part of the project much easier to identify whats going on.

To elaborate on my last post^

Mt leg arrangement flows like this

HipRoll - Coxa - Tibia - Femur - Tars

[font=Monaco, Courier New, monospace][highlight=#fafafa]//Calculate IKHipYawAngle and IKFeetPosXZ[/highlight][/font]
[font=Monaco, Courier New, monospace][highlight=#fafafa]GetATan2 (IKFeetPosX, IKFeetPosZ);[/highlight][/font]
[font=Monaco, Courier New, monospace][highlight=#fafafa]HipYawAngle1[LegIKLegNr] = (((long)Atan4*180) / 3141) + (short)pgm_read_word(&cHipYawAngle1[LegIKLegNr]);[/highlight][/font]

[font=Monaco, Courier New, monospace][highlight=#fafafa]//Using GetAtan2 for solving IKA1 and IKSW[/highlight][/font]
[font=Monaco, Courier New, monospace][highlight=#fafafa]//IKA14 - Angle between SW line and the ground in radians[/highlight][/font]
[font=Monaco, Courier New, monospace][highlight=#fafafa]IKA14 = GetATan2 (IKFeetPosY-FootOffsetY, IKFeetPosXZ-(byte)pgm_read_byte(&cHipYawLength[LegIKLegNr])-FootOffsetXZ);[/highlight][/font]

If i change IKHipYawAngle (Coxa from original code) to IKHipRollAngle that should include it into the Leg IK but im unsure how the code will know that the HipRoll servo is tilted 90º to the Coxa?
Is there a part that tell the code the servos orientation or at least the axis of which it will have an effect on?

Sorry for not wrapping the code with code format. there seems to be something wrong with it.