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

Electric Motors and Controllers
buba   10 kW

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

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

Post by buba » Jul 29 2019 8:52am

stancecoke wrote:
Jul 28 2019 9:11am
buba wrote:
Jul 28 2019 6:08am
I will submit one last commit to my branch today and it will be something that is beta-worthy for all users!
I just took a look at your latest commits. Very well commented and easy to understand!

...

The e mtb mode is not working yet?

regards
stancecoke
Please let me know if I need to comment or explain something more! Just merged my local eMTB branch so if you want to take a look at it you are free to go to my development branch on GitHub:

https://github.com/leon927/TSDZ2-Smart- ... ng-pwm-acc

-----------------------------

It is now possible to release a beta for all users. But would like to make the cadence sensor calibration automatic for those users that wish to have a really fast response. Will explain more about the "double resolution cadence" in a coming post. Will update within one hour.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   10 kW

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

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

Post by buba » Jul 29 2019 10:22am

The New Cadence Sensor Code

As many of you know I have been trying to figure out how to best increase the feeling and response of the entire system. The cadence sensor is one small part of the development but is very important part nonetheless. Especially at startups, when shifting gears and also when you stop pedaling and the motor is supposed to disengage. The time delay in the latter situation is often called the power-off-lag. In short, a good cadence sensor implementation provides a safe and responsive system.

Startups: We need to confirm that the user is rotating the pedals to enable assistance. So we do this by increasing the minimum cadence measured by the system and thus get a more responsive startup. But in doing so we also introduce a time delay as the system needs to wait for the transitions. We partly solve this by optimizing the code overall. But, in some situations, there might still be a considerable delay between the moment the user stops pedaling to the moment the motor stops giving assistance. This is the power-off-lag.

Power-off lag: To solve the power-off-lag we change the resolution and therefore the response time depending on wheel speed. No point in measuring down to 5 RPM and waiting for transitions when going fast. For instance, if we are going at a speed of 20 kph, or almost 13 mph, with a gear ratio of 52 to 11 teeth, the crank cadence is around 30 RPM.

So now, the resolution will automatically adjust appropriately and we get a much faster response.

What more can we do?

This is a very, very, simplified model of a cadence sensor disc with 6 magnets and the transition states for a complete revolution. Note that the TSDZ2 has 20 magnets in its cadence sensor disc but we are keeping it simple with only 6 magnets:
Simplified Cadence Sensor Model with 6 Magnets (100).png
Simplified Cadence Sensor Model with 6 Magnets (100).png (18.27 KiB) Viewed 514 times
The blue fields represent the magnetic fields strong enough to measure as HIGH in the system. The grey fields represent the opposite and is measured LOW in the system. There is a magnet in the center of all the blue fields.

Usually, when calculating the rotational speed of the crank you measure the time between two transitions and take in to account the number of transitions there are in the cadence sensor disc. The transitions that are measured are often of the same kind. One example of transitions of the same kind is when the cadence sensor pin state is going from LOW to HIGH. In our example this means we only count the transitions that go from GREY to BLUE. We discard the transitions that go from BLUE to GREY.

I was curious of using all the transitions but knew that if the spacing between the different transitions was not the same it could be problematic. So I tested for every transition and got this, which I also posted previously in the thread:
fedd.jpg
fedd.jpg (94.8 KiB) Viewed 514 times
It looked like we had a nice distribution of transitions and it seemed the spacing was the same between all transitions. So this made me very happy as we could just make one very small change and immediately half the response time. But this was not the case.

