Skip to the content
2 layers109.2 × 48.3 mmEsp mpu6050 lis3mdl, the printed circuit board in 3D

Master's thesis project 2024

Size
109.2 × 48.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
18
Nets
44
Pads
77
Tracks, vias
120, 0
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
27 May 2023
Updated
2 Sep 2024

Overview

Esp mpu6050 lis3mdl is an open-source printed circuit board by wojtekbab, from the wojtekbab/self_balancing_robot repository on GitHub. It is a 2-layer board of 109.2 × 48.3 mm with 18 parts on 44 nets, routed with 120 tracks and 0 vias.

It is built around the L7805. Its parts include 7 connectors, 3 ICs, 2 capacitors and 1 switch. It belongs with the ESP32 boards of this library.

Main components

1

README

README.md

Two-Wheeled Balancing Robot Project

Overview

Repository contains code for microcontroller ESP-32 with implemented control system with LQR regulator. Microcontroller connects to local network and acts like a web server, providing GUI on website to control vehicle. Matlab scripts were used to calculate mathematical model and simulink system was designed to veryficate close loop system.

Table of Contents

  1. ESP32 Code
  2. MATLAB Code
  3. Inventor Project
  4. KiCad Project

ESP32 Code

Code was written in PlatformIO extension with arduino framework. FreeRTOS was used with hardware interrupts and tasks for:

  • service encoders
  • measure imu data
  • filter data with Kalman Filter
  • calculate rest of state variables
  • generate reference vector
  • calculate control for motors
  • log data

Files

  • main.cpp: main file for the ESP32.
  • defines.cpp: file with defines.
  • globals.cpp: file with global variables used by tasks.
  • interrupts.cpp: interrupts service routines.
  • utilities.cpp: some utility functions.
  • tasks.cpp: file with FreeRTOS tasks.
  • web_server.cpp: web server with html page.
  • platformio.ini: configuration file used by PlatformIO extension.

How to Run

  1. Create empty project with PlatformIO.
  2. Copy platformio.ini file into project.
  3. Copy header and source files into folder src.

MATLAB Code

The MATLAB code is used to calculate mathematical model and simulate system.

Files

  • s1_parameters.m: script with system parameters.
  • s2_mathematical_model.m: script for calculate unlinear and linear model as state-space matrixes.
  • sim1_unlinear_model_with_LQR.slx: simulink close loop system with LQR regulator

How to Run

  1. Open Matlab 2023b.
  2. Run s2_mathematical_model.m to load parameters and calculate K matrix.
  3. Run sim1_unlinear_model_with_LQR.slx to test system output for given reference velocities or different initial state.

Python Code

In case when Matlab is not available, all necessary scripts were translated for python.

Files

  • requirements.txt: contain all necessary python modules.
  • parameters.py: contain dictionary with system parameters.
  • p1_mathematical_model.ipynb: notebook for symbolic equations with sympy to obtain mathematical model.
  • p2_closed_loop_system.ipynb: notebook to make simulations with closed loop system with LQR regulator

How to Run

  1. Install necessary modules.
  2. Run p1_mathematical_model.ipynb to obtain mathematical model.
  3. Run p2_closed_loop_system.ipynb to see result of system simulations.

Inventor Project

Image from Inventor project was included to repository. 3D model was created to design distribution of elements and to calculate parameters of vehicle inertia.

Images

Inventor Assembly Real model

Figure 1: 3D model from Autodesk Inventor and real model.

KiCad Project

Images from KiCad project was included to repository. PCB board was created for electronic parts from system to avoid EMI interferences from DC motors.

Images

Inventor Assembly Real model Real model

Figure 2: designed paths, visualization, home made board

Demo

Link to demo video: https://www.youtube.com/watch?v=7iqSqyg-NeA

Parts

18
QtyValueFootprintReferences
7Conn_01x02_FemaleMojaBibliotekaFootPrint1:zlacze ARK_2J1, J2, J3, J4, J5, J6, J7
4MountingHoleMountingHole:MountingHole_3.2mm_M3_DIN965_PadH1, H2, H3, H4
2100nFCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mmC1, C2
1ESP32-FirebeetleMojaBibliotekaFootPrint1:FIREBEETLE_ESP32E1
1L7805MojaBibliotekaFootPrint1:LM78xxU3
1Lis3mdl_PoluluMojaBibliotekaFootPrint1:lis3mdl_PololuU5
1Toggle_switchMojaBibliotekaFootPrint1:mini_black_switchS1
1mpu6050_DFRobotMojaBibliotekaFootPrint1:mpu6050_DFRobotU6

Similar boards

  • 2 layers40.6 × 110 mmEuropi surface mount, the printed circuit board in 3D

    Europi surface mount

    Allen-Synthesis/EuroPi

    EuroPi: A reprogrammable Eurorack module based on the Raspberry Pi Pico

    92 parts584CC0-1.0
  • 2 layers132.1 × 45.7 mmIPoS, the printed circuit board in 3D

    IPoS

    peterheinrich/InternetOverSpaghetti

    Transmitting IP packages over a pair of spaghetti thus demonstrating how media independent IP really is.

    42 parts342
  • 2 layers59.7 × 57.5 mmFunBox, the printed circuit board in 3D

    FunBox

    GuitarML/FunBox

    Stereo guitar pedal platform using Daisy Seed.

    61 parts289MIT
  • 2 layers90.8 × 35.6 mmERCF easy brd, the printed circuit board in 3D

    ERCF easy brd

    Tircown/ERCF-easy-brd

    More informations on how to reset for flashing:\ https://wiki.seeedstudio.com/Seeeduino-XIAO/#enter-bootloader-mode

    28 parts195GPL-3.0
  • 2 layers111.3 × 106.4 mmSuper Sixteen v1, the printed circuit board in 3D

    Super Sixteen v1

    matthewcieplak/super-sixteen

    Code and schematics for the Super Sixteen Eurorack sequencer

    141 parts171
  • 2 layers91.4 × 71.1 mmPico w rover, the printed circuit board in 3D

    Pico w rover

    NikodemBartnik/Mini-Mars-Rover

    Educational robotic platform made to look like a mini mars rover

    20 parts143MIT
  • 2 layers144.1 × 182.2 mmSHVC CPU-01, the printed circuit board in 3D

    SHVC CPU-01

    starlightk7/OpenSFC

    OSHW Reproduction Parts related to the Super Famicom / Super Nintendo game console

    498 parts114CERN-OHL-S-2.0
  • 2 layers106.1 × 155 mmMotherboard, the printed circuit board in 3D

    Motherboard

    Redherring32/OpenTendo-TopLoader

    An Open Source HardWare (OSHW) recreation of the 1993 toploading NES motherboard (Also known as NES-101)

    84 parts94

Questions

How big is the Esp mpu6050 lis3mdl PCB?

It measures 109.2 × 48.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Esp mpu6050 lis3mdl use?

18 parts, built around the L7805. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Esp mpu6050 lis3mdl KiCad files?

From the wojtekbab/self_balancing_robot repository on GitHub, at the commit this page was made from: the board is pcb_kicad/esp_mpu6050_lis3mdl.kicad_pcb and its schematic pcb_kicad/esp_mpu6050_lis3mdl.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Esp mpu6050 lis3mdl design in my own project?

Its repository states no licence, so its author keeps all rights: ask wojtekbab before reusing the design.