
SunCommander RelayModule
m47eus2/SunCommander-PCB
PCB boards for energy optimalization device. Contactors control for power switching with full optical isolation. Multiple current measurments made with current transformers.

NgSpice Digital Twin of a complete off-grid solar power system: H-Bridge inverter (220V/50Hz, PI control, electro-thermal IGBT modeling) and 4kW MPPT boost converter (UC3843 analog control, KCL summing node, gate drive characterization).
MPPT Booster 4kW Hardware is an open-source printed circuit board by HNadeemTahir, from the HNadeemTahir/AI_Inverter_Project repository on GitHub. It is a 2-layer board of 304.6 × 105.7 mm with 115 parts on 77 nets, routed with 941 tracks and 22 vias.
It is built around the MC34072D, PCF8574P and TLP250(F), with the BC547 and BC337 among its other parts. Its parts include 58 resistors, 23 capacitors, 10 transistors, 6 diodes and 5 ICs. It belongs with the power boards of this library.

NgSpice simulation and KiCad PCB design of a complete off-grid solar power system. The simulation uses manufacturer SPICE models (not ideal switches) and translates dsPIC30F2010 firmware logic into behavioral equations so the control loops can be validated before building hardware.
Two power conversion stages, developed across 10 versions:
The workflow here — simulate with real device models, sweep parameters with Python, train a surrogate model, then route the PCB — is not specific to boost converters. The same approach works for any power stage where you need to predict switching losses and thermal behavior before committing to hardware. I have used variations of this on inverter gate drives, motor current loops, and industrial servo tuning.
| Version | Focus Area | Key Achievement |
|---|---|---|
| V1.0 | Environment Setup | NgSpice + library structure established |
| V2.0 | Half-Bridge SPWM | Ideal switching, basic sine generation |
| V3.0 | Physical IGBT Models | Real FGY75T120SWD switching behavior |
| V4.0 | Full H-Bridge + LC | Unipolar SPWM, motor load, phase lag verified |
| V5.0 | Closed-Loop PI Control | ZMPT101B sensor delay, voltage regulation |
| V6.1 | Dead-Time + Thermal | 2µs shoot-through protection, Foster RC model |
| V6.3 | Python Automation | Batch simulation, CSV data extraction |
| V6.5 | Modulation Benchmark | THI + Dead-Time compensation matrix |
| V7.0 | Surrogate Model | Scikit-Learn Random Forest predictor |
| V8.0 | 4kW MPPT Converter | Feed-forward + PI boost, 3 test profiles |
| V9.0 | UC3843 Control Loop | Analog-digital MPPT integration, gate physics |
| V10.0 | Hardware PCB | KiCad layout, DRC-clean, 3D-verified |
The 4kW MPPT booster control board, designed in KiCad 9.0. DRC-clean. The schematic and layout match the UC3843 + dsPIC control architecture from V8.0 and V9.0 simulations.


| File | Description |
|---|---|
MPPT_Booster_4kW_Hardware.kicad_pro | KiCad 9.0 project file |
MPPT_Booster_4kW_Hardware.kicad_sch | Full schematic (UC3843 + dsPIC + gate drivers + current sensing) |
MPPT_Booster_4kW_Hardware.kicad_pcb | PCB layout with copper pours, clearance rules, and thermal relief |
DRC.rpt | Design Rule Check report |
This version implements the hardware-level control architecture of the 4kW MPPT booster. It moves beyond behavioral SPICE switches into a real analog control loop where a UC3843 peak-current-mode PWM controller is directly slaved to the dsPIC30F2010 MCU via a KCL-balanced voltage summing node.
| Target | Method | Status |
|---|---|---|
| Analog-digital MPPT interface | KCL summing node on UC3843 Pin 2 | ✅ Proven |
| Cold-boot explosion prevention | 10kΩ pull-up on dsPIC OC1 PWM line | ✅ Proven |
| Precharge relay MCU isolation | 2N2222 NPN driving 40A contactor coil | ✅ Proven |
| Sub-harmonic oscillation fix | 2N3904 NPN emitter-follower slope compensation | ✅ Proven |
| 100ns turn-on noise rejection | 1kΩ + 470pF LEB filter on UC3843 Pin 3 | ✅ Proven |
| IGBT Miller plateau characterization | Asymmetric gate drive: 15Ω ON / 5.6Ω+D OFF | ✅ Proven |
| dsPIC PWM-to-analog conversion | 10kΩ + 4.7µF RC filter: 3.3Hz cutoff | ✅ Proven |

