TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Electric Motors and Controllers
buba   100 W

100 W
Posts: 205
Joined: Aug 31 2018 12:36am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by buba » Feb 14 2019 6:56pm

Quick update:
----------------------------------------------

I am back from the longer than planned weekend trip and I resumed development today. Just have to test the last changes I made today and then I will release a beta version and also pull request the most recent changes to the official master branch. I look forward to hear how to make this version even better!

I am still struggling with program space so can not promise anything. But just the fact that it was possible to develop the changes listed below is something to celebrate! Large chunks of code have been rewritten and optimized to make room. Casainho has already reviewed and accepted all submitted changes to the official branch.


Here are some of the changes:
----------------------------------------------
* Added a new sub field in the odometer field temporarily called Energy where user will see energy consumption and estimated range

* Added a function that measures and calculates consumed watt-hours per traveled distance since power on

* Added function that estimates range since power on depending on how much capacity is left

* More accurate watt-hour measurement

* More accurate time measurement

* Safer Walk Assist and Cruise

* Added option to enable or disable motor power limit quick-set-menu

* Added option to set motor power limit in the configuration menu

* Merged previous configuration menu LCD Setup with configuration menu General Setup for better and faster setup. This also optimizes program size

* Added option that enables user to enable or disable display of motor temperature in the odometer field

* Changed order in the Main Screen Setup menu in the configuration menu

* Changed order in the odometer field

* Added two new Main Screen Setup items

* Heavily optimized code size and speed

* Cleaned up code and comments

* Created wiki that has been updated with all the changes:
https://github.com/OpenSource-EBike-fir ... 9.0-(BETA)
Last edited by buba on Feb 14 2019 7:15pm, edited 3 times in total.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   100 W

100 W
Posts: 205
Joined: Aug 31 2018 12:36am

Re: Open Source Firmware Tutorial

Post by buba » Feb 14 2019 7:10pm

tomtom50 wrote:
Feb 09 2019 12:51pm
A lot of people, including me, found upgrading to open source firmware difficult, because the information is spread out over two threads with over 200 pages between them. I also needed the excellent github information and jbalat's videos, and those resources weren't immediately clear to me as I went through the ES threads.

Here is my attempt at a comprehensive tutorial for installing Open-Source firmware with KT-LCD3 and also flashing stock firmware. It doesn't cover everything. I haven't tried marcoq's method of installing OSF with the VLCD5. I didn't cover installing a temperature sensor. The waterproof connectorized cable is for an 8-pin system, etc.

I think it is pretty complete and good for someone new who has never before dealt with connecting to embedded processors. I wrote it before I became so comfortable with the process that I would glide over things that would not be obvious to newcomers.

Revise & re-post as you like. I hope it works for others.
Open Source and Stock Firmware Tutorial.doc
Great job! I think and hope this will help many! :bigthumb:

Have you thought of adding your tutorial officially on GitHub? I think it would be a great tool. You have clearly put down a great deal of effort into it. If you add it on GitHub, do not forget to credit yourself.

Otherwise, I would not mind adding it myself. Would of course credit you for the work. I am a bit time constrained at the moment though.

I just want it to be readily available for everyone!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

Kisazul   1 W

1 W
Posts: 53
Joined: Jun 18 2018 10:32pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Kisazul » Feb 14 2019 8:24pm

Hello buba. I have a question. In which field can I see how much total energy was spent by the motor on my trip? I understand this data is recorded in the data energy field? Or in the battery field? I have already driven about 400 km on this motor with a new firmware, and I really like it! great job casainho and buba! But I have wishes. After the trip, I would like to know how many total watts of my physical energy (leg energy) was spent. And compare with the total expended energy of the motor. So I could compare how much I contributed to each of the trips. (For example: total physical energy: 2300 watts; motor energy: 3500 watts)

buba   100 W

100 W
Posts: 205
Joined: Aug 31 2018 12:36am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by buba » Feb 15 2019 5:03am

