0% found this document useful (0 votes)
9 views43 pages

Spider Robot Graduation Project Overview

Ekjeje

Uploaded by

omercan53535353
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views43 pages

Spider Robot Graduation Project Overview

Ekjeje

Uploaded by

omercan53535353
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ISTANBUL COMMERCE UNIVERSITY

FACULTY OF ENGINEERING
DEPARTMENT OF MECHATRONICS ENGINEERING

ENG401 DESIGN PROJECT

Nikita Yurchenkov 200027703


Mukhammadnur Azimov 200025725
Graduation project
Nikita Yurchenkov 200027703
Mukhammadnur Azimov 200025725
MECHANICAL DESIGN PROCESS

Spider robot
I wanted to share some details about my graduation project. I’ve chosen to work on SPIDER
ROBOT, an open-source intelligent robot platform designed for AI and robotics enthusiasts.
It’s based on Raspberry Pi and offers an excellent opportunity for practical learning and
development.
Here are the key features of SPIDER ROBOT that make it ideal for my project:
 Easy to assemble: It uses a modular design, comes with an open hardware list, and
includes detailed assembly tutorials, making the setup process straightforward.
 Beginner-friendly learning resources: It provides comprehensive guides and sample
code, covering topics from algorithms to real-world applications.
 Rich functionality: The robot supports color recognition, triangular and diagonal
gaits, self-balancing mode, web-based remote control, and lighting indicators.
 Durable design: It’s built with a sturdy acrylic structure.
 Highly extensible: The design is modular and allows for DIY customizations and
expansions.
 Web-based control: I can control the robot on a mobile phone, tablet, or computer
using a Chrome browser, regardless of the operating system (Windows, Linux, or Mac
OS).
 Raspberry Pi compatibility: It supports multiple Raspberry Pi models, including 3B,
3B+, and 4.
 Python support: The robot uses Python for programming, which is both versatile and
widely applicable.
While the precise dimensions of the robot itself are not explicitly stated, its
packaging measures approximately 23 x 16 x 6 centimeters, with a total
shipping weight of around 0.9 kilograms.

Mechanical part:
Acrylic plates are flat sheets made from acrylic, a type of plastic also known as plexiglass or
PMMA (polymethyl methacrylate). These plates are often used in robotics, DIY projects,
and construction because they are:
 Lightweight: Much lighter than glass or metal, making them easy to handle and
transport.
 Strong and durable: Acrylic is impact-resistant and less likely to break or crack
compared to glass.
 Transparent or colored: It can be clear like glass or come in various colors, allowing
for creative designs.
 Easy to cut and shape: It’s simple to machine, drill, or laser-cut, which is ideal for
custom parts in robotic structures.

Machinery parts:
Here’s a detailed explanation of how these components can be utilized in your DarkPaw
project:
1. Nuts (M2, M2.5, M3, M4 Lock Nuts):
These are essential for securing bolts and screws, ensuring stability in your assembly.
Lock nuts prevent loosening under vibrations, crucial for robotic or moving parts.
2. Screws (Various types and sizes):
Screws of different lengths and diameters are used to connect components securely.
For instance:
o M2.5*4 Screws: Ideal for lightweight component connections.
o M3*25 Screws: Suitable for assembling structural parts.
o Self-tapping Screws (M1.76 and M455): For connecting into softer materials
or pre-threaded components.
3. Standoffs (Copper and Nylon):
These act as spacers, creating the necessary distance between components like circuit
boards, sensors, or mechanical parts.
o Copper Standoffs: Provide a rigid connection and are typically used for
structural support.
o Nylon Standoffs: Lightweight and ideal for non-conductive separation in
electronic components.
4. Washers (Rubber and Metal):
o Metal Washers: Distribute the load of screws and nuts, reducing wear on the
materials.
o Rubber Washers: Provide shock absorption and prevent vibrations, important
for delicate electronics.
5. F624ZZ Bearings:
Bearings reduce friction and enable smooth rotational motion, crucial for motor shafts
or rotating mechanisms in your project.
6. Countersunk Screws (M3*12):
These screws allow for a flush fit, ensuring the surface remains smooth without
protrusions, which is vital for aesthetic or functional [Link], which is

A winding pipe typically refers to a curved or coiled pipe used in various


applications, such as transferring fluids, supporting structural systems, or as a design
element in mechanical projects. In the context of robotics or engineering, it can have
specific uses based on its shape and material properties.
Key Features of a Winding Pipe:
1. Curved or Coiled Design:
o Allows the pipe to fit into compact spaces or follow complex pathways,
making it ideal for intricate designs or space-constrained applications.
2. Flexibility and Strength:
o Depending on the material, a winding pipe can be flexible (e.g., silicone or
rubber) or rigid (e.g., metal or plastic), offering versatility for different tasks.
3. Lightweight:
o Many winding pipes are designed to be lightweight, which is crucial in
projects like robotics where reducing overall weight is important.
4. Durability:
o Materials like stainless steel, aluminum, or reinforced plastics ensure the pipe
resists wear, corrosion, or pressure.
Possible Uses in a Robotics Project Like Spider Robot:
1. Cable Management:
o A winding pipe can house and protect cables, keeping the design tidy and
preventing cable damage from movement or external forces.
2. Structural Element:
o It can be used as part of the robot's frame, providing both strength and
flexibility to accommodate dynamic movements.
3. Fluid or Air Transport:
o In pneumatic or hydraulic systems, a winding pipe can channel air or fluids to
actuators or sensors.
4. Aesthetic Design:
o Adds a visually appealing, futuristic look to the robot while also serving
functional purposes.

