NEED Quadrapod walking gate!

does anyone have a walking gate for a 2DOF Quadrapod?

if you still need it, i can post an algorithm i’ve come up with for a quadrupod with 3DOF.

Hi, i’m interested in your quadruped walking gait. Can I?

Sure :slight_smile:
Post Away!

Is the code for the walking gait (Lynxmotion 3DOF ses leg and Mini Quad Body) mentioned in this post still available? I’ve built mine, and have been struggling a bit with the walking gait. So an example would be of tremendous help to me. Thanks.

hi Atomic, pretty old thread so well done for finding it.

Unfortunately no code exists as such but it is possible to get your 3dof quad walking using the phoenix hexapod code as a base to start from.
ill post more in a bit, just got to pop out.

ok are you familiar with the phoenix hexapod code?

Innerbreed,
Thanks for the reply.
No, I am definately not familiar with the Hexapod code.
I did use the powerpod program to generate an inline hexapod, and then commented outthe middle legs and tried to ‘reverse engineer’ that, but with no good results. No movement at all in fact.

What I have been able to do so far is use SSC commands within the Basic Atom IDE to take steps in a hardcoded style, which has worked ok, but I know the potential for better code is there, I’ve seen the videos. :slight_smile:

well with the powerpod program it will only create Tripod gaits (6 legs needed) and i guess you realized this. ok you have the SSC, but do you have the BotBoard2? and Atom pro28?

Yes I have the botboard and the Atom Pro 28.

And I will apologize in advance because I am robotic newbie for the most part. :slight_smile:

great. and welcome to the lynxmotion community. your robot addiction will start here. lol.

ok if you follow the setup for the hexapod phoenix starting at Step 9:
lynxmotion.com/images/html/build131.htm
but obviously disregarding the middle legs.!

Then you will need to follow this tutorial on setting up your botboard.
lynxmotion.com/images/html/build159.htm

Im kinda thinking you have already done most of this but iv not seen your robot so im just starting right from the start. :wink:

OK, Stop at Step 15
Dont upload - phoe2ps2.zip
you will want to start with this one:
lynxmotion.com/images/files/phoen1.3.bas
upload this to the Atom chip.
:wink:

Innerbreed, Thanks for the help!
I’ll go through the steps you’ve provided and make any adjustments from my current Quad build and then try the phoen1.3.bas you’ve suggested.
I appreciate the welcome and the tips you’ve provided, I’ll ping you back at a later date and let you know how it went.
Have a good evening :smiley:

pleasure. :wink:
well here its nearly my bed time but im on line for the next hour or so. look forward in seeing your progress.

once you have it uploaded i will go though the code with you and let you know what you will need to do. there really isnt that much work involved. :wink:

Innerbreed,

I figure I should post what exactly I am working with and give you an idea of what I am after.

Using the mini quad frame (lynxmotion.com/images/jpg/miniq31.jpg)
Along with the SSC-32 Servo Controller + Bot Board II + BASIC Atom Pro 28 Pin and one Sharp GP2D12 IR Sensor
The legs being used are the 3DOF SES A build - version 2 (lynxmotion.com/images/html/build82b.htm)
Using 12 HS-645 servos.

There is no PS2 controller being used because I want this to be an autonomous project, but not using the IR Sensor untill I can get this little guy walking. :slight_smile:

Planning on verifiying that my wiring is matching the documents you provided, and then I’ll try to understand the Phoe**.bas file this weekend. Any additional directions/lessons are appreciated.

Regards,
Adam

thats great. thanks i was going to say could you post am image of the quad so i can see it. i did imagine you were using the mini chassis and that leg design.

i could prob re-write the code for you now but here is the info if you wanted to make a start on it yourself:
let me know if you want me to do it for you…

Jeroen Janssen (aka Xan) the author of the code will undoutably give you far more insight and info on the
code but for what you need i can help.

