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

Electric Motors and Controllers
dameri   100 W

100 W
Posts: 114
Joined: Sep 20 2018 10:57am

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

Post by dameri » Jun 02 2019 3:38am

buba wrote:
Jun 01 2019 9:35am


dameri wrote:
May 31 2019 11:08am
I tried v0.19.0-beta 7. I drove to shop about 7 kms. There was quite poor assist alltough my levels and factors was exact same as previous version. Also other configurations are same as before. After shopping I went back to home and assist came back as good as before. Maby power off helped when I was shopping.
What version of the firmware did you upgrade from? Please try it out more and let me know if you have a bug!
I had v0.19.0-beta6. I'm not developer but I can test new versions and if they not work I can tell you what is wrong.
As I said afterwards beta7 is working fine. New logic is "hard to learn" to old man.

Thank you buba reading testers reports.

Also quoting is not my best shots.

elfnino   10 mW

10 mW
Posts: 33
Joined: Mar 06 2019 5:09am

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

Post by elfnino » Jun 02 2019 3:47am

#new button logic - to exit the submenu once the value is set the long press of on/off button is required however I think just a short press would be enough.
Now by exiting submenu with the long press I have ended occasionally two levels higher than initially wanted as well it takes more time to configure parameters.

#Default values after flashing - due to initial issues with lcd3 flashing I decided to erase program and configuration memory before applying the beta7. I would expect that after first start all the default values will be set but it didn't happen and I had to reconfigure all the parameters manually. So when and how the default values are being initialized ?

Overall I am very happy with beta7, many thanks to all involved and especially to buba for solving the flashing 1 issue !

maximusdm   10 W

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

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

Post by maximusdm » Jun 03 2019 11:21am

I managed today to take a small fall with the bike and the result is that I no longer get any assistance. I get startup boost and after 0w.
I run debug mode on menu 12:
- i get speed read correctly
- i get torque on pedal and adac
- i get cadence read
- human power is always 0 !

Please help with some ideas. :)

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 03 2019 3:53pm

maximusdm wrote:
Jun 03 2019 11:21am
I managed today to take a small fall with the bike and the result is that I no longer get any assistance. I get startup boost and after 0w.
I run debug mode on menu 12:
- i get speed read correctly
- i get torque on pedal and adac
- i get cadence read
- human power is always 0 !

Please help with some ideas. :)
If torque sensor and cadence are working, them you probably have some bad configuration like max power or max current, or min battery voltage.
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.

cheapcookie   100 W

100 W
Posts: 151
Joined: Aug 02 2014 10:34pm
Location: Earth

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

Post by cheapcookie » Jun 03 2019 7:22pm

Hi Casainho, is there a way to get the crank arms not to spin when the motor is on ?

The cyc x1pro does that, you can have motor power while human is coasting/relaxing.

maximusdm   10 W

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

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

Post by maximusdm » Jun 04 2019 2:12am

casainho wrote:
Jun 03 2019 3:53pm
maximusdm wrote:
Jun 03 2019 11:21am
I managed today to take a small fall with the bike and the result is that I no longer get any assistance. I get startup boost and after 0w.
I run debug mode on menu 12:
- i get speed read correctly
- i get torque on pedal and adac
- i get cadence read
- human power is always 0 !

Please help with some ideas. :)
If torque sensor and cadence are working, them you probably have some bad configuration like max power or max current, or min battery voltage.
To be honest, I do not get it. What has a fall on right side has to to with the power setting? Of course I can fully reset the software.
Why I have initial startup boost and then no power? Boost is torque only based so sensor should be ok.
I remember that when I lifted the bike the only thing on the lcd was power at 30w.

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 04 2019 2:16am

maximusdm wrote:
Jun 04 2019 2:12am
To be honest, I do not get it. What has a fall on right side has to to with the power setting? Of course I can fully reset the software.
Why I have initial startup boost and then no power? Boost is torque only based so sensor should be ok.
I remember that when I lifted the bike the only thing on the lcd was power at 30w.
I can imagine for some reason that you touched the buttons and max power was configured for a very low value as 25W and so you will get nothing.
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.

maximusdm   10 W

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

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

Post by maximusdm » Jun 04 2019 2:24am

