Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
sp1n4d0   100 µW

100 µW
Posts: 9
Joined: Jun 13 2019 6:49pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by sp1n4d0 » Dec 05 2019 6:45am

You should backup your stock firmware before flashing anything.
If for some reason you don't have a backup, this tutorial has links for all the stock firmware files https://www.eco-ebike.com/blogs/eco-cyc ... rogramming

wpenner   100 W

100 W
Posts: 103
Joined: May 10 2018 3:27pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by wpenner » Dec 05 2019 1:21pm

wpenner wrote:
Oct 29 2019 5:29pm
wpenner wrote:
Oct 29 2019 10:32am
Elinx wrote:
Sep 27 2019 12:43am
danielson wrote:
Sep 26 2019 8:53pm
I'm using the V19 and 3.7. ........
v. 19C is the latest.
Version 19A and B has this stil this bug.
So, if you want to prevent the same problem, check thoroughly if you have the "C" version of the firmware.
The java-configurator v3.7 is the same for all.
I'm on V19c and had this happen twice now. Motor was still cool and not anywhere near temperature limit. Motor kept pushing me even though i stopped peddling. Speedometer was locked at 13.7km/h on the screen. Up and down buttons change assist level on screen but motor kept pushing. Holding down power button for three seconds stopped it.
It does not happen often. Maybe once every 60 power cycles. Possibly related to adjusting assist level while screen is still loading, as last two times it happened within 30 seconds of starting my commute. Maybe i'm somehow turning on walk assist or something, not sure how to do that. Does the km/h on the screen stay stuck when walk assist is on; when i experience this "glitch" the km/h value is stuck static on the screen.
I had this happen again today half way through a ride. I was not pushing any buttons on the display. Bike was fine for 5 minutes of riding, then all of a sudden got stuck powered on. Used the button on the display to power cycle it. I'll read through this thread, as I've been away for a while and try a new version out.

adrian009   100 µW

100 µW
Posts: 8
Joined: Oct 22 2016 1:21pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by adrian009 » Dec 06 2019 1:39am

sp1n4d0 wrote:
Dec 05 2019 6:45am
You should backup your stock firmware before flashing anything.
If for some reason you don't have a backup, this tutorial has links for all the stock firmware files https://www.eco-ebike.com/blogs/eco-cyc ... rogramming
Thank You for link and patient. I just read entire thread and got all answers, mea culpa. I probably use Ackmania's fork and post results soon :) Stock coaster brake firmware has some delay: when in high cadence, motor dont stop immediately so Im hoping to fix this. Great forum!

thineight   100 W

100 W
Posts: 228
Joined: Oct 05 2018 3:53am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by thineight » Dec 07 2019 3:46am

famichiki wrote:
Dec 04 2019 6:21pm
stancecoke wrote:
Dec 04 2019 4:57am
famichiki wrote:
Dec 04 2019 4:08am
So because of that then your first suggestion at line 685 didn't work.
OK, it seems, that the processor runs out of time. We had similar problems in the kunteng project. We replaced floating point arithmetics with integer arithmetics and replaced divisions with right shifts, where ever possible, that solved the issues.

Casainho and I (in the Kunteng project) have taken different paths in the way of controlling the duty cycle more than one year ago.
So I'm not really familiar with his recent code and I'm not motivated to do more than giving a few "quick and dirty" hints like I did above.

regards
stancecoke
No problem, if you have any more ideas please let me know. I'd be really interested to see how 0.20 performs, but the factory firmware also had an overrun problem so I hope it is able to be corrected.
As far as I can tell Buba put a lot of effort in the v0.20, making clearer and increasing the resolution.
To me it is the best ever release, of course to date it works only with the lcd3 display.
It should be great if marcoq will take it as base for the interface development.

I remember in one of the v.20 beta I reported a click from the motor when you stop pedalling. It was sorted pretty easily and quickly.
viewtopic.php?f=30&t=93818&p=1488997&hi ... d#p1488997
If interested you can see the differences between beta6 and beta7 to isolate the solution.
Cheers
MTB KTM Ultra 29" - City bike DAYTONA 28"

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Dec 09 2019 7:27am

