Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

There is no point disassembling the engine as the cable is very short directly into the controller.

I have found sometimes that I couldn't program the unit and had to read only each part of the memory individually and program each part individually. Checking the checksum each time with the loaded program.

The other thing which I have never fully gotten to the bottom of is the read write data bit has to be changed, on some of the engines its no problem, on others it won't change and then suddenly it changes and never again is a problem.
 
I just made a small change in my version of the firmware so that the cadence is taken into account to stop the motor earlier. This way the motor stops after like 1 second. Not perfect but better than before. If you want the motor to stop even faster you can also raise the "ADC Torque Sensor Threshold" in the Torque sensor settings. This way the torque sensor is less sensitive.
 
famichiki said:
Michael B said:
Actually I rechecked this today and I need to correct that.

At 35-40 kph at moderate cadence and assist I get more like one full rotation. Yours looks more than that. I'm using a 54T narrow wide chainring.
When changing down and slowing to a stop I get virtually no over run.
The other day I must have been somewhere in between when I randomly look down and just happened to notice the half rotation over run.

Maybe the over run is 'increased' with high motor assist and high cadence?

How was the operation when you were running the stock firmware? I do suspect the problem is increased at higher assist levels and/or higher torque or cadence but I haven't had any luck determining exactly what.

I only ever did about 30 km before moving to the Marcoq firmware and then on to Ackmaniac soon after and didn't really notice.

However I was so impressed with the feel of the TSDZ2 I bought another (48V 500W) motor and put on my wifes bike. It still has the stock firmware and I've just taken it for a little ride. The chainring behaviour is the same as mine.

I think it is torque sensor related. When actually exerting some torque on the system and I stop pedalling the chainring continues on for one turn. When decelerating and changing down gears (no force on the pedals, just slowly spinning for shifting) if I stop pedalling the chainring just stops straight away.
 
Over the weekend i could test my software changes a bit more and finetuned the values.
Think it is good now, so please give it a try.
If you pedal slower than 15 revolutions per minute (4 seconds for one revolution) the motor stops assisting.
Feels good to me, so please give it a try with the latest changes.
 
michih. said:
is there somewhere a manual how to flash and configure the vlcd 6........
You don't need to flash the vlcd6 display if you want to use the Open Source Firmware with stock displays.
You have to flash the controller only with the settings you want and made before.
With the display you can change the modes and the levels you haved configured before.
For configuring and flasing you use the java configurator.

If you read back you find links to a configure manual and other configure guides.
 
Elinx said:
michih. said:
is there somewhere a manual how to flash and configure the vlcd 6........
You don't need to flash the vlcd6 display if you want to use the Open Source Firmware with stock displays.
You have to flash the controller only with the settings you want and made before.
With the display you can change the modes and the levels you haved configured before.
For configuring and flasing you use the java configurator.

If you read back you find links to a configure manual and other configure guides.

That's why I can't find anything about it 😂
ok but unfortunately can't find out how it works with the java tool

Thank you!

Mfg Michael
 
michih. said:
.....
That's why I can't find anything about it 😂
ok but unfortunately can't find out how it works with the java tool
...........
Have you seen this link?
https://endless-sphere.com/forums/viewtopic.php?f=30&t=98281&start=700#p1522483
If you go to ashrambo's blog, you can follow the complete flashing procedure.
If you only want to configure with the java gui, you can download the manual.
 
Elinx said:
michih. said:
.....
That's why I can't find anything about it 😂
ok but unfortunately can't find out how it works with the java tool
...........
Have you seen this link?
https://endless-sphere.com/forums/viewtopic.php?f=30&t=98281&start=700#p1522483
If you go to ashrambo's blog, you can follow the complete flashing procedure.
If you only want to configure with the java gui, you can download the manual.

Really? enter the values ​​in the configurator. connect the st-link to the controller, the rest goes by itself?

mfg michael
 
michih. said:
......
Really? enter the values ​​in the configurator. connect the st-link to the controller, the rest goes by itself?....
Normally, Yes

If you have installed JRE runtime and install SDCC and ST Virtual Programmer into C: (not C:/Program Files)
Start the java gui, setup your wished configuration, compile, program. Done

I advice you to make a backup first of your stock firmware with STVP
 
Yes I just installed the programs when I saw the blog with the instructions.

Thank you for your help!!

Mfg Michael
 
Elinx said:
If you have installed JRE runtime and install SDCC and ST Virtual Programmer into C: (not C:/Program Files)

It's less hassle as you say, but if installing into Program Files you can change the location at the bottom right of the configurator.

Code:
ST Visual Programmer (STVP) install directory:
"C:/Program Files (x86)/STMicroelectronics/st_toolset/stvp"
 
famichiki said:
...... if installing into Program Files you can change the location......
Ofcourse that is possible too, but when starting with this all, then this could easy been overseen.
 
For some reason changing the program path in the configurator did not work for me and I remember seeing someone else mentioning the same problem. Reinstall to C: worked right away.
 
ilu said:
... changing the program path in the configurator did not work for me ....
This is because the default directory sdcc and stvp is C:
in the Java gui you can only change stvp path.
You can change the xxx.bat files, but I think it is easier to install both programs in C:
 
Ackmaniac said:
Over the weekend i could test my software changes a bit more and finetuned the values.
Think it is good now, so please give it a try.
If you pedal slower than 15 revolutions per minute (4 seconds for one revolution) the motor stops assisting.
Feels good to me, so please give it a try with the latest changes.
It works well for me too.

I've been getting real nice ride and shifting with all your versions. Road use only though and haven't fitted the throttle.
It's hard to gauge how much better each version is, but definately I can say that none of them has been a step back.
I tend not to excessively fiddle with the buttons while riding and haven't had any weird unexpected unsafe behaviour from the motor.

Many thanks.
 
Hi folks, long time lurker, first time poster... I'm trying to get the latest Java TSDZ2 configurator working but I'm having trouble with some paths used by the 'Makefile_ihx_windows' makefile...

sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float -DTHROTTLE=0 --std-c99 --nolospre --out-fmt-ihx --debug -o../common/STM8S_StdPeriph_Lib/src/stm8s_iwdg.c ../common/STM8S_StdPeriph_Lib/src/stm8s_iwdg.c
process_begin: CreateProcess(NULL, sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float -DTHROTTLE=0 --std-c99 --nolospre --out-fmt-ihx --debug -o../common/STM8S_StdPeriph_Lib/src/stm8s_iwdg.c ../common/STM8S_StdPeriph_Lib/src/stm8s_iwdg.c, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [../common/STM8S_StdPeriph_Lib/src/stm8s_iwdg.rel] Error 2


I've checked that path is correct, the files are there.

Anyone seen this before and have a fix before I figure out how to write my parameters manually and flash the motor from Linux? :)

Cheers, Hugh
 
HughF said:
I've checked that path is correct, the files are there.

Where is your unzipped folder? Try to unzip directly to C:\ to avoid trouble with read/write permissions.

regards
stancecoke
 
stancecoke said:
HughF said:
I've checked that path is correct, the files are there.

Where is your unzipped folder? Try to unzip directly to C:\ to avoid trouble with read/write permissions.

regards
stancecoke
A few folders down from the root of C:
I'll try moving it down and report back...
 
HughF said:
stancecoke said:
HughF said:
I've checked that path is correct, the files are there.

Where is your unzipped folder? Try to unzip directly to C:\ to avoid trouble with read/write permissions.

regards
stancecoke
A few folders down from the root of C:
I'll try moving it down and report back...

Moved to the root of C:\ and the problem is the same. Do I need to install SDCC seperately or does that come with STVP and/or the configuration zip?

