Quadruped Robot using Arduino – Stalker 2

[Oscar Liang] built an Arduino Quadruped Robot that looks rather creepy.

The Beginning of a Quadruped Robot

After successfully made a working Arduino Arduino Hexapod robot, he reused some of the parts and code to build this interesting robot. He call this robot stalker, because of the game unit in Star Craft with the same name. He basically took most of the inverse kinematics codes from his Hexapod robot project, and it working great.

Excel Spreadsheet Quadruped Robot Simulation

It simulates the movements of a quadruped robot. it shows detailed inverse kinematics calculations, and it might help those who are having problem understanding IK to visualize the complex computations.


This is how he made the body:

Arduino Quadruped robot



Creep Gait

Here is the 20-step Creep Gait he developed. Creep gait is how 4 legged animals walk, for example cats. This follows the idea about creep gait described here: http://blog.oscarliang.net/quadruped-robot-gait-study/

This is the GaitStep Plan (leg one is the top right leg, leg two is the bottom right leg… etc…)

Quadruped robot gait sequence

Circled steps are the leg-lifting steps, and the gait cycle starts at step one where leg starts to be lifted.

Here is the source code for the gait I have written:

Before we start, we call this function to initialize the variables for the Gait:


void GaitSelect (){

	//begining of the step cycle for each leg (with reference to the first leg)
	GaitLegNr[LR] = 1;
	GaitLegNr[LF] = 6;
	GaitLegNr[RR] = 11;
	GaitLegNr[RF] = 16;

	NrLiftedPos = 5;  // number of steps that the leg is in the air
	TLDivFactor = 15; // number of steps that the leg is on the ground
	StepsInGait = 20; // total steps


For a complete Gait cycle (e.g. from step 1 to step 20), we will go through loop() function 20 times, each time we call GaitCalculate(), and then increment ‘GaitStep’ variable.

coor GaitCalculate (){
	//Calculate Gait positions

	for (int LegIndex = 0; LegIndex < 4; LegIndex++){

		if (GaitStep == GaitLegNr[LegIndex]) {
			GaitPos[LegIndex].Y = -LegLiftHeight/2;
		else if (GaitStep == GaitLegNr[LegIndex]+1) {
			GaitPos[LegIndex].Z = 0;
			GaitPos[LegIndex].Y = -LegLiftHeight;
		else if (GaitStep == GaitLegNr[LegIndex]+2) {
			GaitPos[LegIndex].Z = WalkLength/2;
			GaitPos[LegIndex].Y = -LegLiftHeight/2;
		else if (GaitStep == GaitLegNr[LegIndex]+3) {
			GaitPos[LegIndex].Y = 0;
		// move body forward
			GaitPos[LegIndex].Z -= WalkLength/TLDivFactor;



	//Advance to the next step
	if (++GaitStep > StepsInGait)	
		GaitStep = 1;




Trot Gait

Right, finally have the time to do some robotics, and this time I made a fist version of Trot Gait for the stalker.

I didn’t look into too much theory stuff to get this gait working, as it pretty straight forward: 2 diagonal legs (1 and 3) lifted and move forward, the other two legs (2 and 4) at the same time move backward, 1 and 3 land. Now 2 and 4 are lifted to move forward while 1 and 3 move backward … And repeat….

Check out my Gait Study post for more detail:


Share Button

2 thoughts on “Quadruped Robot using Arduino – Stalker

  1. pinhead May 14,2013 11:13 am

    Do you have a link for where I can buy robot legs like these?

Leave a Reply