This thread... :confused: Could somebody please fix the assist level 3 in maroq's version? The only issue I've had with his last release is that the engine activates itself when going downhill.

User avatar
stancecoke   100 kW

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 09 2019 3:37pm

I've copied ackmaniacs bugfix for level 3 to my fork of marcoqs vM0.19.C.
https://github.com/stancecoke/TSDZ2-Sma ... aebe82b93a

So download that repo and try if the problem is solved.
https://github.com/stancecoke/TSDZ2-Sma ... D6-display

regards
stancecoke

mbrusa   10 W

10 W
Posts: 95
Joined: Dec 11 2019 12:13am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by mbrusa » Dec 11 2019 3:24am

Hello is my first post here.
I saw the change.
No good, fix level 3 but emtb doesn't work anymore.
This is the modified code
fix_level_3.jpg
fix_level_3.jpg (52.03 KiB) Viewed 2170 times
regards
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

User avatar
stancecoke   100 kW

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 11 2019 5:50am

Welcome to the forum! Nice to see you here :D

OK, I see, ackmaniacs bugfix overwrites the result of the emtb-calculations.
I fixed it at github in another way than you suggested, should do the same, but I'm not sure, if it works.

https://github.com/stancecoke/TSDZ2-Sma ... a2587fcfdd

regards
stancecoke

mbrusa   10 W

10 W
Posts: 95
Joined: Dec 11 2019 12:13am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by mbrusa » Dec 11 2019 7:20am

Ok, it's the same!

regards
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

cejean   100 µW

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by cejean » Dec 14 2019 6:07am

@ mbrusa welcome here :thumb:
Thanks for helping.

Is level 3 emtb now working with this update?

mbrusa   10 W

10 W
Posts: 95
Joined: Dec 11 2019 12:13am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by mbrusa » Dec 14 2019 8:01am

Yes, it should work.

regards
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

godofglow   10 mW

10 mW
Posts: 23
Joined: Oct 19 2019 2:46am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by godofglow » Dec 15 2019 2:31am

I still try to find an overview of the current versions and repos :-D

currently it seems that the repo from stancecoke is the most supported repo and alive :o

@stancecoke:
Do you plan the merge the motor.-current regulation to your repo?

@mbrusa:
Why not using github for your rcode?

@all:
Should we set up a new /clean repo which is not forked from qmaro?
Or integrate the adaption at https://github.com/OpenSource-EBike-fir ... mart-EBike ?

User avatar
stancecoke   100 kW

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 15 2019 6:39am

godofglow wrote:
Dec 15 2019 2:31am
@stancecoke:
Do you plan the merge the motor.-current regulation to your repo?
No. I'm not using a TSDZ2. My fork is just a service for marcoq. My proposal was to use the wiki page as the central platform for all developers to explain the differences and advantages of their own forks and publish the links to their repos. No one but casainho followed, so far :-(
Anyone with a github account can edit and add pages to the wiki...

Regards
stancecoke

mbrusa   10 W

10 W
Posts: 95
Joined: Dec 11 2019 12:13am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by mbrusa » Dec 15 2019 3:50pm

My intention was not to make another fork, but to propose a change to display useful data on the original displays, so that marcoq can add it to its next version.
I don't know GitHub, I can learn ...
Sorry for automatic translation
Regards
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

galaxissurfer   1 µW

1 µW
Posts: 2
Joined: Nov 05 2019 4:12am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by galaxissurfer » Dec 18 2019 12:55am

OK, I see, ackmaniacs bugfix overwrites the result of the emtb-calculations.
I fixed it at github in another way than you suggested, should do the same, but I'm not sure, if it works.

https://github.com/stancecoke/TSDZ2-Sma ... a2587fcfdd


this Software is very very good! i use the vlcd6. No Problems and many Power! thanks

famichiki   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by famichiki » Dec 19 2019 7:38pm

Does anyone know exactly what version Marcoq's fork is based on? It's very strange.

Some variable names were last used in v0.19.0-beta1 before being renamed in v0.19.0-beta2.. but then it does contain some code changes that appeared later. :?:

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 21 2019 5:43am

