• Stars
    star
    737
  • Rank 61,490 (Top 2 %)
  • Language
    C++
  • License
    GNU Affero Genera...
  • Created over 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

你还在为有刷电机的高噪声、低响应速度和低寿命而烦恼吗?这个项目是一个20块钱就能搞定的FOC无刷电机控制方案!This project is a FOC (Field Oriented Control) BLDC Motor control scheme that can be done for 3$!

LOGO

    Version  Build  License        English / 中文

    Are you still buying a DC brush motor drive module in about 3$? Are you still worried about the high noise in addition to the already low response speed and life? Allow me to present you our project, miniFOC---- a FOC brushless motor control scheme that can get you the most bang for your buck, for just 3 $! miniFOC has a built-in torque closed-loop controller so that you can control a brushless motor with a 3-wire UART port. The software and hardware design are fully compliant with the AGPL-3.0 open source license.

Note: miniFOC V2 version is under development(dev branch) to support current loop and sensorless FOC algorithm, please look forward to it.


Brief Introduction

    This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China. The components selected in the example circuit are all manufactured in China. FOC possesses various advantages when it comes to controlling BLCD (Brushless Direct Current) motor; some of the benefits are as follows:

  1. FOC has no speed limit at all and can be accurately controlled at any speed
  2. FOC excels at its reversing performance, ensuring the smoothness of forward and reverse switching even when running at its highest speed
  3. FOC can also perform braking control in the form of energy recovery.
  4. FOC can achieve three closed-loop control of torque, speed, and position.
  5. FOC has significantly lower noise but much higher efficiency compared that of electric regulation

   Although FOC has many advantages, its large amount of calculation and complex principles requires an expensive controller, which made FOC unpopular. After half a year’s research and iteration, I deeply optimized the part of the code that implements mass calculations and re-selected its components to fit the domestic supply chain. I hope this open-source project can help domestic developers use BLDC motors with excellent performance and contribute to the open-source community.


Comparison Of Open Source Solutions

Open source solution miniFOC simpleFOC ODrive FpOC
Microcontroller GD32F130G6U6 ATmega328P STM32F405RGT6 FPGA
Driver chip EG2133 L6234 DRV8301 MP6540
PID loop frequency 30kHz (max) 830Hz (max) 8kHz (typical) 18kHz (typical)
Whether have current loop No No Yes Yes
Driving power 90W 120W 960W 90W
Cost price (approx.) 20¥ 100¥ 300¥ 150¥

    As can be seen from the table above, the scheme adopted by miniFOC can achieve high performance at low cost. At the same time, due to the re-selection according to the domestic supply chain, the selection of devices is not so limited, and there are many alternatives. amid the chip shortage in 2021, the cost of FOC still can be controlled at about 3$, which further proves the degree of cost optimization and the great potential of the project.


Performance Parameter

  • Input voltage range: 5V ~ 18V (you can modify the circuit according to the tutorial here to adapt to higher voltage).
  • Maximum driving current: 5A (you can modify the circuit according to the tutorial here to achieve greater driving current).
  • Detailed parameters of FOC: no current loop control, SVPWM (Space Vector Pulse Width Modulation) is adopted.
  • Communication parameters: UART baud rate is 115200, and Mid Capacity Data Transmit Protocol is used for data transmission.
  • Microcontroller parameters: Cortex-M3 core, 72MHz frequency, 32KB FLASH, 4KB SRAM.

Function Features

  • Using space vector pulse width modulation
  • Torque control without current sensor
  • Rotational speed closed loop control
  • Rotation angle closed loop control
  • Automatic phase sequence detection and correction

Development Environment

  • EDA Tool: EasyEDA (the standard free license is adopted, and there is no license dispute).
  • Compiler tool chain: gcc-arm-none-eabi 10-2020-q4-major
  • Programming tool: OpenOCD 0.11.0-1
  • Integrated development tools: CLion 2021.2.3 #212.5457.51
  • Software development tools: Qt 5.14.2 (MinGW 7.3.0 64bit)
  • Operating system and tool chain:
    • Win10 + MinGW + CLion + gcc-arm-none-eabi + OpenOCD
    • Ubuntu20.04 + make + cmake + gcc-arm-none-eabi + OpenOCD