This the final view of Spider Robot leg.


In the SPIDER ROBOT project, these robotic legs are not just mechanical
components; they are the foundation of agility and precision. Crafted with a sleek,
lightweight frame, they are designed to mimic the movements of a stealth predator.
Each joint is powered by advanced servos, allowing for smooth articulation and
adaptability to any terrain.
The red and cyan components highlight critical pivot points and shock absorption
systems, ensuring balance and stability during high-speed movements or complex
maneuvers. The legs are modular, allowing for easy upgrades or repairs in the field,
making them ideal for exploration or tactical missions.
The true ingenuity lies in the integration of sensors within the joints. These sensors
provide real-time feedback, enabling the robot to adjust its posture dynamically,
ensuring efficiency whether it’s scaling rocky surfaces, sprinting across open fields,
or navigating tight spaces.
SPIDER’s ROBOT legs are a testament to biomechanical engineering, a perfect
blend of functionality, resilience, and futuristic design. These legs are not just tools;
they are the essence of the project’s pursuit of excellence in robotics.
A triangle gait is a locomotion pattern often used in quadruped robots to maintain
balance and efficiency. In this gait, three legs form a stable "triangle" on the ground
while the fourth leg is lifted for a step. This creates a continuous cycle of movement
while preserving the robot's stability.

Key Features of a Triangle Gait:


1. Stable Support:
o At any point during the gait cycle, three legs remain on the ground, forming a
stable triangular base. This minimizes the risk of tipping over.
2. Leg Movement Cycle:
o One leg is lifted, moved forward, and placed back down while the other three
remain stationary. This pattern repeats for each leg in sequence.
3. Energy Efficiency:
o Since only one leg moves at a time, the triangle gait reduces energy
consumption compared to more complex gaits like trotting or galloping.
4. Adaptability to Terrain:
o The triangular base provides excellent balance, making it suitable for uneven
or challenging terrains.
5. Controlled Speed:
o While not the fastest gait, the triangle gait offers precise and deliberate
movement, ideal for scenarios requiring stability over speed.
Advantages for the Spider Robot:
 Robust Stability: Perfect for maintaining balance in rough or unstable environments.
 Simple Control Algorithm: Easy to implement and adjust using basic inverse
kinematics and feedback loops.
 Adaptability: The triangle gait can be fine-tuned to adjust the step height and stride
length based on the terrain.
By employing a triangle gait, your Spider Robot can achieve reliable, stable, and
efficient movement, making it well-suited for tasks requiring precision and
adaptability.

On this side of Spider Robot leg we will attach servo motor.


This is the head structure of the Spider Robot, serving as the central platform for
attaching the robot's legs. The design includes mounting points and slots specifically
positioned to securely fix the legs using servo motors. This structure not only provides
the base for leg attachment but also ensures balanced weight distribution and
mechanical stability, allowing the robot to move with precision and agility during its
operations.

It’s a view of Led Light.


Mechanical Structure of the Spider Robot
The Spider Robot's mechanical design is inspired by biomimicry, focusing on
stability, agility, and adaptability to various terrains. The mechanical components are
carefully engineered to provide precise motion and durability, enabling the robot to
execute complex tasks.

Key Mechanical Components:


1. Chassis:
o The chassis serves as the central frame, housing essential electronics like the
Raspberry Pi, ROBOT HAT, and power sources.
o Made from lightweight and durable materials (e.g., aluminum or high-strength
plastic) to ensure strength without compromising mobility.
o Provides a modular design for easy integration of additional components.
2. Legs:
o The robot's legs are designed with multiple joints, each powered by high-
torque servos (e.g., MG996R or similar).
o These joints allow for smooth articulation, supporting the triangle gait
movement for stable walking on uneven surfaces.
o The legs feature rubberized or textured feet for enhanced grip and reduced
slipping on various terrains.
3. Servo Motors:
o Each leg is powered by precision servo motors, enabling controlled movement
with adjustable speed and torque.
o The servos are programmed to execute precise angular movements for smooth
and synchronized motion.
4. Bearings:
o Bearings (e.g., F624ZZ) are integrated into the joints to reduce friction and
enhance the longevity of the mechanical components.
o They ensure smooth rotational motion and minimize wear and tear.
5. Fasteners and Standoffs:
o High-quality screws, nuts, and standoffs secure the robot's components,
ensuring stability during operation.
o Nylon standoffs are used to isolate electronic components, preventing
vibrations from affecting sensitive circuitry.
6. Modular Design:
o The mechanical parts are modular, allowing for easy upgrades or replacement.
This flexibility makes the robot adaptable for future enhancements or different
use cases.
7. Compact and Balanced Structure:
o The robot's design ensures that its center of gravity remains low, providing
stability even when lifting one leg during its gait cycle.
o The symmetrical placement of legs and components minimizes imbalances
during movement.

