5 RPRT
5 RPRT
<<ROBOTICS-I LAB>>
Experiment No. 05
Experiment Name: Introduction to spider robot with working of its 1 leg servo
motors
List of Figures
Figure 1 Spider Robot with 3 motors on 1 leg ................................................................................ 3
Figure 2 Simulation of above code. ................................................................................................ 5
Figure 3 Simulation showing motor 2 and 3 sweep in opposite direction ...................................... 6
Abstract
The main objective of this lab was to get familiarize with Spider Robot locomotion with help of
servo motors. Each leg of Spider Robot was equipped with 3 servo motors and thus for one leg
how servo motors are working was noticed. Firstly, single motor simulation was run and then to
use 3 motors with desired rotations various codes were manipulated and run on Tinker Cad so that
for entire robot one can get the knowledge of how to manipulate codes for specific orientation.
Introduction:
A servo motor is a precise rotary actuator used in robotics and automation. It operates in a closed-
loop system, providing accurate control of position, speed, and torque. Equipped with a feedback
mechanism, it can maintain high precision, respond quickly to commands, and is adaptable for
various applications. Commonly compact and lightweight, servo motors come in both DC and AC
types and find use in robotics, CNC machinery, aerospace, and more.
Furthermore, a spider robot with 4 legs and 3 motors on 1 leg is a quadrupedal robot designed to
mimic the locomotion of spiders. Each leg of the robot is equipped with three servo motors,
strategically placed to control joint movements and provide flexibility. The motors enable the leg
to articulate, replicate the natural movements of a spider's leg, and navigate various terrains.
Precise control, sensor integration, and motor code manipulation are crucial aspects of its design,
ensuring coordinated and stable movements, ultimately allowing the robot to adapt and traverse
complex environments as shown in figure 1.
Procedure
Analyze the spider robot and placement of motors in legs.
Then observe how servo motors work for 1 leg.
Open the interface of Tinker Cad and go to create design of circuits.
Drag the Arduino UNO with micro servo motor and manipulate the code such that motor
rotates 180 degrees and then for 2nd for loop it rotates back to 0 degrees as shown below in
code and simulation.
#include <Servo.h>
int pos = 0;
Servo servo_9;
void setup()
{
servo_9.attach(9, 500, 2500);
}
void loop()
{
// sweep the servo from 0 to 180 degrees in steps
// of 1 degrees
for (pos = 0; pos <= 180; pos += 1) {
// tell servo to go to position in variable 'pos'
servo_9.write(pos);
// wait 15 ms for servo to reach the position
delay(15); // Wait for 15 millisecond(s)
}
for (pos = 180; pos >= 0; pos -= 1) {
// tell servo to go to position in variable 'pos'
servo_9.write(pos);
// wait 15 ms for servo to reach the position
delay(15); // Wait for 15 millisecond(s)
}
}
This code shows the initial position for motor is 0 degrees and 1st for loop allows movement
of motor from 0 to 180 degrees and then after 15ms of time 2nd loop starts which allows sweep
of motor back to 0 degrees.
Now focus on movement of 3 motors of spider robot and it will be observed that when motor
1 rotates motor 2 rotates to some angle while motor 3 should allow the end portion of leg to
remain vertical for which third motor will move with same angle as of 2nd but in opposite
direction to compensate for no net movement of end portion of leg occurs for which run the
following code.
#include <Servo.h>
Servo servo_1;
Servo servo_2;
Servo servo_3;
void setup()
{
servo_1.attach(9, 500, 2500);
servo_1.write(0);
servo_2.attach(10, 500, 2500);
servo_2.write(0);
void loop()
{
servo_1.write(servo_1.read()+60);
delay(500);
servo_2.write(servo_2.read()+90);
servo_3.write(servo_3.read()-90);
delay(500);
servo_1.write(servo_1.read()-60);
delay(500);
servo_2.write(servo_2.read()-90);
servo_3.write(servo_3.read()+90);
delay(500);
}
This code shows 3 micro servos would be attach to 9, 10 and 11 pin of Arduino referring
signal wires and their initial position will be 0 degrees.
Then in loop 1st motor will sweep to 60 degrees and after 500ms, 2nd and 3rd motor rotates to
90 degrees both in opposite direction to each other to allow for compensation as shown in
simulation below.
Conclusion
To sum up, Spider robot’s one leg motion was analyzed along with working of servo motors and
how motor 3 can be decoupled to allow end portion of leg to remain in vertical position by first
playing with code in Tinker Cad for 1 motor and then for 3 motors simultaneously.