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

stancecoke said:
Valopallo said:
Tested and the problem came back

OK, so we have to skip all the condition checks first.

Replace lines 205 -324 with

Code:
	uint32_current_target = ui16_current_cal_b; // reset target to zero
	controll_state_temp = 0;
	ui8_temp = ui8_assist_percent_actual;
	if ((ui16_aca_flags & DYNAMIC_ASSIST_LEVEL) == DYNAMIC_ASSIST_LEVEL) {
				ui8_temp += ui8_assist_dynamic_percent_addon;
			}
	

	uint32_current_target = (ui8_temp * ui16_battery_current_max_value* 10)>>10; // replace division by right shift: (xxx*10)>>10 is nearly  xxx/100
	uint32_current_target = map(ui16_time_ticks_between_pas_interrupt_smoothed, ui16_s_ramp_end, ui16_s_ramp_start, uint32_current_target, 0);

	uint32_current_target += ui16_current_cal_b;
	if (ui16_time_ticks_for_pas_calculation > timeout || !PAS_is_active) uint32_current_target = ui16_current_cal_b;
	if(ui16_time_ticks_between_pas_interrupt_smoothed>ui16_s_ramp_end)controll_state_temp += 1;
	else controll_state_temp += 2;
	
	uint32_temp = ui16_sum_throttle + ui16_current_cal_b; //check throttle override
	if(uint32_temp>uint32_current_target){
		uint32_current_target = uint32_temp;
		controll_state_temp += 16;
		}
	if (ui8_walk_assist) uint32_current_target = 10 + ui16_current_cal_b;
	//send current target to PI-controller
	ui32_dutycycle = PI_control(ui16_BatteryCurrent, uint32_current_target,uint_PWM_Enable);

