TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Electric Motors and Controllers
jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Mar 18 2020 1:12pm

Rydon wrote:
Mar 17 2020 1:18pm
mbrusa wrote:
Mar 17 2020 9:35am
The HEX file is for the TSDZ2 controller, only that has changed.
For LCD3, the buba 20 beta 1 version is still fine.
Ok, got it. Having LCD3 in the title of the hex file made us think it was for the KT-LCD3. We will try it in the motor today. Thanks!
It flashed fine, everything seems good I'll give it a try on Friday when the rain stops.

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Mar 18 2020 6:11pm

jeff.page.rides wrote:
Mar 18 2020 1:12pm
Rydon wrote:
Mar 17 2020 1:18pm
mbrusa wrote:
Mar 17 2020 9:35am
The HEX file is for the TSDZ2 controller, only that has changed.
For LCD3, the buba 20 beta 1 version is still fine.
Ok, got it. Having LCD3 in the title of the hex file made us think it was for the KT-LCD3. We will try it in the motor today. Thanks!
It flashed fine, everything seems good I'll give it a try on Friday when the rain stops.
The rain stopped today and the clouds parted so I went for a ride. The overrun fix works, but I still have to give a quick yank back on the pedals to get the hub to shift when there's pressure on the chain.

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Mar 19 2020 2:53am

jeff.page.rides wrote:
Mar 18 2020 6:11pm

The rain stopped today and the clouds parted so I went for a ride. The overrun fix works, but I still have to give a quick yank back on the pedals to get the hub to shift when there's pressure on the chain.
I do not understand. Can you explain better?
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: 1202
Joined: Aug 02 2017 2:56pm

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by stancecoke » Mar 19 2020 3:45am

jeff.page.rides wrote:
Mar 18 2020 6:11pm
I still have to give a quick yank back on the pedals to get the hub to shift when there's pressure on the chain.
I think he uses an internal-gear hub. You can't change the gear with tension on the chain. So you have to unload the chain by turning the pedal backwards slightly.

regards
stancecoke

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Mar 19 2020 6:01am

Of course, with the gear on the hub, also with "fix overrun" the chain always remains under tension if the pedals are not released.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Mar 19 2020 11:05am

stancecoke wrote:
Mar 19 2020 3:45am
jeff.page.rides wrote:
Mar 18 2020 6:11pm
I still have to give a quick yank back on the pedals to get the hub to shift when there's pressure on the chain.
I think he uses an internal-gear hub. You can't change the gear with tension on the chain. So you have to unload the chain by turning the pedal backwards slightly.

regards
stancecoke

Sorry, I do use a Nexus or Alfine hub.
I think the next step I want to try is a gear shift sensor hooked up to either the brake cut off or like in this post on the other forum the Speedo sensor.
viewtopic.php?f=30&t=98281&start=825#p1533489
If the shift sensor is hooked up to the brake sensor it may stop power for too long?
If the shift sensor is hooked up to the speedometer sensor it may or may not work?
What would you suggest I try next?
Here are some YouTube links about my bike,
viewtopic.php?f=28&t=79788&start=6775#p1537314
Thanks

maximusdm   10 W

10 W
Posts: 90
Joined: Sep 08 2018 12:51pm

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by maximusdm » Mar 20 2020 6:14am

I have created a pull request on Buba's repository so this important fix does not get lost.

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Mar 20 2020 10:06am

jeff.page.rides wrote:
Mar 19 2020 11:05am
Sorry, I do use a Nexus or Alfine hub.
I think the next step I want to try is a gear shift sensor hooked up to either the brake cut off or like in this post on the other forum the Speedo sensor.
viewtopic.php?f=30&t=98281&start=825#p1533489
If the shift sensor is hooked up to the brake sensor it may stop power for too long?
If the shift sensor is hooked up to the speedometer sensor it may or may not work?
What would you suggest I try next?
Here are some YouTube links about my bike,
viewtopic.php?f=28&t=79788&start=6775#p1537314
Thanks
I don't know the gearsensor but it is certainly better to connect it to the brake sensor, the response time is immediate and the duration of time does not depend on the software but on the time of the signal of the gearsensor, which I believe is already optimized for that.
It will always be necessary to stop pedaling but it will be easier to synchronize the engine stop with the gear change.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

Waynemarlow   1 kW

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by Waynemarlow » Mar 21 2020 8:43am

Guys,

Finally I've got the new controllers arrived from China ( ordered early Jan ) after drowning my motor ( it had a very early sealing system on the chain side ) and will need to reprogram them. Do we have a single motor file with the new over run solution available suitable for the LCD3 ( Buba Beta 20 + over run changes ) and also I'm presuming we do not need to reflash the LCD3 screen file ?

Still liking the LCD3 which just works so well in daylight.

Thanks

maximusdm   10 W

10 W
Posts: 90
Joined: Sep 08 2018 12:51pm

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by maximusdm » Mar 23 2020 10:10am

Hello,

