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

Electric Motors and Controllers
buba   100 W

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

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

Post by buba » Feb 08 2019 6:54pm

perryscope wrote:
Feb 08 2019 2:47pm
buba wrote:
Feb 08 2019 1:11pm
...
But another solution is to not activate Cruise if Walk Assist is activated and vice versa. The user would have to re-press the down button to enable Cruise, and vice versa. I can implement this in the coming 0.19.0.
Yes I think that will be better.
Done! Walk Assist and Cruise are now slightly safer. Coming in version 0.19.0!
perryscope wrote:
Feb 08 2019 2:47pm
I had considered also maybe having a setting to define the cross over speed in the menu? At times when moving slowly over tricky single-track rutted terrain I have found cruise useful to keep me rolling while keeping pedals flat and clear of the ruts. Also when navigating slippy cobbles. I mentioned this a bit here

https://empoweredpeople.co.uk/2019/01/2 ... tem-part-2

At the moment I find I may be just under 8kph and get WalkAssist other time just over and get Cruise. So it would be nice to fine tune that cross over point.
I have worked really(!) hard to optimize the code for size and to make this new version the best ever. The good news is that the optimizations have been successful. The bad news is that there is still limited amount of space for me to add more functions and features. I would love to add that but can not promise anything. This space limitation is sadly really time consuming as I constantly need to optimize, validate and check for size.

Enjoyed reading the article and getting to understand how helpful Walk Assist and Cruise can be in different situations. Those can be improved even more in the future as they are mainly implemented in the TSDZ2 controller.

I am away over the weekend but afterwards there will hopefully be an official beta version and more updates on the changes. Followed by a great discussion on what to improve from the community!
Last edited by buba on Feb 08 2019 7:18pm, edited 3 times in total.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   100 W

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

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

Post by buba » Feb 08 2019 7:00pm

Rydon wrote:
Feb 08 2019 3:53pm
Just a thought. Is holding down the plus button used for anything? The minus is pretty much a universal standard for walk assist. Since cruise control is a new feature, how about using the plus button so they don't conflict?
It could work but the plus button hold is now used to activate or deactivate the LCD backlight together with the front and rear lights.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

tomtom50   100 W

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

Open Source Firmware Tutorial

Post by tomtom50 » 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
(863 KiB) Downloaded 143 times

Rafe   1 W

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

Re: Open Source Firmware Tutorial

Post by Rafe » Feb 09 2019 6:30pm

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
That's a really good idea and great to go to all that effort. It was Jbalat's videos that got me started too and then finding the relevant stuff for the 8 pin VLCD was very confusing at first and of course it turned out in the end to be the easier version to mod by just using another 8 pin HiGo cable. I think your first sentence may be wrong though as I believe the 6 pin VLCD 5 does have brake inputs and the only difference between the 8 and 6 pin versions is that the 8 pin version has an external throughput for a throttle down the two extra wires.

tomtom50   100 W

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

Re: Open Source Firmware Tutorial

Post by tomtom50 » Feb 10 2019 1:28am

Rafe wrote:
Feb 09 2019 6:30pm
I think your first sentence may be wrong though as I believe the 6 pin VLCD 5 does have brake inputs and the only difference between the 8 and 6 pin versions is that the 8 pin version has an external throughput for a throttle down the two extra wires.
Thanks, I'll revise. Since I have 8-pin that's what I know.

User avatar
itsallwhite   10 mW

10 mW
Posts: 34
Joined: Feb 07 2019 5:02am

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

Post by itsallwhite » Feb 10 2019 4:25am

elem wrote:
Feb 07 2019 5:28am
I am going to order another TSDZ2 for my partner and wondered if I 'share' one display between the two motors. So I flash LCD and then flash each motor, but then on one bike go back to using the old LCD once settings changed?
dont thinck it match ...
for vlcd5 use, go to : https://endless-sphere.com/forums/viewt ... ilit=TSDZ2

i use 2 tsdz2 motor, one with open source firmware " standard " ( with kt-lcd3 display ), the other one with VLCD5 and modified firmware from marcoq, all works fine .
Awesome - thanks so much for your help. Think I'll try with Marcoq for VLCD5 first and see how I go. Then if I decide to modify further will order the KT-LCD3.

Is there also an option to modify original firmware?