It makes perfect sense! This is why I saw on the LCD only the power blinking on 20 or 30 w.
I fell at almost 5km/h :))

maximusdm   10 W

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

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

Post by maximusdm » Jun 04 2019 2:15pm

casainho wrote:
Jun 03 2019 3:53pm
maximusdm wrote:
Jun 03 2019 11:21am
I managed today to take a small fall with the bike and the result is that I no longer get any assistance. I get startup boost and after 0w.
I run debug mode on menu 12:
- i get speed read correctly
- i get torque on pedal and adac
- i get cadence read
- human power is always 0 !

Please help with some ideas. :)
If torque sensor and cadence are working, them you probably have some bad configuration like max power or max current, or min battery voltage.
Max power was at 25w. Thank you!

buba   10 kW

10 kW
Posts: 540
Joined: Aug 31 2018 12:36am

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

Post by buba » Jun 05 2019 5:39am

dameri wrote:
Jun 02 2019 3:38am
buba wrote:
Jun 01 2019 9:35am
What version of the firmware did you upgrade from? Please try it out more and let me know if you have a bug!
I had v0.19.0-beta6. I'm not developer but I can test new versions and if they not work I can tell you what is wrong.
As I said afterwards beta7 is working fine. New logic is "hard to learn" to old man.

Thank you buba reading testers reports.

Also quoting is not my best shots.
Thank you for your reply and sorry for my delayed one!

Hope the new logic is growing on you and you have become comfortable with it! There will be a new beta with bug fixes and improvements coming soon. Would love to hear feedback!

elfnino wrote:
Jun 02 2019 3:47am
#new button logic - to exit the submenu once the value is set the long press of on/off button is required however I think just a short press would be enough.
Now by exiting submenu with the long press I have ended occasionally two levels higher than initially wanted as well it takes more time to configure parameters.
Good note! I have decreased the time needed to hold the button. Much faster now but still not a click. I strongly believe it is best to have two different button events/actions for different menu actions so as to have a clear logic. I truly recommend this and would love that you test the new faster logic in the next beta as it should be better!

elfnino wrote:
Jun 02 2019 3:47am
#Default values after flashing - due to initial issues with lcd3 flashing I decided to erase program and configuration memory before applying the beta7. I would expect that after first start all the default values will be set but it didn't happen and I had to reconfigure all the parameters manually. So when and how the default values are being initialized ?
The default values should be initialized whenever you install the firmware for the first time or whenever you reset to defaults in the configuration menu. Let me know if something does not work!

elfnino wrote:
Jun 02 2019 3:47am
Overall I am very happy with beta7, many thanks to all involved and especially to buba for solving the flashing 1 issue !
Thank you!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   10 kW

10 kW
Posts: 540
Joined: Aug 31 2018 12:36am

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

Post by buba » Jun 05 2019 6:00am

New beta is coming soon!

Have listened to feedback from the community and tried to solve everything in the best possible way. Besides the bug fixes there are overall improvements and optimizations for size and speed in both the controller and display firmware.

Will test everything a bit more today and tomorrow to validate all the changes and bug fixes. Will submit the pull request as soon as this is done. The goal is to have no more bugs in this next beta so we can create a stable release.

After the stable release the entire community can switch to version 0.19.0.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   10 kW

10 kW
Posts: 540
Joined: Aug 31 2018 12:36am

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

Post by buba » Jun 05 2019 6:21am

May I ask if a couple of users can take a look at the Advanced Technical Data under sub menu 2, ADC Pedal Torque Sensor, and report what the resting value is. I am curious of the values from the torque sensor in different systems. This might be used later in the development to make the system more responsive, with more error codes to let the user know if something is wrong and maybe even calibrate the system better with a sensor model.

If possible and willing please have the pedal arms horizontal, i.e. parallel to the ground, and then turn on the system and let it calibrate with no force applied. Go to the Configuration Menu and then Advanced Technical Data under sub menu 2, ADC Pedal Torque Sensor and report the resting value.

Bonus: set the assist level to zero before you enter the Configuration Menu and give moderate force on the pedals. You can also ride the bike if it is easier. The motor will not engage as the assist level is set to zero. Report the highest value you see but do not use excessive force, only moderate force similar to normal operation.

