TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Electric Motors and Controllers
casainho   1.21 GW

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

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

Post by casainho » Jul 22 2019 2:46pm

bart594 wrote:
Jul 22 2019 1:31pm
i think developing configuration screen for this lcd is waste of time and resources. We have now like 80 menu items for different settings and this number getting bigger and bigger. On the big screen like 850c it takes lot of time to go through all the menus. SW102 with tiny screen is for showing infos like speed, battery level, assistance levels, trip distance, time and maybe cadence and human power All the settings should be done in android app.
I understand what you mean but I have different perspective: we can be on a long trip on mountains and some sensor can fail like magnet of the brake sensor, magnet of wheel speed sensor, torque sensor fail, etc, and then we need to survive and be able to disable that sensors on the configuration menu. We should not depend on the mobile phone because again it can fail, like being without battery or simple a lost phone.
I am not talking about something that is hard to happen, this things did happen to me or to members of my family.

Yes, configuration is big but I plan to implement a way to compress/expand the sections so it get short.

And I think mobile app can do also the configuration menu and that other features no possible to do with the LCD like the navigation.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.

Rafe   10 W

10 W
Posts: 91
Joined: Oct 16 2018 5:56pm

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

Post by Rafe » Jul 23 2019 1:34am

andrea_104kg wrote:
Jul 22 2019 12:50pm
I would first like to say that mine is a personal opinion. This is so that no one is offended, my opinion counts very little.
I like riding bikes more than setting engines and it doesn't matter if the display isn't colored.
I also have a turbo levo and I can make direct comparisons. With tsdz2 I can do more or less the same things and this in itself is exceptional. I don't care how easy it is to set up because I make the adjustment and then I don't change it anymore for months. For me, therefore, switching to the 850c display is not essential, unless there are really substantial advantages that go beyond aesthetics. I repeat it is a personal opinion.
Very much my view too. I use the 850c on my BBSHD and of the two displays I actually prefer LCD 3. The bells and whistles of the 850c in reality are not an improvement in use, the viewing angles are poorer and it is not as easy to read. The basic black and white display of LCD 3 which is actually good quality is also much easier to read than any mobile phone display in sunlight too. Also it is cheap as chips and extremely easy for the average person to mod for TSDZ2 use. I am pretty much of the view if it ain't broke don't fix it.

vadda   100 mW

100 mW
Posts: 43
Joined: Dec 21 2009 6:22am

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

Post by vadda » Jul 23 2019 1:52am

First of all, I continue to thank everyone for the precious time dedicated to this project and this community.
:thumb:
I agree with casainho, I believe that the less things there are, the less they can break (cit. Ing Ford)
Looking back on the development on LCD3, instead, I think it's not a waste of time because now it has mounted so many people and the most useful thing for everyone is surely the fact that the FW and the new functionalities are tested in the field and brings as many feedback as possible on the good functioning.
In the end, the most difficult thing is to understand and define the logics to implement.
The code is easily portable nowdays.
My 2 cents

e3s   10 W

10 W
Posts: 76
Joined: Jan 08 2018 12:40pm

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

Post by e3s » Jul 23 2019 6:53am

ImageAbout tuning the controller, if I change the capacitors is 75v the maximum voltage that the controller can support? I read some info about the components but for sure I make this question.
Another thing: I like to learn the concept of erps. Example in this gif, if the rotor makes a complete rotatation in a second, the erps is 4?
Image

troebi   1 mW

1 mW
Posts: 18
Joined: Jul 27 2017 3:50pm
Location: South Germany

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

Post by troebi » Jul 24 2019 4:49am

casainho wrote:
Jul 22 2019 1:07pm
Advantages of 850C LCD:
- has a lot of memory and so we are not limited as on KT-LCD3
- the big display let us show big numbers for the ones that have difficult to see tiny
- 4 numeric fields and 1 graph
- easy to understand configuration menu
- time!!
- USB charger

The SW102:
- tiny for the ones that prefer a small LCD
- more memory than LCD3 and way less than 850C
- tiny numbers, hard to see
- can't show much information on LCD because it is tiny
- Bluetooth
- no time but maybe we will be able to implement something more or less reliable
- no USB charger