ok first in the code if you scroll down to BODY DIMENSIONS,
You should be able to get the dimensions just by measuring with a ruler or from the powerpod program!

TibiaLength is the length in mm from the tip of the toe to the center of the tibia servo
FemurLength is the length in mm from the center of the tibia servo to the center of the femur servo
CoxaLength is a little harder to see but it is the length from the center of the femur servo to the vertical

line formed the horizantal axis about which the coxa servo rotates!

Entering the correct body dimensions is extremely important since the length of all the body parts is the

basis for the movement calculations. First, note that all measurements are in millimeters.

CoxaLength con ? ;Length of the Coxa [mm] FemurLength con ? ;Length of the Femur [mm] TibiaLength con ? ;Length of the Tibia [mm]

Then we need to change the “##Offset#”
When looking at your robot from above with the robot’s head facing you…the Z-axis is front to back and
the x-axis is side to side. The robot’s right front leg is (-,-) on the axis and it’s rear left leg is (+,+). Having
said that, the leg-distance offsets are the length along the z axis and x axis from the center of the robot
point (0,0) to the center of each of the coxa servos
So measure from the Center of the body to each Coxa servo.

Scrolling down to “Feet positions”
These will be the most difficult numbers to deal with. Essentially, these foot position are the starting point in

space (X,Y,Z) for each of the robots feet. As before, when looking at your robot from above with the
robot’s head facing you…the Z-axis is front to back and the x-axis is side to side. The robot’s right front
leg is (-,-) on the axis and it’s rear left leg is (+,+). Additionally, the Y-axis is the vertical axis down toward
the ground is + and up toward the sky is -. Determining the initial foot positions is not an easy task but
basically they should be the point in space where your robot is curled up in “sleeping position” with the feet as close to the body as possible.

ok we are nearly done. as i mentioned before, a tripod gait will not work for a quad. in this code there are tripod gaits as well as the ones we want to use.

scroll down to “GAIT Select”
here you will find 8 gaits!
we need to change this.

copy and paste this over it. i have also added a better quad gait wave 24 step.
[GAIT Select]

[code]GaitSelect
;Gait selector
IF (GaitType = 0) THEN ;Ripple Gait 6 steps
LRGaitLegNr = 1
RFGaitLegNr = 2
LMGaitLegNr = 3
RRGaitLegNr = 4
LFGaitLegNr = 5
RMGaitLegNr = 6

NrLiftedPos = 1	  
TLDivFactor = 4	  
StepsInGait = 6
NomGaitSpeed = 150

ENDIF

IF (GaitType = 1) THEN ;Ripple Gait 12 steps
LRGaitLegNr = 1
RFGaitLegNr = 3
LMGaitLegNr = 5
RRGaitLegNr = 7
LFGaitLegNr = 9
RMGaitLegNr = 11

NrLiftedPos = 3
HalfLiftHeigth = TRUE
TLDivFactor = 8	  
StepsInGait = 12	
NomGaitSpeed = 100

ENDIF

IF (GaitType = 2) THEN ;Quadripple 9 steps
LRGaitLegNr = 1
RFGaitLegNr = 2
LMGaitLegNr = 4
RRGaitLegNr = 5
LFGaitLegNr = 7
RMGaitLegNr = 8

NrLiftedPos = 2
HalfLiftHeigth = FALSE	
TLDivFactor = 6	  
StepsInGait = 9	    
NomGaitSpeed = 150

ENDIF

IF (GaitType = 3) THEN ;Wave 12 steps
LRGaitLegNr = 7
RFGaitLegNr = 1
LMGaitLegNr = 9
RRGaitLegNr = 5
LFGaitLegNr = 11
RMGaitLegNr = 3

NrLiftedPos = 1
HalfLiftHeigth = FALSE	
TLDivFactor = 10	  
StepsInGait = 12	    
NomGaitSpeed = 120

ENDIF

