A new Quad Project

Hi Everyone,
I just started this Quad projects a few weeks ago, and figured it was time to introduce myself and post a short video of it. Currently it is running the Phoenix 2.0 code with no real modifications, I’ve mostly been trying to figure out the most stable walking position using the included Hex gaits. Eventually I’d like to try and incorporate some of the Body/COG sift code I’ve seen around the forum and add a few quad specific gates. The eventual goal is to “weapon-ize” the quad (with an airsoft rifle) and enter it in a Mech-Warfare Competition.

This is actually my first robot (I would have done a Hexapod, but they’re not allowed in Mech-Warfare) and I’m doing it as a fun and motivational way to learn about servos, servo Control and programming (I work in Technical Theatre, where embedded electronics are slowing becoming a large part of what we do).

As this is my first attempt at this type of project, I welcome and appreciate any input you may have.

Baby Steps:
youtu.be/BcnLyzhrGxQ

Welcome to the thread… :wink:

I have play with Quad and Phoenix code.
There is a way to have a Body shift table so the body move on the legs that are actualy on the ground.
I need to dig in that… don’t remember and i am not a programmer…

Innerbreed…!!! (He know what i am talking about)

hello… lol

Your quad looks to be walking ok. a great effort for your first robot. hats off. 8)

yes you can get a quad to walk using the Phoenix code by adding a few things.

The code uses a bytetable to shift the body as each opposite leg is lifted. i would assume a few adjustments will need to be made to get it to shift correctly for your quad.

**Firstly **What version of the code are you using? i used Software version: V2.0.1 but any of them can be changed this way.

**Second **your first goal is to configure the Cfg. files so that the parameters and values match your robot…
Leg/body dimensions, leg starting init pos annd also the min/max ranges on the leg servos.

Add this near to the start of your code…

; (RF) (LR) (LF) (RR) ;0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, X_Axis_Shift bytetable 89, 90,100,110,120,130,140,150,151,152,153,152,151,150,140,130,120,110,100, 90, 89, 88, 87, 88, 89, ; (RF) (LR) (LF) (RR) ;0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, Z_Axis_Shift bytetable 130,128,130,132,134,136,138,140,138,136,134,132,130,128,130,132,134,136,138,140,138,136,134,132,130,

Also remove all the gaits and replace them with this one:

[code]GaitSelect
;Gait selector
IF (GaitType = 0) THEN ;Wave 24 steps
GaitLegNr(cLR) = 1
GaitLegNr(cRF) = 21
GaitLegNr(cRR) = 13
GaitLegNr(cLF) = 9

NrLiftedPos = 3
HalfLiftHeigth = 0
TLDivFactor = 20
StepsInGait = 24
NomGaitSpeed = 100
ENDIF
return
[/code]
need to add:
X_Axis_Shift = (Xcomp(GaitStep))-128
Z_Axis_Shift = (Zcomp(GaitStep))-128
To the code in the [GAIT] section:

[code];[GAIT]
GaitCurrentLegNr var nib
Gait [GaitCurrentLegNr]

;Clear values under the cTravelDeadZone
IF (TravelRequest=0) THEN
TravelLengthX=0
TravelLengthZ=0
TravelRotationY=0
ELSE
BodyPosX = (X_Axis_Shift(GaitStep))-128
BodyPosZ = (Z_Axis_Shift(GaitStep))-128
ENDIF

;Leg middle up position[/code]

The bytetabe will then need to be configured so it shifts correctly for your quad…
ok looking at the robot from above the robot moving back/forward is X axis and Z axis is Left/Right
If we assume the value for the robots body center is 128 then any values below or above will change the direction that the body shifts to.
http://i531.photobucket.com/albums/dd355/innerbreed/shiftcode.png
The idea as we know is for the body to move away from the lifted leg by positioning the body’s center of mass away from the leg.

X Axis:
RED = Body is at Center
BLUE = Body is moving toward the Left
GREEN = Body is moving toward the Right

Z Axis:
RED = Body is at Center
PURPLE = Body is moving toward the Front
LIGHT BLUE = Body is moving toward the back

to get an idea of how your quad will work using this code is to slightly change the values and see if the robots body moves correctly.
The idea is to get the body moving in a circle as the robots legs move it forward.
Hope this helps.

Oh, WOW thanks innerbreed, that is going to save me tons of time!

One question about adding the quad gait: do I need to worry about commenting out (or deleting) references to the LM and RM legs throughout the code, or will it be OK to just leave them in place for now?

Thanks again for the code, I look forward to playing with it this weekend.

You can leave those in. :wink:

Alright, after a very long hiatus (jobs have a interesting ability to get in the way of hobbies) I’ve finally been able to do some further work on my quad’s body shift, which you can see here:

I’m using the body shift code that Innerbreed provided, although after much frustration I figured out that I needed to invert his values to get my quad walking right (if I remember correctly the original values caused the body to rotate CCW and I needed it to rotate CW or vice versa)

As you can see it seems to be walking a bit to the right, so I’ll be working on that shortly. My next step is to dress all the servo wires and integrate a webcam on the body. Other improvements since I last posted include a 5.3Ah LiPo Battery and I’ve moved the BB2 and SSC-32 inside the body.

Big thanks go out to Innerbreed for the code, but also to PermaFrost and kurte; all of their posts trying to troubleshoot PermaFrost’s quad really helped me figure out what was going on with mine :slight_smile:

[Edit][Xan] Fixed the link

Nice walk!

Alan KM6VV

Nice work!

Excellent! Another quad is given life!