Skip to content

Manufacture Guide

Lao·Zhu edited this page Oct 14, 2023 · 6 revisions

    In this section, we will tell you in detail how to make a miniFOC with all functions according to the open source content in this project.
First, you need to download this warehouse locally. You can click hereDownload or use the GIT tool to enter the following command to clone the repository (Do not type the $ sign into the console):

$ git clone --depth 1 git@github.com:ZhuYanzhen1/miniFOC.git

If you are in China and do not have a VPN, you can try the following method to clone the repository (it may not work, if it does not work, please find a method by yourself):

$ git clone --depth 1 https://github.com.cnpmjs.org/ZhuYanzhen1/miniFOC.git
$ git clone --depth 1 https://gitclone.com/github.com/ZhuYanzhen1/miniFOC.git

After the warehouse prompt has been downloaded, you can start the next steps. In this section, we will mainly use the files in the manufacture folder.


Step1 Make PCB of miniFOC

In this step, we will teach you how to order PCB files through Jialichuang (refer to the official documents).

  1. Package Gerber files. Package the files starting with "Gerber" in the manufacturing folder into a compressed package (which needs to be compressed into a .zip file or .rar file).
  2. Enter Jialichuang official website Registered account number. Jialichuang provides every user with FREE proofing opportunities twice a month, so you can FREE make miniFOC PCB.
  3. Download [PC ordering assistant](https://download.jlc.com/jlchelper/release/3.4.0/JLCPcAssit_ setup_3.4.0.zip) and log in to the account you registered in step 2.
  4. Select "online order/pricing" in PCB order management and upload the compressed file packaged in step 1.
  5. After the file analysis is completed, select 5 boards and click to enter the next step.
  6. Select do not need to confirm the production draft, do not need SMT patch, do not need to turn on the laser steel mesh.
  7. You can choose your favorite plate thickness and solder resist color, and other parts can remain the default.
  8. After filling in the receipt information, click "submit order" in the lower right corner. After passing the audit, the PCB will enter the manufacturing stage.
  9. Waiting for receipt. So far, you have got the PCB of miniFOC.

Step2 Purchase components and weld

In this step, we will teach you how to use the unit device in Lichuang mall (refer to the official documents).

  1. Open [Lichuang mall]( https://www.szlcsc.com/ ), enter the "BOM allocation" interface and upload the "BOM_miniFOC.csv" file under the manufacturing folder.
  2. After the system analysis is completed, fill in the number of distribution sets according to the demand. Adjust the materials properly, and replace the materials without goods with similar products.
  3. Place an order after adding to the shopping cart. Materials that are still out of stock can be purchased at Amazon.
  4. Weld the components to the PCB according to the BOM and carefully check whether the welding is firm.

You can also purchase from Amazon according to the "BOM_miniFOC.xlsx" file in the manufacturing folder


Step3 Download firmware

    In this step, we will teach you how to use CMSIS-DAP debugger and OpenOCD to burn firmware. If you don’t have a CMSIS-DAP debugger yet, you can use Qinheng’s CH552G to make a CMSIS-DAP debugger according to tutorial.

  1. Download the firmware. If you need a stable version, please go to Release Page to download. If you want to try the latest compiled firmware, you can go to Github Pages download.
  2. Install the CMSIS-DAP driver. Generally, if you use the Windows 10 operating system, the DAP driver will be automatically installed after plugging in the device. If it does not install automatically, please solve it yourself.
  3. Install OpenOCD. Download the latest OpenOCD compressed package here, unzip it locally and add the absolute path of the bin folder under the folder to the system in the PATH environment variable. How to add to system PATH environment variable?
  4. Modify the \scripts\target\stm32f1x.cfg file in the OpenOCD folder and change "reset_config srst_nogate" on line 70 to "reset_config none". Right-click the Windows icon in the lower left corner and call out Windows Powershell. Enter the following instructions to connect to the microcontroller:
> openocd -f interface/cmsis-dap.cfg -f target/stm32f1x.cfg
  1. Then call up a Windows Powershell interface and enter the following commands in order to download the firmware (replace xxx.hex with the actual path of the firmware):
> telnet localhost 4444
> reset halt
> flash probe 0
> stm32f1x mass_erase 0
> flash write_bank 0 xxx.hex 0
> reset run

    At this point, the firmware has been burned. At this time, you can directly power on and start running the firmware. It should be noted that the brushless motor used in this firmware is a 2808 BLDC motor with 7 pole pairs and a KV value of 900. Due to the differences in the KV value, number of pole pairs, permanent magnet magnetic field strength, and permanent magnet shape of different motors, we cannot guarantee that the control effect of each motor can reach the same level as our samples. If the control effect is not good, the developer needs to adjust the parameters in the configuration file and rewrite the compiled firmware to find the most suitable value for the motor you choose.