IF (GaitType = 4) THEN ;Wave 18 steps
LRGaitLegNr = 10
RFGaitLegNr = 1
LMGaitLegNr = 13
RRGaitLegNr = 7
LFGaitLegNr = 16
RMGaitLegNr = 4

NrLiftedPos = 2
HalfLiftHeigth = FALSE	
TLDivFactor = 16	  
StepsInGait = 18	    
NomGaitSpeed = 100

ENDIF

IF (GaitType = 5) THEN ;Wave 24 steps
LRGaitLegNr = 1
RFGaitLegNr = 21
RRGaitLegNr = 13
LFGaitLegNr = 9

            NrLiftedPos = 3
            HalfLiftHeigth = 0   
            TLDivFactor = 20    
            StepsInGait = 24      	    
     NomGaitSpeed = 100

ENDIF

return[/code]

now find this section of the code were we select these gaits using the select button.

[code]IF HexOn THEN
IF (DualShock(1).bit0 = 0) and LastButton(0).bit0 THEN ;Select Button test
IF TravelLengthX=0 & TravelLengthZ=0 & TravelRotationY=0 THEN

  ;Switch to next Gait type
	IF GaitType<7 THEN
	  Sound P9,[50\4000]
	  GaitType = GaitType+1
  	ELSE
	  Sound P9,[50\4000, 50\4500]
	  GaitType = 0
  	ENDIF

  	GOSUB GaitSelect
  ENDIF
ENDIF[/code]

we need to now let the code know we have removed some gaits.
its says IF GaitType<7 THEN
it should be IF GaitType<5 THEN

You might think why we haven’t started removing the middle legs. well we don’t have to. and also removing
them will make the timing change during each step. keeping them in will be better. while the code runs the
parts that “move the middle legs” it actually allows the body to move forward nicely between each of our
quad steps.

i have read that converting from ps2 to autonomous is relatively easy but iv not done it so that info will best prob come from someone else here. guys?

Thank you for all of the help! :slight_smile:
I also appreciate your offer to write some Quad code, but I’d like to try to use what you’ve provided and see how far I can get this weekend, you’ve given me a great start.
I’ll post a reply once I’ve either had some furthering success, or once I’ve realized I might need more help. :slight_smile:
If success, then I’ll be sure to share a video.

no prob. look forward to your project.
you will find that the wave gaits will give you better walking control. but we may still need to implement a center of gravity shift. more on that when we come to it. :wink:

Hi,
Re-read through the post today making sure my botboard and ssc32 were connected as per the diagrams provided.
I think I have it connected properly, that is, I am able to get all 4 legs (12 servos) moving with very simple .bas files. like…

;;stand tall
serout SSC32,i38400,"#",RRHH,RRHH2,"P1500#", RRHV,RRHV2,"P1250#",RRK,RRK2,"P1850#", |  ;Right rear leg Stand Tall
				FRHH, FRHH2,"P1500#", FRHV, FRHV2,"P1250#", FRK, FRK2,"P1850#",  | ;Right front leg Stand Tall
				RLHH, RLHH2,"P1500#", RLHV, RLHV2,"P1750#", RLK, RLK2,"P1100#", | ;Left rear leg Stand Tall
				FLHH, FLHH2,"P1500#", FLHV, FLHV2,"P1750#", FLK, FLK2,"P1150T576",13] ;Left front leg Stand Tall

This is how I’ve set servo connections in my working copy of the Phoen1.3.bas file:

  • I left in the Middle legs as suggested - (The pin connections for these Middle legs do not actually connect to the ssc32)
RRCoxaPin 	con P16	;Rear Right leg Hip Horizontal
RRFemurPin 	con P17	;Rear Right leg Hip Vertical
RRTibiaPin  	con P18	;Rear Right leg Knee

RMCoxaPin 	con P7	;Middle Right leg Hip Horizontal
RMFemurPin 	con P8	;Middle Right leg Hip Vertical
RMTibiaPin  	con P9	;Middle Right leg Knee