Hello Kisazul, thanks for the feedback!
Kisazul wrote:
Feb 14 2019 8:24pm
In which field can I see how much total energy was spent by the motor on my trip? I understand this data is recorded in the data energy field? Or in the battery field?
It is not possible to see watt-hours consumed since you started your trip. You can only see watt-hours consumed since you fully charged your battery. It is maybe possible to add another sub field that displays how many watt-hours you have consumed since system is powered on. Is that something desirable? Watt-hours consumed during a trip and watt-hours consumed since power on are different but in some cases the same.
Kisazul wrote:
Feb 14 2019 8:24pm
After the trip, I would like to know how many total watts of my physical energy (leg energy) was spent. And compare with the total expended energy of the motor. So I could compare how much I contributed to each of the trips.
...
(For example: total physical energy: 230 watt-hours; motor energy: 350 watt-hours)
That is a suggestion for a new function and there is a constraint regarding program space in the KT-LCD3. So not sure if possible to add this. Can not promise anything. But for now: the total motor energy consumed is a factor of human energy consumed. So if you know how many battery watt-hours you have consumed you can calculate the human energy consumed. Not ideal but an approximation. This only works if you use the same assist level or keep track of the assist multipliers.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

casainho   1 GW

1 GW
Posts: 3182
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Feb 15 2019 5:40am

buba wrote:
Feb 15 2019 5:03am
Hello Kisazul, thanks for the feedback!
Kisazul wrote:
Feb 14 2019 8:24pm
In which field can I see how much total energy was spent by the motor on my trip? I understand this data is recorded in the data energy field? Or in the battery field?
It is not possible to see watt-hours consumed since you started your trip. You can only see watt-hours consumed since you fully charged your battery. It is maybe possible to add another sub field that displays how many watt-hours you have consumed since system is powered on. Is that something desirable? Watt-hours consumed during a trip and watt-hours consumed since power on are different but in some cases the same.
Kisazul wrote:
Feb 14 2019 8:24pm
After the trip, I would like to know how many total watts of my physical energy (leg energy) was spent. And compare with the total expended energy of the motor. So I could compare how much I contributed to each of the trips.
...
(For example: total physical energy: 230 watt-hours; motor energy: 350 watt-hours)
That is a suggestion for a new function and there is a constraint regarding program space in the KT-LCD3. So not sure if possible to add this. Can not promise anything. But for now: the total motor energy consumed is a factor of human energy consumed. So if you know how many battery watt-hours you have consumed you can calculate the human energy consumed. Not ideal but an approximation. This only works if you use the same assist level or keep track of the assist multipliers.
I think you could close the KT-LCD3 and focus on color LCD, because it has much more memory so will be possible to add much more features with the advantage that will be easier for user to understand all that fields, since we can custom label each field.

This is just an idea because I think using to much of your time for optimizations of space may be without much interest for you. Also we should try to have something simple and easy to understand, not something complex to understand that users will avoid to use because of that.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

thineight   100 W

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

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Feb 15 2019 7:35am

buba wrote:
Feb 14 2019 6:56pm
Quick update:
----------------------------------------------

Here are some of the changes:
----------------------------------------------
* Added a new sub field in the odometer field temporarily called Energy where user will see energy consumption and estimated range

* Added a function that measures and calculates consumed watt-hours per traveled distance since power on

* Added function that estimates range since power on depending on how much capacity is left

* More accurate watt-hour measurement

* More accurate time measurement

* Safer Walk Assist and Cruise

* Added option to enable or disable motor power limit quick-set-menu

* Added option to set motor power limit in the configuration menu

* Merged previous configuration menu LCD Setup with configuration menu General Setup for better and faster setup. This also optimizes program size

* Added option that enables user to enable or disable display of motor temperature in the odometer field

* Changed order in the Main Screen Setup menu in the configuration menu

* Changed order in the odometer field

* Added two new Main Screen Setup items

* Heavily optimized code size and speed

* Cleaned up code and comments

