I.
Commercial use is strictly prohibited, including but not limited to selling my boards or materials on Xianyu/Taobao!!!
June 5, 2024 Update:
Sorry, the code and firmware were uploaded incorrectly. A correct version of the code and firmware is now uploaded. June

8, 2024 Update:
Updated the PCB for the motor and encoder carrier boards; it's the attached "Motor + Encoder Carrier Board V1.1.zip".
II. Introduction:
Lemon's FOC open-source stamp perforated board code is compiled using Keil 5 for easy debugging. The FOC algorithm is ported from Odrive, with performance stronger than Simplefoc but slightly weaker than Odrive. It uses a fully domestically produced solution: the MCU uses GigaDevice's GD32E103TBU6, the pre-driver chip uses Zhongke Microelectronics' AT8313, and the current sampling chip uses TP181. Most components are domestically produced or readily available on Taobao, greatly reducing DIY costs. It's an essential tool for beginners learning the FOC algorithm.
III. JLCPCB Prototyping Instructions:
1. The stamp perforated board uses a 4-layer design, with dimensions of 25mm*20mm. Purely manual soldering is quite difficult. It's recommended to use JLCPCB's SMT service if possible; you can simply attach capacitors and resistors.
2. The stamp-hole board uses a half-hole process. When prototyping with JLCPCB, you can directly prototypify without using the half-hole process (it's too expensive!), as shown in the image below. Just make a note during prototyping. However, the edges of the stamp holes will be rough, requiring manual polishing later.

IV. Detailed Introduction







V. QQ Group and Bilibili
Future code and hardware iterations will be released in the group. You can also discuss anything you don't understand in the group. Welcome to join!
This is Group 1, almost full.

This is Group 2, newly created; I recommend joining this group.

If you think my work is good, you can follow me on Bilibili. I will continue to open-source various projects and push them to you as soon as possible!

VI. Finished Products for Sale
Many friends have privately messaged me saying that their foundation is weak, and even with open source, it's difficult to reproduce and learn! To make it easier for everyone, I have listed a batch of finished stamp-hole boards on Taobao. You can integrate them into your board more easily through the stamp holes (good news for students doing graduation projects)! Welcome to inquire by searching "Lemon FOC" on Taobao! For those who need customized FOC designs, please contact me.
# Taobao link below:
【Taobao】https://m.tb.cn/h.gVTN0NaNqYEcHFX?sm=d5cb03?tk=7YK6Wx5Fi5r MF3543 "Open Source Lemon FOC Stamp Perforated Board (Source Code/Schematic/PCB Provided) [Bilibili Lemon Tree]"
Click the link to open directly or search on Taobao.
VII. Program Flowchart
Hint: Place the program flowchart and upload the source code in the attachment.
VIII. Physical Display



XI. Attachment Content
The attachment contains everything you need, including source code, debugging host computer, instruction manual, etc.
This package will not be updated further. Code and hardware iterations will be released in the group. Join the QQ group above if you are interested!