RFCoxaPin 	con P20	;Front Right leg Hip Horizontal
RFFemurPin con P21	;Front Right leg Hip Vertical
RFTibiaPin  	con P22	;Front Right leg Knee

LRCoxaPin 	con P0	;Rear Left leg Hip Horizontal
LRFemurPin 	con P1	;Rear Left leg Hip Vertical
LRTibiaPin  	con P2	;Rear Left leg Knee

LMCoxaPin 	con P10	;Middle Left leg Hip Horizontal
LMFemurPin 	con P11	;Middle Left leg Hip Vertical
LMTibiaPin  	con P12	;Middle Left leg Knee

LFCoxaPin 	con P4	;Front Left leg Hip Horizontal
LFFemurPin 	con P5	;Front Left leg Hip Vertical
LFTibiaPin  	con P6	;Front Left leg Knee

I checked the measurements created by the powerpod program with a ruler, and they seemed accurate, as below…

CoxaLength  con 29		;Length of the Coxa [mm]  Adam Checked with powerpod
FemurLength con 76		;Length of the Femur [mm]
TibiaLength con 106		;Lenght of the Tibia [mm]

I am not sure if I understand how to properly measure the offset, here is how I calculated and maybe you can let me know if I was wrong.
flickr.com/photos/shortace/4761590737/
After getting the initial measurement of -55,-90, I took it to be that the numbers wouldn;t change just whther they were + or -, I updated this offset section like:

RFOffsetX con -55		;Distance X from center of the body to the Right Front coxa  Adam Updated
RFOffsetZ con -90		;Distance Z from center of the body to the Right Front coxa  Adam Updated
RMOffsetX con -63		;Distance X from center of the body to the Right Middle coxa    No Change
RMOffsetZ con 0		;Distance Z from center of the body to the Right Middle coxa   No Change
RROffsetX con -55		;Distance X from center of the body to the Right Rear coxa  Adam Updated
RROffsetZ con 90		;Distance Z from center of the body to the Right Rear coxa  Adam Updated

LFOffsetX con 55		;Distance X from center of the body to the Left Front coxa  Adam Updated
LFOffsetZ con -90		;Distance Z from center of the body to the Left Front coxa  Adam Updated
LMOffsetX con 63		;Distance X from center of the body to the Left Middle coxa   No Change
LMOffsetZ con 0		;Distance Z from center of the body to the Left Middle coxa   No Change
LROffsetX con 55		;Distance X from center of the body to the Left Rear coxa  Adam Updated
LROffsetZ con 90		;Distance Z from center of the body to the Left Rear coxa  Adam Updated

:slight_smile: Indeed this is difficult, and I am still trying to figure out what the numbers need to be.
It would be helpful to see a picture of another robot in this starting position.
In the meantime, I left these at the orignal phoenix settings.

I overwrote the GAIT Select step with the suggested change for "GaitType<5 "

IF HexOn THEN
	IF (DualShock(1).bit0 = 0) and LastButton(0).bit0 THEN ;Select Button test
	  IF TravelLengthX=0 & TravelLengthZ=0 & TravelRotationY=0 THEN
		
	  ;Switch to next Gait type
  		IF GaitType<5 THEN
		  Sound P9,[50\4000]
		  GaitType = GaitType+1
  	  	ELSE
		  Sound P9,[50\4000, 50\4500]
		  GaitType = 0
 	  	ENDIF
  
	  	GOSUB GaitSelect
  	  ENDIF
  	ENDIF

The Phoen1.3.bas code as I have edited it above builds and programs/uploads to the AtomPro without errors.
When I switch the power to the servos on, I get a little beeping in groups of threes, but no servo movement at all.

Wondering it is something in the Ps2Input: section making the tones because of my lack of a controller?

Additional views of the Quad.
Front
flickr.com/photos/shortace/4761592857/

Left
flickr.com/photos/shortace/4762225008/

Right
flickr.com/photos/shortace/4762224348/