Thank you all!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   10 kW

10 kW
Posts: 540
Joined: Aug 31 2018 12:36am

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

Post by buba » Jun 05 2019 6:48am

casainho wrote:
Jun 04 2019 2:16am
maximusdm wrote:
Jun 04 2019 2:12am
To be honest, I do not get it. What has a fall on right side has to to with the power setting? Of course I can fully reset the software.
Why I have initial startup boost and then no power? Boost is torque only based so sensor should be ok.
I remember that when I lifted the bike the only thing on the lcd was power at 30w.
I can imagine for some reason that you touched the buttons and max power was configured for a very low value as 25W and so you will get nothing.
Casainho and others, should there be an error code when user has the assist level or assist multiplier set to anything other than zero and motor power limit set to zero and also tries to ride the bike. Maybe only displayed for a short duration such as 5-10 seconds?

I ask this because I think there have been many cases where people have accidentally set/started with the power limit to zero with the assist level greater than zero and wondered why the motor does not work. The error code would help resolve some confusion. There is already an error code table in the 0.19.X wiki where it could be explained.

Just putting it out there. Would love some input. Very simple and only a couple lines of code so could include it in the next beta if this is something useful.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

btslo   100 mW

100 mW
Posts: 49
Joined: Apr 17 2019 8:55am

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

Post by btslo » Jun 05 2019 7:22am

I had this exact issue, flashed the beta as my first version and max motor power and all assist were set at 0, thought I had shorted something and fried my motor as I got no assist. (the wiki said default assist values were good for most users)

Maybe set the default to 250W legal mode just to see if the motor is working after you flash everything.

Also one value in the diagnostics menu is not working, think it's pedal torque, it always shows 0, is this a bug?

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 05 2019 8:01am

buba wrote:
Jun 05 2019 6:48am
Casainho and others, should there be an error code when user has the assist level or assist multiplier set to anything other than zero and motor power limit set to zero and also tries to ride the bike. Maybe only displayed for a short duration such as 5-10 seconds?
I think the default value does not help, if it was something like 1000 watts, then this would not be an issue.

Also, when the power limit is hit, there is not indication to user and that should no be an error message. Maybe short blink power field like 20% of time off, like 200 ms off and 800 ms on.
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   100 W

100 W
Posts: 114
Joined: Sep 20 2018 10:57am

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

Post by dameri » Jun 05 2019 8:36am

buba wrote:
Jun 05 2019 6:21am
May I ask if a couple of users can take a look at the Advanced Technical Data under sub menu 2, ADC Pedal Torque Sensor, and report what the resting value is. I am curious of the values from the torque sensor in different systems. This might be used later in the development to make the system more responsive, with more error codes to let the user know if something is wrong and maybe even calibrate the system better with a sensor model.

If possible and willing please have the pedal arms horizontal, i.e. parallel to the ground, and then turn on the system and let it calibrate with no force applied. Go to the Configuration Menu and then Advanced Technical Data under sub menu 2, ADC Pedal Torque Sensor and report the resting value.

Bonus: set the assist level to zero before you enter the Configuration Menu and give moderate force on the pedals. You can also ride the bike if it is easier. The motor will not engage as the assist level is set to zero. Report the highest value you see but do not use excessive force, only moderate force similar to normal operation.

Thank you all!
I will do that tomorrow. Now battery and man is loading from 54 kms ride. Beta 7 is working fine.
I think I will also get used to new logic.

thineight   100 W

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

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

Post by thineight » Jun 05 2019 3:37pm

buba wrote:
Jun 05 2019 6:21am
If possible and willing please have the pedal arms horizontal, i.e. parallel to the ground, and then turn on the system and let it calibrate with no force applied. Go to the Configuration Menu and then Advanced Technical Data under sub menu 2, ADC Pedal Torque Sensor and report the resting value.

Bonus: set the assist level to zero before you enter the Configuration Menu and give moderate force on the pedals. You can also ride the bike if it is easier. The motor will not engage as the assist level is set to zero. Report the highest value you see but do not use excessive force, only moderate force similar to normal operation.

Thank you all!
Hello Buba, here my results.
Pedals horizontal, no force applied - menu 9 - submenu 2 : reading --> 48/49
Zero assist and easy ride with hard gear on flat garage: reading --> 70-71
Zero assist with soft gear on garage ramp: reading --> 78

