Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Electric Motors and Controllers
rowbiker
10 W
10 W
Posts: 74
Joined: Jul 16, 2013 1:36 pm
Location: Saint Paul, Minnesota USA

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by rowbiker » Dec 26, 2017 10:28 am

I've been following this thread for several weeks now and want to thank you guys for a very interesting and informative project. I've noticed, and wondered, if there is a special reason that you use the word "throotle" to (apparently) mean "throttle", the typical english spelling for the device that causes the motor to change its RPM's. I'm a german guy living in the US, so I'm somewhat bilingual, but couldn't think of a reason for this spelling. Hope everyone had a 'Frohe Weihnachten'!

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 26, 2017 10:40 am

rowbiker wrote:
Dec 26, 2017 10:28 am
I've been following this thread for several weeks now and want to thank you guys for a very interesting and informative project. I've noticed, and wondered, if there is a special reason that you use the word "throotle" to (apparently) mean "throttle", the typical english spelling for the device that causes the motor to change its RPM's. I'm a german guy living in the US, so I'm somewhat bilingual, but couldn't think of a reason for this spelling. Hope everyone had a 'Frohe Weihnachten'!
Thank for you the correction!!! :-) :-)
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 26, 2017 12:18 pm

I think I got the design mostly done.
The nice thing is that it hides options that don't make sense on as specific context - the only case is on throttle types.

Image

Here it hides the options for PAS etc, as PAS is not used:
Image

Image

Image

Image
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

ThierryGTLTS
10 mW
10 mW
Posts: 24
Joined: Jan 10, 2017 8:10 am

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by ThierryGTLTS » Dec 26, 2017 12:54 pm

Fine interface.

So, the mysterious P1 parameter in the LCD3 manual is related to motor rotor offset angle :!:

And other parameters after are there to tweak and improve the FOC behaviour if I understand, right :?: :!:

Have a Nice Day.

Thierry

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 26, 2017 1:00 pm

ThierryGTLTS wrote:
Dec 26, 2017 12:54 pm
Fine interface.

So, the mysterious P1 parameter in the LCD3 manual is related to motor rotor offset angle :!:

And other parameters after are there to tweak and improve the FOC behaviour if I understand, right :?: :!:
That software is for configuring our OpenSource firmware that we implemented from scratch - that options are for our firmware only.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 27, 2017 1:52 pm

I did finish the design, next I will make it generating the config.h file (also there are not instructions yet). The sources are on the branch "netbeans-configuration_tool".

The jar file have the look and feel of Linux but should have the Windows look and feel when running on Windows, can someone please test and share a screenshot?

Actual state on Linux:
Image

Image

Image

Image
Attachments
Flexible_OpenSource_EBike_firmware-Configuration_tool.zip
(56.16 KiB) Downloaded 5 times
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 404
Joined: Aug 02, 2017 2:56 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Dec 28, 2017 4:14 am

Nice pastime over christmas :-). It works on windows. I personally prefer not to have to scroll down, to see all parameters and buttons, but that's just my personal opinion.

regards
stancecoke
Attachments
Configuration Tool.PNG
Configuration Tool.PNG (17.15 KiB) Viewed 404 times

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 28, 2017 5:15 am

No to good looking on Windows but not bad at all.

I started to reuse your code, for the action buttons and for OS detection, and it seams to works :-)

Image

Image

Image
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 28, 2017 8:00 am

Stancecoke,

It works now, but only on Windows since I reused your code. The write options bytes should work as also the write configuration - can you please test? and build the firmware? (you will need to checkout the latest firmware).

Missing:
- Linux commands
- Help text for each option

I really like this way, seems only one long sheet with all options... maybe that is how my brain is formatted...
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 28, 2017 9:14 am

Stancecoke,

I added the Linux commands and they seem to work. I used shell scripts and you did on Windows. But I also moved the tool to the folder: firmware_configuration_tool

