Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
w0utje   100 µW

100 µW
Posts: 9
Joined: Jan 12 2020 3:02am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by w0utje » Jan 17 2020 4:53am

I've read like all the topics about the tsdz2 a lot, got 2 bikes with an tsdz2. An MTB with a 750 watt with custom firmware. Runs like a dream. Then I tried to flash a custom firmware to my normal day bike with 500watts tdz2 with throttle, tried one of marcos but I have an 48 volts engine so the e08 error came up. Yesterday I managed to get a custom firmware on it but forgot to put the amps correctly in the configurator. So I made a new file but now everytime I try to flash the check fails in the end:
Image
Before this flashing was already hard, from the 20 times pushing the button 1 time would work but now it fails all the time.
If I connect my MTB it works like a dream, can read the firmware and flashing is like a breeze.
The tsdz2 500 with throttle is a lot harder and I cant get a whole firmware on it, the motor aint working at the moment.
The st-link works fine on 2 different engine's, cables are like 8 cm. Also tried a different laptop, extra 5v line. Can anyone shed some more light on this problem?
I'm using a vlcd5 on the normal bike and a xh18 on the MTB.

cejean   100 µW

100 µW
Posts: 9
Joined: Jul 20 2019 5:41pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by cejean » Jan 17 2020 9:13am

Hoi Woutje,

Did you already try to fill all numbers wth - 0 - and after that put back the stock firmware ?

w0utje   100 µW

100 µW
Posts: 9
Joined: Jan 12 2020 3:02am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by w0utje » Jan 17 2020 10:28am

Yeah, currently there are only 0 in the readout. If i try to read it I get the same, have to push it like 25 times and if I get it shows only 0
Image
It explains why it aint working, but can not get a firmware on it. Just ordered a second st-link v2, have to wait a fair bit for it arrives. Maybe that works.

When I flash it it writes something on it, cause I can see (a piece?) of the firmware on data and memory but the motor does not work

Image
Image

I'm think of disassembling the motor to connect it straight to the controller, maybe that works correctly.
The 8 pin vlcd5 connecter seems to be different to the 6 pins display's without throttle.

Waynemarlow   1 kW

1 kW
Posts: 352
Joined: Jul 09 2016 7:22am
Location: Bucks, England

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Waynemarlow » Jan 17 2020 12:51pm

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.

Ackmaniac   10 mW

10 mW
Posts: 27
Joined: Jan 02 2017 8:30pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Ackmaniac » Jan 17 2020 9:08pm

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.

Michael B   1 mW

1 mW
Posts: 11
Joined: Oct 03 2019 10:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Michael B » Jan 20 2020 3:50am

famichiki wrote:
Jan 16 2020 7:11am
Michael B wrote:
Jan 16 2020 3:56am
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.
Last edited by Michael B on Jan 21 2020 3:48pm, edited 1 time in total.

Ackmaniac   10 mW

10 mW
Posts: 27
Joined: Jan 02 2017 8:30pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Ackmaniac » Jan 20 2020 7:01am

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.   100 mW

100 mW
Posts: 40
Joined: Nov 11 2018 8:33am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by michih. » Jan 20 2020 10:36am

is there somewhere a manual how to flash and configure the vlcd 6?

mfg michael

Elinx   100 W

100 W
Posts: 227
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Jan 20 2020 12:21pm

michih. wrote:
Jan 20 2020 10:36am
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.

michih.   100 mW

100 mW
Posts: 40
Joined: Nov 11 2018 8:33am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by michih. » Jan 20 2020 1:29pm

Elinx wrote:
Jan 20 2020 12:21pm
michih. wrote:
Jan 20 2020 10:36am
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

Elinx   100 W

100 W
Posts: 227
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Jan 20 2020 2:53pm

michih. wrote:
Jan 20 2020 1:29pm
.....
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?
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.

michih.   100 mW

100 mW
Posts: 40
Joined: Nov 11 2018 8:33am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by michih. » Jan 20 2020 3:16pm

Elinx wrote:
Jan 20 2020 2:53pm
michih. wrote:
Jan 20 2020 1:29pm
.....
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?
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

Elinx   100 W

100 W
Posts: 227
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Jan 20 2020 3:33pm

michih. wrote:
Jan 20 2020 3:16pm
......
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

michih.   100 mW

100 mW
Posts: 40
Joined: Nov 11 2018 8:33am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by michih. » Jan 20 2020 3:56pm

Yes I just installed the programs when I saw the blog with the instructions.

Thank you for your help!!

Mfg Michael

famichiki   100 W

100 W
Posts: 131
Joined: Jul 12 2019 9:00am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by famichiki » Jan 20 2020 5:59pm

Elinx wrote:
Jan 20 2020 3:33pm
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: Select all

ST Visual Programmer (STVP) install directory:
"C:/Program Files (x86)/STMicroelectronics/st_toolset/stvp"

Elinx   100 W

100 W
Posts: 227
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Jan 20 2020 6:12pm

famichiki wrote:
Jan 20 2020 5:59pm
...... 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.

ilu   1 W

1 W
Posts: 62
Joined: Oct 18 2019 10:51am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by ilu » Jan 21 2020 5:03am

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.

Elinx   100 W

100 W
Posts: 227
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Jan 21 2020 11:55am

ilu wrote:
Jan 21 2020 5:03am
... 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:

Michael B   1 mW

1 mW
Posts: 11
Joined: Oct 03 2019 10:56pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Michael B » Jan 23 2020 3:39am

Ackmaniac wrote:
Jan 20 2020 7:01am
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.

HughF   10 W

10 W
Posts: 95
Joined: Jan 23 2020 6:13pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by HughF » Jan 23 2020 6:18pm

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

User avatar
stancecoke   100 kW

100 kW
Posts: 1198
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by stancecoke » Jan 24 2020 4:51am

HughF wrote:
Jan 23 2020 6:18pm
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

HughF   10 W

10 W
Posts: 95
Joined: Jan 23 2020 6:13pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by HughF » Jan 24 2020 6:38am

stancecoke wrote:
Jan 24 2020 4:51am
HughF wrote:
Jan 23 2020 6:18pm
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   10 W

10 W
Posts: 95
Joined: Jan 23 2020 6:13pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by HughF » Jan 24 2020 6:44am

HughF wrote:
Jan 24 2020 6:38am
stancecoke wrote:
Jan 24 2020 4:51am
HughF wrote:
Jan 23 2020 6:18pm
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

rob42   1 µW

1 µW
Posts: 3
Joined: Jan 24 2020 10:25pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by rob42 » Jan 24 2020 10:33pm

Hi,

I'm trying to build and install this from the cloned git repo at https://github.com/AckmaniacSoftware/TS ... D6-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

HughF   10 W

10 W
Posts: 95
Joined: Jan 23 2020 6:13pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by HughF » Jan 25 2020 1:57am

rob42 wrote:
Jan 24 2020 10:33pm
Hi,

I'm trying to build and install this from the cloned git repo at https://github.com/AckmaniacSoftware/TS ... D6-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

Post Reply