EDIT: Installed SDCC from sourceforge (man I hate all the pushed advertising rubbish on there these days) and compilation completes fine - but note you must do a full install of SDCC, not just the STM8 library - I tried that first and it didn't work...

Next step, try and get the drivers working for my £1.49 AliExpress STLink clone
 
Hi,

I'm trying to build and install this from the cloned git repo at https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display. Ive been through the various pages and explanations etc. setups and dev stuff. (I'm a developer, but usually in java)

Running on ubuntu 18.04, "make -f Makefile_linux all" I get an error :

stm8-size main.elf -A
make: stm8-size: Command not found

Sure enough I dont have that or `stm8-objcopy` which follows in the script.

Ive googled all afternoon, and I'm at a loss, where do I get those utilities?

Thanks
Rob
 
rob42 said:
Hi,

I'm trying to build and install this from the cloned git repo at https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display. Ive been through the various pages and explanations etc. setups and dev stuff. (I'm a developer, but usually in java)

Running on ubuntu 18.04, "make -f Makefile_linux all" I get an error :

stm8-size main.elf -A
make: stm8-size: Command not found

Sure enough I dont have that or `stm8-objcopy` which follows in the script.

Ive googled all afternoon, and I'm at a loss, where do I get those utilities?

Thanks
Rob
Hi Rob, sorry I can't help (I've tried googling and seem to end up at the same brick wall as you have), but do you have a windows machine you could use for this task? I know it is admitting defeat, but sometimes you just have to use what delivers the results unfortunately. It's a trait of the electronics industry that they tend to favour Windows with their toolchains, we get it with the Ti DSP assembler we use at work, Windows only.

After faffing about with SDCC the Java Configurator works well for me and I can at least quickly and easily build and test the various motor options.

Hugh
 
rob42 said:
Ive googled all afternoon, and I'm at a loss, where do I get those utilities?

See here:
https://stm8-binutils-gdb.sourceforge.io/

regards
stancecoke
 
Thanks, I did find that, but when I tried it I ran into all sorts of compile errors etc. I'll try again fresh and try to be more specific about errors.
Rob
 
HughF said:
rob42 said:
Hi,

I'm trying to build and install this from the cloned git repo at https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display. Ive been through the various pages and explanations etc. setups and dev stuff. (I'm a developer, but usually in java)

Running on ubuntu 18.04, "make -f Makefile_linux all" I get an error :

stm8-size main.elf -A
make: stm8-size: Command not found

Sure enough I dont have that or `stm8-objcopy` which follows in the script.

Ive googled all afternoon, and I'm at a loss, where do I get those utilities?

Thanks
Rob
Hi Rob, sorry I can't help (I've tried googling and seem to end up at the same brick wall as you have), but do you have a windows machine you could use for this task? I know it is admitting defeat, but sometimes you just have to use what delivers the results unfortunately. It's a trait of the electronics industry that they tend to favour Windows with their toolchains, we get it with the Ti DSP assembler we use at work, Windows only.

After faffing about with SDCC the Java Configurator works well for me and I can at least quickly and easily build and test the various motor options.

Hugh

I've just compiled the FW on OSX with the same dependency issues. It's actually pretty easy to solve.

- The makefile uses stm8-size to show the file size of the compiled binary, purely optional.
- The makefile uses stm8-objcopy to strip debug info and reformat the .elf file to a .hex file. This can be done by the SDCC compiler without these additional dependencies.

TLDR; What I'd recommend is to use this makefile:
https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/blob/master/TSDZ2_Controller_vM0.19.C_and_TSDZ2_Configurator_0.3.7_con_codice_0.19_Stable/src/controller/Makefile_ihx_windows

IMHO the best idea would be to make that Makefile default, not separate between linux/OSX, strip other build cruft and then upstream this in Git. TBH I need to understand a bit more about all the repo's, stakehoders, the italian forums and who is who before I put any effort into this.
 
Back
Top