My goals are to:
1) increase number of max amps (I have 500w model but want to be able to 'unlock' to use more AMPS to increase power)
2) Maintain full power even when battery charge has dropped.

I am using bike mostly to get up a steep hill (short, but gravel road and quite steep) close to my house that I have to get up with a bike trailer & two kids in the back most days.
Bike 1: Giant Hybrid Steel Frame (old) with TSDZ2 48v 500w.
Bike 2: GT Sensor 2 full suspension mountain bike. Work in Progress - ready to 'electrify'!
House: 100% off grid - 5.6kw solar array with selectronics inverter and 24 Volt 1450 Ah BAE Gel battery Bank

AZUR   10 W

10 W
Posts: 93
Joined: Apr 05 2018 6:52am

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

Post by AZUR » Feb 10 2019 6:46am

andrea_104kg wrote:
Feb 07 2019 5:23pm
it's the same for me :D i'm testing my new bike whit tsdz2 48v and firmware .18.02
i have also a turbo levo 2018, and it's incredible, i really prefere the bike whith tsdz2 :D i get over 850w on the display :D and the shock absorbers are really better on this bike even if old...
I thought about getting a "second bike", but it came too well, in the last days I use only this one and the turbo levo is still, I almost wanted to sell it :D
the only thing that really keeps me is that I do not know if the poor engine will be able to withstand my weight for a long time :(

Hi Andrea,

Your testimony is incredible!

Why do you prefer the TSDZ2 bike?

The turbo levo motor it is not better?

Or is the weight of the bike? The turbo levo it´s heavier?

Regards
Azur

AZUR   10 W

10 W
Posts: 93
Joined: Apr 05 2018 6:52am

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

Post by AZUR » Feb 10 2019 7:18am

Hi everybody,

Thank you all and great work you have done.

I have some questions about higher cadence version (option).

I know the current version 18.02 has an option related to high cadence.

Is this option available for 36V and 48V?

Has anyone tested it for 36V?

Was this 18.02 high-cadence version tested by JBALAT (36V)?

As you know JBALAT was one of the first to invest and test this facility and has a way to install it in OSFirmware.

In version 18.02 with higher cadence option disabled, can we install the changes suggested by JBALAT to have a higher cadence? Are there no memory space issues?

Best Regards

Azur

andrea_104kg   10 W

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

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

Post by andrea_104kg » Feb 10 2019 4:56pm

Hi, AZUR, the shock absorbers of the turbo do not satisfy me. They are hard and even the 3-inch wheels do not guarantee sufficient agility.
the gt has 170mm spring-mounted marzocchi focals and a rp23 (completely overhauled) shock absorber, which was a top of the range.
The motor with the 18.02 firmware is almost equivalent. yesterday I made 40km with the tsdz2 and today 20km with the levo and sincerely I find them equal. The levo creaks a little less but this is due to the particular frame of the gt that has the central moment oscillating. There are slight differences in power output at various levels but they are negligible.
The bug on the tsdz2 is unfortunately boring, if I keep my foot on the pedal, it tends to start uncontrollably.
I am very heavy and even the consumption is very similar.
Before putting the new firmware I tried with the original firmware but it was not satisfactory at all, an abysmal difference!
overall, similar motor and better chassis make me prefer the gt.
I have the high cadence enabled setting and it works very well.
An advantage of the levo, the power drops a little less while the battery is discharged,

tomtom50   100 W

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

Open Source Firmware Tutorial v1

Post by tomtom50 » Feb 10 2019 6:00pm

tomtom50 wrote:
Feb 10 2019 1:28am
Rafe wrote:
Feb 09 2019 6:30pm
I think your first sentence may be wrong though as I believe the 6 pin VLCD 5 does have brake inputs and the only difference between the 8 and 6 pin versions is that the 8 pin version has an external throughput for a throttle down the two extra wires.
Thanks, I'll revise. Since I have 8-pin that's what I know.
Revised version attached
Open Source and Stock Firmware Tutorial v1.doc
(874.5 KiB) Downloaded 159 times

perryscope   100 mW

100 mW
Posts: 46
Joined: Jan 06 2019 4:29pm
Contact:

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

Post by perryscope » Feb 11 2019 4:50am

casainho wrote:
Jan 30 2019 6:30am
zappan wrote:
Jan 30 2019 6:21am
Hello casainho, I saw that you are interested in transferring your software to other displays and I would like to ask you two questions:
1. are you continuing to work on the LCD5 display?
2. I found on the site of the Italian seller this color display that looks just like the bafang 850C:
http://www.future-bike.it/shop/kit-di-t ... -a-colori/
  if it really is he definitely solves the problem of cutting the cables for the connection to the engine that you think?
1. yes.
2. I don´t know... but that one is very expensive!!! You can buy at half of that price on Aliexpress and I guess that with adding costs for taxes will be lower than doubling the price.
Hi Casainho,

I was wondering if you had any guide/workflow for compiling the ColorLCD code for the 850C. I have an 850C ready to be flashed but I'm struggling working out the process to compile. I can see the make file is not using sdcc to compile, and looks to be only for a Linux platform, but I'm not sure on the pre-requisites needed?

I also found a nice place to get the programming pins out without compromising the water resistance much...
850c-hack.jpg
Empowered people support rider and techie.
www.empoweredpeople.co.uk

casainho   1 GW

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

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

Post by casainho » Feb 11 2019 5:25am

perryscope wrote:
Feb 11 2019 4:50am
Hi Casainho,

I was wondering if you had any guide/workflow for compiling the ColorLCD code for the 850C. I have an 850C ready to be flashed but I'm struggling working out the process to compile. I can see the make file is not using sdcc to compile, and looks to be only for a Linux platform, but I'm not sure on the pre-requisites needed?

I also found a nice place to get the programming pins out without compromising the water resistance much...
1. yes I am using Linux to build and the make file. Sorry but I can't help other than building on Linux -- maybe others can do or please try by yourself, as the STM32F103 microcontroller is very famous as it is the GCC compiler, you will find instructions on google of other projects. Then please write notes on wiki page to help next others!!

2. I would solder that pins directly on PCB in direction back of the LCD, maybe using a connector header and open a hole on the case for the header, like a user shared before for KT-LCD3.

3. I am slowly working on the firmware. It needs a rework and unlike on KT-LCD3, writing to LCD is a bit slow and the communications seems to be failing because of that. I am working on the branch and the "new_design" branch and the latest best working code is here: https://github.com/OpenSource-EBike-fir ... f837a0715b
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.

Firenzaboy   1 µW

1 µW
Posts: 4
Joined: Jan 21 2019 1:54pm

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

Post by Firenzaboy » Feb 12 2019 11:03am

This my first post so I'm new to this but impressed with all the great work you guys have done - so first many thanks for all the great work you guys are doing - very interesting.

I was wondering if anybody can assist with a strange problem I'm having, once programming (with v18.2) I have what appears to be a fully working KT3 display but no power assist from the motor at all (same results with the older firmware versions too).
My bike is running 48v 750W with 48V 12.8Ah Li-ion with LG LGGBMH11865 cells and works fine with VLCD5 display, it is 6 pin with no temp sensor or throttle installed. As I said it runs fine as stock and with the eco-ebike 'upgrade' hex files installed but like most people the cadence issue was why I started to look for improvements. I have bought and set up the KT-LCD3 and using a ST-Link v2 (not a clone) with the 'homemade' suitable cables I can program both motor and display without errors (and go back to stock set up too) so I don't think issue is with the programming or cable side. Where I've got to is that everything in the display configuration appears to work fine and the setting configuration data can be entered and is saved ok; the functions all appear to work on the display e.g. assist level changes with button press, off road mode toggles on/off , same with walk assist etc .... only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ? Can anyone of your wonderful people suggest what to check next ? The only thing I can think off is maybe I have a faulty motor controller or something ? I'm an experience mechanical engineer but like most of us older grease monkeys we need help with the electrical side :-)
Thanks in advance and keep up the great work.....

casainho   1 GW

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

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

Post by casainho » Feb 12 2019 1:12pm

Firenzaboy wrote:
Feb 12 2019 11:03am
This my first post so I'm new to this but impressed with all the great work you guys have done - so first many thanks for all the great work you guys are doing - very interesting.

I was wondering if anybody can assist with a strange problem I'm having, once programming (with v18.2) I have what appears to be a fully working KT3 display but no power assist from the motor at all (same results with the older firmware versions too).
My bike is running 48v 750W with 48V 12.8Ah Li-ion with LG LGGBMH11865 cells and works fine with VLCD5 display, it is 6 pin with no temp sensor or throttle installed. As I said it runs fine as stock and with the eco-ebike 'upgrade' hex files installed but like most people the cadence issue was why I started to look for improvements. I have bought and set up the KT-LCD3 and using a ST-Link v2 (not a clone) with the 'homemade' suitable cables I can program both motor and display without errors (and go back to stock set up too) so I don't think issue is with the programming or cable side. Where I've got to is that everything in the display configuration appears to work fine and the setting configuration data can be entered and is saved ok; the functions all appear to work on the display e.g. assist level changes with button press, off road mode toggles on/off , same with walk assist etc .... only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ? Can anyone of your wonderful people suggest what to check next ? The only thing I can think off is maybe I have a faulty motor controller or something ? I'm an experience mechanical engineer but like most of us older grease monkeys we need help with the electrical side :-)
Thanks in advance and keep up the great work.....
You description of problem and tests you did really help to understand what can be happen.

I guess it is the max temperature limit that is disabling the motor power -- it does that. The thing is: are you sure you did reset the defaults values and are you sure the motor temperature sensor is disabled on the configurations??
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.

casainho   1 GW

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

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

Post by casainho » 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
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.

Firenzaboy   1 µW

1 µW
Posts: 4
Joined: Jan 21 2019 1:54pm

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

Post by Firenzaboy » Feb 13 2019 7:42am

casainho wrote:
Feb 12 2019 1:12pm
Firenzaboy wrote:
Feb 12 2019 11:03am
This my first post so I'm new to this but impressed with all the great work you guys have done - so first many thanks for all the great work you guys are doing - very interesting.

I was wondering if anybody can assist with a strange problem I'm having, once programming (with v18.2) I have what appears to be a fully working KT3 display but no power assist from the motor at all (same results with the older firmware versions too).
My bike is running 48v 750W with 48V 12.8Ah Li-ion with LG LGGBMH11865 cells and works fine with VLCD5 display, it is 6 pin with no temp sensor or throttle installed. As I said it runs fine as stock and with the eco-ebike 'upgrade' hex files installed but like most people the cadence issue was why I started to look for improvements. I have bought and set up the KT-LCD3 and using a ST-Link v2 (not a clone) with the 'homemade' suitable cables I can program both motor and display without errors (and go back to stock set up too) so I don't think issue is with the programming or cable side. Where I've got to is that everything in the display configuration appears to work fine and the setting configuration data can be entered and is saved ok; the functions all appear to work on the display e.g. assist level changes with button press, off road mode toggles on/off , same with walk assist etc .... only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ? Can anyone of your wonderful people suggest what to check next ? The only thing I can think off is maybe I have a faulty motor controller or something ? I'm an experience mechanical engineer but like most of us older grease monkeys we need help with the electrical side :-)
Thanks in advance and keep up the great work.....
You description of problem and tests you did really help to understand what can be happen.

I guess it is the max temperature limit that is disabling the motor power -- it does that. The thing is: are you sure you did reset the defaults values and are you sure the motor temperature sensor is disabled on the configurations??
Thanks for trying to help. Yes I've checked and double checked that the configuration is correct with the temp sensor disabled but still no success. Could it be something to do with the option byte settings as I've read on here some other people were have different issues with the option byte set up (I have no idea what the option byte does BTW). It was the AFR5 and AFR3 fields that people were changing - what are the correct values for these fields and how do you set them as when I tried to force the AFR3 field to TM3_BK1N as suggested in an earlier post (possible if I use the STM8S105x4 setting) when I turn on the bike to check and then go back and re-read the option byte it have changed back to TM3_CH2 ? Same result with STM8S105x6 read. I'm also correct in that you should force the data memory tab to all zeros at the start (that is what I am doing - again tried both x4 & x6) which is working ok but then populated when you switch on the bike ? The data I get in row 4000 only is:
CD 28 00 0A 32 86 01 02 08 32 00 00 19 0A 32 00 .(..2....2....2.
Not sure if that helps with the diagnosis ? Once again thanks for your help.

casainho   1 GW

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

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

Post by casainho » Feb 13 2019 7:49am

Firenzaboy wrote:
Feb 13 2019 7:42am
casainho wrote:
Feb 12 2019 1:12pm
Firenzaboy wrote:
Feb 12 2019 11:03am
This my first post so I'm new to this but impressed with all the great work you guys have done - so first many thanks for all the great work you guys are doing - very interesting.

I was wondering if anybody can assist with a strange problem I'm having, once programming (with v18.2) I have what appears to be a fully working KT3 display but no power assist from the motor at all (same results with the older firmware versions too).
My bike is running 48v 750W with 48V 12.8Ah Li-ion with LG LGGBMH11865 cells and works fine with VLCD5 display, it is 6 pin with no temp sensor or throttle installed. As I said it runs fine as stock and with the eco-ebike 'upgrade' hex files installed but like most people the cadence issue was why I started to look for improvements. I have bought and set up the KT-LCD3 and using a ST-Link v2 (not a clone) with the 'homemade' suitable cables I can program both motor and display without errors (and go back to stock set up too) so I don't think issue is with the programming or cable side. Where I've got to is that everything in the display configuration appears to work fine and the setting configuration data can be entered and is saved ok; the functions all appear to work on the display e.g. assist level changes with button press, off road mode toggles on/off , same with walk assist etc .... only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ? Can anyone of your wonderful people suggest what to check next ? The only thing I can think off is maybe I have a faulty motor controller or something ? I'm an experience mechanical engineer but like most of us older grease monkeys we need help with the electrical side :-)
Thanks in advance and keep up the great work.....
You description of problem and tests you did really help to understand what can be happen.

I guess it is the max temperature limit that is disabling the motor power -- it does that. The thing is: are you sure you did reset the defaults values and are you sure the motor temperature sensor is disabled on the configurations??
Thanks for trying to help. Yes I've checked and double checked that the configuration is correct with the temp sensor disabled but still no success. Could it be something to do with the option byte settings as I've read on here some other people were have different issues with the option byte set up (I have no idea what the option byte does BTW). It was the AFR5 and AFR3 fields that people were changing - what are the correct values for these fields and how do you set them as when I tried to force the AFR3 field to TM3_BK1N as suggested in an earlier post (possible if I use the STM8S105x4 setting) when I turn on the bike to check and then go back and re-read the option byte it have changed back to TM3_CH2 ? Same result with STM8S105x6 read. I'm also correct in that you should force the data memory tab to all zeros at the start (that is what I am doing - again tried both x4 & x6) which is working ok but then populated when you switch on the bike ? The data I get in row 4000 only is:
CD 28 00 0A 32 86 01 02 08 32 00 00 19 0A 32 00 .(..2....2....2.
Not sure if that helps with the diagnosis ? Once again thanks for your help.
The firmware writes by itself the correct option bytes now. It is being working for other users.

You should not have temperature blinking.

Also check you have max power configured to an higher value like at least 100W and not like 25W.
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.

Firenzaboy   1 µW

1 µW
Posts: 4
Joined: Jan 21 2019 1:54pm

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

Post by Firenzaboy » Feb 13 2019 8:06am

casainho wrote:
Feb 13 2019 7:49am
Firenzaboy wrote:
Feb 13 2019 7:42am
casainho wrote:
Feb 12 2019 1:12pm
Firenzaboy wrote:
Feb 12 2019 11:03am
This my first post so I'm new to this but impressed with all the great work you guys have done - so first many thanks for all the great work you guys are doing - very interesting.

I was wondering if anybody can assist with a strange problem I'm having, once programming (with v18.2) I have what appears to be a fully working KT3 display but no power assist from the motor at all (same results with the older firmware versions too).
My bike is running 48v 750W with 48V 12.8Ah Li-ion with LG LGGBMH11865 cells and works fine with VLCD5 display, it is 6 pin with no temp sensor or throttle installed. As I said it runs fine as stock and with the eco-ebike 'upgrade' hex files installed but like most people the cadence issue was why I started to look for improvements. I have bought and set up the KT-LCD3 and using a ST-Link v2 (not a clone) with the 'homemade' suitable cables I can program both motor and display without errors (and go back to stock set up too) so I don't think issue is with the programming or cable side. Where I've got to is that everything in the display configuration appears to work fine and the setting configuration data can be entered and is saved ok; the functions all appear to work on the display e.g. assist level changes with button press, off road mode toggles on/off , same with walk assist etc .... only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ? Can anyone of your wonderful people suggest what to check next ? The only thing I can think off is maybe I have a faulty motor controller or something ? I'm an experience mechanical engineer but like most of us older grease monkeys we need help with the electrical side :-)
Thanks in advance and keep up the great work.....
You description of problem and tests you did really help to understand what can be happen.

I guess it is the max temperature limit that is disabling the motor power -- it does that. The thing is: are you sure you did reset the defaults values and are you sure the motor temperature sensor is disabled on the configurations??
Thanks for trying to help. Yes I've checked and double checked that the configuration is correct with the temp sensor disabled but still no success. Could it be something to do with the option byte settings as I've read on here some other people were have different issues with the option byte set up (I have no idea what the option byte does BTW). It was the AFR5 and AFR3 fields that people were changing - what are the correct values for these fields and how do you set them as when I tried to force the AFR3 field to TM3_BK1N as suggested in an earlier post (possible if I use the STM8S105x4 setting) when I turn on the bike to check and then go back and re-read the option byte it have changed back to TM3_CH2 ? Same result with STM8S105x6 read. I'm also correct in that you should force the data memory tab to all zeros at the start (that is what I am doing - again tried both x4 & x6) which is working ok but then populated when you switch on the bike ? The data I get in row 4000 only is:
CD 28 00 0A 32 86 01 02 08 32 00 00 19 0A 32 00 .(..2....2....2.
Not sure if that helps with the diagnosis ? Once again thanks for your help.
The firmware writes by itself the correct option bytes now. It is being working for other users.

You should not have temperature blinking.

Also check you have max power configured to an higher value like at least 100W and not like 25W.
Yes temp is still blinking in the display whatever I try. Yes max power is set at 250W (default) and issue is the same in both on and off road mode (and I tried disabling off road mode too). Just put bike back again to stock and motor is functioning (as a double check) but can't get stock walk mode to work (with VLD5) even though setting is 'on' which is strange as it was working before ? Could it be a motor controller hardware issue - I may try buying another controller as a last resort ? Confusing isn't it !

perryscope   100 mW

100 mW
Posts: 46
Joined: Jan 06 2019 4:29pm
Contact:

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

Post by perryscope » Feb 13 2019 10:40am

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.

......

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

Image

I had also seen these on AliExpress, they look like a great little display very interesting to see what can be done.
Empowered people support rider and techie.
www.empoweredpeople.co.uk

casainho   1 GW

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

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

Post by casainho » Feb 13 2019 10:51am

Firenzaboy wrote:
Feb 12 2019 11:03am
only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ?
1. you must make sure that is not the motor max temperature feature that is disabling the motor power!! Verify again the configurations and reset to default values.

2. Not only see the torque sensor value, see also the pwm duty-cycle value when you push the pedals and rotate them!!
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.

perryscope   100 mW

100 mW
Posts: 46
Joined: Jan 06 2019 4:29pm
Contact:

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

Post by perryscope » Feb 13 2019 10:54am

Firenzaboy wrote:
Feb 13 2019 8:06am
Just put bike back again to stock and motor is functioning (as a double check) but can't get stock walk mode to work (with VLD5) even though the setting is 'on' which is strange as it was working before? Could it be a motor controller hardware issue - I may try buying another controller as a last resort? Confusing isn't it !
I don't know if it helps but I had a similar issue when switching back to the stock firmware after using the macro vM0.16.B_VLCD6 version for a while with the VLCD6 screen, to resolve the walk-assist I had to reflash the backup hex files I took of the stock Data and Option memory areas. After doing this it put it back to a fully working stock setup. I put it down to manually editing the data area. have you got a backup hex file for those?
Empowered people support rider and techie.
www.empoweredpeople.co.uk

casainho   1 GW

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

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

Post by casainho » Feb 13 2019 10:57am

casainho wrote:
Feb 13 2019 10:51am
Firenzaboy wrote:
Feb 12 2019 11:03am
only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ?
1. you must make sure that is not the motor max temperature feature that is disabling the motor power!! Verify again the configurations and reset to default values.

2. Not only see the torque sensor value, see also the pwm duty-cycle value when you push the pedals and rotate them!!
And make sure brake sensors are not activated also :-)
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.

Bartman   1 W

1 W
Posts: 61
Joined: Feb 11 2018 2:38pm

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

Post by Bartman » Feb 13 2019 3:45pm

casainho wrote:
Feb 13 2019 10:57am
casainho wrote:
Feb 13 2019 10:51am
Firenzaboy wrote:
Feb 12 2019 11:03am
only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ?
1. you must make sure that is not the motor max temperature feature that is disabling the motor power!! Verify again the configurations and reset to default values.

2. Not only see the torque sensor value, see also the pwm duty-cycle value when you push the pedals and rotate them!!
And make sure brake sensors are not activated also :-)
I had exactly the same problem. I reverted back to the stock hex file I saved before flashing. I then reflashed and immediately rest to defaults from the menu. For some strange reason, I have to reset to default after every firmware upgrade otherwise even setting the parameters manually (before resetting) results in no power. As you said verything looks but no power.

Firenzaboy   1 µW

1 µW
Posts: 4
Joined: Jan 21 2019 1:54pm

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

Post by Firenzaboy » Feb 14 2019 3:50am

Bartman wrote:
Feb 13 2019 3:45pm
casainho wrote:
Feb 13 2019 10:57am
casainho wrote:
Feb 13 2019 10:51am
Firenzaboy wrote:
Feb 12 2019 11:03am
only weird thing with the display side is that I have the temperature cell (bottom right on the display) always flashing 0 deg C even though the motor temp control feature is disabled (no temp sensor installed) and is still flashing if I disable the whole temp display setting (sub menu 6.0 set to zero to display nothing in that field) ....... apart from this strange temp display issue the main issue is that I have absolutely no assist from the motor even though the motor controller appears to be taking the hex file and verifying OK. Using menu 12.3 I can see the torque sensor is working when I apply torque to crank but I'm getting no assisting in any mode or with walk assist or anything ?
1. you must make sure that is not the motor max temperature feature that is disabling the motor power!! Verify again the configurations and reset to default values.

2. Not only see the torque sensor value, see also the pwm duty-cycle value when you push the pedals and rotate them!!
And make sure brake sensors are not activated also :-)
I had exactly the same problem. I reverted back to the stock hex file I saved before flashing. I then reflashed and immediately rest to defaults from the menu. For some strange reason, I have to reset to default after every firmware upgrade otherwise even setting the parameters manually (before resetting) results in no power. As you said verything looks but no power.
Interesting thanks for that, glad I’m not going mad ! So just to be clear you fixed it by going back to stock program tab with with stock data tab too or loaded data with zeros ? Then did you delete (zero) the prog and data tabs (hex files) or just overwrote the old stock prog firmware file with new open source file ? What did you need to do with the KT3 ? Reset that to zeroed data tab or was it ok with the saved set up data from your previous attempts when the motor didn’t work ? Sorry for the questions just wanted to be 100% clear what you did to fix it as it driving me mad ! Thanks again

Bartman   1 W

1 W
Posts: 61
Joined: Feb 11 2018 2:38pm

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

Post by Bartman » Feb 14 2019 1:43pm

Firenzaboy wrote:
Feb 14 2019 3:50am
Bartman wrote:
Feb 13 2019 3:45pm
casainho wrote:
Feb 13 2019 10:57am
casainho wrote:
Feb 13 2019 10:51am

1. you must make sure that is not the motor max temperature feature that is disabling the motor power!! Verify again the configurations and reset to default values.

2. Not only see the torque sensor value, see also the pwm duty-cycle value when you push the pedals and rotate them!!
And make sure brake sensors are not activated also :-)
I had exactly the same problem. I reverted back to the stock hex file I saved before flashing. I then reflashed and immediately rest to defaults from the menu. For some strange reason, I have to reset to default after every firmware upgrade otherwise even setting the parameters manually (before resetting) results in no power. As you said verything looks but no power.
Interesting thanks for that, glad I’m not going mad ! So just to be clear you fixed it by going back to stock program tab with with stock data tab too or loaded data with zeros ? Then did you delete (zero) the prog and data tabs (hex files) or just overwrote the old stock prog firmware file with new open source file ? What did you need to do with the KT3 ? Reset that to zeroed data tab or was it ok with the saved set up data from your previous attempts when the motor didn’t work ? Sorry for the questions just wanted to be 100% clear what you did to fix it as it driving me mad ! Thanks again
It was only the motor I had to reflash. I loaded the stock program, data and options tabs
I’d saved from the motor from new. Then tried with the standard display and all worked. Reinstalled the KTLCD3,
then only flashed the program tab with the open source hex file. Then I reset to factory defaults using the instruction in the wiki (i.e on v18.x it’s menu 9 option 3).

Post Reply