Hope this helps.
MTB KTM Ultra 29" - City bike DAYTONA 28"

thineight   100 W

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

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

Post by thineight » Jun 05 2019 3:43pm

Buba, I guess we spoke about this some time ago, but I do not remember the conclusion.
Regarding the walk assist, it is beneficial to have a sort of "lock" of the walk assist in order not to require the DOWN button to be pushed constantly. In fact it is hard not to slip off with the finger on a steep hill.. and the walk assistance will stop.

In fact when the "lock" is active the walk assist is started just holding the DOWN button and after you can release it, the bike will keep on walking beside you. Simple press on UP or DOWN button (or brake if magnetic sensors are installed) will stop the walk assistance.
This logic is applied also on marcoq fork for the stock display and it works very well.
Do you think we have chance to have it on the LCD3 display or the memory is over?

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

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 05 2019 4:19pm

thineight wrote:
Jun 05 2019 3:43pm
Buba, I guess we spoke about this some time ago, but I do not remember the conclusion.
Regarding the walk assist, it is beneficial to have a sort of "lock" of the walk assist in order not to require the DOWN button to be pushed constantly. In fact it is hard not to slip off with the finger on a steep hill.. and the walk assistance will stop.

In fact when the "lock" is active the walk assist is started just holding the DOWN button and after you can release it, the bike will keep on walking beside you. Simple press on UP or DOWN button (or brake if magnetic sensors are installed) will stop the walk assistance.
This logic is applied also on marcoq fork for the stock display and it works very well.
Do you think we have chance to have it on the LCD3 display or the memory is over?

Thanks
I strongly disagree with this because walk assist as it is now is very dangerous. I even didn't told to my son when he had to push his bicycle hardly on mountain because it is dangerous: very fast and strong start and possibly high speed. You can't know the speed until you start so it is always a guess.
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.

buba   10 kW

10 kW
Posts: 540
Joined: Aug 31 2018 12:36am

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

Post by buba » Jun 05 2019 6:04pm

casainho wrote:
Jun 05 2019 8:01am
buba wrote:
Jun 05 2019 6:48am
Casainho and others, should there be an error code when user has the assist level or assist multiplier set to anything other than zero and motor power limit set to zero and also tries to ride the bike. Maybe only displayed for a short duration such as 5-10 seconds?
I think the default value does not help, if it was something like 1000 watts, then this would not be an issue.

Also, when the power limit is hit, there is not indication to user and that should no be an error message. Maybe short blink power field like 20% of time off, like 200 ms off and 800 ms on.
Okay good, in short, no error code necessary. If it becomes a problem later on we can set the default power to 250 watts as suggested by btslo and/or write a function that flashes the power reading if at power limit as you suggested.

dameri wrote:
Jun 05 2019 8:36am
buba wrote:
Jun 05 2019 6:21am
May I ask if a couple of users can take a look at the Advanced Technical Data under sub menu 2, ADC Pedal Torque Sensor, and report what the resting value is...
Thank you all!
I will do that tomorrow. Now battery and man is loading from 54 kms ride. Beta 7 is working fine.
I think I will also get used to new logic.
:D That sounds great! Hope you charge up nicely! :bolt: Thank you!

thineight wrote:
Jun 05 2019 3:37pm
Hello Buba, here my results.
Pedals horizontal, no force applied - menu 9 - submenu 2 : reading --> 48/49
Zero assist and easy ride with hard gear on flat garage: reading --> 70-71
Zero assist with soft gear on garage ramp: reading --> 78

Hope this helps.
I really appreciate that you took the time to do the tests! :)

Thanks, thineight!

thineight wrote:
Jun 05 2019 3:43pm
Buba, I guess we spoke about this some time ago, but I do not remember the conclusion.
Regarding the walk assist, it is beneficial to have a sort of "lock" of the walk assist in order not to require the DOWN button to be pushed constantly. In fact it is hard not to slip off with the finger on a steep hill.. and the walk assistance will stop.