Here is the pull request I did starting from Buba's code. It has the overrun fix and an additional fix for torque sensor with minimal value smaller than 100 so it does not give torque sensor error.
https://github.com/leon927/TSDZ2-Smart-EBike/pull/2

You can build your binaries from my development branch.

Regards!

thineight   100 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by thineight » Mar 29 2020 10:28am

Hello guys. In these days of quarantine I had chance to flash the v.20 with mbrusa overrun fix.
The overrun is of course improved with good results, but I experienced a delay in motor kick in while restarting pedaling.
I have to do at least a complete pedal turn prior the motor engages.
Did anyone else experience the same?

I wait some feedback.. in case I will try to go back to the previous buba "official" beta1.

Thanks
MTB KTM Ultra 29" - City bike DAYTONA 28"

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Mar 29 2020 2:09pm

mbrusa wrote:
Mar 21 2020 2:11am
....
I want to highlight that by increasing the calculated value of "ui16_cadence_sensor_ticks_stop", increases the overrun time, decreasing it lacks startup assistance.
I had reports of too fast stops and a case of lack startup assistance.
For this reason, in the next full version I will slightly increase the calculated values.
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 3)));" in standard mode,
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 1));" in advanced mode,
or maybe I'll add editable parameters in the config.h file.
Hi thineight
I had reported it in a previous post.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Mar 30 2020 7:45pm

mbrusa wrote:
Mar 20 2020 10:06am
jeff.page.rides wrote:
Mar 19 2020 11:05am
Sorry, I do use a Nexus or Alfine hub.
I think the next step I want to try is a gear shift sensor hooked up to either the brake cut off or like in this post on the other forum the Speedo sensor.
viewtopic.php?f=30&t=98281&start=825#p1533489
If the shift sensor is hooked up to the brake sensor it may stop power for too long?
If the shift sensor is hooked up to the speedometer sensor it may or may not work?
What would you suggest I try next?
Here are some YouTube links about my bike,
viewtopic.php?f=28&t=79788&start=6775#p1537314
Thanks
I don't know the gearsensor but it is certainly better to connect it to the brake sensor, the response time is immediate and the duration of time does not depend on the software but on the time of the signal of the gearsensor, which I believe is already optimized for that.
It will always be necessary to stop pedaling but it will be easier to synchronize the engine stop with the gear change.
I installed my shift sensor on the brake sensor plug and wow does it shift great. The second I push my shift button the motor stops it shifts fast, smooth, and quiet. Now the problem is it powers off for about 2 seconds and about 2 revolutions at 75 RPM before the power comes back on, that's a long dead-spot.
Is there a way in the firmware that we can speed up this power back on, to only a half a second?

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Mar 31 2020 7:33am

jeff.page.rides wrote:
Mar 30 2020 7:45pm
I installed my shift sensor on the brake sensor plug and wow does it shift great. The second I push my shift button the motor stops it shifts fast, smooth, and quiet. Now the problem is it powers off for about 2 seconds and about 2 revolutions at 75 RPM before the power comes back on, that's a long dead-spot.
Is there a way in the firmware that we can speed up this power back on, to only a half a second?
I should understand if it depends on the "fix overrun" or anything else.
If you are using the version with LCD3 can you try this modification?
It slightly increases the overrun time and decreases the restart time.
If it improves, it is possible to further change the relationship between overrun and restart.
TSDZ2-v0.20.1-fix_overrun_test-LCD3_version.zip
(42.94 KiB) Downloaded 55 times
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Mar 31 2020 11:41am

mbrusa wrote:
Mar 31 2020 7:33am
jeff.page.rides wrote:
Mar 30 2020 7:45pm
I installed my shift sensor on the brake sensor plug and wow does it shift great. The second I push my shift button the motor stops it shifts fast, smooth, and quiet. Now the problem is it powers off for about 2 seconds and about 2 revolutions at 75 RPM before the power comes back on, that's a long dead-spot.
Is there a way in the firmware that we can speed up this power back on, to only a half a second?
I should understand if it depends on the "fix overrun" or anything else.
If you are using the version with LCD3 can you try this modification?
It slightly increases the overrun time and decreases the restart time.
If it improves, it is possible to further change the relationship between overrun and restarts.
TSDZ2-v0.20.1-fix_overrun_test-LCD3_version.zip
I am using the LCD3 with version 20 beta 1 and the overrun fix installed a couple of weeks ago. Is this file the same or is it something you've changed for me to try?

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Mar 31 2020 1:30pm

jeff.page.rides wrote:
Mar 31 2020 11:41am
I am using the LCD3 with version 20 beta 1 and the overrun fix installed a couple of weeks ago. Is this file the same or is it something you've changed for me to try?
Yes it is a new version to try.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Mar 31 2020 5:58pm