Following is an exaggerated version of the reality where I want to make it very clear what problem we must solve. Firstly, here we have strong magnets in the cadence sensor disc. So the spacing between LOW to HIGH -> HIGH to LOW is longer than the spacing between the HIGH to LOW -> LOW to HIGH.
Simplified Cadence Sensor Model with 6 Magnets (Over 100).png
Simplified Cadence Sensor Model with 6 Magnets (Over 100).png (18.33 KiB) Viewed 514 times
Secondly, here we have weak magnets in the cadence sensor disc. So the spacing between the LOW to HIGH -> HIGH to LOW is shorter than the spacing between HIGH to LOW -> LOW to HIGH.
Simplified Cadence Sensor Model with 6 Magnets (Less than 100).png
Simplified Cadence Sensor Model with 6 Magnets (Less than 100).png (18.42 KiB) Viewed 514 times
So let us call this discrepancy a difference in magnet pulse width. Sadly, this value is different for every cadence sensor. Meaning calibration is needed for every user that wants to have the more responsive cadence sensor. I had the opportunity to test on two different TSDZ2 units, one very old and one completely new. One unit got 67 % HIGH and 43 % LOW and the other 40 % HIGH and 60 % LOW.

With clever code we can make this all work very nicely and have the equivalent of 40 magnets. Making the cadence sensor react faster, with less rotation to engagement and make the overall system more responsive.

What I wish to do today is an automatic calibration process. The user will be able to choose between the standard or extra cadence sensor mode. If the user chooses the extra cadence sensor mode a small calibration process is needed but the TSDZ2 will manage everything. The user only needs to hold one button and it is all configured automatically.

So if no one minds I will try to add this automatic calibration process and save a lot of time writing a tutorial with tips and tricks. As it will all be done automatically. So in the long term this will probably be more time efficient and will result in an even better experience for users.

Another reason this is especially important to do is that it can greatly help users that use the coaster brake version. Where it is very important with a fast response. So I hope everyone understands why I want to implement the automatic calibration process instead of the manual calibration. Do note that I will continue to work several hours per day with the development until the beta is out!
Last edited by buba on Jul 29 2019 2:34pm, edited 3 times in total.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

User avatar
stancecoke   100 kW

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

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

Post by stancecoke » Jul 29 2019 10:28am

casainho wrote:
Jul 29 2019 8:28am
Hmm, I got a different of 30kgs between left and right pedal: 100 kgs on right and 70 kgs on left so I think it should not be ignored.
Hm, it would be interesting, if other users have this difference, too. Especially the fact, that there is the difference of 168 vs. 184 ADC value from left to right pedal in horizontal position with no load at all is very strange. So you must have an oszillating signal if you turn the cranks without load. Are you sure, that your sensor is mounted properly, all little springs of the coils in place?!

The more I learn about the torque sensor, the more I think that it's not a masterpiece of engineering arts. :mrgreen:

What is the frequency for the power supply of the coils? With stock firmware it's about 150 kHz.
https://www.pedelecforum.de/forum/index ... dz2.45029/

regards
stancecoke

buba   10 kW

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

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

Post by buba » Jul 29 2019 10:35am

stancecoke wrote:
Jul 29 2019 10:28am
The more I learn about the torque sensor, the more I think that it's not a masterpiece of engineering arts. :mrgreen:
I feel exactly the same. Am a bit disappointed but I understand it is built to a price.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

User avatar
stancecoke   100 kW

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

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

Post by stancecoke » Jul 29 2019 12:03pm

buba wrote:
Jul 29 2019 8:52am
Just merged my local eMTB branch so if you want to take a look at it
OK, so the current target is just calculated by torque ^ exponent, where the exponent can be between 1.3 and 2.0
To avoid the exponential (power) math function, you have defined several lookup tables.

Hm. In the very first beginning, I experimented with
current = factor*torque^a*cadence^b
but I found it is not very sensitive. I even played around with exponents smaller than 1.
It's very important for me, to be able to keep any speed just with the control of my legs without adjusting assistance levels at the display (as I have no display :D) especially when riding in a group of several riders.


I ended up with
current=factor*torque*cadence*(1+speed/max_speed)
This works perfect for me. But as i mentioned before, I don't ride in the mountains, so I can't judge, if it works satisfying there, too.