In fact when the "lock" is active the walk assist is started just holding the DOWN button and after you can release it, the bike will keep on walking beside you. Simple press on UP or DOWN button (or brake if magnetic sensors are installed) will stop the walk assistance.
This logic is applied also on marcoq fork for the stock display and it works very well.
Do you think we have chance to have it on the LCD3 display or the memory is over?

Thanks
I understand completely.

Let me list some improvements planned for the Walk Assist function long ago:

* Acceleration of power. Walk Assist in its current state should always be activated when already walking as it has a very high acceleration. But with a "soft start" function it will be really smooth even from a complete stand still.

* Closed feedback loop controlling the motor rotation. This feedback loop would ensure more consistent operation and would ensure same speed regardless of state of charge. The wheel speed could also be used but it is not advisable due to the low resolution and inertia.

* Power limit safety. This limit would cut or lower the power in certain situations where it is necessary. Ensuring user safety and protection of the drive train.

* Locked Walk Assist. This would be the aforementioned functionality of locked Walk Assist with no button press. This would operate until user presses a button, the brakes or if there are abnormal levels of resistance, or lack thereof, in the system.

* No Load Cuttoff. If the user falls or the wheels are in the air the system would deactivate.

I have no problems with walk assist as it is now because I am familiar with the power levels I set. It is slower and smoother than the original firmware implementation. But could be even better with the mentioned improvements.

We can definitely look at this after the stable 0.19.0 and then make the Walk Assist even better for the next version. Then we could also implement the "no-button" Walk Assist if it ends up being really safe!

casainho wrote:
Jun 05 2019 4:19pm
thineight wrote:
Jun 05 2019 3:43pm
Buba, I guess we spoke about this some time ago, but I do not remember the conclusion.
Regarding the walk assist, it is beneficial to have a sort of "lock" of the walk assist in order not to require the DOWN button to be pushed constantly. In fact it is hard not to slip off with the finger on a steep hill.. and the walk assistance will stop.
I strongly disagree with this because walk assist as it is now is very dangerous. I even didn't told to my son when he had to push his bicycle hardly on mountain because it is dangerous: very fast and strong start and possibly high speed. You can't know the speed until you start so it is always a guess.
Sad to hear you feel that it is that dangerous. The default values on the lower assist levels should be really, really, slow. And all other values can be lowered and adjusted to fit any bike and weight. But I agree that there are improvements to be made. Such as those I mentioned above.
Last edited by buba on Jun 05 2019 6:41pm, edited 2 times in total.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 05 2019 6:30pm

buba wrote:
Jun 05 2019 6:04pm
casainho wrote:
Jun 05 2019 8:01am
buba wrote:
Jun 05 2019 6:48am
Casainho and others, should there be an error code when user has the assist level or assist multiplier set to anything other than zero and motor power limit set to zero and also tries to ride the bike. Maybe only displayed for a short duration such as 5-10 seconds?
I think the default value does not help, if it was something like 1000 watts, then this would not be an issue.

Also, when the power limit is hit, there is not indication to user and that should no be an error message. Maybe short blink power field like 20% of time off, like 200 ms off and 800 ms on.
Okay good, in short, no error code necessary. If it becomes a problem later on we can set the default power to 250 watts as suggested by btslo and/or write a function that flashes the power reading if at power limit as you suggested.
I think this is a problem already because it did happen to a few users that reported but they had no clue. The quick and simple way is simple to keep a value that disables the limitation as also makes hard to disable the system with a mistake of just 1 or 2 clicks of down button when changing max power by mistake. To make this, just change default value from 0 to 1000.
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.

buba   10 kW

10 kW
Posts: 540
Joined: Aug 31 2018 12:36am

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

Post by buba » Jun 05 2019 6:38pm

casainho wrote:
Jun 05 2019 6:30pm
I think this is a problem already because it did happen to a few users that reported but they had no clue. The quick and simple way is simple to keep a value that disables the limitation as also makes hard to disable the system with a mistake of just 1 or 2 clicks of down button when changing max power by mistake. To make this, just change default value from 0 to 1000.
Will change the default value! :thumb:
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 05 2019 6:50pm

thineight wrote:
Jun 05 2019 3:43pm
Regarding the walk assist, it is beneficial to have a sort of "lock" of the walk assist in order not to require the DOWN button to be pushed constantly. In fact it is hard not to slip off with the finger on a steep hill.. and the walk assistance will stop.
So this user says the finger slip on a steep hill and this is the real issue.