Mechanical Functionality:
 Triangle Gait Movement:
The legs are programmed to move in a coordinated pattern, forming a stable triangular
support base at all times. This gait ensures balance and precise movement.
 Shock Absorption:
The legs and feet are designed to absorb minor shocks, reducing strain on the servos
and frame when traversing rough terrain.
 Durability and Longevity:
Materials like aluminum alloy and reinforced plastics are used to withstand repeated
use and environmental factors like dust, moisture, or minor impacts.
Graduation project
Nikita Yurchenkov 200027703
Mukhammadnur Azimov 200025725
ELECTRICAL PART

Electronics parts:
A servo (short for "servomechanism") is a small, precise motor with a built-in control system
used to achieve accurate positioning or motion.
1. Components:
 Motor: A DC or AC motor drives the mechanism.
 Control Circuit: Processes the input signal and controls the motor's movement.
 Gearbox: Reduces speed and increases torque.
 Position Sensor: Tracks the motor's position and provides feedback for adjustments.
2. Movement:
A servo typically moves to a specified angle between 0° and 180°, though some servos
support continuous rotation.
With 12 servos (X12) in the Spider Robot project, these motors are responsible for
controlling the robot's legs, enabling realistic gait patterns, precise movements, and adaptable
terrain navigation.

The MPU-6050 is an essential component in the Spider Robot project, serving as a 6-axis
motion tracking sensor. It combines a 3-axis gyroscope and a 3-axis accelerometer into a
single chip, allowing the robot to measure both angular velocity and linear acceleration.
Key Roles in the Spider Robot Project:
1. Self-Stabilization:
o The MPU-6050 provides real-time feedback on the robot's orientation and
movement. This data is crucial for maintaining balance, especially when the
robot is navigating uneven terrain or performing complex gaits.
2. Dynamic Movement Adjustment:
o By continuously monitoring angular velocity and acceleration, the robot can
dynamically adjust its movements to stay stable and efficient, even under
external forces or unexpected shifts.
3. Smooth Gait Control:
o The sensor helps synchronize leg movements, ensuring fluid and natural
motion patterns. This is particularly important for precise gait algorithms and
terrain adaptability.
4. Collision Recovery:
o In case of a stumble or impact, the MPU-6050 detects changes in orientation
and enables the robot to quickly recover, preventing falls or instability.
In summary, the MPU-6050 (X1) is a critical component that enhances the robot's stability,
adaptability, and overall performance, making it capable of executing precise, responsive
movements in real-world environments.

The Raspberry Pi Camera in the Spider Robot project serves as a key visual sensor,
enabling the robot to perceive and interact with its surroundings. Its integration significantly
enhances the robot's functionality and adaptability.
Key Roles of the Raspberry Pi Camera in the Spider Robot Project:
1. Object Detection and Recognition:
o The camera allows the robot to identify objects, obstacles, and specific
features in its environment. This capability is critical for tasks like avoiding
collisions, navigating through spaces, or targeting specific items.
2. Path Planning and Navigation:
o Using image processing algorithms, the camera helps the robot analyze its
surroundings and determine the optimal path. For example, it can detect
markers, lines, or terrain features to guide its movement.
3. Vision-Based Interaction:
o The camera enables the robot to interact with its environment visually, such as
recognizing and responding to gestures, colors, or QR codes.
4. Monitoring and Feedback:
o The camera can be used for real-time monitoring, providing visual feedback to
the user. This is particularly useful during testing, debugging, or remote
operation.
5. Advanced AI Applications:
o Combined with machine learning algorithms, the camera can enable advanced
features like facial recognition, tracking moving objects, or analyzing dynamic
scenes.
In the Spider Robot project, the Raspberry Pi Camera(X1) is a critical component for
enabling autonomy and situational awareness, making the robot capable of performing
complex tasks in diverse environments.

The ROBOT HAT in the Spider Robot project serves as a versatile and essential
component for controlling and managing the robot's hardware and sensors. It acts as the
central interface between the Raspberry Pi and the various electronic components of the
robot.

Key Roles of the ROBOT HAT in the Spider Robot Project:


1. Motor Control:
o The ROBOT HAT simplifies the control of multiple servos and motors,
providing a reliable way to manage the precise movements of the robot's legs
and other mechanical parts.
2. Sensor Integration:
o It acts as a hub for connecting and processing data from sensors like the MPU-
6050 or the Raspberry Pi Camera, ensuring smooth communication between
components.
3. Power Management:
o The ROBOT HAT efficiently distributes power to various modules, ensuring
consistent performance without overloading or undervoltage issues.
4. Programmability:
o It supports easy programming and customization via the Raspberry Pi,
enabling developers to implement specific algorithms for gait patterns,
obstacle avoidance, or other robotic behaviors.
5. Expansion Capability:
o With multiple GPIO pins and interfaces, the ROBOT HAT allows for further
expansion of the Spider Robot, making it adaptable for additional features or
upgrades.
In the Spider Robot project, the ROBOT HAT(X1) is the backbone of the control system,
providing seamless integration, precise operation, and flexibility for implementing advanced
functionalities.