regards
stancecoke

buba   10 kW

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

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

Post by buba » Jul 29 2019 12:58pm

stancecoke wrote:
Jul 29 2019 12:03pm
buba wrote:
Jul 29 2019 8:52am
Just merged my local eMTB branch so if you want to take a look at it
OK, so the current target is just calculated by torque ^ exponent, where the exponent can be between 1.3 and 2.0
To avoid the exponential (power) math function, you have defined several lookup tables.
Yes and yes. Basically the harder you push on the pedals the more power you get and it is not linear. This enables maximum power when pushing hard but normal power in normal situations. All without changing assist levels as is usually done in other riding modes.

I forgot to mention I removed the wheel speed power offset to make it more natural but I think you noticed that.


stancecoke wrote:
Jul 29 2019 12:03pm
Hm. In the very first beginning, I experimented with
current = factor*torque^a*cadence^b
but I found it is not very sensitive. I even played around with exponents smaller than 1.
Good that you shared that. Was thinking on a lot of different implementations... But settled on this one as it can be configured easily.


stancecoke wrote:
Jul 29 2019 12:03pm
I ended up with
current=factor*torque*cadence*(1+speed/max_speed)
This works perfect for me. But as i mentioned before, I don't ride in the mountains, so I can't judge, if it works satisfying there, too.

regards
stancecoke
Will you consider testing my code and comparing it to yours? Should be possible very soon with the coming beta. I would like to hear what you feel is more natural as you have something to compare to. From what I have heard, eMTB should be the most natural riding mode. Or at least a mode where users do not feel they need to change assist levels.

I can implement your code as well just to try it out but that will be later as I need to finish some work.

---------------------------------

Really look forward to everyone testing out all the riding modes!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

chri27.5   1 mW

1 mW
Posts: 16
Joined: Jan 25 2019 9:46am

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

Post by chri27.5 » Jul 29 2019 5:42pm

good morning,
a question for buba & casainho,
Has it ever happened to you that the motor suddenly remains on while you are pedaling and continues to turn without ever stopping?
Thank you for your wonderful job that with patience and dedication you carry on.
Excuse my English
Thank you

buba   10 kW

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

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

Post by buba » Jul 29 2019 6:04pm

chri27.5 wrote:
Jul 29 2019 5:42pm
good morning,
a question for buba & casainho,
Has it ever happened to you that the motor suddenly remains on while you are pedaling and continues to turn without ever stopping?
Thank you for your wonderful job that with patience and dedication you carry on.
Excuse my English
Thank you
Good morning,

Hmm... As a developer I have several times forced the motor to run and have created several private versions that do continuously run for testing. But have never had a motor-run-away problem on a stable release with my personal settings. But I think there are certain cases and situations where it maybe is possible to force a motor-run-away on a stable release. Not sure though. Have nonetheless actively worked to eliminate all possible safety problems in the next version.

Have you experienced any problems? If so, please let me know! Also include your settings when it happened and the overall situation that caused it. I will try to help!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

casainho   1.21 GW

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

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

Post by casainho » Jul 29 2019 7:09pm

chri27.5 wrote:
Jul 29 2019 5:42pm
good morning,
a question for buba & casainho,
Has it ever happened to you that the motor suddenly remains on while you are pedaling and continues to turn without ever stopping?
Thank you for your wonderful job that with patience and dedication you carry on.
Excuse my English
Thank you
Yes, recently with 0.19.0. Even the brake sensors didn't stop the motor, luckily for me the motor was imwas not pushing strong forward...
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.

famichiki   100 mW

100 mW
Posts: 35
Joined: Jul 12 2019 9:00am

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

Post by famichiki » Jul 29 2019 7:18pm

I read that the motor won't start if out of voltage range, for example using a fully charged 52v battery with 48v configuration. But in that case, will the display still power up and be usable? And only the motor will refuse to drive?

