Skip to content

ChrisEd0/ESP32_stewart_platform_simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stewart Platform IK Simulator & Serial Control

This project implements the inverse kinematics (IK) of a 6-DOF Stewart platform, including real-time visualization and serial communication with an ESP32 for controlling servos via a PCA9685 driver.

🧩 Overview

The system is divided into two main parts:

Simulation (Python) Inverse kinematics calculation Visualization of simplified platform position Hardware Control (ESP32 + PCA9685) Receives servo commands via serial communication Controls 6 servos (MG996) using PWM driver

βš™οΈ Hardware Setup Microcontroller: ESP32 Servo Driver: PCA9685 (I2C) Servos: MG996 (or similar high-torque servos)

The PCA9685 allows precise PWM control of multiple servos using I2C, reducing load on the ESP32. PCB desing

πŸ”Œ System Architecture

Python (IK + Control) β†’ Serial Communication (USB) β†’ ESP32 β†’ I2C β†’ PCA9685 β†’ Servos β†’ Stewart Platform

🧠 Inverse Kinematics (Python) πŸ“Œ ik_visualizer.py IK Simulation

This script simulates the Stewart platform and visualizes its motion.

The user inputs: Roll Pitch The system computes: The required position of each actuator (6 servos) Output: Individual servo values corresponding to platform orientation Graphical visualization of position

πŸ“Œ ik_serial.py

This script connects directly to the ESP32 via serial communication.

πŸ” Workflow: User inputs: Roll Pitch Python: Computes inverse kinematics Normalizes the output values Sends data via serial in the format: a,b,c,d,e,f#

πŸ”§ ESP32 Firmware (Arduino Framework) πŸ“Œ controlSerial.ino

This code runs on the ESP32 and handles servo control.

πŸ” Workflow: Waits for a complete serial message ending in # Parses the received string Splits values into 6 independent variables Updates each servo position πŸŽ›οΈ Servo Control Logic

Each servo is controlled using:

servo.write(90 + m);

Where:

90 β†’ neutral (center) position m β†’ normalized offset value from IK

πŸ“¦ Requirements (Python) pip install numpy matplotlib pyserial

πŸ“Έ Model & References Images and screenshots available in /images 3D model available on GrabCAD https://grabcad.com/library/stewart-plataform-1 3D model

πŸ“ Notes This repository focuses on inverse kinematics and low-level control Advanced control strategies (PID, LQR, BC+DeepRL) are implemented in a separate project Designed for modular integration with computer vision systems

πŸ‘¨β€πŸ’» Author Cristian Guerrero

About

Inverse kinematics simulation and visualization of a 6-DOF Stewart platform with optional serial communication to ESP32.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors