Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

I've built a new "empty" Java configuation tool prototype with two tabs for parameter definitions.
I added the .form file to the repo too, so it is very easy to edit the graphical elements on the program interface by drag and drop with the netbeans IDE.

https://github.com/stancecoke/BMSBattery_S_controllers_firmware/tree/JavaToolPrototype/tools/JavaConfigurator/src

regards
stancecoke



View attachment 1
 
stancecoke said:
I've built a new "empty" Java configuation tool prototype with two tabs for parameter definitions.

Looks perfect for separating basic and advanced settings. I like the one-step compile & flash button too. :thumb:
 
famichiki said:
I like the one-step compile & flash button too. :thumb:

The one step compiling+flashing is no matter of the GUI but of the batch files.

After some trials: :D
As marcoq deletes the config.h after compiling, you have to call the configurator_program.bat from the configurator_compile.bat

Code:
@echo off
PATH = %PATH%;C:\SDCC\usr\local\bin;%~dp0..\..\tools\cygwin\bin

make -f Makefile_ihx_windows clean
if errorlevel == 1 goto FAIL

:: pass batch file parameters, e.g. THROTTLE=0
make -f Makefile_ihx_windows %*
if errorlevel == 1 goto FAIL

configurator_program.bat

:PASS
goto EXIT
:FAIL
pause
:EXIT
exit
::pause

You have to add (uncomment) the path to the STVP manually in the configurator_program.bat:

Code:
@echo off
PATH = %PATH%;C:\Program Files (x86)\STMicroelectronics\st_toolset\stvp

STVP_CmdLine -BoardName=ST-LINK -ProgMode=SWIM -Port=USB -Device=STM8S105x6 -FileOption=option_no_prot.ihx -verbose -verif -no_loop
if errorlevel == 1 goto FAIL

STVP_CmdLine -BoardName=ST-LINK -ProgMode=SWIM -Port=USB -Device=STM8S105x6 -FileProg=main.ihx -FileData=data.ihx -FileOption=option_no_prot.ihx -verbose -no_loop -verif -no_warn_protect
if errorlevel == 1 goto FAIL

::STVP_CmdLine -BoardName=ST-LINK -ProgMode=SWIM -Port=USB -Device=STM8S105x6 -FileProg=main.ihx -FileData=data.ihx -FileOption=option_prot.ihx -verbose -no_loop -no_verif -no_warn_protect
::if errorlevel == 1 goto FAIL

:PASS
goto EXIT
:FAIL
pause
:EXIT
exit

Now it flashes the hex file automatically, if you click the complile-button in the GUI

regards
stancecoke
 
Stancecoke, Just for my understanding, what is the intent of this "revised" configurator?
Having all the parameters in a text file ready to edit instead of embedded in a Java tool?

Many thanks :wink:
 
thineight said:
what is the intent of this "revised" configurator?

This is just a suggestion to help people like demion and mbrusa get started with GUI programming, especially with the drag and drop editing of graphical elements. It is very tedious to program all this purely via the source code.

thineight said:
Having all the parameters in a text file ready to edit instead of embedded in a Java tool?
The config.h is an elementary part of the source code. I have no idea why marcoq deletes it after compiling.
If you delete or comment out this lines from marcoqs java code (and build the new .jar file), you will see the content of the config.h after comipiling, too:

Code:
// Delete config.h
			Files.deleteIfExists(Paths.get("src/controller/config.h"));

			// Create empty file config.h
			PrintWriter pWriter = null;
			pWriter = new PrintWriter(new BufferedWriter(new FileWriter("src/controller/config.h")));
			pWriter.println("/*\r\n"
					+ " * config.h\r\n"
					+ " *\r\n"
					+ " *  Automatically created by TSDZ2 Controller's Parameters Configurator\r\n"
					+ " *  Author: marcoq\r\n"
					+ " */\r\n"
					+ "\r\n"
					+ "#ifndef CONFIG_H_\r\n"
					+ "#define CONFIG_H_\r\n"
					+ "\r\n#endif /* CONFIG_H_ */");
			
			// Close file config.h
			if(pWriter != null)
			{
				pWriter.flush();
				pWriter.close();
			}