Can you please pull the firmware and try use the configuration tool on Windows? please look at the paths for the scritps as I changed them, you can see for instance the changes I did for make run on Linux, on that specific folder.
Would be great if you could test and push the needed changes for it to work on Windows.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 404
Joined: Aug 02, 2017 2:56 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Dec 28, 2017 11:33 am

casainho wrote:
Dec 28, 2017 9:14 am
Can you please pull the firmware and try use the configuration tool on Windows?
It doesn't work the way it is on windows. I don't know how to set the pathes in the batch files. So I would suggest to copy the windows- batchfiles back to the main folder for the moment, to have a working solution for potential windows users.

and again, there are several error messages in the log while compiling. (with C#ROME-B)

Code: Select all

C:\temp\BMSBattery_S_controllers_firmware-master>make -f Makefile_windows
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_itc.c StdPeriphLib/src/stm8s_itc.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_clk.c StdPeriphLib/src/stm8s_clk.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_iwdg.c StdPeriphLib/src/stm8s_iwdg.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_gpio.c StdPeriphLib/src/stm8s_gpio.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_exti.c StdPeriphLib/src/stm8s_exti.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_uart2.c StdPeriphLib/src/stm8s_uart2.c
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_tim1.c StdPeriphLib/src/stm8s_tim1.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_tim2.c StdPeriphLib/src/stm8s_tim2.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_adc1.c StdPeriphLib/src/stm8s_adc1.c
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp1. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp1. Please contact sdcc authors with source code to reproduce.
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_flash.c StdPeriphLib/src/stm8s_flash.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -owatchdog.c watchdog.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -ogpio.c gpio.c
In file included from gpio.h:50,
                 from gpio.c:11:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from gpio.h:50,
                 from gpio.c:11:
config.h:35:1: error: this is the location of the previous definition
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -outils.c utils.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -ouart.c uart.c
In file included from uart.c:15:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from uart.c:15:
config.h:35:1: error: this is the location of the previous definition
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oadc.c adc.c
In file included from gpio.h:50,
                 from adc.c:12:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from gpio.h:50,
                 from adc.c:12:
config.h:35:1: error: this is the location of the previous definition
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -obrake.c brake.c
In file included from gpio.h:50,
                 from brake.c:12:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from gpio.h:50,
                 from brake.c:12:
config.h:35:1: error: this is the location of the previous definition
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -opas.c pas.c
In file included from gpio.h:50,
                 from pas.c:12:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from gpio.h:50,
                 from pas.c:12:
config.h:35:1: error: this is the location of the previous definition
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -otimers.c timers.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -opwm.c pwm.c
In file included from gpio.h:50,
                 from pwm.c:12:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from gpio.h:50,
                 from pwm.c:12:
config.h:35:1: error: this is the location of the previous definition
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oeeprom.c eeprom.c
In file included from eeprom.h:12,
                 from eeprom.c:12:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from eeprom.h:12,
                 from eeprom.c:12:
config.h:35:1: error: this is the location of the previous definition
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -omotor.c motor.c
In file included from ebike_app.h:13,
                 from motor.c:17:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from ebike_app.h:13,
                 from motor.c:17:
config.h:35:1: error: this is the location of the previous definition
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp121. Please contact sdcc authors with source code to reproduce.
motor.c:1039: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  -oebike_app.c ebike_app.c
In file included from ebike_app.h:13,
                 from ebike_app.c:9:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from ebike_app.h:13,
                 from ebike_app.c:9:
config.h:35:1: error: this is the location of the previous definition
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp9. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp9. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp9. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp9. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
sdcc -IStdPeriphLib/inc -I.  -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-ihx --debug  main.c StdPeriphLib/src/stm8s_itc.rel StdPeriphLib/src/stm8s_clk.rel StdPeriphLib/src/stm8s_iwdg.rel StdPeriphLib/src/stm8s_gpio.rel StdPeriphLib/src/stm8s_exti.rel StdPeriphLib/src/stm8s_uart2.rel StdPeriphLib/src/stm8s_tim1.rel StdPeriphLib/src/stm8s_tim2.rel StdPeriphLib/src/stm8s_adc1.rel StdPeriphLib/src/stm8s_flash.rel watchdog.rel gpio.rel utils.rel uart.rel adc.rel brake.rel pas.rel timers.rel pwm.rel eeprom.rel motor.rel ebike_app.rel
In file included from gpio.h:50,
                 from main.c:12:
main.h:23:1: warning: "MOTOR_TYPE" redefined
In file included from main.h:12,
                 from gpio.h:50,
                 from main.c:12:
config.h:35:1: error: this is the location of the previous definition
main.c:119: warning 126: unreachable code

?ASlink-Warning-Undefined Global '_wheel_speed_sensor_init' referenced by module 'main'
make: *** [main] Error 1

C:\temp\BMSBattery_S_controllers_firmware-master>ren main.ihx main.hex

C:\temp\BMSBattery_S_controllers_firmware-master>STVP_CmdLine -BoardName=ST-LINK -ProgMode=SWIM -Port=USB -Device=STM8S105x6 -FileProg=main.hex -verbose -no_loop
regards
stancecoke

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 28, 2017 11:47 am

For me, on master, builds as expected:
cas@cas-sp4:~/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware$ make -f Makefile_linux
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_itc.c StdPeriphLib/src/stm8s_itc.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_clk.c StdPeriphLib/src/stm8s_clk.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_iwdg.c StdPeriphLib/src/stm8s_iwdg.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_gpio.c StdPeriphLib/src/stm8s_gpio.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_exti.c StdPeriphLib/src/stm8s_exti.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_uart2.c StdPeriphLib/src/stm8s_uart2.c
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_tim1.c StdPeriphLib/src/stm8s_tim1.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_tim2.c StdPeriphLib/src/stm8s_tim2.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_adc1.c StdPeriphLib/src/stm8s_adc1.c
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp1. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp0. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp1. Please contact sdcc authors with source code to reproduce.
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oStdPeriphLib/src/stm8s_flash.c StdPeriphLib/src/stm8s_flash.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -owatchdog.c watchdog.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -ogpio.c gpio.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -outils.c utils.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -ouart.c uart.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oadc.c adc.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -obrake.c brake.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -opas.c pas.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -owheel_speed_sensor.c wheel_speed_sensor.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -otimers.c timers.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -opwm.c pwm.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oeeprom.c eeprom.c
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -omotor.c motor.c
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp121. Please contact sdcc authors with source code to reproduce.
motor.c:1003: warning 85: in function do_motor_controller_mode unreferenced local variable : 'ui8_pwm_duty_cycle_current_controller'
motor.c:1039: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
/home/cas/software/stm8-binutils/bin/sdcc -c -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug -oebike_app.c ebike_app.c
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp44. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp32. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp2. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
Warning: Non-connected liverange found and extended to connected component of the CFG:iTemp4. Please contact sdcc authors with source code to reproduce.
/home/cas/software/stm8-binutils/bin/sdcc -IStdPeriphLib/inc -I. -mstm8 -Ddouble=float --std-c99 --nolospre --out-fmt-elf --debug main.c StdPeriphLib/src/stm8s_itc.rel StdPeriphLib/src/stm8s_clk.rel StdPeriphLib/src/stm8s_iwdg.rel StdPeriphLib/src/stm8s_gpio.rel StdPeriphLib/src/stm8s_exti.rel StdPeriphLib/src/stm8s_uart2.rel StdPeriphLib/src/stm8s_tim1.rel StdPeriphLib/src/stm8s_tim2.rel StdPeriphLib/src/stm8s_adc1.rel StdPeriphLib/src/stm8s_flash.rel watchdog.rel gpio.rel utils.rel uart.rel adc.rel brake.rel pas.rel wheel_speed_sensor.rel timers.rel pwm.rel eeprom.rel motor.rel ebike_app.rel
main.c:119: warning 126: unreachable code
stm8-size main.elf -A
main.elf :
section size addr
DATA 98 1
INITIALIZED 321 99
SSEG 3 420
HOME 131 32768
GSINIT 30 32899
GSFINAL 3 32929
CODE 23938 32932
INITIALIZER 321 56870
.debug_line 25701 0
.debug_loc 6400 0
.debug_abbrev 2589 0
.debug_info 29370 0
.debug_pubnames 10618 0
.debug_frame 432 0
Total 99955


stm8-objcopy -O binary -R DATA -R INITIALIZED -R SSEG -R .debug_line -R .debug_loc -R .debug_abbrev -R .debug_info -R .debug_pubnames -R .debug_frame main.elf main.bin
cas@cas-sp4:~/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware$
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 28, 2017 11:52 am

stancecoke wrote:
Dec 28, 2017 11:33 am
It doesn't work the way it is on windows. I don't know how to set the pathes in the batch files. So I would suggest to copy the windows- batchfiles back to the main folder for the moment, to have a working solution for potential windows users.
On Windows, original example:

Code: Select all

del main.hex
make -f Makefile_windows clean
Now we are 2 folder after, so we should need "..\..":

Code: Select all

del ..\..\main.hex
And make needs C command to say it will run 2 folders backwards:

Code: Select all

make -C '..\..\' -f Makefile_windows clean
Linux version that works:

Code: Select all

make -C '../../' -f Makefile_linux clean
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 404
Joined: Aug 02, 2017 2:56 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Dec 28, 2017 12:06 pm

I've just updated the makefile_windows, that fixed one error. Is it right, that you don't configure the motortype any longer in the tool? Then I have to delete this option from the C#ROME-B tool, to get back to a working windows-solution.
To set the pathes in the right way is not that easy, your suggestion does't work :-(

Regards
stancecoke

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 28, 2017 12:11 pm

Ok then I will move all the scripts to root folder.

Yes about the motor type. In the end, motor type just changes a parameter for PID speed controller, so I think we can mantain the same value and not use motor type for now on the user configuration tool.

I will improve as needed, from users feedback.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 404
Joined: Aug 02, 2017 2:56 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Dec 28, 2017 12:17 pm

casainho wrote:
Dec 28, 2017 12:11 pm
Ok then I will move all the scripts to root folder.
I've done that already, the C#ROME-B is updated already, too. So the windows toolchain should work again now.

regards
stancecoke

User avatar
stancecoke
1 kW
1 kW
Posts: 404
Joined: Aug 02, 2017 2:56 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Dec 28, 2017 3:30 pm

I've figured out the right syntax in Java now. You have to change this two lines, to execute the batch files in the windows_scripts folder:

Code: Select all

...

Process process = Runtime.getRuntime().exec("cmd /c start windows_scripts\\WriteOptionBytes");

...

Process process = Runtime.getRuntime().exec("cmd /c start windows_scripts\\Start_Compiling");

...

With this change, it should work with windows, too.

I've adjusted the batch file in the windows_scripts folder on github already.

edit: I've just seen, that you are using this syntax in the Java-sourcecode already. So it works as it is with my changes in the batchfile and the move of the make.exe and the dlls to the windows_scripts folder :D .

Regards
stancecoke

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 28, 2017 5:31 pm

stancecoke wrote:
Dec 28, 2017 3:30 pm
. So it works as it is with my changes in the batchfile and the move of the make.exe and the dlls to the windows_scripts folder :D .
That's great!! And I need to test on Linux, test building and flashing, as I didn't before.

And now even more ideas and changes!! :-)