Getting Started

Please refer to the wiki page of this project for getting started.
We also provide the domestic image address.
You can visit Github Page to learn about the usage of functions and variables in the code.
Note: Since the main development and deployment are carried out on Github, Gitee is only used as a domestic mirror warehouse to store the code, and there will be problems such as wiki and issue that are not updated in time. You can visit the Github source repository here.


Bugs & Feature Requests

Please report bugs and request features using the Issue Tracker and follow these request:

  1. Tab highlight when on different tab.
  2. Don’t let the update disappear if the window is not in focus.

License

The source code is released under a AGPL-3.0 License.

Affiliation:AcmeTech
Author: Zhu Yanzhen
Maintainer:YanzhenZhu, [email protected]

    The product has been tested under Windows 10 and Ubuntu 18.04 and 20.04. This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.

More Repositories

1

MM32_CLion

本项目是全国大学生智能车竞赛GDUT 2022年极速越野组的项目文件。采用了LQR控制器和多速率卡尔曼融合算法,并在单片机上实现。This project is the project document for the GDUT 2022 Extreme Off-Road Category of the National Student Intelligent Vehicle Competition.
C
52
star
2

CDTP

数据链路层协议,只需要提供单字节的收发函数就可以移植这些协议。Data link layer protocols can be transplanted by providing a single byte transceiver function.
C
23
star
3

CH32V307

CH32V307的CLion开发环境。包含了一个移植好的FreeRTOS及FATFS例程和Hardfault自动追踪分析程序。CLion development environment for CH32V307. A ported FreeRTOS routine is included as well as a simple Hardfault tracer.
C
16
star
4

Geek_Appraisal

本仓库为广东工业大学集电GEEK俱乐部考核仓库。下面将描述每个任务的要求以及相关的学习资料。请同学们认真阅读本文件并学习相关资料。有关信息的更新或更正将在本README文件中完成。
C
10
star
5

priRV32

这是我设计的第一个RV32内核,这个内核只打算实现RV32I指令集架构,对标8051及ARM Cortex-M0内核。This is the first RV32 core I designed. This core only intends to implement the RV32I instruction set architecture, which is aimed at the 8051 and ARM Cortex-M0 cores.
Verilog
7
star
6

allwinner_v3s

本仓库储存了全志V3s芯片的开发板相关资料。仓库中包含了开发板原理图、PCB和制造文件以及相对应的u-boot、Linux Kernel、Buildroot的构建脚本。This repository stores development board related information for Allwinner V3s chips.
6
star
7

miniFOC_Firmware

6
star
8

Si-Series

Si系列是【老朱】在高二的时候为【智能信息社】设计的一个开发板系列,其中Si-α基于STC12C5A60S2,Si-β基于STM32F103ZET6,分别用于51单片机和STM32的学习及开发。同学们可以用这套开发板进行简单的工业控制以及视觉的开发。
C
5
star
9

RM2019-Group8

RM2019高中生夏令营第八组嵌入底层框架
C
3
star
10

EDA_Challenge

本项目实现的是具有VCD文件信号信息统计的工具,并对其大文件解析和信号统计速度进行优化。This project implements a tool with VCD file signal information statistics, and optimizes its large file parsing and signal statistics speed.
C++
3
star
11

Qt-CI-Template

C++
1
star
12

RM_Souvenir

本仓库储存的是RM纪念品的二次开发代码。 This repository stores the secondary development code for the RM souvenir.
C
1
star
13

2019-nCov-Simulator

To simulate the infect speed of 2019-nCov. 用Qt做的一个基于概率的新冠病毒传染演示软件。
Makefile
1
star
14

ZhuYanzhen1

1
star
15

iugandi

这是一个基于STM32H750VBT6的核心板开源项目,它通过兼容M.2 Key-B外形的金手指与载板进行连接。 This is an open source core board project based on STM32H750VBT6 it can be connected to the carrier board through the M.2 Key-B typed gold fingers.
1
star