I am just pondering the possibility of having multiple battery configurations stored and being able to change between them using the display. So if you have two batteries with different voltages, you could swap them without needing to flash the firmware each time.

Rydon   100 W

100 W
Posts: 238
Joined: Aug 11 2016 5:26pm

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

Post by Rydon » Jul 29 2019 9:02pm

casainho wrote:
Jul 29 2019 7:09pm
chri27.5 wrote:
Jul 29 2019 5:42pm
good morning,
a question for buba & casainho,
Has it ever happened to you that the motor suddenly remains on while you are pedaling and continues to turn without ever stopping?
Thank you for your wonderful job that with patience and dedication you carry on.
Excuse my English
Thank you
Yes, recently with 0.19.0. Even the brake sensors didn't stop the motor, luckily for me the motor was imwas not pushing strong forward...
Yes, I have seen that with a bad torque sensor. A bad torque sensor will do exactly what you describe. Also, if the torque sensor initializes with backward force on the pedals it can do that. The backward force is usually only possible with a coaster brake motor.

casainho   1.21 GW

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

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

Post by casainho » Jul 30 2019 12:37am

Rydon wrote:
Jul 29 2019 9:02pm
casainho wrote:
Jul 29 2019 7:09pm
chri27.5 wrote:
Jul 29 2019 5:42pm
good morning,
a question for buba & casainho,
Has it ever happened to you that the motor suddenly remains on while you are pedaling and continues to turn without ever stopping?
Thank you for your wonderful job that with patience and dedication you carry on.
Excuse my English
Thank you
Yes, recently with 0.19.0. Even the brake sensors didn't stop the motor, luckily for me the motor was imwas not pushing strong forward...
Yes, I have seen that with a bad torque sensor. A bad torque sensor will do exactly what you describe. Also, if the torque sensor initializes with backward force on the pedals it can do that. The backward force is usually only possible with a coaster brake motor.
For me was not a bad torque sensor, it was for sure a problem/bug with the firmware, because I verified that brakes were not cutting the motor power, basically, it was like if the system were stuck and the main loop that read the sensors and then setup a specific motor current, was not running. I had to turn off the motor on the LCD and just after I did turn on again and everything were working perfectly again. And this was the first time happening to me.
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.21 GW

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

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

Post by casainho » Jul 30 2019 12:38am

famichiki wrote:
Jul 29 2019 7:18pm
I read that the motor won't start if out of voltage range, for example using a fully charged 52v battery with 48v configuration. But in that case, will the display still power up and be usable? And only the motor will refuse to drive?

I am just pondering the possibility of having multiple battery configurations stored and being able to change between them using the display. So if you have two batteries with different voltages, you could swap them without needing to flash the firmware each time.
Go and read the wiki of our firmware to clarify your question.
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.

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 30 2019 12:56am

Has anyone had a difficult time finding working LM35s for the temperature sensor? I've bought 2 lots of 10 from different vendors and I can't get it to work on the open source software. The bike just doesn't register any change from the sensor. I guess part of the problem is that they're from ebay and chinese knockoffs, but you would think that 1 in 20 would be ok. I've tested the bike with TMP36 and a 10k potentiometer and they both report values that change with input so I don't think its my soldering job.

famichiki   100 mW

100 mW
Posts: 35
Joined: Jul 12 2019 9:00am

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

Post by famichiki » Jul 30 2019 1:20am

casainho wrote:
Jul 30 2019 12:38am
famichiki wrote:
Jul 29 2019 7:18pm
I read that the motor won't start if out of voltage range, for example using a fully charged 52v battery with 48v configuration. But in that case, will the display still power up and be usable? And only the motor will refuse to drive?

I am just pondering the possibility of having multiple battery configurations stored and being able to change between them using the display. So if you have two batteries with different voltages, you could swap them without needing to flash the firmware each time.
Go and read the wiki of our firmware to clarify your question.
It says you can change the individual settings for the battery through the display, but I couldn't find anything about making multiple preset profiles.