So, why not do as we did before with the documentation, put the focus in the user?
So, user download from the github and after unzip, the root folder could have the java executable + user documentation (the one that is online). Firmware sources would be on firmware folder. This would mean that the paths to build the firmware, etc would need to be changed.
What do you think?
The notes files can export as html or PDF, but I am not sure PDF is better than html.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 29, 2017 7:05 am

Got the scripts running on Linux, and so the Java firmware configuration tool now work on Windows and Linux.
The missing thing now is help text for each option.

I also found some incorrect implementations on the firmware, they are now resolved.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 404
Joined: Aug 02, 2017 2:56 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Dec 29, 2017 11:31 am

casainho wrote:
Dec 28, 2017 5:31 pm
the root folder could have the java executable + user documentation (the one that is online). Firmware sources would be on firmware folder.
What do you think?
Yes, this makes sense.
casainho wrote:
Dec 28, 2017 5:31 pm
The notes files can export as html or PDF, but I am not sure PDF is better than html.
PDF would be better for printing, I guess. But I wouldn't pack the documentation to the master branch, as it will take several Megabyte of data. Even your pixelcamp presentation would better be placed on bitbucket. I always get annoyed about the slow download of almost 40MB for the Masterbranch as zip-file.

regards
stancecoke

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 29, 2017 1:49 pm