The WS2812 LED in the Spider Robot project serves as a dynamic and visually impactful
component, providing customizable lighting effects that enhance the robot's aesthetics and
functionality.
Key Roles of the WS2812 LED in the Spider Robot Project:
1. Status Indication:
o The WS2812 LED can display different colors or patterns to indicate the
robot's current state, such as active, idle, or low battery. This visual feedback
helps monitor the robot's performance at a glance.
2. Debugging Assistance:
o During development, the LEDs can provide visual cues for debugging by
signaling sensor activations, errors, or completed tasks.
3. Interactive Feedback:
o The LEDs can react to environmental inputs, such as changing color based on
proximity to an object, adding an interactive element to the robot's behavior.
4. Customizable Aesthetics:
o The WS2812 LED offers full RGB control, allowing for a wide range of
colors and patterns. This makes the Spider Robot more engaging and visually
appealing, especially in demonstrations or presentations.
5. Communication Enhancement:
o The LEDs can be used to communicate with users or other systems through
pre-programmed light signals or patterns.
In the Spider Robot project, the WS2812 LED(X2) adds a layer of functionality and style,
making the robot not only more efficient in conveying information but also more captivating
in appearance.

The 3-Pin Wire (Red) in the Spider Robot project is a critical component used for
connecting and powering the WS2812 LED module, ensuring reliable communication and
functionality of the lighting system.
Key Roles of the 3-Pin Wire in the Spider Robot Project:
1. Power Delivery:
o The wire provides stable power to the WS2812 LED module, ensuring
consistent brightness and operation of the LEDs.
2. Signal Transmission:
o It enables the transfer of data signals from the microcontroller or control board
to the LED module, allowing for precise control over colors, brightness, and
patterns.
3. Secure Connection:
o The 3-pin design ensures a secure and straightforward connection, minimizing
the risk of loose contacts or disconnections during operation.
4. Ease of Installation:
o The wire’s color-coded design (red for power, other colors for signal and
ground) simplifies the installation process, reducing the chance of errors
during assembly.
5. Reliable Performance:
o By providing a robust and flexible link between the control system and the
WS2812 LED module, the wire ensures the lighting system functions
optimally under various operating conditions.
In the Spider Robot project, the 3-Pin Wire (X2) (Red) is a small but essential component
that guarantees the smooth operation of the LED module, contributing to the robot's visual

appeal and functional feedback.


The 4-Pin Wire (White) in the Spider Robot project plays a vital role in connecting and
transmitting data and power between components, ensuring seamless communication and
operation within the robot's system.
Key Roles of the 4-Pin Wire (White) in the Spider Robot Project:
1. Data Transmission:
o The wire facilitates the transfer of signals between the robot’s sensors, control
boards, and other modules, enabling precise communication for real-time
operations.
2. Power Distribution:
o It provides a stable power supply to connected components, ensuring
consistent performance during the robot's tasks.
3. Multi-Purpose Connectivity:
o The 4-pin configuration allows it to handle multiple functions simultaneously,
such as transmitting power, ground, and two data signals, making it versatile
for various modules.
4. Secure and Organized Wiring:
o The 4-pin design ensures a reliable and organized connection, minimizing
clutter and reducing the risk of accidental disconnections during movement or
vibration.
5. Ease of Integration:
o The white color and standardized pin configuration simplify installation and
troubleshooting, ensuring that components are connected correctly without
confusion.
In the Spider Robot project, the 4-Pin Wire(X1) (White) is a crucial component for
maintaining efficient and reliable connections, supporting the robot’s advanced functionality
and ensuring smooth communication between its various systems.
The Raspberry Pi in your Spider Robot project serves as the main control unit, managing
the robot's sensors, motors, and other components. Its flexibility and power make it ideal for
handling complex robotic tasks such as movement control, sensor data processing, and real-
time decision-making.
Key Roles of the Raspberry Pi in Your Project:
1. Central Processing Unit:
o Acts as the brain of the Spider Robot, processing inputs from sensors (e.g.,
MPU-6050, Raspberry Pi Camera) and sending commands to actuators (e.g.,
servos, LEDs).
2. Motion Control:
o Executes algorithms for the triangle gait, ensuring smooth and stable
movement across various terrains.
3. Sensor Integration:
o Collects and processes data from sensors like the MPU-6050 for stability and
the camera for vision-based navigation.
4. Communication:
o Manages wired and wireless communication with other devices, allowing
remote control or data transmission for monitoring and debugging.
5. Customizable Programming:
o Supports multiple programming languages (e.g., Python, C++) and libraries,
making it easy to develop and test robotic algorithms.
6. Modularity and Scalability:
o Allows for adding new components or functionalities, such as additional
sensors or AI capabilities, as the project evolves.
In summary, the Raspberry Pi is the core of your Spider Robot, enabling it to perform
precise movements, process environmental data, and adapt to various tasks seamlessly.
Using 18650 batteries in your Spider Robot project is a practical choice due to their
combination of high energy capacity, compact size, and reliability. Here’s why they are a
suitable power source:
Advantages of 18650 Batteries for the Spider Robot:
1. High Energy Density:
o 18650 batteries have a high energy-to-weight ratio, providing long-lasting
power without significantly increasing the robot's weight.
2. Compact and Lightweight:
o Their small cylindrical form factor makes them easy to integrate into the
Spider Robot's design, ensuring efficient use of space.
3. Sufficient Voltage and Current Output:
o Each 18650 battery typically provides 3.7V (nominal) and can supply
sufficient current for powering motors, servos, and sensors.
4. Rechargeable and Durable:
o They are rechargeable and have a long lifespan, making them a cost-effective
and environmentally friendly choice for projects requiring consistent power.
5. Scalability:
o Multiple 18650 batteries can be connected in series or parallel to achieve the
desired voltage or capacity, providing flexibility for different power
requirements.
6. Compatibility with Robotics Projects:
o Many robotics components, including the Raspberry Pi, servos, and sensors,
are designed to operate efficiently with voltages and currents provided by
18650 batteries.
7. Stable Power Supply:
o They offer a stable discharge rate, essential for maintaining consistent
performance of the robot's electronics and actuators.
Why Choose 18650 Over Other Options?
 Compared to Alkaline Batteries: 18650 batteries are rechargeable and deliver more