Four-point parametric sweep of the dsPIC OC1 PWM duty cycle. Proves the KCL summing node physics: at 25% duty cycle, Pin 2 settles below 2.50V and the UC3843 boosts at maximum power. At 50%–100%, Pin 2 rises above the 2.50V threshold and the converter shuts down in a controlled manner. The 10kΩ pull-up resistor ensures this safe state is the default during MCU boot.
| dsPIC PWM | RC Filter Output | Pin 2 Voltage | UC3843 State |
|---|---|---|---|
| 25% | 1.25V | 2.33V | Boosting (MAX POWER) |
| 50% | 2.50V | 2.51V | Shut Down |
| 75% | 3.75V | 2.69V | Shut Down |
| 100% | 5.00V | 2.88V | Shut Down |

500µs high-resolution transient analysis of the asymmetric gate drive network on the STGW60H65DFB parallel IGBT pair. Characterizes the Miller Plateau crossing, threshold voltage events, and the turn-on/turn-off time constants resulting from the 15Ω / 5.6Ω+1N4148 resistor-diode network.
| Parameter | Turn-ON | Turn-OFF |
|---|---|---|
| Gate Resistor | 15 Ω | 5.6 Ω + 1N4148 |
| Time Constant (τ) | ~300 ns | ~112 ns |
| Purpose | di/dt limiting, diode recovery ctrl | Miller effect suppression, shoot-through prevention |
| IGBT Threshold (Vth) | 6.0 V | 6.0 V |
| Miller Plateau | ~9 V | ~9 V |
| Full Saturation | 15 V | — |

Full closed-loop simulation of the UC3843 controlling the power stage. Shows the DC bus regulation, inductor current waveform, and the 20kHz gate drive signal across the full 60ms transient window.

Step-response analysis of the Leading Edge Blanking (LEB) filter at UC3843 Pin 3. A simulated dead-short event causes the INA181 output to jump instantaneously to 1.5V. The 1kΩ + 470pF RC filter delays the signal reaching the 1.0V trip threshold by 470ns — exactly the blanking window required to mask IGBT turn-on current spikes while remaining fast enough to detect a genuine short circuit within one switching cycle.
Full power-stage simulation of the 4kW DC-DC booster. Feed-forward + PI control architecture handles 3-panel to 8-panel PV string inputs.
| Parameter | Value |
|---|---|
| Input Range | 120V – 350V DC |
| Output | 380V DC (regulated) |
| Max Power | 4000W |
| Switching Frequency | 20kHz |
| IGBTs | 2× STGW60H65DFB (650V/60A, parallel) |
| Boost Diode | STTH3006D (600V/30A, 35ns Trr) |
| Gate Driver | FOD3150 (optically isolated) |
| Control | Feed-Forward + PI with anti-windup |
| Profile | Input | Load | Steady State | Verdict |
|---|---|---|---|---|
| 3-Panel String | 120V | 1500W | 380V flat | PASS |
| 5-Panel String | 250V | 3000W | 380V flat | PASS |
| 8-Panel String | 350V | 4000W | 380V ±10V† | PASS |
† Bounded oscillation at 350V is LC resonance at near-unity boost ratio. Eliminated in firmware by a single-coefficient EMA filter: vbus_filt = 0.015 * raw + 0.985 * filt.



A Random Forest Regression model trained on 204 NgSpice simulations generated by the parametric data factory. The predictor approximates IGBT junction temperature, efficiency, and AC output voltage for any input condition in under 0.01 seconds — eliminating the need to run a full transient simulation during firmware tuning.