When the finger slips for a long period of time means users probably is not anymore in control of the bicycle and then motor should stop. If it is for a short period like 1 second, then it can slip because of the vibrations due to the irregularity of the terrain however user still his in control. I think we just need to filter out quick button releases of less then 1 second or such.

Let's assume the user did fall on top of the bicycle and a leg is touching the rear wheel -- should walk assist work with that lock and grind the user leg until the user can recover, wake up, and disable the lock? And what if the user has long hair and fall with head on the wheel and the hair rolls on the wheel/spokes/sprocket, can the user ever recover or will die?
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.

buba   10 kW

10 kW
Posts: 540
Joined: Aug 31 2018 12:36am

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

Post by buba » Jun 05 2019 8:35pm

casainho wrote:
Jun 05 2019 6:50pm
thineight wrote:
Jun 05 2019 3:43pm
Regarding the walk assist, it is beneficial to have a sort of "lock" of the walk assist in order not to require the DOWN button to be pushed constantly. In fact it is hard not to slip off with the finger on a steep hill.. and the walk assistance will stop.
So this user says the finger slip on a steep hill and this is the real issue.

When the finger slips for a long period of time means users probably is not anymore in control of the bicycle and then motor should stop. If it is for a short period like 1 second, then it can slip because of the vibrations due to the irregularity of the terrain however user still his in control. I think we just need to filter out quick button releases of less then 1 second or such.
Have previously tried button debounce. But with the debounce together with the communication time it was too unsafe and slow during certain situations. This is why I removed it before I submitted the Walk Assist Pull Request long ago. But now the communication is much faster so it might operate better.
casainho wrote:
Jun 05 2019 6:50pm
Let's assume the user did fall on top of the bicycle and a leg is touching the rear wheel -- should walk assist work with that lock and grind the user leg until the user can recover, wake up, and disable the lock? And what if the user has long hair and fall with head on the wheel and the hair rolls on the wheel/spokes/sprocket, can the user ever recover or will die?
I understand your concern and in this case there is a fine line between really safe and potentially unsafe. Most of the scenarios you mentioned would be greatly or completely removed with the previously mentioned improvements. But there is still a chance that something might go wrong. Especially if you have long hair.
buba wrote:
Jun 05 2019 6:04pm
* Acceleration of power. Walk Assist in its current state should always be activated when already walking as it has a very high acceleration. But with a "soft start" function it will be really smooth even from a complete stand still.

* Closed feedback loop controlling the motor rotation. This feedback loop would ensure more consistent operation and would ensure same speed regardless of state of charge. The wheel speed could also be used but it is not advisable due to the low resolution and inertia.

* Power limit safety. This limit would cut or lower the power in certain situations where it is necessary. Ensuring user safety and protection of the drive train.

* Locked Walk Assist. This would be the aforementioned functionality of locked Walk Assist with no button press. This would operate until user presses a button, the brakes or if there are abnormal levels of resistance, or lack thereof, in the system.

* No Load Cuttoff. If the user falls or the wheels are in the air the system would deactivate.
What I think is best for now, as I said before, is to focus on the stable 0.19.0. Then improve Walk Assist and try to make it as safe as possible. With watertight logic, able to sense all kinds of abnormal scenarios.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

thineight   100 W

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

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

Post by thineight » Jun 06 2019 1:46am

Ok casainho, I understand your concerns with the walk assist. The safety controls mentioned by buba or the "button bounce check" would potentially solve the problem, because as it is now is very hard sometimes to push the bike uphill. :thumb:

Regarding the startup power and speed I guess marcoq managed these issues in a different way (if I remember correctly he coded this feature first) and the bike starts to move very soft, you can really feel the ramp.
I do not understand why you mention that the bike can start at high speed/power as the values are set quite low for the various assistance levels, perhaps I miss some tips in the coding itself.
Just for information, the "auto" walk assist on marcoq soft was implemented only for level 1, higher levels still use the original logic.

All in all, at the moment this is an improvement that does not take priority 1.. let's focus on the stable 0.19 first.
Thanks a lot
MTB KTM Ultra 29" - City bike DAYTONA 28"

Post Reply