I think both of this are way better than LCD3.
In my oppinion, the displays are means for the purpose. They shall be as simpel as possible (also for configuration). So I think, the 850C might be one of the best (for me).
The LCD3 has a perfect contrast in sunlight but as well the main config as the daily use is not very comfortable. When I want to check the trip milage, the average speed, or the total milage, I do not always succeed (I use 0.18 but I'm looking forward to 0.20 :D ).

I hope, the graphics will be done like bafang does. Human power and assistance power is interesting but not mandantory (perhaps it can be switched in a menu)

User avatar
stancecoke   100 kW

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

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

Post by stancecoke » Jul 24 2019 5:28am

troebi wrote:
Jul 24 2019 4:49am
In my oppinion, the displays are means for the purpose.
I agree. I prefer to have no display at all. I live in a flat area, with a torquesensor based sytem, there even is no need to change the assist level :D

Setting up the system with a display and just three buttons to edit the parameters?! :shock: No solution for me. I prefer a laptop with a normal keyboard and a clear overview of relevant parameters on the laptop screen and the possibility to save and reload setups . Be honest: how often do you change parameters? Normally I need 4 or 5 attemps to find a satisfying setup for a new bike...

regards
stancecoke

casainho   1.21 GW

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

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

Post by casainho » Jul 24 2019 5:43am

stancecoke wrote:
Jul 24 2019 5:28am
troebi wrote:
Jul 24 2019 4:49am
In my oppinion, the displays are means for the purpose.
I agree. I prefer to have no display at all. I live in a flat area, with a torquesensor based sytem, there even is no need to change the assist level :D

Setting up the system with a display and just three buttons to edit the parameters?! :shock: No solution for me. I prefer a laptop with a normal keyboard and a clear overview of relevant parameters on the laptop screen and the possibility to save and reload setups . Be honest: how often do you change parameters? Normally I need 4 or 5 attemps to find a satisfying setup for a new bike...
That is why you developed the option on the OpenSource firmware for KT motor controllers to work like that :-) -- do you want to do the same for TSDZ2 (that could help users like you)??

I have only one bicycle and I use it on the city and also on mountains. For me is very important things like manage the battery range when I am on the mountains, where I will not take my computer with me (although my computer is very portable because has a 7'' only display).
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.21 GW

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

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

Post by casainho » Jul 24 2019 5:43am

e3s wrote:
Jul 23 2019 6:53am
ImageAbout tuning the controller, if I change the capacitors is 75v the maximum voltage that the controller can support? I read some info about the components but for sure I make this question.
Another thing: I like to learn the concept of erps. Example in this gif, if the rotor makes a complete rotatation in a second, the erps is 4?
Image
Yes.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.21 GW

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

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

Post by casainho » Jul 24 2019 6:10am

I got working the quick selection of variables to show on the graph: on the main screen, we need to click + long click on ON/OFF button and the graph title blinks, then we can select another variable by using UP and DOWN buttons. Then we leave this mode by long click on ON/OFF button.
Other than the regular variables like pedal human power, pedal cadence, battery voltage, motor power, etc, we can also select ones that are tecnhical like motor angle FOC (maybe in future this can be disabled in configurations).

I took a ride and let me show the graphs (graph shows an interval of 15 minutes) and let's learn a bit how the motor works.

On this ride I was able to go up to 47.6 kms/h:

Image


My cadence was max of about 90 RPMS:

Image



The human power max was about 150 watts:

Image


And the motor current max was:

Image


And the battery voltage, as we can see it dropped with the current peaks. (Some 0 values on the graph, must be some issue).

Image


And the motor power, was max of 704 watts (see that for I get up to the 47.6 kms/h on a light descend, I had to do 154 watts on the pedals while the motor pulled 704 watts from the battery -- assist level factor of about 4.6):

Image


The motor temperature did increase a bit after this short current peaks:

Image


Motor PWM duty-cycle (possible max value is 255):

Image


Motor ERPS (electric rotations per second), where max permitted value is 525 but with high cadence mode this value can be higher:

Image


And the FOC algorithm angle, it increases with both motor ERPS and current, this is what makes the motor to run most efficient possible, having the most torque possible for the same battery usage power and be most silent possible:

Image


And finally, the battery SOC based on Coulomb counting which has good accuracy:
Image
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.

shaddi   100 mW

100 mW
Posts: 43
Joined: May 30 2018 3:20pm

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

Post by shaddi » Jul 24 2019 8:22am

stancecoke wrote:
Jul 24 2019 5:28am
troebi wrote:
Jul 24 2019 4:49am
In my oppinion, the displays are means for the purpose.
I agree. I prefer to have no display at all. I live in a flat area, with a torquesensor based sytem, there even is no need to change the assist level :D