* Created wiki that has been updated with all the changes:
https://github.com/OpenSource-EBike-fir ... 9.0-(BETA)
That's A LOT. Thanks, glad you managed to implement the distance left estimation too.
Let me read the updated wiki, will be hard to remember all the settings ;)
Is it still suggested to reset to default values from the menu coming from a .18 beta?
MTB KTM Ultra 29" - City bike DAYTONA 28"

buba   100 W

100 W
Posts: 205
Joined: Aug 31 2018 12:36am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by buba » Feb 15 2019 7:38am

Okay, anyone want to test out the 0.19.0 beta 1? :wink:

Here is a link to the hex file for the KT-LCD3:
https://drive.google.com/open?id=1kgcgk ... kDKftLnotw

Here is a link to the wiki:
https://github.com/OpenSource-EBike-fir ... 9.X-(BETA)

Here are some changes:

* Added a new sub field in the odometer field temporarily called Energy where user will see energy consumption and estimated range

* Added a function that measures and calculates consumed watt-hours per traveled distance since power on

* Added a function that estimates range since power on depending on how much capacity is left

* More accurate watt-hour measurement, do not forget to update the capacity of your battery

* More accurate time measurement

* Safer Walk Assist and Cruise

* Added option to enable or disable motor power limit quick-set-menu in the main screen

* Added option to set motor power limit in the configuration menu

* Merged previous configuration menu LCD Setup with configuration menu General Setup for better and faster setup. This also optimizes program size, see the wiki for more information

* Added option that enables user to enable or disable display of motor temperature in the odometer field

* Changed order in the Main Screen Setup menu in the configuration menu

* Changed order in the odometer field

* Added two new Main Screen Setup items

* Heavily optimized code size and speed, also cleaned up code and comments
Last edited by buba on Feb 15 2019 8:18am, edited 3 times in total.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   100 W

100 W
Posts: 205
Joined: Aug 31 2018 12:36am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by buba » Feb 15 2019 7:58am

casainho wrote:
Feb 15 2019 5:40am
I think you could close the KT-LCD3 and focus on color LCD, because it has much more memory so will be possible to add much more features with the advantage that will be easier for user to understand all that fields, since we can custom label each field.

This is just an idea because I think using to much of your time for optimizations of space may be without much interest for you. Also we should try to have something simple and easy to understand, not something complex to understand that users will avoid to use because of that.
I agree that it gets rather complex to have too many functions and options available on the KT-LCD3. I think the display will be completed in one way or another rather soon. But am really close to finish it.

I think the color LCD is a good choice for the more advanced functions and features. There are more possibilities to display data in an intuitive way. It has more room to implement new functions and features. It is also shipped with the TSDZ2 by some suppliers and therefore there is no need to make your own cables. Overall a good choice albeit more expensive.

But for now I would like to completely finish the KT-LCD3 and solve all issues/bugs, both on the display and the controller.

thineight wrote:
Feb 15 2019 7:35am
That's A LOT. Thanks, glad you managed to implement the distance left estimation too.
Let me read the updated wiki, will be hard to remember all the settings ;)
Is it still suggested to reset to default values from the menu coming from a .18 beta?
Thank you! Please try it out and let me know what you think!

You do not need to reset to default settings. Everything should work as expected. Just set the new functions/features to preferred settings and you are all set :)
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

thineight   100 W

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

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Feb 15 2019 8:19am

buba wrote:
Feb 15 2019 7:58am

Thank you! Please try it out and let me know what you think!

You do not need to reset to default settings. Everything should work as expected. Just set the new functions/features to preferred settings and you are all set :)
Good to know I can avoid to reset as setting the wheel circumference was a quite long task...

I've read the new wiki and I understand the distance left is based on the consumed Wh since last charge Vs Wh left, and the "actual consumption" is not used.
Please correct me if I'm wrong, but in this case if I consumed half battery in assistance 1 (say 50km done) and then I switch to assistance 4 (or if I start to climb a hill) the system tells me I've 50km left? This is obviously wrong because if I require more power I would run much less than 50km, right?

Some pages ago I was suggesting to adopt a sort of moving average of the actual consumption, this would update the distance left as soon as I demand more or less energy to the motor.
Maybe also a coefficient (e.g. 1.10 or 0.85) may be user defined to tune the calculated result if the real duration is
eventually greater or less than the calculated one.

Please Buba shed some light on how the function actually works.
Cheers!
MTB KTM Ultra 29" - City bike DAYTONA 28"

buba   100 W

100 W
Posts: 205
Joined: Aug 31 2018 12:36am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by buba » Feb 15 2019 8:39am

thineight wrote:
Feb 15 2019 8:19am
I've read the new wiki and I understand the distance left is based on the consumed Wh since last charge Vs Wh left, and the "actual consumption" is not used.
Please correct me if I'm wrong, but in this case if I consumed half battery in assistance 1 (say 50km done) and then I switch to assistance 4 (or if I start to climb a hill) the system tells me I've 50km left? This is obviously wrong because if I require more power I would run much less than 50km, right?

Some pages ago I was suggesting to adopt a sort of moving average of the actual consumption, this would update the distance left as soon as I demand more or less energy to the motor.
Maybe also a coefficient (e.g. 1.10 or 0.85) may be user defined to tune the calculated result if the real duration is
eventually greater or less than the calculated one.

Please Buba shed some light on how the function actually works.
Cheers!
You are correct. The function uses the remaining capacity, consumed energy and traveled distance since power on and estimates a range depending on those variables. Why implement the estimated range like this?

1. It will, in some cases, be a good average when traveling in terrain with a lot of hills as it will average out the uphill consumption with the downhill consumption, thus giving a better estimation of range than a moving average.

2. It has by far the lowest impact on program space than any other type of implementation as we are reusing variables that already exist.

But, this is hopefully only one out of many functions that will be developed. Suggestions for future updates in the coming 0.19.0 betas:

- Consumption depending on a moving average
- Estimated range depending on a moving average
- Consumption since last user reset
- Estimated range since last user reset
- Consumption since last full charge
- Estimated range since last full charge

0.19.0 is not fully developed or finished yet. I released this beta so I can get all the great user feedback!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

thineight   100 W

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

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Feb 15 2019 10:18am

buba wrote:
Feb 15 2019 8:39am
You are correct. The function uses the remaining capacity, consumed energy and traveled distance since power on and estimates a range depending on those variables. Why implement the estimated range like this?

1. It will, in some cases, be a good average when traveling in terrain with a lot of hills as it will average out the uphill consumption with the downhill consumption, thus giving a better estimation of range than a moving average.

2. It has by far the lowest impact on program space than any other type of implementation as we are reusing variables that already exist.

But, this is hopefully only one out of many functions that will be developed. Suggestions for future updates in the coming 0.19.0 betas:

- Consumption depending on a moving average
- Estimated range depending on a moving average
- Consumption since last user reset
- Estimated range since last user reset
- Consumption since last full charge
- Estimated range since last full charge

0.19.0 is not fully developed or finished yet. I released this beta so I can get all the great user feedback!
I well understand that now the key point is the low memory left, which is unfortunately a fact.
I'm sure that you gurus will understand if any further implementation is possible or not, in the meantime I try to figure out if the distance left as it is now gives an added value to me.. not sure (never seen it in other systems).
Unfortunately I'm not a programmer therefore I cannot help more than some pseudo-code :confused:
MTB KTM Ultra 29" - City bike DAYTONA 28"

andrea_104kg   10 W

10 W
Posts: 70
Joined: Mar 05 2018 5:51pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by andrea_104kg » Feb 15 2019 3:40pm

I think that unfortunately the usefulness of a function depends a lot on the type of bike, from the routes and not least from the weight of the cyclist :-( (I weigh over 108kg with backpack)
Unfortunately I live in one of the worst places .... I live on top of a hill of 300 meters and my routes consist in going down and up again from the hills, out of the way. The return is obviously on top of the hill when the battery is almost empty. It is essential for me to return with a minimum battery charge if I want to avoid heart attack :-)
In this scenario I think the only reliable charge indicator is my brain associated with the total wh consumed and the residual voltage of the battery. Any possible forecast of the remaining kilometers would be totally unreliable.
It's also a lot of fun trying to get the most out of the kilometers by estimating the battery charge, keeping your brain active :-)
The situation is very different if you use the bicycle on a paved road and on the plain.
I think it would be useful to make 2 versions, for road bikes and mtb. The mtb version should be adapted to the smallest possible display, where the essential data are only the speed and the kilometers traveled, the watt consumed and the residual voltage of the battery. Other functions, navigation, elevation gain, etc. can be assigned to a modern smartphone.
If the transition was simple also lcd05 would be better than lcd03 on a mtb.
Obviously mine are just opinions, it already works very well so with lcd03 :-)

tomtom50   100 W

100 W
Posts: 185
Joined: Jun 18 2018 10:09am

Re: Open Source Firmware Tutorial

Post by tomtom50 » Feb 15 2019 8:57pm

buba wrote:
Feb 14 2019 7:10pm
tomtom50 wrote:
Feb 09 2019 12:51pm
A lot of people, including me, found upgrading to open source firmware difficult, because the information is spread out over two threads with over 200 pages between them. I also needed the excellent github information and jbalat's videos, and those resources weren't immediately clear to me as I went through the ES threads.

Here is my attempt at a comprehensive tutorial for installing Open-Source firmware with KT-LCD3 and also flashing stock firmware. It doesn't cover everything. I haven't tried marcoq's method of installing OSF with the VLCD5. I didn't cover installing a temperature sensor. The waterproof connectorized cable is for an 8-pin system, etc.

I think it is pretty complete and good for someone new who has never before dealt with connecting to embedded processors. I wrote it before I became so comfortable with the process that I would glide over things that would not be obvious to newcomers.

Revise & re-post as you like. I hope it works for others.
Open Source and Stock Firmware Tutorial.doc
Great job! I think and hope this will help many! :bigthumb:

Have you thought of adding your tutorial officially on GitHub? I think it would be a great tool. You have clearly put down a great deal of effort into it. If you add it on GitHub, do not forget to credit yourself.

Otherwise, I would not mind adding it myself. Would of course credit you for the work. I am a bit time constrained at the moment though.

I just want it to be readily available for everyone!
Thanks. I was thinking of figuring out how to add to github, you are welcome to do it too. I have to free the time, not sure this weekend works.

tomtom50   100 W

100 W
Posts: 185
Joined: Jun 18 2018 10:09am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by tomtom50 » Feb 15 2019 9:04pm

casainho wrote:
Feb 15 2019 5:40am
I think you could close the KT-LCD3 and focus on color LCD, because it has much more memory so will be possible to add much more features with the advantage that will be easier for user to understand all that fields, since we can custom label each field.

This is just an idea because I think using to much of your time for optimizations of space may be without much interest for you. Also we should try to have something simple and easy to understand, not something complex to understand that users will avoid to use because of that.
Transitioning from KT-LCD3 to Bafang 850C would be alot easier if a new cable didn't need to be hacked.

I have seen some new TSDZ2 kits include Bafang 850C, so there must be a cable now in production. Does anyone know more?

dameri   10 W

10 W
Posts: 96
Joined: Sep 20 2018 10:57am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by dameri » Feb 16 2019 3:19am

buba wrote:
Feb 15 2019 7:38am
Okay, anyone want to test out the 0.19.0 beta 1? :wink:

Here is a link to the hex file for the KT-LCD3:
https://drive.google.com/open?id=1kgcgk ... kDKftLnotw

Here is a link to the wiki:
https://github.com/OpenSource-EBike-fir ... 9.X-(BETA)

Here are some changes:

* Added a new sub field in the odometer field temporarily called Energy where user will see energy consumption and estimated range

* Added a function that measures and calculates consumed watt-hours per traveled distance since power on

* Added a function that estimates range since power on depending on how much capacity is left

* More accurate watt-hour measurement, do not forget to update the capacity of your battery

* More accurate time measurement

* Safer Walk Assist and Cruise

* Added option to enable or disable motor power limit quick-set-menu in the main screen

* Added option to set motor power limit in the configuration menu

* Merged previous configuration menu LCD Setup with configuration menu General Setup for better and faster setup. This also optimizes program size, see the wiki for more information

* Added option that enables user to enable or disable display of motor temperature in the odometer field

* Changed order in the Main Screen Setup menu in the configuration menu

* Changed order in the odometer field

* Added two new Main Screen Setup items

* Heavily optimized code size and speed, also cleaned up code and comments
There is no need to update TSDZ2 motor? Only KT-LCD3? I tried v018.2 in motor and LCD and nothing worked. No boost, no more assistance stays same in diffirend levels alltough they was tuned to bigger values. I travelled about 20 kms and assistance fade almost away. Previous version v0.17.0 worked fine. Maby I try your beta tomorrow.

Thank you for your work developing code.

I’m also interested new color LCD.

andrea_104kg   10 W

10 W
Posts: 70
Joined: Mar 05 2018 5:51pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by andrea_104kg » Feb 16 2019 5:45am

Why this differenze? I have 18.02 and works... I no use Boost but all works.. yes there is little difference in assistence in different level But for me it's Not a really problem
Last edited by andrea_104kg on Feb 16 2019 7:35am, edited 1 time in total.

buba   100 W

100 W
Posts: 205
Joined: Aug 31 2018 12:36am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by buba » Feb 16 2019 5:46am

dameri wrote:
Feb 16 2019 3:19am
There is no need to update TSDZ2 motor? Only KT-LCD3? I tried v018.2 in motor and LCD and nothing worked. No boost, no more assistance stays same in diffirend levels alltough they was tuned to bigger values. I travelled about 20 kms and assistance fade almost away. Previous version v0.17.0 worked fine. Maby I try your beta tomorrow.

Thank you for your work developing code.

I’m also interested new color LCD.
There is no need to update the motor controller firmware. You can use version 0.18.2 for the motor controller and 0.19.0 beta 1 for the KT-LCD3 display. No problem with compatibility.

Everything should work as expected, Dameri, so do try to reinstall everything and reset to default values. Here are some tips for making a clean install:

- Scroll through the configuration menu and make sure everything is set as desired
- Make a total reset so the default values are loaded and then configure as desired

Or as Rafe suggested:
Rafe wrote:
Jan 19 2019 6:26pm
What I do and it works well for me is when I first start ST visual programmer it automatically presents pages of all zeros for both the programme memory and data memory, then I simply programme each tab with the zeros so nothing remains of the previous firmware. Then I write the new version into the programme memory.
Good luck!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

Rafe   1 W

1 W
Posts: 62
Joined: Oct 16 2018 5:56pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Rafe » Feb 16 2019 7:05am

casainho wrote:
Feb 13 2019 5:54am
Tiny LCD with bluetooh

PSWPower is selling the SW102 LCD for Bafang that seems a version of the eggrider LCD, for 45€. Seems a decent price.

Eggrider seems to use a Nordic microcontroller that includes Bluetooth.

SW102 listing on PSWPower and other online shops on aliexpress never mention Bluetooth but I found only a listing saying:

At present, this display does not have bluetooth function. If the bluetooth function is needed, it can only be customized with a batch order

Since they use a Nordic microcontroller that includes Bluetooth, I guess all this LCDs supports Bluetooth but it may be disabled/not implemented in firmware on some models.

I am being developing firmware for another ebike LCD (commercial project, not OpenSource) that uses Nordic microcontroller with Bluetooth, so I am familiar with this systems. They support the ARM GCC compiler, so would be more or less easy for me to develop for this LCD.

But the programming using bootloader on this LCD should be locked like on 850C so I think the only option is open the LCD and try solder the programming wires... let's see if is possible... I just bought 1 unit from PSWPower and should take 2 weeks to arrive.

This LCD has some characteristics many has being asking:
- small size
- Bluetooth
- cheap/medium price

Let's see if we can program it....

Image
The SW102 is interesting but like LCD3 it still does not have a clock for stand alone use, the Bluetooth enabled version is about £45 on ebay. The Chinese brand that make the SW102 Topology also make a full sized colour display with Bluetooth ds103+sw101

https://www.alibaba.com/product-detail/ ... 7cdcEuwQQM

casainho   1 GW

1 GW
Posts: 3182
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Feb 16 2019 7:30am

Thanks for the information.

I really miss Real Time Clock, I love it on 850C as during the week I always run against the clock, when I go to shop, gym, etc.

The thing is that we can't make firmware for many LCDs so we should choose the ones that will stay long on the market. SW102 seems that will be one of them because it is announced as Bafang display and seem to have most the important feature the MTB guys are asking/similar to top brands MTB ebikes. I can find many sellers for SW102 on Ebay and Aliexpress but none for that ds103+sw101...
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

dameri   10 W

10 W
Posts: 96
Joined: Sep 20 2018 10:57am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by dameri » Feb 16 2019 10:43am

andrea_104kg wrote:
Feb 16 2019 5:45am
Why this differenze? I have 18.02 and works... I no use Boost but all works.. yes there is little difference in assistence in different level But for me it's Not a really problem
I'm wondering that too. I try tomorrow metod that Rafe use and programme first with zeros and after that new firmware.

I didn't do that when I jump to next firmware and everything worked exept v18.02.

e3s   10 mW

10 mW
Posts: 32
Joined: Jan 08 2018 12:40pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by e3s » Feb 16 2019 2:09pm

recension for lcd3: too many functions. It isn't understandable what there is in the screen and what to do to change something. You need the wiki on hand. Then the screen is too big . I made a mistake buying it. I'll buy something like the lcd5. Too many functions aren't necessary. The essential is to see the level assist, the human power. optionally a simple odometer and the total human watt, in the menu a function to limit the current, but to use a lcd as a watt meter isn't necessary, that's the work of a watt meter.

andrea_104kg   10 W

10 W
Posts: 70
Joined: Mar 05 2018 5:51pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by andrea_104kg » Feb 16 2019 6:31pm

An example of difference in views, for me the wattmeter function is essential :-) as I would not be able to push up a 25kg mtb, knowing how long the battery lasts for me is the most important function. Also knowing the instantaneous consumption in watts is important because so I can limit the engine power when the absorption will be too high. I do not really care about muscular power, it's what it is, I have an electric bike because I want to be facilitated, I already know that I would not be able to do without it.
As I said they are differences of opinion :-)

User avatar
eyebyesickle   10 kW

10 kW
Posts: 654
Joined: Apr 07 2015 9:28pm
Location: Nashville

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by eyebyesickle » Feb 16 2019 8:19pm

casainho wrote:
Feb 13 2019 5:54am
Tiny LCD with bluetooh

PSWPower is selling the SW102 LCD for Bafang that seems a version of the eggrider LCD, for 45€. Seems a decent price.

Eggrider seems to use a Nordic microcontroller that includes Bluetooth.

SW102 listing on PSWPower and other online shops on aliexpress never mention Bluetooth but I found only a listing saying:

At present, this display does not have bluetooth function. If the bluetooth function is needed, it can only be customized with a batch order

Since they use a Nordic microcontroller that includes Bluetooth, I guess all this LCDs supports Bluetooth but it may be disabled/not implemented in firmware on some models.

I am being developing firmware for another ebike LCD (commercial project, not OpenSource) that uses Nordic microcontroller with Bluetooth, so I am familiar with this systems. They support the ARM GCC compiler, so would be more or less easy for me to develop for this LCD.

But the programming using bootloader on this LCD should be locked like on 850C so I think the only option is open the LCD and try solder the programming wires... let's see if is possible... I just bought 1 unit from PSWPower and should take 2 weeks to arrive.

This LCD has some characteristics many has being asking:
- small size
- Bluetooth
- cheap/medium price

Let's see if we can program it....

Image
This is the display I originally recommend and you strongly opposed if you recall. I have already done work and have these working with the TSDZ2, and a variety of functions... I'm a little surprised to see you pick this up now. What has changed? I would have sent you one for free... FYI these are one of the cheapest displays also, which is part of why I originally recommend it... It's a great solution in my opinion, which I why I pushed for it long ago

We have a batch with Bluetooth and can upgrade firmware very easily, as well as other functions if one wishes to implement... Also things like the clock are very easy, especially for someone like you... No soldering wires etc... I buy them directly from manufacturer...and have custom programming for BBS series and TSDZ2... Working on making it smoother for the open source code... But if you are now interested, it could be much easier. This is not my expertise and I have to enlist help... I could still send one if you want, just PM

casainho   1 GW

1 GW
Posts: 3182
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Feb 17 2019 2:02am

eyebyesickle wrote:
Feb 16 2019 8:19pm
casainho wrote:
Feb 13 2019 5:54am
Tiny LCD with bluetooh

PSWPower is selling the SW102 LCD for Bafang that seems a version of the eggrider LCD, for 45€. Seems a decent price.

Eggrider seems to use a Nordic microcontroller that includes Bluetooth.

SW102 listing on PSWPower and other online shops on aliexpress never mention Bluetooth but I found only a listing saying:

At present, this display does not have bluetooth function. If the bluetooth function is needed, it can only be customized with a batch order

Since they use a Nordic microcontroller that includes Bluetooth, I guess all this LCDs supports Bluetooth but it may be disabled/not implemented in firmware on some models.

I am being developing firmware for another ebike LCD (commercial project, not OpenSource) that uses Nordic microcontroller with Bluetooth, so I am familiar with this systems. They support the ARM GCC compiler, so would be more or less easy for me to develop for this LCD.

But the programming using bootloader on this LCD should be locked like on 850C so I think the only option is open the LCD and try solder the programming wires... let's see if is possible... I just bought 1 unit from PSWPower and should take 2 weeks to arrive.

This LCD has some characteristics many has being asking:
- small size
- Bluetooth
- cheap/medium price

Let's see if we can program it....

Image
This is the display I originally recommend and you strongly opposed if you recall. I have already done work and have these working with the TSDZ2, and a variety of functions... I'm a little surprised to see you pick this up now. What has changed? I would have sent you one for free... FYI these are one of the cheapest displays also, which is part of why I originally recommend it... It's a great solution in my opinion, which I why I pushed for it long ago

We have a batch with Bluetooth and can upgrade firmware very easily, as well as other functions if one wishes to implement... Also things like the clock are very easy, especially for someone like you... No soldering wires etc... I buy them directly from manufacturer...and have custom programming for BBS series and TSDZ2... Working on making it smoother for the open source code... But if you are now interested, it could be much easier. This is not my expertise and I have to enlist help... I could still send one if you want, just PM
Well, on that time, if I remember, almost no one was selling it and was expensive like 100 euros, now it is very different.

I appreciate if you can send me 1 unit, but I am only evaluate for now. Please share pictures of the internal boards, etc, that is the most important for now.

The clock needs a specific piece of hardware to keep clock working while power is disconnected. Can you please confirm that original firmware has clock??
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

michih.   1 mW

1 mW
Posts: 10
Joined: Nov 11 2018 8:33am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by michih. » Feb 17 2019 5:46am

I have a Bug in the 18.2
When i Start pedaling in odometer blinking 1 and there is no assist. The same is with the walk assist. Push the down Button bike Start and after 1-2 sec the 1 blinking and Motor stop.

When i start pedaling in a flat area is no problem....
Only on uphill....


Mfg Michael

Post Reply