consistent power.
 Compared to Li-Po Batteries: They are more robust and less prone to damage from
mishandling, making them safer for educational and experimental projects.
In conclusion, 18650 batteries(X2) are an ideal power source for your Spider Robot project,
offering a balance of performance, safety, and convenience to support your robot’s
functionality.
In your Spider Robot project, a Blu-ray flashlight can have several innovative applications,
depending on your robot's intended functions. Here are potential uses:
1. Environmental Scanning:
 The Blu-ray flashlight's 405 nm wavelength can be used to illuminate and detect UV-
reactive or fluorescent markers. This could help the robot identify paths, boundaries,
or specific objects in its environment.
2. Inspection and Detection:
 The light can highlight cracks, stains, or other UV-sensitive details in surfaces or
objects, making it valuable for inspection tasks in manufacturing or maintenance
scenarios.
3. Object Recognition:
 By pairing the flashlight with the Raspberry Pi Camera, you can enhance the robot's
ability to recognize UV-reactive objects or patterns that might be invisible under
normal lighting.
4. Creative Displays:
 The Blu-ray flashlight could serve as a visual effect, enhancing the robot's appearance
during demonstrations or public exhibitions with glowing, high-energy lighting.
5. Security or Tracking:
 Use the flashlight to interact with UV-sensitive markers for security purposes or to
track hidden trails or objects.
Implementation Tips:
 Power Management: Ensure the flashlight does not draw too much power from your
system. You might need a dedicated battery or voltage regulator.
 Safety: Blu-ray light operates near the UV spectrum, which can be harmful to human
eyes and skin. Ensure the robot's flashlight is shielded or angled appropriately to
avoid direct exposure.
 Integration with Sensors: Pair the flashlight with sensors or cameras that can detect
the specific fluorescence or patterns it produces for enhanced functionality.
A Blu-ray flashlight can add a unique and practical feature to your Spider Robot, enhancing
its capabilities in navigation, inspection, or interactive tasks. Let me know if you'd like
further ideas on integrating it!

A breathing LED light effect for a motion detector and color tracking system in your Spider
Robot can enhance functionality and visual appeal. Here’s how you can implement and
utilize this feature:

Purpose of the Breathing LED Light:


1. Motion Detection Feedback:
o The LED changes brightness in a smooth "breathing" pattern when motion is
detected, providing a visual cue that the robot is actively scanning its
surroundings.
2. Color Tracking Indication:
o The LED can adjust its color dynamically based on the color the robot is
tracking, offering real-time feedback to the user.
3. User Engagement:
o Adds an interactive and futuristic visual element to the robot, making it more
appealing during demonstrations or public interactions.

Implementation Ideas:
1. Breathing Effect for Motion Detection:
 When motion is detected, the LED gradually increases and decreases its brightness in
a loop to indicate active sensing.
 This can be achieved using PWM (Pulse Width Modulation) to control the intensity
of the LED.
2. Dynamic Color Change for Tracking:
 The LED changes its color to match the color of the tracked object (e.g., red for a red
object, blue for a blue object).
 Use the Raspberry Pi Camera to identify the target color through image processing,
and control the WS2812 LED to reflect this color.
3. Combined Modes:
 When both motion and color are detected, the LED can blend the breathing effect with
color changes, alternating between states to indicate simultaneous tracking and
detection.
Technical Details:
1. Motion Detector Integration:
o Use a PIR sensor or a computer vision-based algorithm to detect motion.
o Trigger the breathing LED effect when motion is identified.
2. Color Tracking with Raspberry Pi Camera:
o Use libraries like OpenCV to process images from the camera and identify the
dominant color of the tracked object.
o Translate the detected color values (RGB) into LED color signals for the
WS2812 LEDs.
3. Programming:
o Write a script (e.g., in Python) to integrate the motion detector and color
tracking systems with the LED control logic.
o Use PWM for the breathing effect and GPIO pins or libraries like Adafruit
NeoPixel for controlling the WS2812 LEDs.