Setting up the system with a display and just three buttons to edit the parameters?! :shock: No solution for me. I prefer a laptop with a normal keyboard and a clear overview of relevant parameters on the laptop screen and the possibility to save and reload setups . Be honest: how often do you change parameters? Normally I need 4 or 5 attemps to find a satisfying setup for a new bike...

regards
stancecoke
fully agree!
My dream is to get the SW102, so i have a small display for the daily usage and an APP (mobile or notebook) for configurations via BLE.

I also thought about an ESP32 Controller, with a small OLED Display. So we can have BLE and WiFi together. First E-Bike with an own WebInterface :lol:

e3s   10 W

10 W
Posts: 76
Joined: Jan 08 2018 12:40pm

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

Post by e3s » Jul 24 2019 11:38am

casainho wrote:
Jul 24 2019 5:43am
Yes.

Or 8? I'm bit confused. In the meantime well done for the huge work of coding. I'm not an expert but I'm a little good at electronics. I'll try to make some tuning starting from the controller.
Last edited by e3s on Jul 24 2019 11:46am, edited 1 time in total.

casainho   1.21 GW

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

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

Post by casainho » Jul 24 2019 11:44am

e3s wrote:
Jul 24 2019 11:38am
casainho wrote:
Jul 24 2019 5:43am
Yes.
Or 8? A bit confused.
If there are 4 pair of magnets, then it is 4 erps if the rotor rotates 1 per second.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.

RicMcK   1 W

1 W
Posts: 63
Joined: Jun 19 2019 9:12am

TSDZ2 8 Pin extension cable?

Post by RicMcK » Jul 24 2019 7:30pm

Where can I find a 8 pin display extension cable for a TDSZ2? Or do I have to use a 6 pin extension cable and do with out the other 2 leads?

THANKS Rick.
Rick Seattle WA

elfnino   100 mW

100 mW
Posts: 43
Joined: Mar 06 2019 5:09am

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

Post by elfnino » Jul 25 2019 2:30am

casainho wrote:
Jul 24 2019 6:10am
I got working the quick selection of variables to show on the graph: on the main screen, we need to click + long click on ON/OFF button and the graph title blinks, then we can select another variable by using UP and DOWN buttons. Then we leave this mode by long click on ON/OFF button.
Other than the regular variables like pedal human power, pedal cadence, battery voltage, motor power, etc, we can also select ones that are tecnhical like motor angle FOC (maybe in future this can be disabled in configurations).
Great ! :thumb:
It would be also interesting to see how the total power is distributed among human and motor power in a single graph just by using different colors.

Sky is the limit with colorful LCD..

casainho   1.21 GW

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

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

Post by casainho » Jul 25 2019 2:34am

elfnino wrote:
Jul 25 2019 2:30am
Great ! :thumb:
It would be also interesting to see how the total power is distributed among human and motor power in a single graph just by using different colors.
I understand what you mean and I already though on that. The issue is that will bring even more possibilities and more configuration options, which will make even much more confuse. Maybe later, for now I would like to work on stable version first.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.21 GW

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

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

Post by casainho » Jul 25 2019 5:05am

Buba, see this:
wpenner wrote:
Jul 25 2019 1:10am
casainho wrote:
Jul 25 2019 12:51am
wpenner wrote:
Jul 24 2019 11:19pm
My motor cooked itself 2500km+ Blue gear still good. Not sure if overheated or controller cooked it. Noticed small break in yellow wire housing, maybe that shorted to the case.
It was suddenly? Or was something slow? Maybe you need to install the temperature sensor...
It was all of a sudden, when changing gears I felt some resistance for 10 seconds and then stopped. I did have my motor apart a few rides ago to add the temperature sensor(was not configured yet). It seems only the wires connected to the yellow phase wire are burned near the entry. Rest or motor wires are not black, so I guess likely controller short or maybe yellow wire touched the case where housing was damaged. If was over temperature I think all wires would be black instead of just on one corner of the motor.
I think we need to improve the motor code to avoid this. Basically, the motor must have some min ERPS value if there is power/current on it. I did this kind of protection but on upper layer and it is slow to react -- I guess we need to make it on lower layer so it is faster to react. I think the issue is if there is some bug and coils get current while the motor is stopped.

