Developed Apps

Raspberry Pi Projects

Raspberry Pi 4 Model B board Raspberry Pi

01 – Blink LED

Pythonlgpio GPIO

A hands-on introduction to GPIO output and digital signals. Wire up an LED, write a Python script, and control it directly from the Pi's GPIO pins, the classic starting point for hardware programming.

Beginner

GitHub Repo »
PWM LED dimming demo on Raspberry Pi - software-controlled brightness via pulse width modulation Raspberry Pi

02 – PWM LED Dimming

Pythonlgpio PWMGPIO

Use Pulse Width Modulation to smoothly control LED brightness from software. A practical demonstration of how PWM bridges the gap between digital outputs and analog-like control, which is the basis for motor drives and power converters.

Beginner-Intermediate

GitHub Repo »
ACS712 current sensor on Raspberry Pi Raspberry Pi

03 – ACS712 Current Sensor

PythonSPI Current Sensing ACS712ADS1263

Read real DC/AC current using an ACS712 hall-effect sensor and the ADS1263 32-bit ADC HAT over SPI. Covers differential measurement, SPI communication, and converting raw ADC counts to engineering units.

Intermediate

GitHub Repo »
Closed-loop PI current controller with MOSFET on Raspberry Pi Raspberry Pi

04 – Closed-Loop PI Current Controller

Python PI ControlClosed-Loop MOSFETACS712

A complete closed-loop PI current controller running on the Pi. The D4184 MOSFET switches a resistive load while the ACS712 feeds current feedback, a real-world demonstration of the same control loop used in industrial power electronics.

Intermediate-Advanced

GitHub Repo »
Closed-loop MPC current controller on Raspberry Pi Raspberry Pi

05 – Closed-Loop MPC Current Controller

Python MPCOptimal Control MOSFETACS712

A finite-horizon constrained Model Predictive Controller on the same MOSFET and ACS712 hardware as project 04. Identifies the plant model online from a step test, precomputes the optimal gain matrix, and runs a full constrained optimization at ~480 Hz with no manual tuning required.

Advanced

GitHub Repo »
Raspberry Pi 4 receiving F28388D ADC stream over Ethernet and rendering it as a live Streamlit + Plotly oscilloscope Raspberry Pi

06 – Ethernet Scope (F28388D Receiver)

Python Streamlit Plotly UDP Ethernet F28388D Real-Time

Receives the F28388D controlCARD ADC stream over a direct point-to-point Ethernet link and renders it as a live oscilloscope. ADCINA0 is sampled at 10 kHz on the controlCARD and shipped in 50-sample UDP packets at 200 packets/s, holding zero loss over multi-minute windows. The Pi runs a threaded UDP listener feeding a bounded ring buffer, exposed through two consumers: a CLI sniffer for bring-up diagnostics, and a Streamlit + Plotly dashboard with live KPIs (current, mean, min, max, RMS, packet rate, loss %, link uptime), pause toggle, and CSV export. The binary packet parser is the single source of truth, hand-aligned byte for byte against the firmware sender.

Advanced

GitHub Repo »
Raspberry Pi 4 driving the F28388D dual-core FOC current controller over Ethernet with a four-panel Streamlit and Plotly dashboard for Id, Iq, phase currents and DC bus Raspberry Pi

07 – FOC Drive Dashboard over Ethernet

Python Streamlit Plotly UDP FOC Ethernet F28388D Real-Time

Pi-side command and visualization host for the F28388D synchronous-frame current controller on a BOOSTXL-3PhGaNInv 48 V GaN inverter. Over a direct point-to-point Ethernet link, the Pi sends binary command packets at 200 Hz carrying Idref, Iqref, electrical-frequency reference, plant parameters (Rs, Ls, target loop bandwidth) and enable/reset flags, while the controlCARD streams 5 kHz telemetry back on a second UDP port. A four-panel Streamlit + Plotly dashboard renders Id/Iq reference versus measurement, the three phase currents, and DC-bus voltage with electrical angle at 100 ms refresh, alongside a live status decoder for enable, overcurrent, over/under voltage and Ethernet-watchdog flags. The IMC-tuned Kp/Ki preview is recomputed in the browser before any new gain set is committed to the firmware, and CRC-16-CCITT validates every command and telemetry packet against the firmware-side wire definition.