Electrical System of the Spider Robot


The Spider Robot's electrical system is the backbone of its functionality, providing power
distribution, data processing, and control to all mechanical and electronic components. The
design focuses on efficiency, modularity, and reliability to ensure smooth operation.

Key Electrical Components:


1. Raspberry Pi:
o Serves as the central processing unit for the robot, running software that
controls movement, sensors, and communication.
o Provides GPIO pins for interfacing with other components like the ROBOT
HAT and sensors.
2. ROBOT HAT:
o Acts as a bridge between the Raspberry Pi and the motors/sensors.
o Includes motor drivers for controlling servos and peripherals.
o Manages power distribution to the motors and other electrical parts.
3. 18650 Batteries:
o The primary power source for the robot, providing stable and long-lasting
energy.
o Batteries are connected in a pack to supply sufficient voltage and current for
all components.
4. Voltage Regulators:
o Ensure a consistent voltage supply to sensitive components, protecting them
from power fluctuations.
5. WS2812 LEDs:
o RGB LEDs integrated into the robot for status indication, visual feedback, and
aesthetic enhancement.
o Controlled via GPIO pins for dynamic lighting effects.
6. MPU-6050 Sensor:
o A 6-axis gyroscope and accelerometer module that provides orientation and
motion data.
o Crucial for maintaining balance and executing precise movements during the
triangle gait.
7. Raspberry Pi Camera:
o Captures visual data for navigation, object detection, and environmental
interaction.
o Interfaces with the Raspberry Pi for processing images and videos in real-time.
8. Servo Motors:
o Controlled by PWM signals generated through the ROBOT HAT.
o Receive power and data signals for precise angular positioning of the legs.
9. Wiring and Connectors:
o High-quality wires (e.g., 3-pin and 4-pin connectors) for secure and reliable
connections between components.
o Organized wiring ensures minimal interference and easy troubleshooting.
10. Power Management System:
o Manages power distribution from the battery to the Raspberry Pi, servos, and
other peripherals.
o Includes circuit protection (e.g., fuses or overcurrent protection) to prevent
damage from surges or short circuits.

Electrical Functionality:
1. Power Distribution:
o Batteries supply energy through the ROBOT HAT to all components, ensuring
balanced and efficient power usage.
2. Signal Processing:
o Sensors like the MPU-6050 and camera send data to the Raspberry Pi, which
processes it and sends control signals to the servos via the ROBOT HAT.
3. Lighting Effects:
o WS2812 LEDs provide visual cues for debugging, status indication, and user
interaction.
4. Communication:
o The electrical system allows seamless communication between hardware
components, enabling real-time feedback and adjustments.
5. System Protection:
o Voltage regulators and circuit protection ensure the longevity and safety of the
electrical components.

How Servo Motors Work with Raspberry Pi


Servo motors operate by receiving PWM (Pulse Width Modulation) signals, which control
their position, speed, or rotation angle. The Raspberry Pi generates these PWM signals via its
GPIO (General Purpose Input/Output) pins.
1. Signal Control:
o The PWM signal from the Raspberry Pi determines the position of the servo
arm. For example:
 A signal with a 1ms pulse positions the servo at 0°.
 A 1.5ms pulse sets it to 90°.
 A 2ms pulse moves it to 180°.
2. Power Supply:
o Servos require external power (typically 4.8V to 6V) because the Raspberry Pi
GPIO pins cannot provide enough current to drive them directly.

Key Components for Integration


1. ROBOT HAT or Servo Driver:
o The ROBOT HAT (already in your setup) acts as an interface between the
Raspberry Pi and servos.
o It provides:
 PWM signal generation.
 Power regulation for multiple servos.
o Alternatively, you can use a PCA9685 PWM driver board if more precise
control is needed.
2. External Power Supply:
o Servos need a dedicated power source, such as a 5V battery pack, to handle
their current requirements without overloading the Raspberry Pi.
3. Connection Wires:
o Use 3-pin connectors for each servo:
 Signal (connected to Raspberry Pi or ROBOT HAT).
 Power (connected to external power source).
 Ground (shared between Raspberry Pi and servo power supply).

Steps to Connect Servo Motors


1. Connect the Servo to the ROBOT HAT:
o Plug the 3-pin connector into the ROBOT HAT, aligning the signal, power,
and ground pins.
2. Connect the ROBOT HAT to the Raspberry Pi:
o Attach the ROBOT HAT to the GPIO header of the Raspberry Pi.
3. Provide Power to the Servos:
o Connect a 5V external power source to the ROBOT HAT to power the servos.
4. Programming the Servo Control:
o Use Python libraries like [Link], gpiozero, or Adafruit-PCA9685 to send
PWM signals to the servos.
o Example (with Adafruit-PCA9685):
o from adafruit_servokit import ServoKit
o kit = ServoKit(channels=16)
o [Link][0].angle = 90 # Move servo on channel 0 to 90 degrees

Advantages of Using Raspberry Pi for Servo Control