We need to re-enable the watch dog timer on PWM cycle code so if something fails, the system reboots and not stay halt with current on coils. And also that motor must have ERPS if there is current on coils.

I think this kind of issues are way important than the advanced features. It is preferable to cut any advanced feature over having a rock solid motor working.

I am waiting for the new version and then we can carefully see how we will handle this.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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: 587
Joined: Aug 31 2018 12:36am

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

Post by buba » Jul 25 2019 6:04am

casainho wrote:
Jul 25 2019 5:05am
I think we need to improve the motor code to avoid this. Basically, the motor must have some min ERPS value if there is power/current on it. I did this kind of protection but on upper layer and it is slow to react -- I guess we need to make it on lower layer so it is faster to react. I think the issue is if there is some bug and coils get current while the motor is stopped.

We need to re-enable the watch dog timer on PWM cycle code so if something fails, the system reboots and not stay halt with current on coils. And also that motor must have ERPS if there is current on coils.

I think this kind of issues are way important than the advanced features. It is preferable to cut any advanced feature over having a rock solid motor working.

I am waiting for the new version and then we can carefully see how we will handle this.
Definitely! This is why I removed the startup-assistance-without-pedal-rotation! I burned a phase wire and destroyed a motor this way during testing. Now on the 0.20.0 I only enable motor if the motor shaft rotates at least 4 revolutions per second so it is never enabled when stand still!

I have pictures of my burned phase wires. If there is any value in seeing how the wire insulation and isolation disc melted I can upload pictures!

NOTE: I have improved everything else so the startup is basically instant even though we do not have startup-assistance-without-pedal-rotation! It will still startup much, much faster than before so I hope no one feels the removal is bad. It is just that much safer as you can rest your feet on the pedals and when you want to go it is instant! If you use the double cadence it will startup perfectly and the standard cadence is also really fast!


casainho wrote:
Jul 25 2019 5:05am
We need to re-enable the watch dog timer on PWM cycle code so if something fails, the system reboots and not stay halt with current on coils. And also that motor must have ERPS if there is current on coils.
Very good solution to have that check.


wpenner wrote:
Jul 25 2019 1:10am
casainho wrote:
Jul 25 2019 12:51am
wpenner wrote:
Jul 24 2019 11:19pm
My motor cooked itself 2500km+ Blue gear still good. Not sure if overheated or controller cooked it. Noticed small break in yellow wire housing, maybe that shorted to the case.
It was suddenly? Or was something slow? Maybe you need to install the temperature sensor...
It was all of a sudden, when changing gears I felt some resistance for 10 seconds and then stopped. I did have my motor apart a few rides ago to add the temperature sensor(was not configured yet). It seems only the wires connected to the yellow phase wire are burned near the entry. Rest or motor wires are not black, so I guess likely controller short or maybe yellow wire touched the case where housing was damaged. If was over temperature I think all wires would be black instead of just on one corner of the motor.
wpenner, I know it is difficult to remember but:

1. What speed where you riding at when this happened?
2. Were you rotating the pedals quickly when you felt the resistance or was it barely any rotation?
3. Do you have the Coaster Brake version?
4. Did you experience any rain before this?
5. Did the motor stop before you changed gears or did you change gears during rotation?
6. Do you think the motor rotated and was there excess power going to the motor at the moment of resistance?
7. Do you have version 0.19.0 installed?
8. Do you think the root cause was the yellow phase wire that shorted to the case?

Sorry for the questions but the more we know the better code we can write to solve this. This will also help us find ultra rare bugs. If you do not want or do not know how to answer some questions it is totally fine! Just want to check!

Thank you for the reporting and sorry to hear that happened! This is one of many things I hope are improved on the 0.20.0 and we can even do more just as Casainho suggested!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   10 kW

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

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

Post by buba » Jul 25 2019 6:54am

Sorry for being offline the last couple of days! Have focused on finalizing my work so we can have a beta out this week. I hope everyone understands.

But was reading every single post and I got to say it was really NICE to see the discussions! It is great to see the community share their opinions and feelings! When it is time to discuss the 0.20.0 I can only hope that as many join and give feedback! We could even have polls where the entire community is given an opportunity to vote!

As for the first beta: I have been extremely limited with time this week but still managed to develop every single day. Have just recently added so we can have great motor control from very low current levels without motor jitter. So when starting against a hill or in a high gear it will be a smooth experience that assists you up to speed. I think Bosch brags about assist startup on hills and what not... :wink:

The deadline remains and everything should be finished this week and the last changes submitted. Then I will try to explain important points and start a discussion about the 0.20.0 and answer all questions.

I have implemented all the great user suggestions as well. If for any reason you do not see your particular suggestion in the coming beta, please let me know and we will sort it out. :) Most likely I just missed it due to the amount of changes made!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

perryscope   100 W

100 W
Posts: 106
Joined: Jan 06 2019 4:29pm
Contact:

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

Post by perryscope » Jul 25 2019 7:17am

I just wanted to share an Issue I had today, and will follow up later once I have examined the motor, but I noticed on the morning ride to work my motor suddenly stopped all assistance and I could see on the screen my temperature was at floating around 140 Deg C! and flashing.

Well it was hot but not that hot so I guessed that I have an issue with either the temperature sensor or more likely a restrictive short on the pins to the sensor /cable.
It was not at a fixed value either jumping around a few degrees up and down and a tap to the motor would drop it 10 degrees or more, all suggesting a cable issue with changing resistance.

I did rinse down the bike yesterday after a muddy ride and left it to dry well in this heat we are having, but its possible that some water got wicked into the cable, and more than a coincidence I think.

I was confident my motor was not about to go into meltdown, so disabled the temperature protection ( Menu 7 > 4 > set to 0) which somehow I remembered the location of :D so its all running again for now and I can get home tonight.

With you talking about motor protection it made me think maybe it may be good to detect a very high or indeed low temperature readings as a more general fault and could suggest a cable , sensor or moisture issue worth investigation. Maybe hard to do anything different on the LCD3 screen but on the text capable screens a more written warning could be given " Temperature sensor Fault" and the option to disable over temperature protection but keep the warning until the reading is within a logical range.

I will update once I find the actual issue.
Empowered people support rider and trustee
www.empoweredpeople.co.uk

buba   10 kW

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

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

Post by buba » Jul 25 2019 7:54am

perryscope wrote:
Jul 25 2019 7:17am
I just wanted to share an Issue I had today, and will follow up later once I have examined the motor, but I noticed on the morning ride to work my motor suddenly stopped all assistance and I could see on the screen my temperature was at floating around 140 Deg C! and flashing.

Well it was hot but not that hot so I guessed that I have an issue with either the temperature sensor or more likely a restrictive short on the pins to the sensor /cable.
It was not at a fixed value either jumping around a few degrees up and down and a tap to the motor would drop it 10 degrees or more, all suggesting a cable issue with changing resistance.

I did rinse down the bike yesterday after a muddy ride and left it to dry well in this heat we are having, but its possible that some water got wicked into the cable, and more than a coincidence I think.

I was confident my motor was not about to go into meltdown, so disabled the temperature protection ( Menu 7 > 4 > set to 0) which somehow I remembered the location of :D so its all running again for now and I can get home tonight.

With you talking about motor protection it made me think maybe it may be good to detect a very high or indeed low temperature readings as a more general fault and could suggest a cable , sensor or moisture issue worth investigation. Maybe hard to do anything different on the LCD3 screen but on the text capable screens a more written warning could be given " Temperature sensor Fault" and the option to disable over temperature protection but keep the warning until the reading is within a logical range.

I will update once I find the actual issue.
Can confirm I had the exact issue! Turned out I had water inside the case. Can also confirm I was hitting the temperature limiting when that happened and was generally shown abnormal motor temperature values.

Good suggestion! We should also advice the user to dry out/clean inside the case and check the wires if something like that happens. We just need to be able to properly define a non-working sensor situation and be confident it will not cause a problem. Worst case scenario is that have a real over-temperature situation and set an error for sensor fault. Thus disabling the motor temperature protection. But that is very unlikely if properly implemented.

Anyway, it is at least safe to say that a value of 140 degrees Celsius should point to sensor fault.

Will remember this and when time allows maybe the community can start a discussion of how we might implement such an error flag and what parameters are safe to use. Also what the effect of the error should be.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

casainho   1.21 GW

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

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

Post by casainho » Jul 25 2019 8:12am

buba wrote:
Jul 25 2019 6:04am
Definitely! This is why I removed the startup-assistance-without-pedal-rotation! I burned a phase wire and destroyed a motor this way during testing. Now on the 0.20.0 I only enable motor if the motor shaft rotates at least 4 revolutions per second so it is never enabled when stand still!

