Skip to the content
2 layers100 × 100 mmCARTPOLE MOSFET, the printed circuit board in 3D

Designed PCB board with 24V/150W DC Motor Controller for Cart-Pole systems using IRF3205S MOSFETs and IR2104 drivers.

Size
100 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
129
Nets
106
Pads
422
Tracks, vias
622, 331
Pours
9
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
18 Mar 2026
Updated
19 Mar 2026

Overview

CARTPOLE MOSFET is an open-source printed circuit board by conmeokhoi, from the conmeokhoi/Controller-for-Cart-Pole-System repository on GitHub. It is a 2-layer board of 100 × 100 mm with 129 parts on 106 nets, routed with 622 tracks and 331 vias.

It is built around the STM32F103C8T6, B0505S-1W and IR2104PBF, with the TPS5430DDA, AMS1117-3.3 and L7812 among its other parts. Its parts include 39 capacitors, 31 resistors, 16 diodes, 16 connectors and 12 ICs. It belongs with the robots and motor control boards and the STM32 boards of this library.

Main components

9

README

README.md

150W Isolated Cart-Pole Control Board (STM32)

Platform Power PWM

📌 Project Overview

This project presents the design and implementation of a specialized control board for an Inverted Pendulum on a Cart (Cart-Pole) system. It serves as a benchmark for testing cascaded control strategies in highly non-linear, unstable, and under-actuated environments.

🛠 Hardware Architecture

Image

1. Multi-Stage Power Management

The system operates on a primary 24V DC input with hierarchical regulation to ensure signal stability and efficiency:

  • 12V Rail: Regulated by the L7812 for MOSFET gate drivers.
  • 5V Auxiliary Rail: Stepped down via a high-efficiency TPS5430 Buck Converter (~90% efficiency) to power encoders and sensors.
  • Isolated 3.3V Logic: Utilizes a B0505S isolated DC-DC converter and an AMS1117-3.3 LDO to shield the MCU from power-stage inductive switching noise.

2. Motor Drive Stage (150W H-Bridge)

  • MOSFET Selection: Features four IRF3205S N-channel MOSFETs with an exceptionally low $R_{DS(on)} \approx 8 m\Omega$ to minimize conduction losses.
  • Gate Driving: Employs IR2104 drivers with bootstrap circuitry to maintain high-side gate saturation.
  • Safety Logic: Integrated 520ns hardware dead-time prevents "shoot-through" short circuits.

3. Galvanic Isolation

  • High-Speed Paths: 6N137 optocouplers (10Mbps) are dedicated to PWM and Encoder signals to prevent propagation delay in the real-time control loop.
  • Isolation Barrier: Complete physical partitioning between the Power Zone and Clean Logic Zone via the optocoupler bridge. Image Image

💻 Firmware & Control Logic

Powered by the STM32F103C8T6 (ARM Cortex-M3) at 72MHz:

  • Encoder Processing: Utilizes hardware Timer Encoder Mode for high-resolution quadrature decoding without CPU overhead.
  • PWM Configuration: Frequency set at 20kHz to eliminate audible jitter and provide granular torque control: $$f_{PWM} = \frac{f_{CLK}}{(PSC+1) \times (ARR+1)} = \frac{72,000,000}{36 \times 100} = 20,000 \text{ Hz}$$
  • Control Algorithm: Implements a Cascaded PID structure where the outer loop manages cart position and the inner loop stabilizes the pendulum angle.

🔍 Failure Analysis (Root Cause)

During integration, a hardware breakdown occurred in the H-bridge. Forensic analysis identified a missing connection between the VS pin (Pin 6) of the IR2104 drivers and the source terminals of the high-side MOSFETs.This led to a "floating gate" state, causing a direct short-circuit from the 24V rail to Ground.

Image Image

🎥 Experimental Validation

The following video demonstrates the individual functional verification of the control board:

  • Hardware Self-Test: Verification of the 24V, 12V, 5V, and 3.3V power rails.
  • Encoder & Sensor Feedback: Real-time pulse capturing and gyroscope data retrieval.
  • PWM Output: Validation of 20kHz complementary signals via oscilloscope.
  • Video Demo: Cart-Pole Demo

Author: Nguyễn Huỳnh Khôi.
Supervised by: PhD. Võ Lâm Chương.
University: Ho Chi Minh City University of Technology and Engineering (HCMUTE)

Parts

