Open source on Lishui LSW6G-90B-FOC-171215.

moriamoria

1 mW
Joined
Dec 28, 2023
Messages
18
Location
paris
Hello every one,

After briking a kt 48ZWSKT-SJT02L where I have flash with stancecoke/BMSBattery_S_controllers_firmware (even after install a current sensor), I decide to floow "stancecoke" advise on a precedent post and to go to a lushui controller.

I have found a LSW 667-31F 36v controller (I just have to change one FET that is HS). the motherboard is LSW6G_90B-FOC-171215

on this motherboard, I think the specification for open source looks ok :

STM32FEB KC6T6
1* LM317 regulator
3* FD03S
C34 H91C
....

After the story, my questions :

  1. Can any one send me the stock firmware and the tools to set properties on the current firmware.
  2. Is it a good controller for EBiCS_Firmware
  3. Can I use a KT lcd3 display on it.
  4. Could you confirm that I need to add a DC to DC converter for a bluetooth adapter?
  5. I have a 48v battery, and the resistance for the board power supply is 100 homs, Do I need to adjust it ?
  6. Finaly I will use a magnetic pedal sensor. Ok for that ? I think stanceoke sais it was ok.
Many thanks for your return.
 

Attachments

  • IMG_20240114_150112.jpg
    IMG_20240114_150112.jpg
    2 MB · Views: 8
  • IMG_20240114_150040 (1).jpg
    1.4 MB · Views: 10
  • IMG_20240114_145943 (1).jpg
    1.2 MB · Views: 6
Last edited:
Hello,

I had make a mistake on the board reference, it is :

LSW6G_90B-FOC-171215

Thanks for your help about setting a open firmware, and if possible got a stock firmware.

Regards to all from Paris France
 
Please read the wiki at github, how to configure and flash the EBiCS firmware.

If you still have questions after reading the wiki, don't hesitate to ask here.

regards
stancecoke
 
Hello,

Thanks for your answer, I had already flash a KT controller, it was easy, but this was a wrong controler (square ) and I have create a brick !

Before doing the same with this Lishui controller, I like to have a stock firmware.

Any one has a firmware from Lishui ?

In any case thanks stacecoke for your support. I will start right a way.

Regard to all
 
and I have create a brick !
Why? You just have to disable the angle optimization. Then the firmware works with the square wave hardware, also. Just a little less efficient. Motor halls required.

For the Lishuis, there is no public official firmware available.

regards
stancecoke
 
Hello,

I am trying to connect my new lishui controller to my old byke.

It looks like on the Lishui controller, we have 4 hall sensor (). But on my bike and on the KT controller, I have only 3 hall sensor. Is it a problem(red black blue green yellow).

I need also to connect my lcd3 display to the Lishui controller, but it seems that I have 6 wire on the Lishui (Red black yellow green blue white) and on my kt controller/ old byke, i have (red blue black green yellow) 5 wire.

After, I have on the lishui a "julet" connector with 5 pins, it is connected to the motherboard as :

white connected to AD1
blue not connected
yellow to ebs
red and black to power line.

And to finish, I have a KM4 connector

yellow to rx (also connected to power suply connector)
green tx (also connected to power suply connector)
blue light to sw
red vb+
black vb-

So I am looking for a pinout plan to connect all that stuff to my old bike.

Any idea ? Helps

Many regards
 
So I am looking for a pinout plan
Obviously you haven't read the wiki yet. ;)

regards
stancecoke
Pinout%20Old%20Generation.PNG
 
Hello,

You are right.

I have download the git and I was looking to pinout.

  • The pin our shows only 3 hall sensor, so one of the 4 wire must be unused.
  • I suppose that SYS_JTMS_SWDIO and SYS_JTCK_SWCLK are pin used to flash the controller, I will connect them to the programmer ST LINK 32
  • Regarding LCD3, I think that USART T1_rx and USART T1_tx goes there. Also the configuration tools offer Kunten display. Should be ok.
  • lishui a "julet" with AD1 looks to be the torque sensor, I will not use it, only PAS

for the
KM4 connector

yellow to rx (also connected to power suply connector)
green tx (also connected to power suply connector)
blue light to sw

I am lost for the moment, but I will read the code file and the wiki.

Regards
 
I am lost for the moment
:)
Your controller model seems to be quite special, having the UART1 lines on the battery connector in parallel to the display is strange. Are you sure, that it isn't UART3 like in some new generation PCBs?
Of course you can build some kind of UART bus with various members like controller, display and battery BMS, but that will not work with "normal" display protocols.
But don't mind, the EBiCS can be configured to work with you hardware surely.
The white wire on the motor connector is for the speed signal normally. So it should be connected to the SS pad on the PCB. Sometimes it's used for the temperature signal, then it's attached to the AD2 pad.