NOTE: I have improved everything else so the startup is basically instant even though we do not have startup-assistance-without-pedal-rotation! It will still startup much, much faster than before so I hope no one feels the removal is bad. It is just that much safer as you can rest your feet on the pedals and when you want to go it is instant! If you use the double cadence it will startup perfectly and the standard cadence is also really fast!
Startup-assistance-without-pedal-rotation is a feature I did implement and I use daily. Please put it back or I will have to do it.

There is no problem to have motor starting if we don't rotate the pedals, the throttle works just like that.

What others asked is an offset and I was thinking in having a configurable offset in kgs, where the user could see on advanced tecnhical data the value in kgs of weight done on the pedals (as we will have this to calibrate the torque sensor). I am looking at the calibration of the torque sensor and looking at the torque sensor ADC values, I can see that the weight of my leg resting on the pedal is near 10 kgs. I could setup a value of like 15 kgs or 5 kgs, depending in what I prefer. For me, could be the 5 kgs because I like to get immediate assistance as soon I release the brakes.

By the way, 10 kgs is +14 ADC 8 bits units on my recent bought torque sensor, which I think is plenty to be safe as an offset to avoid unwanted startups.

The torque sensor needs more love from us: we need to add calibration and also show to user the force on it in kgs. This my torque sensor, as we use it now, can only measure (wrongly!) up to about 120 watts of human power at my natural cadence while it should be able to measure up to 500 watts of human power (because it can only measure up to 25 kgs but calibrate will measure up to 110 kgs).
Last edited by casainho on Jul 25 2019 8:18am, edited 1 time in total.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.

hydrinium.h2   1 mW

1 mW
Posts: 12
Joined: Jul 25 2019 6:56am

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

Post by hydrinium.h2 » Jul 25 2019 8:16am

Hi,
First I wanted to say that this project is great, I've been using the software and overall I enjoy it!
However I've noticed that the assist levels seem to hit a wall pretty quickly, at least for me. I'm actually finding that compared to the stock software I'm around 10% slower at max speed and that anything over around 2x assist doesn't really affect the output of the motor. Looking through the thread I think a couple other people also mentioned this issue with assist scaling. On my installation I can't seem to get over around 400w sustained output from the motor, even if I set assist at 3x or 4x. Although I've seen short spikes up to 800w. For example, if I have assist at 3x with 200w human power I'm still seeing 400w max. The human power I'm getting from the odometer subfield.
I've scoured this thread and the settings for any solutions but I haven't really found anything.
My current setup is 0.19.x with a 48v 14.5Ah battery
http://www.uppbattery.com/ship-from-us- ... -p0839.htm.
My config is:
Assist Levels - 6 levels at 0.5, 1, 1.5, 2, 2.5 and 3
Max current - 18 Amps
Speed Limit - 50 mph
Low voltage cutoff - 38 v
Motor Voltage type - 48v
Motor Power Limit - 0
Temperature Limit or Throttle - 0
Boost - 0
Street Mode - 0

Would anyone have any ideas on what could be the issue, or is this actually normal behavior for the software? Any help would be great!
Thanks!

casainho   1.21 GW

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

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

Post by casainho » Jul 25 2019 8:22am

hydrinium.h2 wrote:
Jul 25 2019 8:16am
Would anyone have any ideas on what could be the issue, or is this actually normal behavior for the software? Any help would be great!
When you feel you are hitting the limit, go to advanced technical data menu and see the value of the motor ERPS and PWM duty-cycle, then share with us here.

Here an example of my values but that I was not a max of the motor:

Image

Image
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.

hydrinium.h2   1 mW

1 mW
Posts: 12
Joined: Jul 25 2019 6:56am

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

Post by hydrinium.h2 » Jul 25 2019 9:03am

From a quick test I got:
PWM duty cycle : 254
ERPs : Fluctuated between 390-400
Also, current seems to max out around 8 Amps seated, I can get it to jump to around 12 if I start pedaling standing.

casainho   1.21 GW

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

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

Post by casainho » Jul 25 2019 9:08am

hydrinium.h2 wrote:
Jul 25 2019 9:03am
From a quick test I got:
PWM duty cycle : 254
ERPs : Fluctuated between 390-400
Also, current seems to max out around 8 Amps seated, I can get it to jump to around 12 if I start pedaling standing.
PWM duty cycle at 254 is the max value possible. And what is your pedal cadence on this situation?
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

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.

Post Reply