129
QtyValueFootprintReferences
9100 nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC11, C15, C19, C21, C32, C33, C39, C40, C42
710kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR2, R9, R11, R18, R22, R27, R29
6SS36Diode_SMD:D_SMA_HandsolderingD2, D5, D7, D8, D11, D12
510 nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC1, C23, C24, C37, C38
5220RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR13, R14, R24, R25, R28
4100 nFCapacitor_SMD:C_0603_1608MetricC26, C27, C28, C29
410uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC4, C17, C20, C41
41N4148Diode_SMD:D_SOD-123D3, D4, D9, D10
427RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR4, R5, R6, R7
44k7Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR8, R10, R19, R23
46N137Package_DIP:SMDIP-8_W9.53mm_Clearance8mmU7, U8, U10, U11
4GNDConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ10, J12, J14, J16
4IRF3205Package_TO_SOT_SMD:TO-263-2Q1, Q2, Q3, Q4
4~MountingHole:MountingHole_3.2mm_M3_Pad_ViaH5, H6, H7, H8
310kCapacitor_SMD:C_0603_1608MetricR12, R15, R17
2100uF/50VCapacitor_SMD:CP_Elec_8x10.5C2, C13
210pFCapacitor_SMD:C_0603_1608MetricC35, C36
210uF/25VCapacitor_SMD:C_0603_1608MetricC25, C31
21kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR1, R26
21uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC9, C10
23k3Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR3, R30
247uF/25VCapacitor_SMD:CP_Elec_6.3x5.4C16, C22
24k7Resistor_SMD:R_0603_1608MetricR20, R21
2IR2104Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2, U3
10Capacitor_SMD:C_0603_1608MetricR16
11.5AFuse:Fuseholder_Littelfuse_Nano2_154xF2
110 uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC12
11000uF/50VCapacitor_THT:C_Radial_D12.5mm_H25.0mm_P5.00mmC6
1100nFCapacitor_SMD:C_0603_1608MetricC34
1100nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC3
1100uF/25VCapacitor_SMD:CP_Elec_8x10.5C18
1120R-2ACapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderFB1
112VConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ13
112V_LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD15
115AFuse:Fuseholder_Littelfuse_Nano2_154xF1
1220uFCapacitor_SMD:CP_Elec_8x10.5C5
124VConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ15
124VDC INTerminalBlock:TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mmJ1
124V_LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD14
13.3VConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ11
1330 nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC14
1330RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR31
13V3_LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD16
147uHCDRH127_LDNP-221MC:INDPM120120X800NL1
15VConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ9
15V_LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD6
160V-4ADiode_SMD:D_SMBD1
18MhzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U5
1B0505SRFM-0505S:CONV_RFM-0505SU6
1ENCODERConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ5
1I2CConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ4
1L7812Package_TO_SOT_THT:TO-220-3_VerticalU4
1LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD13
1LOGOPicture:UTE_15x15G***
1MotorTerminalBlock:TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mmJ2
1PB3-PB5Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ8
1PC13-PC15Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ7
1PC817X2PC817X2NIP0F:SOP254P975X460-4NU12
1STLINK_DEBUGConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1STM32F103C8T6Package_QFP:LQFP-48_7x7mm_P0.5mmU9
1SW_PushButton_Switch_SMD:SW_SPST_CK_RS282G05A3SW1
1TPS5430DDAPackage_SO:TI_SO-PowerPAD-8_ThermalViasU1
1USARTConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ6

Similar boards

  • 4 layers90 × 80 mmSteering Panel, the printed circuit board in 3D

    Steering Panel

    NTURacingTeam/nturt_kicad_EP7

    247 parts
  • 2 layers98.8 × 55.1 mmH bridge controller, the printed circuit board in 3D

    H bridge controller

    jayanta525/dual-h-bridge

    Dual H-Bridge Controller with IRF3205 and IR2104 MOSFET Driver, and with ATMega328P-AU PWM Controller

    104 parts5MIT
  • 2 layersMultiple IRF2104, the printed circuit board in 3D

    Multiple IRF2104

    Sudhamsu98/IRF2104_MOSFET_Driver

    IRF2104 based MOSFET Driver

    130 parts1
  • 2 layers78.5 × 46.5 mmBuck, the printed circuit board in 3D

    Buck

    G-Leonel-6/C2

    En este repositorio se guardaran los archivos correspondientes al desarrollo de una fuente de alimentacion regulada

    14 parts
  • 2 layers70 × 53 mmLDOs, the printed circuit board in 3D

    LDOs

    Princediscjalpha/DIY-PCB-Projects

    I am creating this repository that will include most of PCB Board designs and layouts that are mostly used for hobby purposes and are very helpful to understand the industrial projects and their working as well.

    17 parts2

Questions

How big is the CARTPOLE MOSFET PCB?

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

What parts does the CARTPOLE MOSFET use?

129 parts, built around the STM32F103C8T6, B0505S-1W, IR2104PBF and TPS5430DDA. 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 CARTPOLE MOSFET KiCad files?

From the conmeokhoi/Controller-for-Cart-Pole-System repository on GitHub, at the commit this page was made from: the board is CARTPOLE_MOSFET.kicad_pcb and its schematic CARTPOLE_MOSFET.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the CARTPOLE MOSFET design in my own project?

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