regards
stancecoke
 
stancecoke said:
I've built a new "empty" Java configuation tool prototype with two tabs for parameter definitions.
I added the .form file to the repo too, so it is very easy to edit the graphical elements on the program interface by drag and drop with the netbeans IDE.

https://github.com/stancecoke/BMSBattery_S_controllers_firmware/tree/JavaToolPrototype/tools/JavaConfigurator/src

regards
stancecoke

NetbeansDesktop.PNG

ConfiguratorPrototype at runtime.PNG

+1 :)
 
What happend woith the Git-repo and all forks?

https://github.com/qmarco/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/

@stancecoke:
- I saw your post in the italia forum
- Make it sense to start now a new fork (incl. a new GUI tool) based on the https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike repo?
 
godofglow said:
What happend with the Git-repo and all forks?
The fork of ackmaniac (and your own :)) and several others still exist.

https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/network/members

If someone of the fork owners read this: Please add marcoqs java source file to your repos! Thank you!

regards
stancecoke
 
stancecoke said:
godofglow said:
What happend with the Git-repo and all forks?
The fork of ackmaniac (and your own :)) and several others still exist.

https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/network/members

If someone of the fork owners read this: Please add marcoqs java source file to your repos! Thank you!

regards
stancecoke

Who is elem01?
Makes it sense to open now a new clean repo (fork/branch from casainho) with the new beginning GUI from you?
Could be much more easier to maintain all the code for the future - or I am wrong?
 
chri27.5 said:
Hi Elinx,
I just made the calibration of the hardware sensor, thanks to Mbrusa I was able to read the ADC values, when empty it read 49.2 and 62.1 with the maximum force applied on the crank in a horizontal position, this calibration I did because having a reading field very narrow the engine had a bad performance, it could only be used in sport / turbo.
After calibration the no-load values ​​are 25.0 and 65.0 with maximum applied force.
I highly recommend you to calibrate it because after calibration the engine works perfectly, now I can use all 4 assistance levels without any problem

Hi Chri27.5,
Can you please tell me how did you put back the torque sensor on the motor. I really need some details since mine is broken.
More details in here: https://endless-sphere.com/forums/viewtopic.php?f=28&t=79788&p=1520207#p1520207
How are you making the coil ring with springs to stay in place while you have to force add the second part of the sensor?

Thanks!
 
maximusdm said:
chri27.5 said:
Hi Elinx,
I just made the calibration of the hardware sensor, thanks to Mbrusa I was able to read the ADC values, when empty it read 49.2 and 62.1 with the maximum force applied on the crank in a horizontal position, this calibration I did because having a reading field very narrow the engine had a bad performance, it could only be used in sport / turbo.
After calibration the no-load values ​​are 25.0 and 65.0 with maximum applied force.
I highly recommend you to calibrate it because after calibration the engine works perfectly, now I can use all 4 assistance levels without any problem

Hi Chri27.5,
Can you please tell me how did you put back the torque sensor on the motor. I really need some details since mine is broken.
More details in here: https://endless-sphere.com/forums/viewtopic.php?f=28&t=79788&p=1520207#p1520207
How are you making the coil ring with springs to stay in place while you have to force add the second part of the sensor?

Thanks!
Hello,
for assembly, position the motor / bike horizontally, then put a little grease on the springs and position them in the special oval slots, then place the new ring in position.
At this point you can choose two ways to mount the other part of the sensor:
In the first way it takes two people, you can have the new ring held on the motor case by one person using two small tools, at this point you can push the sensor in small strokes, when the sensor arrives against the tools they must be removed and you can finish pushing until the end of the bar.

The second way is a little more annoying if you don't have anyone to help you keep the disc down, don't despair you can also mount it by being careful,
it must be put a lot of fat behind the new disk so it will remain glued for a few seconds, test first and check the adherence time, done this you will have to be quick to tap the other part of the sensor, be careful with the first one. tap verifies that everything is centered.
I succeeded in both ways without problem.
 
What is the latest most stable .hex file to suit 36v 350w motor?

And where can I get it from?

What is the most simple way to change my low voltage cut off?

I have 36v 350w tsdz2

Motor cuts off at 35.5v battery voltage now