regards
stancecoke
 
Last edited:
Hello,

After some time, I have finaly wired all cable to my bike.

  • The 3 power button works, I can swith on the controler, I can enable light. I can change the level of assistance.
  • The LCD works a litle. It is a kunten LCD.
  • The pas is not working
  • When I use the thotle, the motor runs slowly and with unique speed.

I supose that my controler expect tork sensor, and other display.

By the way thanks stancecoke for the help. This time, I will follow the wiki. he he he ...

But before flashing the firmware, I like to play with Lishui parameters adjustor. Because I will not be able to flash stock firmware.

But I can't find any link to download this software.

Can anyone give me some link ?

Regards to all
 
Hello,

I did not wait for configurator and decide to flash open source.

I tryed to follow the wiki, but I got Following error :

C:\EBiCS_Firmware-master>set eclipsepath=C:\Ac6\SystemWorkbench

C:\EBiCS_Firmware-master>set stmpath=C:\Program Files (x86)\STMicroelectronics

C:\EBiCS_Firmware-master>set flashoption=STLink

C:\EBiCS_Firmware-master>PATH = C:\Program Files (x86)\STMicroelectronics\st_toolset\asm;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\GitExtensions\;C:\ProgramData\chocolatey\bin;C:\Program Files\dotnet\;C:\Program Files\WireGuard\;C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility;C:\Users\mat\scoop\apps\openjdk9\current\bin;C:\Users\mat\scoop\apps\maven\current\bin;C:\Users\mat\scoop\apps\python\current;C:\Users\mat\scoop\apps\python\current\Scripts;C:\Users\mat\scoop\shims;C:\Users\mat\AppData\Local\Microsoft\WindowsApps;C:\Users\mat\AppData\Local\Microsoft\WindowsApps;C:\Users\mat\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mat\.dotnet\tools;C:\Program Files\SDCC\bin;C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.17.0.201812190825\tools\make;C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.17.0.201812190825\tools\compiler\bin;C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility

C:\EBiCS_Firmware-master>IF NOT exist Debug (md Debug )

C:\EBiCS_Firmware-master>cd Debug

C:\EBiCS_Firmware-master\Debug>make -f ..\make\Makefile clean
rm -rf *


C:\EBiCS_Firmware-master\Debug>cd..\make

C:\EBiCS_Firmware-master\make>copy *.* ..\Debug
hex2lsh.jar
hexToLsh.java
lishuiFlash.exe
makefile
objects.list
objects.mk
sources.mk
srec_cat.exe
STLINK_FLASH.ld
STLINK_system_stm32f1xx.c
subdir_drivers.mk
subdir_src.mk
subdir_startup.mk
UART_FLASH.ld
UART_system_stm32f1xx.c
15 fichier(s) copié(s).

C:\EBiCS_Firmware-master\make>cd ..\Debug

C:\EBiCS_Firmware-master\Debug>md Drivers\STM32F1xx_HAL_Driver\Src

C:\EBiCS_Firmware-master\Debug>md startup

C:\EBiCS_Firmware-master\Debug>md src

C:\EBiCS_Firmware-master\Debug>copy subdir_drivers.mk Drivers\STM32F1xx_HAL_Driver\Src\subdir.mk
1 fichier(s) copié(s).

C:\EBiCS_Firmware-master\Debug>copy subdir_src.mk Src\subdir.mk
1 fichier(s) copié(s).

C:\EBiCS_Firmware-master\Debug>copy subdir_startup.mk startup\subdir.mk
1 fichier(s) copié(s).

C:\EBiCS_Firmware-master\Debug>copy STLINK_FLASH.ld ..\STM32F103C6Tx_FLASH.ld
1 fichier(s) copié(s).

C:\EBiCS_Firmware-master\Debug>copy STLINK_system_stm32f1xx.c ..\Src\system_stm32f1xx.c
1 fichier(s) copié(s).

C:\EBiCS_Firmware-master\Debug>make all
Building file: ../startup/startup_stm32f103x6.s
Invoking: MCU GCC Assembler

arm-none-eabi-as -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -g -o "startup/startup_stm32f103x6.o" "../startup/startup_stm32f103x6.s"
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.17.0.201812190825/tools/make/sh: arm-none-eabi-as: not found
Startup/subdir.mk:15: recipe for target 'startup/startup_stm32f103x6.o' failed
make: *** [startup/startup_stm32f103x6.o] Error 127

C:\EBiCS_Firmware-master\Debug>ST-LINK_CLI.exe -c SWD -P LishuiFOC_01.hex -V
STM32 ST-LINK CLI v3.6.0.0
STM32 ST-LINK Command Line Interface