So, if I have it set up for 48V and swap in a fully charged 52V battery will the controller and display still power up and allow me to change those settings? Or do I need to change the settings before swapping the batteries?

casainho   1.21 GW

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

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

Post by casainho » Jul 30 2019 1:23am

famichiki wrote:
Jul 30 2019 1:20am
casainho wrote:
Jul 30 2019 12:38am
famichiki wrote:
Jul 29 2019 7:18pm
I read that the motor won't start if out of voltage range, for example using a fully charged 52v battery with 48v configuration. But in that case, will the display still power up and be usable? And only the motor will refuse to drive?

I am just pondering the possibility of having multiple battery configurations stored and being able to change between them using the display. So if you have two batteries with different voltages, you could swap them without needing to flash the firmware each time.
Go and read the wiki of our firmware to clarify your question.
It says you can change the individual settings for the battery through the display, but I couldn't find anything about making multiple preset profiles.

So, if I have it set up for 48V and swap in a fully charged 52V battery will the controller and display still power up and allow me to change those settings? Or do I need to change the settings before swapping the batteries?
Will always let you change 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.

vadda   100 mW

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

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

Post by vadda » Jul 30 2019 1:59am

hydrinium.h2 wrote:
Jul 30 2019 12:56am
Has anyone had a difficult time finding working LM35s for the temperature sensor? I've bought 2 lots of 10 from different vendors and I can't get it to work on the open source software. The bike just doesn't register any change from the sensor. I guess part of the problem is that they're from ebay and chinese knockoffs, but you would think that 1 in 20 would be ok. I've tested the bike with TMP36 and a 10k potentiometer and they both report values that change with input so I don't think its my soldering job.
Yes,
after several attempts from different sellers, I bought them on Amazon choosing the product based on feedback

casainho   1.21 GW

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

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

Post by casainho » Jul 30 2019 2:02am

vadda wrote:
Jul 30 2019 1:59am
hydrinium.h2 wrote:
Jul 30 2019 12:56am
Has anyone had a difficult time finding working LM35s for the temperature sensor? I've bought 2 lots of 10 from different vendors and I can't get it to work on the open source software. The bike just doesn't register any change from the sensor. I guess part of the problem is that they're from ebay and chinese knockoffs, but you would think that 1 in 20 would be ok. I've tested the bike with TMP36 and a 10k potentiometer and they both report values that change with input so I don't think its my soldering job.
Yes,
after several attempts from different sellers, I bought them on Amazon choosing the product based on feedback
You guys should report negatively that sellers on eBay.
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: 69
Joined: Sep 08 2018 12:51pm

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

Post by maximusdm » Jul 30 2019 2:46am

Hello everyone,

I have been reading the last few pages and I can't wait to test the new sensor calibration. Thank you dev team for making this possible!
I know that there is a memory issue with KT3 lcd and new features cannot be added, but the motor functionality features are the most important to any rider and they should be included if possible. Like stancecoke said 95% of configuration is done initially and then we just change the assist levels and enjoy the ride :). Also the big majority of users has KT3 lcd setup already installed.
My ideas on the matter are:
- prioritize the list of existing features so the most important are preset
- use Marcoq's idea and use a simple UI to make the bike specific configuration, or even a simple property file that is configured before installation and then a script that sets constants in the motor code.
Keep in mind that sensor calibration does not need to be configurable, just set once for each motor. I could modify constants like MAX_ERPS, rebuild and that's it.

Regards!

vadda   100 mW

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

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

Post by vadda » Jul 30 2019 2:56am