famichiki wrote:
Dec 19 2019 7:38pm
Does anyone know exactly what version Marcoq's fork is based on?.....
For what I know Marcoq has used the stable version of v.0.19.
But because he has released v0.19A, v0.19B, v0.19C, it could be that he changed some things.

I admire your perseverance to find the solution for your problems that you have find in all vlcd versions. (marcoq, demion, ackmaniac). But if I read your complains in the other topic:
famichiki wrote:
Dec 19 2019 8:02am
...motor overrun and strange kick of power sometimes after stopping pedalling. Right now I need to wait a few seconds after stopping pedalling to change gear smoothly. However momentary braking cuts power instantly and smoothly. The problem is that after releasing the brake the overrun can restart, and also can still get that strange kick......
It looks like the complains I read here by toñocid. This was a hardware problem.
...
.When you press the pedal and stop the motor continue working a time
.you feel more power assist than normal


FYI (Source):
It is possible to measure torque with vlcd5/6, XH18 too with the latest release of mbrusa
For comparision with wiki you need to do a calculation of the measured values. (x10/4)

EDIT:
mbrusa made an update that doesn't need the calculation anymore.

To consider:
All vlcd versions are based on v.0.19. Marcoq has annouced he is working on a v0.20 configurator too, but it will be a matter of time to be released.
Demion has made in the past a vlcd release of v.018 and v0.19 without any modifications on the original OSF, but with replacement of only two files (config.h and ebike_app.c). (like mbrusa does too with his additions for marcoq's v0.19C).
I know too little about coding to judge whether this is also possible for v0.20 OSF without deep digging.
Last edited by Elinx on Dec 25 2019 6:12am, edited 1 time in total.

famichiki   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by famichiki » Dec 21 2019 4:33pm

Elinx wrote:
Dec 21 2019 5:43am
For what I know Marcoq has used the stable version of v.0.19.
Thanks for all that info! My motor has had these issues since new, but it's certainly a possibility after reading the experiences of others. I will see if I can get a torque reading displayed on the VLCD5, it will help with the diagnosis. I feel that the torque sensor is not sensitive enough at the lower end, and it does not take much pedal pressure to reach maximum assist.

After modifying the code I have managed to get the overrun down to an acceptable duration. So far I haven't experienced any continual running, but no matter what I try I can't get the kick of power to go away that sometimes happens about a second after stopping pedalling. I set a display error code to show when duty cycle is zero, and it seems to relate to the duty cycle sometimes not being pulled down to zero properly, even though the motor has stopped running.

godofglow   10 mW

10 mW
Posts: 23
Joined: Oct 19 2019 2:46am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by godofglow » Dec 25 2019 4:57am

famichiki wrote:
Dec 19 2019 7:38pm
Does anyone know exactly what version Marcoq's fork is based on? It's very strange.

Some variable names were last used in v0.19.0-beta1 before being renamed in v0.19.0-beta2.. but then it does contain some code changes that appeared later. :?:
Yes, still confusing.
I still think there is a need of a clean fork from https://github.com/OpenSource-EBike-fir ... mart-EBike needed.
With the source of the java configurator.
Still confused why marco is not using github as a clean forked repo with all sources :| :?:

I really like ti use the HX18 display, but we definitly should find a way to manage all these repos.
I currently use the fork from Achmaniac (because motor current control sounds logical for me) but I am sacred about upcoming updates, features from OSF (https://github.com/OpenSource-EBike-fir ... mart-EBike)

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 25 2019 5:52am

godofglow wrote:
Dec 25 2019 4:57am
Yes, still confusing.
I still think there is a need of a clean fork ...
....
With the source of the java configurator.
Still confused why marco is not using github as a clean forked repo with all sources...
You can wish what you want, but the developer decide how to publish.
The java configurator is closed source by Marcoq.
Marco doesn't use github anymore and communicates mostly on Italian Jobike forum in one tsdz2 topic. (So it is reasonable central.)
Why? Only he knows. (language?, time? etc.)

I'm happy with it. I use G-translate and have the latest versions and mods of Marcoq's fork.

So if you want a clean fork on Github, you have to do it yourself (like Demion did in the past) or find a developer.

chri27.5   10 mW

10 mW
Posts: 34
Joined: Jan 25 2019 9:46am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by chri27.5 » Dec 25 2019 8:03am

Finalmente sono riuscito a capire perché ci sono differenze di potenza tra motore, ho tre motori che uso, ma solamente uno eroga potenza da vendere, questa cosa non riuscivo proprio ad accettarla, oggi grazie a Mbrusa che ha permesso di leggere il valore del sensore di torque posso affermare che i motori sono tutti uguali ma la differenza la fa la lettura del sensore che poi trasmette i dati alla centralina e di conseguenza eroga potenza.
La potenza che poi riscontriamo quando si utilizza la bici, e ci fa capire le differenze di spinta tra motori.
Vi posto quattro foto,
due dove si legge il valore a pedali orizzontali a vuoto,
e due in piedi sui pedali imprimendo la forza massima.
Attachments
S91225-093058.jpg
S91225-093058.jpg (167.41 KiB) Viewed 1297 times
S91225-093112.jpg
S91225-093112.jpg (159.66 KiB) Viewed 1297 times
S91225-093130.jpg
S91225-093130.jpg (188.35 KiB) Viewed 1297 times
S91225-093207.jpg
S91225-093207.jpg (154.46 KiB) Viewed 1297 times

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 25 2019 10:51am

chri27.5 wrote:
Dec 25 2019 8:03am
Finalmente sono riuscito a capire perché ci sono differenze di potenza tra motore ..............
Grazie Chri27.5...
For easier reading translated with Google Translate:
_____________________
Finally I managed to understand why there are differences in power between the engines.
I have three engines that I use, but only one delivers power enough.
This thing I just could not accept.
Today thanks to Mbrusa who allowed to read the sensor value of torque I can say that the motors are all the same but the difference is made by reading the sensor which transmits the data to the control unit and consequently delivers power.
The power that we then find when using the bike, and makes us understand the differences in thrust between engines.

I'll post four photos,
two where the value is read with horizontal empty pedals,
and two standing on the pedals imparting maximum force.

_____________________
link to this addition of mbrusa

User avatar
stancecoke   100 kW

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 25 2019 11:33am

Elinx wrote:
Dec 25 2019 5:52am
You can wish what you want, but the developer decide how to publish.
The java configurator is closed source by Marcoq.
Marcoq used the java-code of the Kunteng project as starting point for his configurator. I don't think he wants to keep his source code secret, but nobody has asked for it yet.

regards
stancecoke

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 25 2019 12:07pm

stancecoke wrote:
Dec 25 2019 11:33am
.... I don't think he wants to keep his source code secret, but nobody has asked for it yet.
-
You could be right, it is possible that nobody has asked this on "Endless" or on "Jobike".
But it could be also that Marcoq hasn't answered this question yet.

For me it isn't clear. If I read this message after starting the configurator I get the impression it isn't open software:
MarcoqMessage.jpg
MarcoqMessage.jpg (26.68 KiB) Viewed 1256 times
casainho and Ackmaniac has asked at qMarco's Github about the Java tool, but the answer to casainho is a link to the firmware on your Github, not the source of the Java tool.

For me (as not a developer), I respect the choices of developers. They problably have their reasons why they handle as they do.
I'm grateful for what they do to make this available to everyone.

godofglow   10 mW

10 mW
Posts: 23
Joined: Oct 19 2019 2:46am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by godofglow » Dec 26 2019 1:11am

stancecoke wrote:
Dec 25 2019 11:33am
Elinx wrote:
Dec 25 2019 5:52am
You can wish what you want, but the developer decide how to publish.
The java configurator is closed source by Marcoq.
Marcoq used the java-code of the Kunteng project as starting point for his configurator. I don't think he wants to keep his source code secret, but nobody has asked for it yet.

regards
stancecoke
oh, that is definitly interesting.

@stanecoke: do you update/merge your repo everytime if there is a new release from marco?

Post Reply