Advanced

GitHub Repo »

TI C2000 Embedded Projects

TI TMDSCNCD28388D F28388D controlCARD on TMDSHSECDOCK docking station TI C2000

01 – Blink LED

C C2000Ware GPIO F28388D SysConfig

Hardware bring-up verification for the TMDSCNCD28388D controlCARD. Blinks the onboard D1 LED at 1 Hz via GPIO31, confirming the clock tree, GPIO subsystem, and JTAG debug connection are all working before any application firmware is deployed.

Beginner

GitHub Repo »
TI TMDSCNCD28388D F28388D controlCARD with BOOSTXL-3PHGANINV three-phase inverter board TI C2000

02 – Three-Phase SVPWM with Synchronized ADC

C C2000Ware SVPWM ADC ePWM CLA

Generates three-phase Space Vector PWM at 20 kHz on the BOOSTXL-3PHGANINV inverter board using ePWM1/2/3 with dead-time insertion. The ADC fires synchronously at the PWM carrier peak to sample at the minimum current ripple point, while a dedicated CLA task reads the result in parallel with the main CPU. Sector, duty cycles, and ADC data stream to UART at 10 Hz.

Intermediate–Advanced

GitHub Repo »
TI F28388D controlCARD with BOOSTXL-3PHGANINV GaN inverter running a discrete PI current controller on the CLA coprocessor TI C2000

03 – Discrete PI Current Controller on CLA

C C2000Ware PI Controller ADC ePWM CLA

A 20 kHz PI current controller running entirely on the F28388D CLA coprocessor, leaving the main C28x CPU free for reference generation and UART telemetry. Gains are designed from bandwidth targets (ωc = 2π×1000 rad/s) and discretised in incremental form, giving natural anti-windup with no extra logic. The CLA task finishes in under 2 µs, triggered by the ADC conversion complete interrupt, and writes the new duty cycle to shared message RAM for the ePWM ISR. A companion Python script reads 10 Hz serial telemetry and plots the measured Bode response against the theoretical open-loop curve.

Advanced

GitHub Repo »
TI F28388D controlCARD with BOOSTXL-3PHGANINV GaN inverter running hardware overcurrent protection via CMPSS and ePWM Trip Zones TI C2000

04 – Hardware Overcurrent Protection via CMPSS

C C2000Ware CMPSS Trip Zone ePWM F28388D

Hardware overcurrent protection for a GaN inverter leg using the F28388D CMPSS and ePWM Trip Zones. The comparator checks phase current against ±8 A thresholds entirely in hardware, tripping ePWM1 outputs to zero in under 100 ns with no CPU involvement. A 32-sample digital filter blanking window rejects switching transient noise. Both CBC and OST trip modes are supported, a Trip Zone ISR logs fault events in a 16-entry circular buffer, and 10 Hz UART telemetry streams current and fault data at 115200 baud. A software fault injection test runs automatically on startup to verify the protection path end to end.

Advanced

GitHub Repo »
TI F28388D controlCARD streaming ADC samples over its on-chip Ethernet MAC to a Raspberry Pi receiver using a Cortex-M4 lwIP UDP transmitter TI C2000

05 – ADC Streaming over Ethernet (Dual-Core lwIP)

C C2000Ware lwIP UDP Ethernet F28388D Dual-Core