mbrusa wrote:
Mar 31 2020 1:30pm
jeff.page.rides wrote:
Mar 31 2020 11:41am
I am using the LCD3 with version 20 beta 1 and the overrun fix installed a couple of weeks ago. Is this file the same or is it something you've changed for me to try?
Yes it is a new version to try.
Thanks, I'll give it a try on Friday. Do we need to just flash the TSDZ2 I hope or do we have to flash the LCD3 also?

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Mar 31 2020 10:48pm

jeff.page.rides wrote:
Mar 31 2020 5:58pm
Thanks, I'll give it a try on Friday. Do we need to just flash the TSDZ2 I hope or do we have to flash the LCD3 also?
Only the TSDZ2.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Apr 03 2020 7:54pm

mbrusa wrote:
Mar 31 2020 7:33am
jeff.page.rides wrote:
Mar 30 2020 7:45pm
I installed my shift sensor on the brake sensor plug and wow does it shift great. The second I push my shift button the motor stops it shifts fast, smooth, and quiet. Now the problem is it powers off for about 2 seconds and about 2 revolutions at 75 RPM before the power comes back on, that's a long dead-spot.
Is there a way in the firmware that we can speed up this power back on, to only a half a second?
I should understand if it depends on the "fix overrun" or anything else.
If you are using the version with LCD3 can you try this modification?
It slightly increases the overrun time and decreases the restart time.
If it improves, it is possible to further change the relationship between overrun and restart.
TSDZ2-v0.20.1-fix_overrun_test-LCD3_version.zip
I rode 25 miles today on my handcycle and I didn't notice any difference with the changes that you made.
It all seem to be exactly as before.
THANKS

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Apr 04 2020 12:51am

jeff.page.rides wrote:
Apr 03 2020 7:54pm
I rode 25 miles today on my handcycle and I didn't notice any difference with the changes that you made.
It all seem to be exactly as before.
THANKS
Positive is that it does not depend on "fix overrun".
I think I understand where the problem is.
The stop with the brake sensors is immediate, but the restart of the engine is not.
This is because the restart code is in ebike_app.c which has a delay in execution of 0.1-0.2 seconds.
I can modify it but I don't have LCD3 and not even brake sensors to try.
Do you have only gear sensor or also brake sensors?
Are you available to try the change even if not tested?
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

Waynemarlow   1 kW

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by Waynemarlow » Apr 04 2020 7:01am

Mbrusa

Do you have a link to the hex file for the motor based on your changes and Buba's V20, I'm just about to reprogram a unit and refit it to the bike

Thanks

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Apr 04 2020 10:49am

mbrusa wrote:
Apr 04 2020 12:51am
jeff.page.rides wrote:
Apr 03 2020 7:54pm
I rode 25 miles today on my handcycle and I didn't notice any difference with the changes that you made.
It all seem to be exactly as before.
THANKS
Positive is that it does not depend on "fix overrun".
I think I understand where the problem is.
The stop with the brake sensors is immediate, but the restart of the engine is not.
This is because the restart code is in ebike_app.c which has a delay in execution of 0.1-0.2 seconds.
I can modify it but I don't have LCD3 and not even brake sensors to try.
Do you have only gear sensor or also brake sensors?
Are you available to try the change even if not tested?
I have the gear sensor hooked up where the brake sensor goes and that's it no brake sensor is used. Yes, I will test a new firmware change even if it hasn't been tested by you. THANKS

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Apr 04 2020 1:33pm

jeff.page.rides wrote:
Apr 04 2020 10:49am
I have the gear sensor hooked up where the brake sensor goes and that's it no brake sensor is used. Yes, I will test a new firmware change even if it hasn't been tested by you. THANKS
Okay let's do this test.
I send you the hex file with a private message, then if it works I will released it on the forum.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

mbrusa   10 W

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

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mbrusa » Apr 04 2020 10:22pm

Waynemarlow wrote:
Apr 04 2020 7:01am
Mbrusa

Do you have a link to the hex file for the motor based on your changes and Buba's V20, I'm just about to reprogram a unit and refit it to the bike

Thanks
The last hex file for the motor, version with LCD3 display, can be found on this page a few posts back.
download/file.php?id=269437
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

jeff.page.rides   100 W

100 W
Posts: 136
Joined: Aug 13 2019 10:16am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by jeff.page.rides » Apr 05 2020 11:01am

mbrusa wrote:
Apr 04 2020 1:33pm
jeff.page.rides wrote:
Apr 04 2020 10:49am
I have the gear sensor hooked up where the brake sensor goes and that's it no brake sensor is used. Yes, I will test a new firmware change even if it hasn't been tested by you. THANKS
Okay let's do this test.
I send you the hex file with a private message, then if it works I will released it on the forum.
I didn't notice any difference in the start-up time after I shift still at 2 seconds or 2 revolution.

I think the perfect setup would be that when you shift the motor stops completely like it does and then within a half a second it starts ramping up power and by the time you hit 1-2 seconds it's at full power again.

It could be me but it seems like with these last couple of hex files I have to shift early because power levels off at 70 RPMs and by the time you hit 80 it has half the power and by 90 it's almost zero.

Thanks for all your efforts!

Post Reply