kabuterimon
~ Sensorless BLDC Control ~
ATTENTION
This project is for reference only and has many imperfections. Due to time constraints, only one channel was tested.
Project description

and code repository: https://github.com/dokee39/kabuterimon
LCSC Hardware Open Source Platform: Four-in-One ESC The four-
in-one brushless ESC consists of a power board and a control board, capable of driving four brushless motors simultaneously. The power board uses a large area of copper foil and solder mask openings, providing strong current carrying capacity and heat dissipation. With the aid of blade cooling, it can continuously carry approximately ?A of current. For easy debugging, the control board is designed as a stack of four small boards, connected to the power board via connectors, realizing PWM input, zero-crossing detection, six-step commutation, and other functions in the control code.
Based on Qinheng Qingke RISC-V general-purpose series product CH32V203F8U6, this brushless electronic speed controller (ESC)
2024 The National Undergraduate Embedded Chip and System Design Competition,
Chip Application Track, presents the brushless motor control and application code structure
from Nanjing Qinheng Microelectronics Co., Ltd. The software implementation for the brushless ESC module in this project is open-sourced on GitHub and is applicable to brushless electronic speed controllers (ESCs) based on Qinheng Qingke RISC-V general-purpose series products. The project uses the CH32V203F8U6 as the main controller, the mounriver-studio-toolchain as the toolchain, a Makefile for project building, and openocd-wch-riscv and WCH-LinkE debuggers for code burning and debugging. This project implements the basic functions of a brushless electronic speed controller. The project code is concise, reliable, and features high readability and maintainability. The code repository structure is as follows: ├── App // Application layer │ ├── bldc_callback.c // Interrupt callback functions involved in BLDC │ ├── bldc_ctrl.c // Polling task for mode switching and control value setting │ ├── bldc_mos_ctrl.c // MOS transistor control │ ├── bldc_tim_cnt.c // Timer control │ ├── bldc_zero_cross.c // Zero-crossing detection │ ├── led_task.c │ └── inc │ └── ... ├── Components // Components │ ├── support // Common mathematical tools │ │ ├── user_lib.c │ │ └── inc │ │ └── ... │ └── system // Time-slice task polling based on intrusive linked lists │ ├── list.c │ ├── timeslice_task.c │ └── inc │ └── ... ├── Core // Initialization and interrupt callback │ ├── ch32v20x_it.c │ ├── main.c │ ├── system_ch32v20x.c │ └── inc │ ├── ch32v20x_conf.h │ ├── ch32v20x_it.h │ ├── main.h │ └── system_ch32v20x.h ├── Driver // Driver │ ├── CMSIS │ │ └── ... │ └── Peripheral │ └── ... ├── compile_commands.json ├── Link.ld ├── Makefile ├── README.md └── startup_ch32v20x_D6.s See Github for more information.