casainho wrote:
Jul 30 2019 2:02am
vadda wrote:
Jul 30 2019 1:59am
hydrinium.h2 wrote:
Jul 30 2019 12:56am
Has anyone had a difficult time finding working LM35s for the temperature sensor? I've bought 2 lots of 10 from different vendors and I can't get it to work on the open source software. The bike just doesn't register any change from the sensor. I guess part of the problem is that they're from ebay and chinese knockoffs, but you would think that 1 in 20 would be ok. I've tested the bike with TMP36 and a 10k potentiometer and they both report values that change with input so I don't think its my soldering job.
Yes,
after several attempts from different sellers, I bought them on Amazon choosing the product based on feedback
You guys should report negatively that sellers on eBay.
Right
In my specific case the sellers were physical stores

buba   10 kW

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

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

Post by buba » Jul 30 2019 4:37am

casainho wrote:
Jul 30 2019 12:37am
Rydon wrote:
Jul 29 2019 9:02pm
casainho wrote:
Jul 29 2019 7:09pm
chri27.5 wrote:
Jul 29 2019 5:42pm
good morning,
a question for buba & casainho,
Has it ever happened to you that the motor suddenly remains on while you are pedaling and continues to turn without ever stopping?
Thank you for your wonderful job that with patience and dedication you carry on.
Excuse my English
Thank you
Yes, recently with 0.19.0. Even the brake sensors didn't stop the motor, luckily for me the motor was imwas not pushing strong forward...
Yes, I have seen that with a bad torque sensor. A bad torque sensor will do exactly what you describe. Also, if the torque sensor initializes with backward force on the pedals it can do that. The backward force is usually only possible with a coaster brake motor.
For me was not a bad torque sensor, it was for sure a problem/bug with the firmware, because I verified that brakes were not cutting the motor power, basically, it was like if the system were stuck and the main loop that read the sensors and then setup a specific motor current, was not running. I had to turn off the motor on the LCD and just after I did turn on again and everything were working perfectly again. And this was the first time happening to me.
Do not know what LCD you were running and system settings but regardless, this is exactly why the 0.20.0 is developed so heavily. It will be that much better and safer.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

csbike   100 mW

100 mW
Posts: 37
Joined: Apr 05 2019 2:18am

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

Post by csbike » Jul 30 2019 4:39am

Hi all,
I am new to this opensource firmware and I am very interested in the possibility to use it with a smartphone app.
I've seen there is development in this direction with the SW102. But I was wondering if the required logic cannot be implemented directly in a smartphone app. Has anyone looked into this? I remember seeing a video of someone that had installed a bluetooth command to start their throttle using a smartphone, but I can no longer find it.
I would be interested in doing at least some of the devel myself, if I am not the only interested person ;).

casainho   1.21 GW

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

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

Post by casainho » Jul 30 2019 4:45am

csbike wrote:
Jul 30 2019 4:39am
Hi all,
I am new to this opensource firmware and I am very interested in the possibility to use it with a smartphone app.
I've seen there is development in this direction with the SW102. But I was wondering if the required logic cannot be implemented directly in a smartphone app. Has anyone looked into this? I remember seeing a video of someone that had installed a bluetooth command to start their throttle using a smartphone, but I can no longer find it.
I would be interested in doing at least some of the devel myself, if I am not the only interested person ;).
Then please follow the github SW102 issues as current active developers are getting coordinated there. And since I know, no one is developing the mobile app and a working beta/alpha version of SW102 is expected on the end of this week.
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.

csbike   100 mW

100 mW
Posts: 37
Joined: Apr 05 2019 2:18am

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

Post by csbike » Jul 30 2019 4:50am

I will,
thanks.
Is there actually a simulator/emulator with which I can do development and testing without flashing the thing each time?

casainho   1.21 GW

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

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

Post by casainho » Jul 30 2019 5:01am

csbike wrote:
Jul 30 2019 4:50am
I will,
thanks.
Is there actually a simulator/emulator with which I can do development and testing without flashing the thing each time?
Not that I am aware. Please ask on GitHub as the developers there seem to no follow much this thread.
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.

Post Reply