Finally added the help text. I think the tool is now finished.

Image

When clicking on the help for "Throttle control algorithm output":
Image
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 30, 2017 7:12 am

I like a lot Podride and I wanted to offer my help, so I sent the following message to their contact channels.
Hi.

I am a developer of Flexible OpenSource firmware for EBike motor controllers and I would like to offer my help (for free) as I really believe in what Podride represents.

Our EBike motor controllers firmware is flexible and OpenSource, more than customization, any feature for some specific need can be easily implemented and for free (no need to pay any commercial license).

The firmware runs on the capable but also cheap EBike motor controllers with various sizes e powers, from 0.25kW up to 5kW.

You can reach me at: casainhoMAIL or our community at: https://opensourceebikefirmware.bitbucket.io/s
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 30, 2017 6:09 pm

stancecoke wrote:
Dec 29, 2017 11:31 am
casainho wrote:
Dec 28, 2017 5:31 pm
the root folder could have the java executable + user documentation (the one that is online). Firmware sources would be on firmware folder.
What do you think?
Yes, this makes sense.
casainho wrote:
Dec 28, 2017 5:31 pm
The notes files can export as html or PDF, but I am not sure PDF is better than html.
PDF would be better for printing, I guess. But I wouldn't pack the documentation to the master branch, as it will take several Megabyte of data. Even your pixelcamp presentation would better be placed on bitbucket. I always get annoyed about the slow download of almost 40MB for the Masterbranch as zip-file.
I made it. And I didn't put the documentation there, because of the space and also no need to duplicate, as the final user should have internet -- I just pointed on README.md file to http://opensourceebikefirmware.bitbucket.io/

