A work-in-progress project aimed at driving a BLDC motor using a Gowin GW1NSR-4C FPGA chip with a hard Cortex-M3 MCU core. This project provides an affordable solution for BLDC motor control.
- MCU Part:
- Programming Language: C++
- Build System: CMake + arm-none-eabi-gcc toolchain
- FPGA Part:
- Programming Language: SystemVerilog
- Tools: Gowin EDA
- Table-based BLDC communication
- Field-Oriented Control (FOC) and Vector BLDC driving using external ADC and current sensors
- MCU communication via UART
- RS-485 interface to MCU (or FPGA directly, to be decided)
Instructions for installation and running will be provided in later stages of the project.
- Sipeed TangNano 4K board
- Motor driver board with 6 PWM inputs and 3 power terminals
- ADC and current sensors (specifics to be specified later)
- BLDC motor
- Install CMake 3.25+ and arm-none-eabi-gcc toolchain.
- Include the armpp library (included as a submodule).
- Use Gowin EDA for synthesizing and FPGA board programming.
- MCU Firmware: Build the firmware using CMake and program the firmware binary to the board flash using the Gowin programmer.
- FPGA Bitstream: Use the Gowin programmer to flash the bitstream.
- Pull requests and issues are welcome.
- Comments and feedback are appreciated.
- C++ and SystemVerilog code follow snake_case naming convention.
- SCREAMING_SNAKE_CASE is used exclusively for macros.
- CamelCase is used only for template parameters.
- Code formatting guidelines are provided in the repository. Instructions for formatting from the command line and setting up auto-formatting in VS Code IDE will be provided.
As the project is in an early stage, there may be bugs, compilation issues, or non-functional behavior. Please feel free to report any issues.
To report issues, please submit an issue on the project's GitHub repository.
This project is licensed under the MIT License.