Skip to the content
2 layers76.2 × 53.3 mmMy pcb, the printed circuit board in 3D

Este proyecto implementa un robot de equilibrio vertical (péndulo invertido) que puede partir tanto desde una posición inclinada (40°) como de una posición en equilibrio y logra estabilizarse automáticamente en posición…

Size
76.2 × 53.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
6
Nets
39
Pads
64
Tracks, vias
96, 0
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
14 Jun 2025
Updated
14 Jun 2025

Overview

My pcb is an open-source printed circuit board by pablomediavilla, from the pablomediavilla/pendulo_invertido repository on GitHub. It is a 2-layer board of 76.2 × 53.3 mm with 6 parts on 39 nets, routed with 96 tracks and 0 vias.

Its parts include 3 ICs and 2 connectors. It belongs with the AVR (ATmega, ATtiny) boards of this library.

README

README.md

pendulo_invertido

Robot Péndulo Invertido - Control por PID con MPU6050

Este proyecto implementa un robot de equilibrio vertical (péndulo invertido) que puede partir tanto desde una posición inclinada (~40°) como de una posición en equilibrio y logra estabilizarse automáticamente en posición vertical utilizando un controlador PID con realimentación de ángulo obtenida por un sensor MPU6050.


Requisitos de hardware

  • Placa Arduino Nano (u otra compatible)
  • Sensor MPU-6050 (giroscopio + acelerómetro)
  • Driver de motores TB6612FNG
  • 2 motores DC con ruedas
  • Batería adecuada (En este caso Li-Po)
  • PCB y chasis

Conexiones

MPU6050 → Arduino

  • VCC → 5V
  • GND → GND
  • SDA → A4
  • SCL → A5

TB6612FNG → Arduino

  • PWMA → Pin 9
  • AIN1 / AIN2 → Pin 7 / 8
  • PWMB → Pin 10
  • BIN1 / BIN2 → Pin 5 / 6
  • STBY → Pin 4
  • VM / VCC / GND → Alimentación del motor

Lógica de cambio de configuraciones PID

cpp
if (abs(input) > 12) {
  Kp = Kp_fast; Ki = Ki_fast; Kd = Kd_fast;
} else {
  Kp = Kp_slow; Ki = Ki_slow; Kd = Kd_slow;
}

Funcionamiento General

1. Inicialización y calibración

Al iniciar, el programa calibra el sensor MPU6050 y establece la posición inicial como referencia de equilibrio.

2. Lectura del ángulo

En cada ciclo del loop(), se obtiene el ángulo de inclinación del robot a partir del eje X del sensor. Este ángulo indica que tan lejos está el robot de la posición de equilibrio.

3. Cambio automático de modo PID

Se implementan dos configuraciones PID:

  • Modo rápido (levantamiento): Se activa si el ángulo supera los 12°. Usa constantes más agresivas para levantar el robot rápidamente desde una posición inclinada.
  • Modo lento (estabilización): Se activa cuando el robot está cerca del equilibrio. Usa constantes más suaves para evitar oscilaciones y mejorar la estabilidad.

4. Cálculo PID

El programa calcula la salida del PID (output) como una combinación proporcional, integral y derivativa del error entre el ángulo actual y el deseado (setpoint, que es 0°).

5. Control de motores

Según la señal de salida:

  • Si el robot está inclinado hacia adelante, los motores se mueven hacia atrás.
  • Si está inclinado hacia atrás, los motores avanzan.
  • Si el error es muy pequeño, los motores se detienen.

6. Depuración

Se imprime por serial el ángulo actual y la velocidad aplicada, lo que resulta útil para ajustar los parámetros PID y monitorear el comportamiento general del sistema.

Parts

6
QtyValueFootprintReferences
1Arduino_Nano_v3.xModule:Arduino_NanoA1
1DSN2596mY_dsn2596:My_DSN2596U2
1My_MPUMy_MPU:My_MPUU1
1My_TB6612FNGMy_TB6612FNG:My_TB6612FNGU3
1Screw_Terminal_01x02conexion_1x2:conex_1x2J2
1Screw_Terminal_01x04conexion_1x4:conex_1x4J1

Similar boards

  • 2 layers18.5 × 11.1 mmSwitch, the printed circuit board in 3D

    Switch

    byrantech/laptop

    anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

    6 parts4.3kMIT
  • 2 layers14.6 × 33 mmBrain board SD Card 1, the printed circuit board in 3D

    Brain board SD Card 1

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    6 parts1.2k
  • 2 layers9 × 9 mmDpoint, the printed circuit board in 3D

    Dpoint

    Jcparkyn/dpoint

    Open-source digital stylus using camera tracking and inertial measurements

    6 parts1.1kMIT
  • 2 layers51.5 × 16.6 mmMicroswitchXY Endstop, the printed circuit board in 3D

    MicroswitchXY Endstop

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    6 parts1.1kGPL-3.0
  • 2 layers21.9 × 76.7 mmAmiga External, the printed circuit board in 3D

    Amiga External

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    6 parts1kGPL-3.0
  • 2 layers88.9 × 50.8 mmBusinesscard, the printed circuit board in 3D

    Businesscard

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    6 parts915
  • 2 layers20.3 × 15.2 mmL0 RGB led, the printed circuit board in 3D

    L0 RGB led

    Luos-io/luos_engine

    Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.

    6 parts546MIT
  • 2 layers9 × 3.6 mmOpticalEncoder, the printed circuit board in 3D

    OpticalEncoder

    adamb314/ServoProject

    Getting the most out of your hobby servo

    6 parts545

Questions

How big is the My pcb PCB?

It measures 76.2 × 53.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the My pcb use?

6 parts. 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 My pcb KiCad files?

From the pablomediavilla/pendulo_invertido repository on GitHub, at the commit this page was made from: the board is Hardware/my_pcb.kicad_pcb and its schematic Hardware/my_pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the My pcb design in my own project?

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