Four independently toggled modulation strategies benchmarked against each other using a parametric sweep across 400V DC link conditions.
| THI | DT Comp | Strategy | V_rms | Tj_max | Efficiency |
|---|---|---|---|---|---|
| OFF | OFF | Bare SPWM | 188.7V | 45.9°C | 97.2% |
| OFF | ON | SPWM + DT Comp | 192.1V | 45.5°C | 98.1% |
| ON | OFF | THI Flat-Top | 192.8V | 45.9°C | 97.2% |
| ON | ON | THI + DT Comp | 195.5V | 45.5°C | 97.9% |

The combined strategy recovers 6.8V of AC output. Uncompensated dead-time introduces harmonic distortion that recirculates as I²R heat — compensating it in firmware improves both output voltage and thermal efficiency simultaneously.
50Hz output into 20Ω/100mH R-L load. Peak ±311V.
Current lags voltage by ~57°. Confirmed: arctan(2π × 50 × 0.1 / 20) = 57.5°.
ZMPT101B-delayed feedback vs reference. PI controller achieves tracking within 2 cycles.
Error and integral signals. Integral term stabilizes by 20ms.
200µs RC group delay (2kΩ / 100nF) modeled from physical transformer + PCB filter.
~2µs dead-time gap between Leg A HS and LS transitions, matching dsPIC DTCON1 register.
Negative current = energy delivery to load. Positive spikes at zero-crossings = inductive freewheeling through body diodes.
0.1Ω dead-short at t=25ms. CT + comparator trips INT0 latch at 50A primary. Current decays through freewheeling path within 1ms.
Foster RC network output. 50Hz thermal ripple at junction node. Heatsink stable at 45°C.
Single switching event: both gate signals at 0V for the full 2µs dead-time interval.
Full 20ms cycle. Leg A switches at 16kHz on the positive half; Leg B clamped. Roles exchange at zero-crossing.