Dual-core firmware that turns the F28388D into an Ethernet-attached scope front-end. The C28x CPU1 samples ADCINA0 at 10 kHz (ePWM1 SOCA triggering ADC-A SOC0), converts each result to volts, and publishes into a 128-deep float ring in shared MSGRAM. The Cortex-M4 Connectivity Manager runs lwIP NO_SYS on the on-chip Ethernet MAC at static IP 192.168.10.10, polls the ring on a 1 ms SysTick, and packs 50 samples per UDP datagram at 200 packets/s. CPU1 boots the CM core via Device_bootCM in the strict flash order required by the F2838x dual-core protocol. Verified end to end against a Raspberry Pi receiver with zero packet loss over multi-minute windows.

Advanced

GitHub Repo »
TI F28388D controlCARD with BOOSTXL-3PHGANINV running a dual-core synchronous-frame FOC current controller commanded over Ethernet by a Raspberry Pi TI C2000

06 – Synchronous-Frame Current Controller over Ethernet (Dual-Core FOC)

C C2000Ware FOC SVPWM lwIP F28388D Dual-Core GaN

Field-oriented current controller for a three-phase RL load, driven by the BOOSTXL-3PhGaNInv 48 V GaN inverter and commanded over Ethernet by a Raspberry Pi 4. The C28x CPU1 runs a 20 kHz Clarke → Park → two decoupled PI loops → inverse Park → min/max common-mode-injection SVPWM pipeline inside the ADCA1 EOC ISR, with IMC pole-zero gains (Kp = 2π·fbw·Ls, Ki = 2π·fbw·Rs), back-calculation anti-windup, and feed-forward cross-axis decoupling. INA240 phase-current sense and DC-bus voltage are sampled at the ePWM carrier valley, an auto-calibrated zero-current offset is subtracted, and a hardware safety layer (overcurrent, over/under voltage, Ethernet watchdog) forces the CMPA triplet to 50% and arms an ePWM Trip Zone one-shot on any fault. The Cortex-M4 core runs lwIP NO_SYS on the on-chip EMAC at static IP 192.168.10.10, terminating two UDP sockets (command on 5001, telemetry on 5002) and bridging them to CPU1 through two unidirectional MSGRAM mailboxes. Wire packets are CRC-16-CCITT protected and little-endian aligned so the C28x 16-bit char side and the M4 8-bit char side see the same layout. The ISR pipeline closes in ~4.5 µs of the 50 µs switching period, leaving more than 9× CPU headroom.

Advanced

GitHub Repo »

Python Motor Drive Simulations

Python animation of Space Vector PWM principle

Space Vector PWM (SVPWM) – Animated Principle

SVPWMAnimation Power ElectronicsPython

Crystal-clear animation showing how SVPWM builds its 7-segment inverter switching pattern from a rotating voltage reference vector.

0:59

Watch »   GitHub »
Python animation of Clarke-Park transformation

ABC to DQ (Clarke & Park) – Animated Transformation

FOCClarke-ParkAnimationPython

Visual walkthrough of the Clarke (αβ) and Park (dq) transforms that sit at the heart of field-oriented motor control.

0:58

Watch »   GitHub »
Python animation of dq-current decoupling

Decoupling dq-Currents – Animated Principle

FOCdq-axisAnimationPython

Animation showing how d-axis and q-axis current decoupling works in PMSM field-oriented control and why it is essential for independent torque and flux regulation.

Watch »   GitHub »
Python animation of PLL-based back-EMF observer

PLL-Based Back-EMF Observer at Low Speed

SensorlessPLLAnimation PMSMPython

Simulation showing how a PLL-based observer tracks the back-EMF angle in a PMSM as speed approaches zero, highlighting phase error and loss of lock near standstill.

Watch »   GitHub »
Python simulation of complete FOC control loop

Field-Oriented Control (FOC) – Complete Loop Simulation

FOCSimulationAnimation PMSMPython

Full closed-loop PMSM FOC simulation with real-time load torque disturbance observer and live signal visualization across the entire control chain.

Watch »   GitHub »
Python animation comparing Complex-Vector PI vs conventional PI

Complex-Vector PI vs Conventional PI – Frequency Sweep