I tested on Linux and also updated the paths for Windows but I can't test it - can you please test?

Also, you will see that I updated the tool to:
- if torque sensor is selected and human power is also selected, the PAS options are enabled because for human power the user need to setup PAS options.

Image
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 404
Joined: Aug 02, 2017 2:56 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Dec 31, 2017 4:59 am

casainho wrote:
Dec 30, 2017 6:09 pm
I tested on Linux and also updated the paths for Windows but I can't test it - can you please test?
I've just updated the Start_Compiling.bat at github, it works now with Windows, too.
The call of the batch file from eclipse doesn't work at the moment, as it's no longer placed in the firmware folder, but I will only fix that, if someone wants to use it really.

regards
stancecoke

casainho
100 kW
100 kW
Posts: 1120
Joined: Feb 14, 2011 2:43 pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Dec 31, 2017 7:02 am

stancecoke wrote:
Dec 31, 2017 4:59 am
I've just updated the Start_Compiling.bat at github, it works now with Windows, too.
Good!!
And I just updated the user documentation with screenshots and info about the firmware configuration tool + windows instructions, that I did copy from your site. I also linked to your site and I want to mention it on the main page.

I think the documentation and the firmware are now finished but they have space for improvement. I hope to keep improve the documentation on next days.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

Post Reply