Foster RC network mapping power dissipation to junction temperature. Standard power electronics electro-thermal equivalence:
| Thermal Domain | Electrical Equivalent |
|---|---|
| Power (W) | Current Source (A) |
| Temperature (°C) | Voltage (V) |
| Thermal Mass (J/°C) | Capacitance (F) |
| Thermal Resistance (°C/W) | Resistance (Ω) |
Parameters (onsemi FGY75T120SWD datasheet):
| Stage | Parameter | Value |
|---|---|---|
| Junction to Case | Rth(j-c) | 0.21 °C/W |
| Junction Thermal Mass | Cth | 0.05 F |
| Case to Heatsink | Rth(c-h) | 0.24 °C/W |
| Heatsink to Ambient | Rth(h-a) | 1.0 °C/W |
| Ambient | V_Ambient | 45°C (worst-case) |
Steady-state at 40W average dissipation per IGBT:
T_junction = 40 × (0.21 + 0.24 + 1.0) + 45 = 103°C — within the 175°C absolute maximum.
├── hardware/
│ ├── kicad/ # KiCad 9.0 project, schematic, and PCB layout
│ │ ├── MPPT_Booster_4kW_Hardware.kicad_pro
│ │ ├── MPPT_Booster_4kW_Hardware.kicad_sch
│ │ ├── MPPT_Booster_4kW_Hardware.kicad_pcb
│ │ └── DRC.rpt
│ └── renders/ # 3D PCB screenshots
│
├── models/
│ ├── FGY75T120SWD.lib # onsemi 1200V/75A IGBT (inverter)
│ ├── tlp250h.sub # TLP250H gate driver (inverter)
│ ├── STGW60H65DFB.lib # ST 650V/60A IGBT (booster)
│ ├── STTH3006D.lib # ST fast-recovery boost diode
│ ├── FOD3150.sub # FOD3150 gate driver (booster)
│ └── UC3843_Behavioral.sub # UC3843 controller model
│
├── src/
│ ├── H_Bridge_Full.cir # Inverter master netlist (V6.5)
│ ├── MPPT_Booster.cir # Booster — feed-forward PI (V8.0)
│ ├── MPPT_Booster_UC3843.cir # Booster — UC3843 closed-loop (V9.0)
│ ├── Gate_Analysis.cir # Gate RC charge/discharge (V9.0)
│ ├── Summing_Node_Test.cir # KCL summing node sweep (V9.0)
│ └── RC_Filter_Test.cir # LEB 470ns delay test (V9.0)
│pip install matplotlib numpy scikit-learn# Batch mode (auto-plots and saves PNG)
python run_simulation.py
# Interactive NgSpice mode
ngspice src/H_Bridge_Full.cir
run
plot v(OUT_A, OUT_B)
plot v(Thermal_Power_In) v(Case_Temp) v(Heatsink_Temp)python run_mppt_sim.py
# Edit src/MPPT_Booster.cir to select input profile (120V / 250V / 350V)python run_mppt_uc3843.py # Full closed-loop booster dashboard
python run_gate_analysis.py # IGBT gate charge/discharge analysis
python run_summing_node.py # dsPIC summing node 4-point sweep
python run_rc_filter.py # LEB 470ns propagation delaypython data_factory.py # Generate 204-simulation training dataset
python train_ai.py # Train and save Random Forest model
python predict.py # Instant performance predictor CLIlimit() function is not supported in NgSpice 46 B-source expressions.sdt() integrator is not available — use G-source + Capacitor model..PARAM variables cannot be referenced inside B-source expressions — hardcode values directly.| Document | Description |
|---|---|
| MPPT Booster Engineering Report | Full design report, controller parameters, firmware reference |
| Bill of Materials | Component purchasing list with supplier references |
| Boost Inductor Calculations | Core selection, winding calculations, saturation analysis |
| UC3843 Hardware Guide | Oscillator timing, slope compensation, pin-by-pin design |
| INA181A2 Hardware Guide | Current sense amplifier design and PCB layout guidelines |
Nadeem Tahir
I have been designing and commissioning inverters, motor drives, and PLC-based industrial machines for 13 years. This project started as a way to validate my booster design before ordering PCBs, and grew into a simulation platform I now use across projects. I am working toward an MS/PhD in robotics and intelligent control.
Hardware: dsPIC30F2010, PIC, STM32, ESP32, Delta AS228T PLC. Tools: NgSpice, KiCad, Python, Matplotlib, Scikit-Learn.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 18 | 10k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1, R20, R23, R25, R26, R33, R34, R37, R40, R43, R44, R45, R48, R55, R56, R58 +2 |
| 5 | 0.1uf | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mm | C14, C15, C16, C20, C24 |
| 5 | 1k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R17, R35, R36, R49, R57 |
| 5 | 20m | Resistor_SMD:R_2512_6332Metric | R12, R13, R14, R15, R16 |
| 5 | 4.7k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R38, R39, R42, R46, R47 |
| 5 | 470 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R50, R51, R52, R53, R54 |
| 5 | BC547 | Package_TO_SOT_THT:TO-92L_Inline_Wide | Q3, Q6, Q7, Q9, Q10 |
| 3 | 10 | Resistor_THT:R_Axial_Power_L25.0mm_W6.4mm_P27.94mm | R9, R10, R11 |
| 3 | 10uf | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C17, C21, C23 |
| 3 | 1N5819 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D1, D3, D6 |
| 3 | 1nf | Capacitor_THT:C_Rect_L13.0mm_W6.0mm_P10.00mm_FKS3_FKP3_MKS4 | C6, C7, C8 |
| 3 | 470k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R29, R30, R31 |
| 3 | 500k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R22, R27, R28 |
| 3 | BC337 | Package_TO_SOT_THT:TO-92L_Inline_Wide | Q4, Q5, Q8 |
| 2 | 100nf | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mm | C13, C19 |
| 2 | 10nf | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mm | C11, C12 |
| 2 | 15 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R4, R6 |
| 2 | 1N4007 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D4, D5 |
| 2 | 2.2nf | Capacitor_THT:C_Rect_L13.0mm_W6.0mm_P10.00mm_FKS3_FKP3_MKS4 | C2, C3 |
| 2 | 470uf | Capacitor_THT:CP_Radial_D35.0mm_P10.00mm_SnapIn | C4, C5 |
| 2 | 5.6 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R3, R5 |
| 2 | Q_NIGBT_CGE | Package_TO_SOT_THT:TO-247-3_Vertical | Q1, Q2 |
| 2 | RAYEX-L90 | Relay_THT:Relay_SPDT_RAYEX-L90 | K1, K2 |
| 1 | 1.3k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R18 |
| 1 | 100k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R21 |
| 1 | 15k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R32 |
| 1 | 1uf | Capacitor_THT:C_Rect_L18.0mm_W9.0mm_P15.00mm_FKS3_FKP3 | C1 |
| 1 | 1uf | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C25 |
| 1 | 4.7 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R41 |
| 1 | 4.7uf | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C18 |
| 1 | 470pf | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mm | C9 |
| 1 | 47k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R24 |
| 1 | 50 | Resistor_THT:R_Axial_Power_L25.0mm_W6.4mm_P27.94mm | R2 |
| 1 | 5k | Potentiometer_THT:Potentiometer_Bourns_3296W_Vertical | RV2 |
| 1 | 8.6k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R19 |
| 1 | ACS758 | Sensor_Current:Allegro_CB_PFF | U4 |
| 1 | Buzzer | Buzzer_Beeper:Buzzer_12x9.5RM7.6 | BZ1 |
| 1 | Conn_01x02 | TerminalBlock_Ningbo-Kagnex:TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mm | J2 |
| 1 | Control | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J5 |
| 1 | DC_IN | TerminalBlock_Ningbo-Kagnex:TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mm | J1 |
| 1 | D_Schottky_AKA | Package_TO_SOT_THT:TO-247-3_Vertical | D2 |
| 1 | L | Inductor_THT:L_Toroid_Horizontal_D49.3mm_P44.60mm_Vishay_TJ8 | L2 |
| 1 | L_Coupled | Inductor_THT:Choke_Schaffner_RN114-04-22.5x21.5mm | L1 |
| 1 | Led Con | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J4 |
| 1 | MC34072 | Package_DIP:DIP-8_W7.62mm | U2 |
| 1 | PCF8574P | Package_DIP:DIP-16_W7.62mm | U5 |
| 1 | Supply | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J3 |
| 1 | TLP250 | Package_DIP:DIP-8_W7.62mm | U1 |
| 1 | UC3843_DIP8 | Package_DIP:DIP-8_W7.62mm | U3 |
| 1 | Varistor | Varistor:RV_Disc_D15.5mm_W5.4mm_P7.5mm | RV1 |
| 1 | Zener | Diode_THT:D_DO-35_SOD27_P7.62mm_Horizontal | ZD1 |

