HIL-3Phase-PFC
├── stf7
│ ├── stf7
│ ├── main.c (All code and binaries)
│ └── 3ph.elf
│ ├── matlab
│ ├──*.slx (All Simulink & Matlab files for the STM32F7)
│
├── matlab
│ ├── sim
│ ├── *.slx (All Simulink files for the Spartan7)
├── vivado_lite
│ ├── All vivado files for the project
├── ips
│ ├── All vivado IPs for the project
└── README.md
- Application: Digital control of a 3-phase PFC converter in real time using PLL Dsogi.
- Controller: STM32F767ZI (ARM Cortex-M7 @ 216MHz)
- FPGA: Xilinx Spartan-7
- Mode: Hardware-in-the-Loop with real-time plant emulation in FPGA
- Real-time HIL simulation of a 3-phase AC/DC PFC stage DACs MCP4922.
- FPGA-based fast plant model (fixed-step solver at 110MHz rate), FETs were linearize.
- Digital control loop implementation on STM32F7 @8Khz (which is ok for a S7) (PID, PLL Dsogi).
- MATLAB/Simulink/Simscape model for validation using PiL, MiL.
- Scalable for DSP or other FPGA platforms.
Component | Function |
---|---|
Spartan-7 FPGA |
Emulates PFC power stage dynamics in real time |
STM32F7 MCU |
Executes control algorithms (current, voltage regulation) |
MATLAB/Simulink |
Design, test, and compare control loops and plant models |
- STM32CubeIDE 1.15+
- Vivado 2022.1 or later
- MATLAB R2022b
- STM32F767ZI Nucleo or custom board
- Spartan-7 FPGA board (e.g., Digilent Cmod S7 or custom design)
- Flash the STM32 with
pfc3van.elf/
- Load bitstream to FPGA from
design_1_wrapper.bin/
- Run host-side script or GUI to initiate control loop test
- Observe performance via scope
- STM32CubeMX / STM32CubeIDE – Microcontroller development
- Xilinx Vivado – FPGA synthesis and implementation
- MATLAB/Simulink/Simscape – Plant and control modeling
- CAN/EtherCAT interface for industrial integration
- Adaptive control algorithms
- Integration with real-time OS (FreeRTOS)
- PWM jitter analysis and suppression
- Fully parameterized VHDL generator from Simulink
Contributions, bug reports, and feature requests are welcome.
Please open an Issue or submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Lead Developer: Angel Rodriguez
- Email:
ang.rodr97@gmail.com
Subject:HIL PFC 3PH
⚠️ This project is for research and development purposes. Not certified for use in safety-critical or production energy systems.