With this there is no speedlimit- , no undervoltage-, no .... check active.
To be honest, I'm not very motivated to add all of this step by step to see when the processor reaches it's limit. I recommend to use the Gazelle branch without the BlueOsec app.... (Or try to do the steps in the Master-code by yourself, it's not that difficult...)

regards
stancecoke

Did not change anything. I tried the throttle only code once again and now it does not work either. All of the tests give now only 35km/h before overloading. I also tried to flash gazelle with display:none and the right hand side toggle between diagnostics and bluosec I chose bluosec ON. I tried to flash but there was an error about no such file for some directory(I can try again) and also at the end
>>> Loading file main.hex in PROGRAM MEMORY image in computer
No such file or directory

As it seems the parameters are fine. I'm still a bit unsure about the right correction angle and the right motor specific angle parameters, could they cause overloading the processor if set a tiny bit wrong values or would the wrong parameter here be noticed clearly first by a bad motor behavior? Another guess to the air; would it matter that my throttle is powered from front motor controller(Factory FW) and only the signal is used by the rear controller that uses OSEC? Would trying it the other way around be worth a try to possibly overcome anything related to the overloading of the processor?
 
Valopallo said:
Did not change anything. I tried the throttle only code once again and now it does not work either.
Sorry, then I can't help any more. I am at the end of my rope at this point. :confused:

regards
stancecoke
 
stancecoke said:
Valopallo said:
Did not change anything. I tried the throttle only code once again and now it does not work either.
Sorry, then I can't help any more. I am at the end of my rope at this point. :confused:

regards
stancecoke

Any help with the gazelle branch error:
Code:
C:\BMSBattery_S_controllers_firmware-Gazelle>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:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Windows Imaging\;C:\ProgramData\chocolatey\bin;;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Cracklock\Bin;C:\Users\Mza\AppData\Local\Microsoft\WindowsApps;C:\SDCC\bin;;C:\Program Files\STMicroelectronics\st_toolset\stvp;C:\Program Files (x86)\STMicroelectronics\st_toolset\stvp;C:\SDCC\usr\local\bin;C:\BMSBattery_S_controllers_firmware-Gazelle\tools\cygwin\bin

C:\BMSBattery_S_controllers_firmware-Gazelle>del main.hex
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\main.hex

C:\BMSBattery_S_controllers_firmware-Gazelle>sdcc --version
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.8.0 #10562 (MINGW64)
published under GNU General Public License (GPL)

C:\BMSBattery_S_controllers_firmware-Gazelle>make -f Makefile_windows clean
Cleaning files...

C:\BMSBattery_S_controllers_firmware-Gazelle>cd stdperiphlib\src

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.asm

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.rel

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.lk
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src\*.lk

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.lst

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.rst
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src\*.rst

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.sym

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.cdb
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src\*.cdb

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.map
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src\*.map

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.elf
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src\*.elf

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.bin
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src\*.bin

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>del *.adb

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib\src>cd..

C:\BMSBattery_S_controllers_firmware-Gazelle\StdPeriphLib>cd..

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.asm

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.rel

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.lk
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.lk

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.lst

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.rst
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.rst

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.sym

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.cdb
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.cdb

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.map
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.map

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.elf
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.elf

C:\BMSBattery_S_controllers_firmware-Gazelle>del *.adb

C:\BMSBattery_S_controllers_firmware-Gazelle>del Result.log
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.asm
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.rel
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.lk
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.lst
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.rst
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.sym
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.cdb
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.map
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.elf
Could Not Find C:\BMSBattery_S_controllers_firmware-Gazelle\*.adb
Done.

C:\BMSBattery_S_controllers_firmware-Gazelle>make -f Makefile_windows
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_itc.c StdPeriphLib/src/stm8s_itc.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_clk.c StdPeriphLib/src/stm8s_clk.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_iwdg.c StdPeriphLib/src/stm8s_iwdg.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_gpio.c StdPeriphLib/src/stm8s_gpio.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_exti.c StdPeriphLib/src/stm8s_exti.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_uart2.c StdPeriphLib/src/stm8s_uart2.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_tim1.c StdPeriphLib/src/stm8s_tim1.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_tim2.c StdPeriphLib/src/stm8s_tim2.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_adc1.c StdPeriphLib/src/stm8s_adc1.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_flash.c StdPeriphLib/src/stm8s_flash.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -ogpio.c gpio.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -outils.c utils.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -ocruise_control.c cruise_control.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -ouart.c uart.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oadc.c adc.c
adc.c:76: warning 85: in function adc_init unreferenced local variable : 'ui16_counter'
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -obrake.c brake.c
brake.c:23: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -otimers.c timers.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -opwm.c pwm.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -omotor.c motor.c
motor.c:214: warning 158: overflow in implicit constant conversion
motor.c:228: warning 158: overflow in implicit constant conversion
motor.c:242: warning 158: overflow in implicit constant conversion
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oPAS.c PAS.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oSPEED.c SPEED.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oupdate_setpoint.c update_setpoint.c
update_setpoint.c:103: syntax error: token -> ')' ; column 77
update_setpoint.c:274: warning 85: in function update_setpoint unreferenced function argument : 'PAS'
make: *** [update_setpoint.rel] Error 1

C:\BMSBattery_S_controllers_firmware-Gazelle>ren main.ihx main.hex
Määritettyä tiedostoa ei löydy.

C:\BMSBattery_S_controllers_firmware-Gazelle>STVP_CmdLine -BoardName=ST-LINK -ProgMode=SWIM -Port=USB -Device=STM8S105x6 -FileProg=main.hex -verbose -no_loop
STVP_CmdLine version 1.6

Verbose ON
Log activity ON
Display Progress OFF
Message box warning if protect option byte ON
Loop mode OFF
Erase device OFF
Blank check device OFF
Verify device ON

Configuration:
BoardName=ST-LINK ST-LINK_ID=0 Device=STM8S105x6 Port=USB ProgMode=SWIM

>>> Filling PROGRAM MEMORY image in computer with Blank Value
<<< Filling PROGRAM MEMORY image in computer succeeds

>>> Loading file main.hex in PROGRAM MEMORY image in computer
(API) ERROR : No such file or directory

C:\BMSBattery_S_controllers_firmware-Gazelle>pause
Press any key to continue . . .
 
Valopallo said:
Any help with the gazelle branch error:

strange, I get no error. Can you please post the content of your config.h

regards
stancecoke

Code:
C:\temp\BMSBattery_S_controllers_firmware-Gazelle>make -f Makefile_windows
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_itc.c StdPeriphLib/src/stm8s_itc.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_clk.c StdPeriphLib/src/stm8s_clk.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_iwdg.c StdPeriphLib/src/stm8s_iwdg.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_gpio.c StdPeriphLib/src/stm8s_gpio.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_exti.c StdPeriphLib/src/stm8s_exti.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_uart2.c StdPeriphLib/src/stm8s_uart2.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_tim1.c StdPeriphLib/src/stm8s_tim1.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_tim2.c StdPeriphLib/src/stm8s_tim2.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_adc1.c StdPeriphLib/src/stm8s_adc1.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oStdPeriphLib/src/stm8s_flash.c StdPeriphLib/src/stm8s_flash.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -ogpio.c gpio.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -outils.c utils.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -ocruise_control.c cruise_control.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -ouart.c uart.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oadc.c adc.c
adc.c:76: warning 85: in function adc_init unreferenced local variable : 'ui16_counter'
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -obrake.c brake.c
brake.c:23: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -otimers.c timers.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -opwm.c pwm.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -omotor.c motor.c
motor.c:200: warning 158: overflow in implicit constant conversion
motor.c:214: warning 158: overflow in implicit constant conversion
motor.c:228: warning 158: overflow in implicit constant conversion
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oPAS.c PAS.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oSPEED.c SPEED.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -oupdate_setpoint.c update_setpoint.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -odisplay.c display.c
sdcc -c -IStdPeriphLib/inc -I.  -mstm8 --std-c99 --nolospre --out-fmt-ihx --debug  -odisplay_kingmeter.c display_kingmeter.c
sdcc -IStdPeriphLib/inc -I.  -mstm8 --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 gpio.rel utils.rel cruise_control.rel uart.rel adc.rel brake.rel timers.rel pwm.rel motor.rel PAS.rel SPEED.rel update_setpoint.rel display.rel display_kingmeter.rel

C:\temp\BMSBattery_S_controllers_firmware-Gazelle>ren main.ihx main.hex
 
stancecoke said:
[Can you please post the content of your config.h

regards
stancecoke

Code:
/*
 * config.h
 *
 *  Automatically created by OSEC Parameter Configurator
 *  Author: stancecoke
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#define NUMBER_OF_PAS_MAGS 12
#define limit 25
#define timeout 3125
#define wheel_circumference 2039L
#define fummelfaktor 1L
#define ADC_THROTTLE_MIN_VALUE 51
#define ADC_THROTTLE_MAX_VALUE 214
#define BATTERY_VOLTAGE_MIN_VALUE 153
#define BATTERY_CURRENT_MAX_VALUE 150L
#define PHASE_CURRENT_MAX_VALUE 300L
#define REGEN_CURRENT_MAX_VALUE 50L
#define MOTOR_ROTOR_DELTA_PHASE_ANGLE_RIGHT 213
#define current_cal_a 100
#define TEMP_CAL_A 
#define TEMP_CAL_B 
#define LEVEL_1 20
#define LEVEL_2 40
#define LEVEL_3 60
#define LEVEL_4 80
#define LEVEL_5 100
#define CHEAT_TIME_1 50
#define CHEAT_TIME_2 50
#define CHEAT_TIME_3 50
#define RAMP_END 1500
#define P_FACTOR 0.20
#define I_FACTOR 0.15
#define GEAR_RATIO 23L
#define BATTERY_LI_ION_CELLS_NUMBER 14
#define PAS_THRESHOLD 3.2
#define THROTTLE_AND_PAS
#define PWM_CYCLES_SECOND 15625L
#define SPEEDSENSOR_INTERNAL
#define REGEN_DIGITAL
#define PAS_DIRECTION 1

#endif /* CONFIG_H_ */
 
You have defined nothing for

Code:
#define TEMP_CAL_A 
#define TEMP_CAL_B

Just keep the values at their standard, even if you don't use them....

Code:
#define TEMP_CAL_A 1.6
#define TEMP_CAL_B 110.4

for "normal" PAS function choose ride mode "Torque-Simulation"
"Throttle and PAS" means, that the throttle only works if you are pedaling.

regards
stancecoke.
 
New member with likely an old problem.

I have a 30A KT Sinewave controller I just received, it doesn't have a torque sensor input so I would like to add one and use the firmware.

PXL_20210910_001236383~2.jpg

I have looked at the WIKI for setting up the firmware and the board displayed there for doing the hard connection is different than mine. My board has many connections holes instead of just four. Anyone familiar with this board or know where I can get a schematic?

PXL_20210911_143325968~2.jpg
PXL_20210911_143522472~2.jpg
PXL_20210911_143512738~2.jpg
 

Attachments

  • PXL_20210910_001324696~2.jpg
    PXL_20210910_001324696~2.jpg
    366.3 KB · Views: 3,703
  • PXL_20210911_143316654.jpg
    PXL_20210911_143316654.jpg
    407.9 KB · Views: 3,711
I tried the gazelle build today but it just turns the controller into a dead box that does nothing. It doesn't even connect to the osec app either. Reverting back to the master build fixes this. I did select the osec display option in the java tool.
 
About https://github.com/Koxx3/SmartESC_STM32_v3.

Hi, Stancecoke, any step by step mannual, example of setup available ? What means Ant+LEV syntax ?
What terminal programm I shuld use ? Any correct config.h avalable for work with ESP32 ?
 
miklelv said:
any step by step mannual, example of setup available
You can use the wiki of the original EBiCS repo for the meaning of the settings in the config.h. But you have to use the STM Cube IDE for compiling and flashing.
Please use this thread for further questions:
https://endless-sphere.com/forums/viewtopic.php?f=30&t=111834

regards
stancecoke
 
I have run this firmware with the LCD 4 and IT Works very well. However, the displays keep breaking due to water ingress.

Are any of you running other displays in damp climates without issues? If so, please let me know!
 
Vbruun said:
Are any of you running other displays in damp climates without issues? If so, please let me know!

I sealed my LCD3 to prevent any water ingress. There are multiple ways you can do that. In my case I completely coated it in clear Plasti Dip, both the monitor and the buttons. The coating is flexible enough that it does not impede in any way the use of the buttons. For a nicer result I would recommend UV resistant resin on the monitor and Plasti Dip only for the buttons (I did not have any resin on hand so I used what I had)

If you know water got inside I would recommend making sure it is perfectly dry before sealing it or you are going to trap water inside.

I'm pretty confident that I could submerge my sealed LCD3 in water for hours and no water will get inside at all
 
Hi!
I opened my controller to find out where some wires go.
I see on the KT boards there is a wire connected to "ZL"

Does anyone know what this wire is for? Thanks
 
Hey there Stance and gang :D
I finished flashing OSEC on my 52V KT yesterday. Got everything working, including BluOSEC with HC-05 and XL7015 based stepdown for new 15V rail, based on earlier post by Sylvain. Idle current @59V is now reading 40mA, goes to 60mA once bluetooth connects.
This however got me thinking - what about removing the last link in the chain, that 5V LDO and supply those 5V from external stepdown (such as the one usually powering HC-05), to hopefully fix all power related issues with that rail?
 

Attachments

  • file.png
    file.png
    814.6 KB · Views: 2,780
iaval said:
Hey there Stance and gang :D
I finished flashing OSEC on my 52V KT yesterday. Got everything working, including BluOSEC with HC-05 and XL7015 based stepdown for new 15V rail, based on earlier post by Sylvain. Idle current @59V is now reading 40mA, goes to 60mA once bluetooth connects.
This however got me thinking - what about removing the last link in the chain, that 5V LDO and supply those 5V from external stepdown (such as the one usually powering HC-05), to hopefully fix all power related issues with that rail?

Of course you could supply 5v separately but I have personally never felt the need to do so. For stability and reliability during high loads (and corresponding large+quick voltage drop) I would highly recommend to use a buck converter for the 15v rail, just like you already do. The existing 5v solution is nice and compact, is powerful enough for its purpose and doesn’t get very hot, so no need to change that? But feel free to do so.

To reduce switching losses, i have recently started using 12v on the 15v rail. This seems to work fine; my 18 irfb4110 mosfet controller is providing some 7500 watt without issues (84v/72v 20s battery, 100 battery amps limit and 300 phase amps limit).

This is in correspondence with the tests on page 173 that sylvain_wm did showing that 12v works fine and results in some 10.6v at the high side mosfets.

This enables us to use the 16-120v -> 12v 3a buck converters that are widely available on AliExpress, without having to modify them to 15v output. I really like these buck converters for there large input voltage range, small size and reliable power output (i have 6 controllers running on them without any issues so far).
 
Iambuilderman said:
iaval said:
Hey there Stance and gang :D
I finished flashing OSEC on my 52V KT yesterday. Got everything working, including BluOSEC with HC-05 and XL7015 based stepdown for new 15V rail, based on earlier post by Sylvain. Idle current @59V is now reading 40mA, goes to 60mA once bluetooth connects.
This however got me thinking - what about removing the last link in the chain, that 5V LDO and supply those 5V from external stepdown (such as the one usually powering HC-05), to hopefully fix all power related issues with that rail?

Of course you could supply 5v separately but I have personally never felt the need to do so. For stability and reliability during high loads (and corresponding large+quick voltage drop) I would highly recommend to use a buck converter for the 15v rail, just like you already do. The existing 5v solution is nice and compact, is powerful enough for its purpose and doesn’t get very hot, so no need to change that? But feel free to do so.

To reduce switching losses, i have recently started using 12v on the 15v rail. This seems to work fine; my 18 irfb4110 mosfet controller is providing some 7500 watt without issues (84v/72v 20s battery, 100 battery amps limit and 300 phase amps limit).

This is in correspondence with the tests on page 173 that sylvain_wm did showing that 12v works fine and results in some 10.6v at the high side mosfets.

This enables us to use the 16-120v -> 12v 3a buck converters that are widely available on AliExpress, without having to modify them to 15v output. I really like these buck converters for there large input voltage range, small size and reliable power output (i have 6 controllers running on them without any issues so far).

I see. My concern with those 12V 3A is the idle power draw. Since there is no auto-power off feature, having low idle current is quite important in case it's not turned off.

I previously read that the 5V provided by the board is barely enough for those 3 hall sensors (brake, throttle and PAS).


By the way, total offtopic, but do you know how cruise control works with OSEC? I haven't been able to find any settings about it, with the exception of 'cruise_control.c' and 'cruise_control.h', where I haven't been able to confirm the delay for engaging CC.
 
I think the mod could be warranted if bluOSEC is used.

Then the 5v for the bluetooth module could be taken directly from the 5v rail without using a seperate converter.
 
Yes, that was the idea, have proper 5V supply even for HC-05, along with the rest
 
iaval said:
Yes, that was the idea, have proper 5V supply even for HC-05, along with the rest

Ah, ok, then it makes more sense. Where do you plan to put the hc-05 module? I think it should be outside the controller or else the radio signal will be shielded by a farraday cage.

The way i do it is as follows: as said before I use a 15/12v buck converter that powers the 15v rails. This is placed behind the ‘key lock’ so it is only powered when I switch on the ‘ignition’ key.

For the hc-05 module I use the 5v version of the same buck converter. This one is powered by the lcd connector and is also only powered when the ignition key is on. So no power losses when the key is switched off; only the bms is using a tiny bit of power. I can leave the battery idle for months if I want/need to.

The 5v buck converter and hc-05 module can be nicely packed together in a custom Bluetooth module. See example pictures of my simple but effective creations. I use some 104j cbb capacitors to filter out noise on the 5v and 12v power supply lines. This seems to work well; no loss of Bluetooth connections. Off topic: i also put some heatsinks on all key components of the controller (cpu, phase amp sensor, 5v power supply) just to be sure.

There are many solutions possible; you could indeed place the 5v buck inside the controller and have a 5v line exiting the controller to power an external hc-05.
 

Attachments

  • 56677410-6727-4ACC-BE9D-E685A87BF22B.jpeg
    56677410-6727-4ACC-BE9D-E685A87BF22B.jpeg
    1.5 MB · Views: 2,727
  • 3FC2445E-A0D3-410E-9AA3-6EFAEE57A5E9.jpeg
    3FC2445E-A0D3-410E-9AA3-6EFAEE57A5E9.jpeg
    1.6 MB · Views: 2,727
  • BA210785-C4C9-4659-B3DA-3248E291FB85.jpeg
    BA210785-C4C9-4659-B3DA-3248E291FB85.jpeg
    2.4 MB · Views: 2,727
Iambuilderman said:
iaval said:
Yes, that was the idea, have proper 5V supply even for HC-05, along with the rest

Ah, ok, then it makes more sense. Where do you plan to put the hc-05 module? I think it should be outside the controller or else the radio signal will be shielded by a farraday cage.
I put it inside the enclosure, due to better waterproofing on the inside, glued using thermally conductive compound for better heat dissipation. No issues with signal, manages 5m radius without issues.
Yep, I have mine also packed together in a similar fashion.
 
stancecoke said:
kgff said:
-Does it mean I that I need to disassemble the motor?

No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.

regards
stancecoke

I desperately looking for such PCB board design. It will solve me my problem with STM32f103c8 Lishui FOC controller and my 2 e.bike sensorless wheels.

I tried to google "Back EMF to HALL signall convertor/emulator" converters ideas , maybe Arduino boards? But no luck at the moment.

Can this idea be done within one Lishui stm32f103c8 controller with 3 low side shunt resistors? I mean for detecting BEMF and convert to HALL signall.

Thanks for any advise.

Fluct
 
Fluctuator said:
Can this idea be done within one Lishui stm32f103c8 controller with 3 low side shunt resistors?
No, the Lishui project works in FOC commutation. The 'trick' with the BEMF on the floating phase only works with 6 step commutation.

regards
stancecoke
 
Back
Top