1. Precision:
o The Raspberry Pi provides precise PWM signals for accurate servo
positioning.
2. Versatility:
o Multiple servos can be controlled simultaneously using servo drivers or
expansion boards.
3. Programmability:
o Raspberry Pi allows for complex movement algorithms and real-time
adjustments (e.g., gait patterns, obstacle avoidance).
4. Integration:
o The Raspberry Pi can coordinate servo movements with other sensors and
components, like the MPU-6050 or camera.
Graduation Project
Nikita Yurchenkov 200027703
Mukhammadnur Azimov 200025725

SOFTWARE PART

Flowchart:

1: Main Flow

2: Sub-Flow (Gait Control)


Algorithms:

Walking Gait Algorithm

The robot moves using pre-defined gaits (e.g., crawl gait or trot gait). The algorithm calculates leg movements based on
the robot’s orientation.
1. Input: Desired direction, speed, and stability requirements.
2. Initialize: Define step length, cycle time, and leg sequence.
3. Control Logic:
• Lift one leg (swing phase).
• Move the lifted leg forward.
• Lower the leg to the ground (stance phase).
• Repeat for other legs in a coordinated manner.
4. Output: Servo motor commands for each leg.

Inverse Kinematics (IK) Algorithm

IK calculates joint angles required to position the robot’s feet accurately.


1. Input: Target foot position (x, y, z).
2. Solve Equations:
• Use trigonometric equations for the leg’s structure to compute joint angles.
3. Output: Joint angles for servo motors.

Obstacle Avoidance Algorithm

If equipped with sensors like an ultrasonic sensor:


1. Input: Distance data from the sensors.
2. Logic:
• If distance < threshold, calculate an alternative path.
3. Output: Adjust walking direction.

Balancing Algorithm

Using an IMU (gyroscope + accelerometer):


1. Input: Tilt and orientation data.
2. Logic: Adjust leg positions to maintain balance using a PID controller.
3. Output: Corrective servo commands

Programming Details:

Languages and Libraries

• Python: Primary language for Raspberry Pi-based robotics.


• Libraries:
• [Link]: For GPIO pin control.
• numpy: For matrix and trigonometric calculations in IK.
• Adafruit_PCA9685: For controlling servo motors.
• smbus: For I2C communication with IMU.

Python Code Snippet:

Initialization
Walking Gait Logic

Obstacle Avoidance
Servo Motor Control:

Components
Raspberry Pi
Robot HAT
Servo

What is a servo?

Servo is a position (angle) servo driver, which is suitable for control systems that require constant angle changes and can
be maintained. It has been widely used in high-end remote control toys, such as airplane toys, submarine models, and
remote control robots.
We use a 180° servo in this lesson, which can move between 0° and 180°. Since the 180° servo can be used to control the
rotation angle of a certain mechanism via PWM signal, it is a more commonly used module in robot products.
On the Raspberry Pi driver board Robot HAT, there is a PCA9685 chip specially used to control the servo. The Raspberry
Pi uses I2C to communicate with the PCA9685. The chip controls the servo by sending pulse signals from the Raspberry Pi
which tell the servo where to move. Below is what a 180° servo looks like:
Schematic Diagram

The 180° servo module needs to connect to the servo interface on the Robot HAT. The yellow wire is connected to the
yellow pin, the red wire to the red pin, and the brown wire to the black pin, as shown below (connect to pin 0):

Code Snippet

Control the servo to rotate to a certain angle:

In the above code, set_pwm_freq(50) is used to set the PWM frequency to 50Hz. This setting depends on the model of the
servo. Servos used on Adeept robot products are controlled by a 50Hz PWM signal. For other servos, the value depends on
the servo specifications.
pwm.set_pwm(0, 0, 300) is to control the rotation of a servo to a certain position. To explain the three values:
"0" is the port number of the servo, corresponding to the number marked on the Robot HAT driver board (when
connecting the servo, pay attention not to insert the ground wire, VCC and signal wire inversely – correct way is servo's
brown wire to the black of HAT, red to red, and yellow to yellow).
"0" is the deviation value for controlling the servo's rotation, which is not used in the program here. This function is used
to correct the deviation (for the cause of the error, refer to the precautions for structural assembly).
"300" is the value of the PWM duty cycle to be set. The rotation angle varies from servos. The PWM duty cycle range of the
servo used in the robot is about 100 to 560, which corresponds to the range of rotating angle about 0° to 180°.
The code above does not control the rotation speed of the servo. To control the robot to slowly swing back and forth
between two positions, you need to use the method of increasing or decreasing variables to control the servo.

Control the servo to move slowly:


pwm.set_pwm(0, 0, 300+i) is used to control the servo to rotate to a certain position. "0" is the port number of the servo,
corresponding to the number marked on the Robot HAT driver board (when connecting the servo, pay attention not to
insert the ground wire, VCC and signal wire inversely – correct way is servo's brown wire to the black of HAT, red to red,
and yellow to yellow). "0" is the deviation value for controlling the servo's rotation. "300+i" is the value of the PWM duty
cycle to be set. The rotation angle varies from servos. The PWM duty cycle range of the servo used in the robot is about
100 to 560, which corresponds to the range of rotating angle about 0° to 180°.
By the formula (duty ratio - 100) / 2.55, the angle corresponding to the current duty cycle can be calculated.
The code above can be used to control the servo to rotate slowly back and forth between 300 and 400, but it has great
drawbacks. When the program is executed to the slow-motion part of the servo, it will be blocked, which will seriously
affect the program. Therefore, a multi-threaded solution is provided in the robot product program to solve this problem.

