Skip to content
stancecoke edited this page Mar 27, 2020 · 17 revisions

Welcome to the LishuiFOC wiki!

Necessary steps to flash the firmware to your controller.

  1. Make sure, that your controller uses the STM32FEB KC6T6 processor

  2. Make sure, the you can find the three shunts, three halfbridge-drivers and the OP on the PCB. Your PCB can look completely different, it's only important, that you can find the components.

Photo of PCB 3. Wire the STLink-V2 to the white connector, or directly to the PCB.

STLink-V2 white connector

  1. Download and install the Java Runtime Environment (if not already installed)

  2. Download and install the System Workbench for STM32. Start Eclipse once to extract the compiler. (in path C:\Ac6\SystemWorkbench\eclipse.exe by default)

  3. Download the repo from github and extract it.

  4. Doubleclick on JavaConfigurator.jar to open the configuration tool.

Screenshot GUI

  1. click on "unlock controller" once, to disable the read/write protection. Caution, the original firmware is deleted and can't be undone!

  2. Adjust your settings for the parameters, then click on "compile & flash". Don't touch the parameters in the "advanced" tab, if you don't know what you are doing!

If you want to add new features to the firmware open the project in Eclipse:

  1. Import the repo in Eclipse by file --> import --> git --> Projects from git --> clone URL. Copy the adress https://github.com/stancecoke/LishuiFOC to the dialog window and choose an empty folder. In eclipse, you have to adjust the reset setting:

Screenshot eclipse debugger setting

  1. You have to disable the write protection of the controller once, this will delete the original firmware and can't be undone. You can use the ST-Link utility, see figure 19 of the manual

Main parameter to be adjusted to your individual motor

Essential for motors with hallsensors is the setting of SPEC_ANGLE. If you set the Display-Type to "DISPLAY_TYPE_DEBUG" the controller runs a diagnostics procedere to determine the angle at startup. The value is printed via UART. Make sure, that the wheel can turn free without load during the autodetect procedere.

Caution: all of this project is highly experimental and all you are doing is on your own risk!

https://www.youtube.com/embed/iYRHn77PX7U?wmode=opaque&start=0