Complex Vector PIPI ControlAnimationPython

Side-by-side comparison of synchronous-frame complex-vector PI and conventional PI on an RL load as electrical frequency sweeps 0-200 Hz, with Bode plots at key operating points.

Watch »   GitHub »

News

External Fraunhofer IZM 500 kW per liter silicon carbide traction inverter with PCB-embedded SiC MOSFETs and copper busbars on an aluminium baseplate

Fraunhofer IZM SiC Inverter Hits 500 kW Per Liter at 99% Efficiency

A new 800 V traction inverter from Fraunhofer IZM packs 500 kW of three-phase output into a single liter of volume, with peak efficiency above 99%. The trick is embedding twelve SiC MOSFETs directly into the PCB for each half-bridge, which collapses commutation-loop inductance to roughly 1 nH and lets the switches slew at 65 V/ns. The result is about five times the power density of current production traction inverters, and 2.5 times the previous research benchmark. Built for Mitsubishi Heavy Industries, the unit will be shown publicly at PCIM Europe in Nuremberg on June 9 to 11, 2026.

May 2026

Read More »
Paper Integrated electric drive system with inverter and motor control hardware

IEEE Review: Machine Learning Reshaping the Control and Monitoring of Electric Drives

A landmark review in the IEEE Open Journal of Industry Applications maps how machine learning, from deep neural networks to reinforcement learning, is transforming speed and torque control, fault detection, and thermal monitoring in electric machine drives. The survey covers PMSM, induction, and switched-reluctance machines, and is now a go-to reference for engineers working at the intersection of AI and power electronics.

May 2026

Read Paper »
External Tesla Supercharger fast charging station

800V and SiC Inverters Are Redefining What Fast Charging Means

Silicon carbide is quietly changing what is possible in EV drivetrains. Fourth-generation SiC MOSFETs push inverter efficiency past 99% and cut heat generation by half compared to standard silicon. The practical outcome is 400 km of range added in under five minutes, making 800V architecture the benchmark for serious EV platforms in 2026.

Apr 2026

Read More »
External BMW i3 lithium-ion battery pack opened showing cells

Solid-State EV Batteries Are Getting Closer to the Road

For years, solid-state batteries were always just around the corner. That is starting to change. Mercedes-Benz has integrated a lithium-metal solid-state cell into a real vehicle platform, Rimac demonstrated a pack charging from 10 to 80% in six and a half minutes, and production targets for 2026 are no longer just ambitions on a roadmap. With energy densities reaching 375 Wh/kg, the gap between today's lithium-ion and solid-state is closing fast.

Mar 2026

Read More »
Paper Advanced Powertrain Test Facility for hybrid electric vehicles at Argonne National Laboratory

Scientific Reports: Efficient Speed & Voltage Control for BLDC Motor Drives in EVs

A 2026 Nature Scientific Reports study proposes a Multi-Device Interleaved DC-DC Bidirectional Converter with a novel TIFDNFD-SFOA controller for simultaneous speed and voltage regulation of BLDC motor drives, which fills a critical gap in EV drive efficiency that most existing studies overlook.

Jan 2026

Read Paper »
Paper 220kW UQM electric traction motor and inverter installed in a truck

MDPI Machines: New Trends in EV Traction Motors and Drive Control Techniques

A 2026 peer-reviewed study benchmarks FOC, DTC, model predictive control, and AI-enhanced frameworks for PMSM, IM, and BLDC traction drives, evaluating efficiency, dynamic response, and scalability for next-generation EVs.

Dec 2025

Read Paper »

About Masoud Bakhshi

Control Software Engineer specializing in electric machine drives, inverter systems, and automotive control software.

Plan22 is where I share engineering tools, Python simulations, and hands-on hardware projects built at the intersection of control theory, power electronics, and EV systems.

Get in Touch

For inquiries or collaboration, drop me a line or fill out the form below:

info@plan22.net