ST-LINK SN: 090028000E0000344334534E
ST-LINK Firmware version: V2J29S7
Connected via SWD.
SWD Frequency = 4000K.
Target voltage = 3.2 V
Connection mode: Normal
Reset mode: Software reset
Device ID: 0x412
Device flash Size: 32 Kbytes
Device family: STM32F10xx Low-density

Loading file...
Unable to open file!


C:\EBiCS_Firmware-master\Debug>pause
Appuyez sur une touche pour continuer...

Could be nice to help me on that mather

Regards
 
Hello,

I have install manualy arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi

add in the path C:\arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi\bin

It is better , but I have following error :

Building target: LishuiFOC_01.elf
Invoking: MCU GCC Linker
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -L../Drivers/CMSIS -specs=nosys.specs -specs=nano.specs -T"../STM32F103C6Tx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "LishuiFOC_01.elf" @"objects.list" -larm_cortexM3l_math -lm
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: Src/display_kunteng.o:C:\EBiCS_Firmware-master\Debug/../Src/display_kunteng.c:33: multiple definition of `huart1'; Src/display_ebics.o:C:\EBiCS_Firmware-master\Debug/../Src/display_ebics.c:13: first defined here
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: Src/display_kunteng.o:C:\EBiCS_Firmware-master\Debug/../Src/display_kunteng.c:21: multiple definition of `ui8_rx_buffer'; Src/display_ebics.o:C:\EBiCS_Firmware-master\Debug/../Src/display_ebics.c:14: first defined here
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: Src/display_kunteng.o:C:\EBiCS_Firmware-master\Debug/../Src/display_kunteng.c:13: multiple definition of `ui8_tx_buffer'; Src/display_ebics.o:C:\EBiCS_Firmware-master\Debug/../Src/display_ebics.c:15: first defined here
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: Src/main.o:C:\EBiCS_Firmware-master\Debug/../Src/main.c:89: multiple definition of `huart1'; Src/display_ebics.o:C:\EBiCS_Firmware-master\Debug/../Src/display_ebics.c:13: first defined here
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: Src/main.o:C:\EBiCS_Firmware-master\Debug/../Src/main.c:85: multiple definition of `htim1'; Src/FOC.o:C:\EBiCS_Firmware-master\Debug/../Src/FOC.c:42: first defined here
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/thumb/v7-m/nofp\libc_nano.a(libc_a-closer.o): in function `_close_r':
closer.c:(.text._close_r+0xc): warning: _close is not implemented and will always fail
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/thumb/v7-m/nofp\libc_nano.a(libc_a-lseekr.o): in function `_lseek_r':
lseekr.c:(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/thumb/v7-m/nofp\libc_nano.a(libc_a-readr.o): in function `_read_r':
readr.c:(.text._read_r+0x10): warning: _read is not implemented and will always fail
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/thumb/v7-m/nofp\libc_nano.a(libc_a-writer.o): in function `_write_r':
writer.c:(.text._write_r+0x10): warning: _write is not implemented and will always fail
C:/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: LishuiFOC_01.elf has a LOAD segment with RWX permissions
collect2.exe: error: ld returned 1 exit status
makefile:36: recipe for target 'LishuiFOC_01.elf' failed
make: *** [LishuiFOC_01.elf] Error 1




Many thanks for your help

Regards
 
Hello,

My bad, I did not follow the wiki action by action !

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

I forgot
  1. Start Eclipse once to extract the compiler.

Now I can compile.

Regards
 
Hello,

ok I succeed in flashing the firmware and result not good :

Working :

Kunten display

Not working :

Pas not working at all.
Motor phase seems bad, but I can't execute autodetection ! Again, bad reading of the WIKI? !
The thotle works only at maximum, but motor run slowly with noise.

I thinks I could need help again.

Thanks for your patience

Regards
 
Hello,

better result, I have been able con do the autodetect, and I had to reverse the motor.

The thotle works with hole at the begining and the end, I think I need to set thotle ofset and max.

But the PAS is not working.

I put my scope on it and be back to all. Thanks for reading my step to step story
 
Hello,

I check the PAS from my bicycle with the scope and all ok.

I open again the controler and the input of the pas is connected to TA on the motherboard.
 

Attachments

  • PAS 2024-05-13 à 22.06.32_41a7095a.jpg
    PAS 2024-05-13 à 22.06.32_41a7095a.jpg
    236.4 KB · Views: 0
Hello,

some good news.

I have connected the PAS power from 12V to 5v.

Now after just step on the padle, the motor runs.

Problem left :

The power on the motor look the same even if I change the power assistance on the display menu.
I don't have any indication of speed on the display.

Enougth for today, but I allways to help.

Regard to all
 
Back
Top