m47eus2/SunCommander-PCB
PCB boards for energy optimalization device. Contactors control for power switching with full optical isolation. Multiple current measurments made with current transformers.

z-XOF-z/FT150TS
Tablero digital + launcher para Android que funciona solo con el teléfono del manubrio y está listo para una tarjeta ESP32 en la moto.


makerspace-wi/SimonProject
ESP32-basierte Steuerung fuer Fallblattanzeigen (MAN/Krone/Vossloh) mit: - WiFi Access Point - Weboberflaeche/HTTP-API - Serieller Ausgabe im Krone-Protokoll - I2C-Transfer von Byte-Werten an 3 Slave-Adressen (ADTrans)

PriX-Y/UTL-Pad---Ulimated-Macro-pad
i made this macro with with Statis - HackClub



Millisman/EG8010
Collection of designs for the EG8010 (ASIC for single-phase SPWM control H-bridge)
It measures 304.6 × 105.7 mm and has 2 copper layers, 1.6 mm thick.
115 parts, built around the MC34072D, PCF8574P, TLP250(F) and BC547. 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.
From the HNadeemTahir/AI_Inverter_Project repository on GitHub, at the commit this page was made from: the board is hardware/kicad/MPPT_Booster_4kW_Hardware.kicad_pcb and its schematic hardware/kicad/MPPT_Booster_4kW_Hardware.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask HNadeemTahir before reusing the design.