Non-blocking control method:


Use the above code to control the servo to reciprocate, except for [Link](), which will not block the running of the
context program.
Call singleServo() to start and stopWiggle() to stop motion. singleServo() requires three parameter: the port numbers of
the servo to be controlled (e.g., "3" means to control the No. 3 servo connected to Robot HAT), the direction of the servo (1
or -1), and the speed of the servo (the larger the value, the faster the movement).

Image Processing:

Algorithms

Object Detection and Recognition

• Purpose: To identify objects (e.g., obstacles, targets) using the camera.

1. Input: Image frames from the camera.


2. Preprocessing:
• Convert image to grayscale or apply Gaussian blur to reduce noise.
3. Feature Detection:
• Use methods like HOG (Histogram of Oriented Gradients) or a pre-trained neural network (e.g., YOLO, MobileNet).
4. Classification:
• Use a trained model (e.g., TensorFlow, PyTorch) to classify objects.
5. Output: Object labels and coordinates.

Line Following Algorithm

• Purpose: To follow a line on the ground for navigation.

1. Input: Image frames from the camera.


2. Preprocessing:
• Convert image to grayscale and apply edge detection (e.g., Canny).
3. Logic:
• Identify the line’s position in the frame using contours.
• Calculate the deviation from the center.
4. Output: Steering commands to keep the robot aligned.

SLAM (Simultaneous Localization and Mapping)

• Purpose: To navigate and build a map of the environment.

1. Input: Camera feed and IMU data.


2. Logic:
• Extract features from the environment (e.g., ORB or SIFT features).
• Track these features across frames to estimate motion.
• Use algorithms like EKF (Extended Kalman Filter) or graph-based SLAM for localization.
3. Output: Map of the environment and robot’s position.

Motion Planning Using Image Data

• Purpose: To navigate based on detected obstacles or waypoints.

1. Input: Detected obstacles and target position from image data.


2. Logic:
• Use path-planning algorithms like A* or Dijkstra to calculate a collision-free path.
3. Output: Command for movement (e.g., turning, forward motion).

Flowchart:

1: Main Flow
2: Sub-Flow (Object Detection)
Programming Details

Languages and Libraries

• Python: Best suited for Raspberry Pi.


• Libraries:
• OpenCV: For image processing.
• NumPy: For numerical calculations.
• TensorFlow or PyTorch: For object detection models.
• picamera: For interfacing with the Raspberry Pi camera.

Python Code:
Object Detection Using OpenCV and TensorFlow

Line Following Using OpenCV

Color Detection:
Color Space
Color space refers to a method of organizing colors. With the help of color space and tests of physical devices, we can get a
certain analog and digital representation of colors. Color space can be defined by random colors. For example, Pantone series
uses a group of specific colors as sample, and define each color with a name and code. Or, define it mathematically like Adobe
RGB, sRGB, etc.

RGB Color Space


RGB uses additive colors as it describes a specific proportion by which various kinds of "light" produces colors. Starting from
black, light keeps mixing to generate different colors. RGB means the value of red, green, and blue; RGBA produces a
transparent color based on RGB with the alpha channel.

Common color spaces based on the RGB mode include sRGB, Adobe RGB and Adobe Wide Gamut RGB.

HSV Color Space


HSV, or hue, saturation, and value, also referred to as HSB (B for brightness), is commonly used by artists because it's more
understandable to describe color by hue and saturation compared with terms of additive or subtractive color mixing. HSV is a
variant of RGB color space and closely related in content and color standards as it derives from RGB.
HSV color space is used for color detection with OpenCV since it's less effected by ambient light and brings more accurate
detection results. Besides, it's easy to define color range with HSV. During color detection, the code is to recognize some range
of colors instead of some color. Therefore, the HSV color space is used for color detection since it is similar to the human
perception of color.
Here we use this function to aim the camera at a target of a specific color with the function. The process is as follows:

Running Color Detection


Power on the robot; it may take 30s-50s (it will automatically run the [Link] when booting up).

After booting up, open a Google Chrome web browser on your mobile or computer, enter the address of your Raspberry Pi and
":port number". For example, [Link]:5000, and then the web controller will be shown on the browser.

Main Program:
HSV Color Component Range in OpenCV

Generally the H (hue) value of HSV color space ranges from 0-360, yet 0-180 in OpenCV.
HSV\Color Black gray white red orange yellow green cyan blue purple
H_min 0 0 0 0 156 11 26 35 78 100 125
H_max 180 180 180 10 180 25 34 77 99 124 155
S_min 0 0 0 43 43 43 43 43 43 43
S_max 255 43 30 255 255 255 255 255 255 255
V_min 0 46 221 46 46 46 46 46 46 46
V_max 46 220 255 255 255 255 255 255 255 255

You might also like