I want to cut off at 29v. How do I change this simply?

Thanks
 
Chewy said:
What is the latest most stable .hex file to suit 36v 350w motor?

And where can I get it from?
The latest (v0.19Cv3.7) of marcoq
Info about other releases and configuration manual
You must start the "all in one" Java Gui "jar" file, then setup your settings, compile your personal hex file, program, done
The difference with the original OSF is that all settings must be setup before and flashed to the controller, that is why you need to compile first.


About the battery cutoff, you can set this in the Java Gui, but the real cutoff depends of the specs. of the used li-ion cells and the cut-off setting of the BMS too. Maybe 29V isn't possible.
 
Thanks, I need to flash using the STVP as the .Jar compiler does not work on my PC, which is why I need the latest .hex file for a stable version.


Can I just flash TDSZ2_Controller_vM0.19.C.hex file using STVP?

Thanks
 
Chewy said:
Thanks, I need to flash using the STVP as the .Jar compiler does not work on my PC, which is why I need the latest .hex file for a stable version.
You have to install the JRE runtime for running Jar files.
But it is also possible to use the methode of Demion

Edit a config.h file with notepad and compile the complete source with SDCC
If you see a picture of the java Gui, you know wich values you can write in config.h



I have attached a config.h file for the marcoq release that you can edit for your parameters that otherwise where entered in the Java Gui.
View attachment config.h
 
Is it not possible to flash TDSZ2_Controller_vM0.19.C.hex file using STVP?
 
Chewy said:
Is it not possible to flash TDSZ2_Controller_vM0.19.C.hex file using STVP?

Once again, each hex files from marcoq and its branches (i.e. for original displays) includes the settings for the specific user.
You need to compile your own hex.. or obtain a hex files with the same settings you need for your case.
Quick question: do you have one of the original displays or one of the alternative ones (kt-lcd3, 850c, sw102)?
 
I have the VLCD6 display.

I was under the impression that Marqoc settings suited the 36v motor?

All I really need is the original .hex file with the LVC changed to 29v (battery BMS 30v.)

The problem is I only get half range out of my battery as the motor turns off at 35.5v.

Thanks
 
Chewy said:
Is it not possible to flash TDSZ2_Controller_vM0.19.C.hex file using STVP?
Yes, but first you must compile your personal hex file with sdcc, because you can't configure the settings with the display.
These personal settings you must insert the config.h file.

That is why using the all-in-one Java Gui is easier to use, because compiling and programming is automated.
 
Sorry, I am very new to programming.

What personal setting would I be inserting in the config.h file?

Why cant I just use the settings in TDSZ2_Controller_vM0.19.C.hex?
 
Chewy said:
Sorry, I am very new to programming.

What personal setting would I be inserting in the config.h file?

Why cant I just use the settings in TDSZ2_Controller_vM0.19.C.hex?
Because it is unknown what the settings are inside.
You want to edit at least the support of the four levels and the power cut-off.
Normally this an easy job in the Java gui and the configurator manual, were all settings are explaned.
For that you must install JRE, SDCC and STVP
JRE runtimes for Java gui, SDCC for compiling and STVP for programming.
JRE runs automatic if you start the JAR file. SDCC and STVP are running automatic by the Java Gui. So that is realy the most easy job.

If you want to edit config.h the best way is to look at the same time to a picture of the Java Gui, so you can compare the settings with the configurator-manual and edit config.h values with notepad.
After that you copy the config.h file into the ../src/controller directory. Than you can run sequencely the compile.bat and program.bat files. For this method you need only to install SDCC and STVP.
 
Elinx said:
.


About the battery cutoff, you can set this in the Java Gui, but the real cutoff depends of the specs. of the used li-ion cells and the cut-off setting of the BMS too. Maybe 29V isn't possible.

You were correct, I ran the battery on a light globe until the bms shut it off at 35v.

Do you know if it is possible to change the LVC on a battery bms?
 
You need to look at what BMS you are having. The more intellegent ones have a serial interface or a bluetooth interface that permits to monitor the cell groups and allows to adjust some of the parameters. IMHO it's a feature that shouldn't be optional for a BMS board.
 
Back
Top