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

Electric Motors and Controllers
zappan   100 mW

100 mW
Posts: 40
Joined: Sep 27 2018 3:00am
Location: Sicilia

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

Post by zappan » Mar 10 2019 9:56am

554226203 wrote:
Mar 09 2019 1:45am
Thanks for the contribution, I don't know English, so I use Google Translate, I would like to ask, I have a 350w 36v tsd z2 xh18, if I brush the firmware, can I have more power and speed?

To increase the power and leave your original display you can also use the marcoq software :D
https://endless-sphere.com/forums/viewt ... 30&t=98281

zappan   100 mW

100 mW
Posts: 40
Joined: Sep 27 2018 3:00am
Location: Sicilia

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

Post by zappan » Mar 10 2019 9:59am

554226203 wrote:
Mar 09 2019 11:07pm
tomtom50 wrote:
Mar 09 2019 7:01pm
554226203 wrote:
Mar 09 2019 1:45am
Thanks for the contribution, I don't know English, so I use Google Translate, I would like to ask, I have a 350w 36v tsd z2 xh18, if I brush the firmware, can I have more power and speed?
You can increase power two ways:

1. Increase the allowed amperage in the manufacturer firmware.
2. Install the open source firmware and set a higher power level. This is harder and you need to wire in a different display. (KT-LCD3).

350W at 36V is 9.7 amperes. You can overheat your motor if you use many more amperes for long time.

At 36V 350W is safe. 550W (15A) is OK for 5 - 10 minutes to climb a hill. 550W to go fast for a long time might overheat your motor.
Thank you for your reply, then please, how can I do the first solution?

read here
https://www.eco-ebike.com/blogs/eco-cyc ... romscratch

Rydon   100 W

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

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

Post by Rydon » Mar 10 2019 11:20pm

More on the high backward resistance with the motor on ...
thineight wrote:
Jan 01 2019 6:38pm

After this, i guess the only major bug left to solve is the backwards resistance. :thumb:
casainho wrote:
Nov 30 2018 5:14am
thineight wrote:
Nov 30 2018 4:38am
Any idea about the backward resistance possible solution I wrote 2 posts ago?
For backward resistance, I would implement detection of pedals rotating backwards.
jbalat wrote:
Nov 14 2018 5:57pm
Firstly let me say version 16 is really cool - Love it, great work !!!!! :bigthumb:

In summary the only updates it needs is.
1. walk mode
2. no resistance backwards
3. cadence display - What happened to this, is it gone ???
4. Long keypress to fast cycle button clicks - I too got stuck doing like 100000000000 keypresses because default values are for 48v :)
I am happy to report that version 18.2 with its "no throttle mode" works great for coaster brake motors. However, the above listed backward resistance issue turns out to be a show stopper for coaster brake versions of the motor.

I did not realize how massive this backward resistance is until we got the software working on a coaster brake motor on a hand-cycle. The resistance is so high when you try to pedal backward that it feels like you are applying the coaster brake before the coaster brake even kicks in. With only arm power on a hand-cycle, it is impossible to overcome the resistance when you want to brake.

Apparently, the high backward resistance is only an issue on regular (non-coaster brake) motors when you push the bike backward because the motor freewheels at the cranks. The coaster brake version of the motor does not freewheel at the cranks so it is also an issue whenever you pedal backward.

I hope there is a solution for this as this is the only mid-drive motor that supports coaster brakes. This is crucial on hand-cycles for riders who do not have the use of their hands for braking. The Flexible Open Source Firmware is otherwise perfect for handcycles because the torque sensitivity can be adjusted according to the strength of the rider.

casainho   1 GW

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

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

Post by casainho » Mar 11 2019 8:32am

This is a historic mark:

Time to time I get some donations, which I am being using to buy resources for my investigations and developments. I have not been grateful publicly or privately the donations because I have so little time that is not enough for the developments that are needed to be done.

This days I got a donnation with the following message:
Sold a few FOS firmware products on my Website http://www.electrifybike.com/store/c37/ ... ducts.html I will be contributing 10% of sales to the developers for a period of time.
I am spreading this because this shop because other than being friendly for the developent of our OpenSource firmware for TSDZ2 (that can be applied for other ebike motor controllers, or any BLDC motor controller), this shops sells the needed TSDZ2 and LCD3 already programmed with our firmware and connections!!!
I will link to this shop on wiki as this may be very important for some users!!

Image

https://www.electrifybike.com/store/c37 ... ducts.html#/
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.

User avatar
stancecoke   10 kW

10 kW
Posts: 957
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 11 2019 10:52am

zappan wrote:
Mar 10 2019 9:59am
I hope there is a solution for this as this is the only mid-drive motor that supports coaster brakes. This is crucial on hand-cycles for riders who do not have the use of their hands for braking. The Flexible Open Source Firmware is otherwise perfect for handcycles because the torque sensitivity can be adjusted according to the strength of the rider.
That's quite easy to implement in the ebike_app.c, just disable the PWM if erps = 0 and no power wanted:

Code: Select all

if(erps == 0 && battery_target_current == 0)TIM1_CtrlPWMOutputs(DISABLE);
and enable PWM again, if power is wanted:

Code: Select all

if(erps == 0 && battery_target_current != 0)TIM1_CtrlPWMOutputs(ENABLE);
regards
stancecoke

casainho   1 GW

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

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

Post by casainho » Mar 12 2019 6:14am

Rydon wrote:
Mar 10 2019 11:20pm
I did not realize how massive this backward resistance is until we got the software working on a coaster brake motor on a hand-cycle. The resistance is so high when you try to pedal backward that it feels like you are applying the coaster brake before the coaster brake even kicks in. With only arm power on a hand-cycle, it is impossible to overcome the resistance when you want to brake.

Apparently, the high backward resistance is only an issue on regular (non-coaster brake) motors when you push the bike backward because the motor freewheels at the cranks. The coaster brake version of the motor does not freewheel at the cranks so it is also an issue whenever you pedal backward.

I hope there is a solution for this as this is the only mid-drive motor that supports coaster brakes. This is crucial on hand-cycles for riders who do not have the use of their hands for braking. The Flexible Open Source Firmware is otherwise perfect for handcycles because the torque sensitivity can be adjusted according to the strength of the rider.
So, TSDZ2 main gear on the coaster brake does not have a clutch??

I wounder if when rider backpedals to brake, if it is possible the motor to keep rotate a bit on forward... I mean, how fast is the reaction of the rider to brake?? does the original firmware immediately stops the motor and free it?? Can you feel any kind of delay??

For my experience (and can you please test this?? looking at LCD3 torque sensor value), when backpedaling the torque sensor detects force as if it is a forward pedaling. Can someone please verify this on LCD3??
If so, I guess the only way to detect backpedaling is by looking at the PAS signal...
stancecoke wrote:
Mar 11 2019 10:52am
zappan wrote:
Mar 10 2019 9:59am
I hope there is a solution for this as this is the only mid-drive motor that supports coaster brakes. This is crucial on hand-cycles for riders who do not have the use of their hands for braking. The Flexible Open Source Firmware is otherwise perfect for handcycles because the torque sensitivity can be adjusted according to the strength of the rider.
That's quite easy to implement in the ebike_app.c, just disable the PWM if erps = 0 and no power wanted:

Code: Select all

if(erps == 0 && battery_target_current == 0)TIM1_CtrlPWMOutputs(DISABLE);
and enable PWM again, if power is wanted:

Code: Select all

if(erps == 0 && battery_target_current != 0)TIM1_CtrlPWMOutputs(ENABLE);
Thanks!!

Do you ever did this when erps > 0?? because I wonder if waiting for motor stop will cause a delay...

And on TSDZ2 original firmware that we did disassembly, I recall to see disabling PWM by disabling ONLY the 3 high side mosfets and keep always the 3 low side enabled. I must check this again.
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.

James Broadhurst   1 W

1 W
Posts: 59
Joined: Nov 10 2016 3:29pm
Location: Oxford, England

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

Post by James Broadhurst » Mar 12 2019 6:48am

Rydon wrote:
Mar 10 2019 11:20pm
More on the high backward resistance with the motor on ...

Apparently, the high backward resistance is only an issue on regular (non-coaster brake) motors when you push the bike backward because the motor freewheels at the cranks. The coaster brake version of the motor does not freewheel at the cranks so it is also an issue whenever you pedal backward.
There's a fairly constant 5w of power being consumed as soon as the KT display is switched on (0.103 amps) which, when the bike is pushed backwards, fluctuates towards zero as if the motor is now a generator.

James Broadhurst   1 W

1 W
Posts: 59
Joined: Nov 10 2016 3:29pm
Location: Oxford, England

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

Post by James Broadhurst » Mar 12 2019 7:00am

I have just converted to the new firmware a 6pin 48V 750W(new version) and an 8pin 36V 350W (quite old, 2015, and like a bag of nails) and it is awesome. The old 36v motor hasn't quite been turned into a silk purse from a sow's ear but nearly.

This was really worthwhile doing and congratulations to casainho and his many helpers for doing this. It converts that motor from something tediously grudging when required to do something into a truly sparkling performer.

User avatar
stancecoke   10 kW

10 kW
Posts: 957
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 12 2019 9:52am

James Broadhurst wrote:
Mar 12 2019 6:48am
when the bike is pushed backwards, fluctuates towards zero as if the motor is now a generator.
you are right in principle, but the motor control algorithm does not know a reverse running rotor. If the hall sensor-state says "recent rotorposition is 60°" the software assumes, that the next hall-based position signal will be 120° and it interpolates the rotor position and the according PWM pattern from 60° to 120°. But of course the next hall-position (and true rotorposition) will be 0° when pushing the bike backward. So the PWM pattern is not synced with the rotorposition and this will cause bad current peaks and high pushing resistance...
casainho wrote:
Mar 12 2019 6:14am
Do you ever did this when erps > 0??
Yes, with the BionX direct drive. Disabling with turning motor is no problem, but enabling with turning rotor is difficult, as you have to predict the right dutycycle for the recent rotor speed to avoid current peaks. (See the experimental implementation in the Kunteng-Master)

regards
stancecoke

casainho   1 GW

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

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

Post by casainho » Mar 12 2019 1:07pm

stancecoke wrote:
Mar 12 2019 9:52am
Yes, with the BionX direct drive. Disabling with turning motor is no problem, but enabling with turning rotor is difficult, as you have to predict the right dutycycle for the recent rotor speed to avoid current peaks. (See the experimental implementation in the Kunteng-Master)
Thanks!!
Have you ever tried what you once told me: "let the current controller handle it". I mean, when the current increase we increase duty-cycle up to min current value.

Anyway, we have only 2 different motors and we know their BEMF constant, rate with erps: 48V motor --> 48v / 4000 rpm. The user already identifies the motor voltage on LCD3, because of FOC algorithm calculations and so we add the parameters for the BEMF constant.

Let's see if all this work.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   1 GW

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

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

Post by casainho » Mar 12 2019 1:26pm

Rydon, I have a different idea if what can be happening. Please help to test/validate this ideas.

So you are reporting for when users use the coast brake TSDZ2 version, that is a direct drive motor (has no clutch like TSDZ2 regular version).

Since I remember for my very little experience with coast brakes, to brake, user needs very little amplitude of movement of back pedaling. I really think it is not enough to get almost any regen current. I have another theory:

When we pedal forward or backward, our firmware was not developed to detect the backward pedaling because that is not a need for most of us that uses a regular TSDZ2 and has the clutch to avoid the back pedaling.

On coast version TSDZ2, the torque sensor detects pedal torque for both pedal directions. Also, the pedal cadence is calculated for both directions. Guess what?? When you pedal backwards, you get motor assistance and in this case, it assist you against your movement direction!! The harder you pedal, the harder more motor assistance you get against you!! Does this make sense?? If so, please validate this by looking at PWM value on LCD3 that increase when motor assistance increase!! Please see if the PWM increases when you back pedal.

At assist level 0, even if you back pedal, the PWM value is always 0. Try that way and see if that works ok because if so, we just need to detect cadence in backward direction and stop motor assistance on that situation.
Rydon wrote:
Mar 10 2019 11:20pm
More on the high backward resistance with the motor on ...
thineight wrote:
Jan 01 2019 6:38pm

After this, i guess the only major bug left to solve is the backwards resistance. :thumb:
casainho wrote:
Nov 30 2018 5:14am
thineight wrote:
Nov 30 2018 4:38am
Any idea about the backward resistance possible solution I wrote 2 posts ago?
For backward resistance, I would implement detection of pedals rotating backwards.
jbalat wrote:
Nov 14 2018 5:57pm
Firstly let me say version 16 is really cool - Love it, great work !!!!! :bigthumb:

In summary the only updates it needs is.
1. walk mode
2. no resistance backwards
3. cadence display - What happened to this, is it gone ???
4. Long keypress to fast cycle button clicks - I too got stuck doing like 100000000000 keypresses because default values are for 48v :)
I am happy to report that version 18.2 with its "no throttle mode" works great for coaster brake motors. However, the above listed backward resistance issue turns out to be a show stopper for coaster brake versions of the motor.

I did not realize how massive this backward resistance is until we got the software working on a coaster brake motor on a hand-cycle. The resistance is so high when you try to pedal backward that it feels like you are applying the coaster brake before the coaster brake even kicks in. With only arm power on a hand-cycle, it is impossible to overcome the resistance when you want to brake.

Apparently, the high backward resistance is only an issue on regular (non-coaster brake) motors when you push the bike backward because the motor freewheels at the cranks. The coaster brake version of the motor does not freewheel at the cranks so it is also an issue whenever you pedal backward.

I hope there is a solution for this as this is the only mid-drive motor that supports coaster brakes. This is crucial on hand-cycles for riders who do not have the use of their hands for braking. The Flexible Open Source Firmware is otherwise perfect for handcycles because the torque sensitivity can be adjusted according to the strength of the rider.
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.

User avatar
stancecoke   10 kW

10 kW
Posts: 957
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 12 2019 1:41pm

casainho wrote:
Mar 12 2019 1:07pm
Have you ever tried what you once told me: "let the current controller handle it". I mean, when the current increase we increase duty-cycle up to min current value.
Yes, of course, that's the normal way, the Kunteng Master branch handles "active freewheeling" for direct drives. But that's only working, if the motor runs in forward direction. As I wrote before, if you are pushing in reverse, this can't work. With a gearless direct drive it doesn't matter as you will not reach the erps where the software switches to 60° interpolation. With a geared motor, you will reach the switch level easily with pushing the bike backwards (depending on your settings). If the software raises the dutycycle because of the missing direction detection and a positive torque signal, it's even worse of course :shock:

regards
stancecoke

casainho   1 GW

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

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

Post by casainho » Mar 12 2019 4:23pm

So I went to test the resistance when pushing my bicycle backwards. I need to put in gears that result in most rotation possible of the pedal crank, that means more torque and more cadence!!

If I keep the TSDZ2 turned off, the resistance is like none, just the one from the mechanical system rotating.

If turn on TSDZ2 but keep assist level at 0, I get high resistance when pushing backwards. This should be the regen happening.

Then, If I put assist level at 1, I keep getting the resistance.

Then If I put assist level at something like 5 or 9, I not only get high resistance and soon I get bicycle moving forward in a strong and fast way (dangerous!!).

So seems we the 2 things here when we push backwards: motor assist power applied AND regen current.

I think I will start on the most easy part to do that is detecting backward pedaling using the pedals cadence sensor and put assist level at 0 at that situation.
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.

NIPSEN   100 mW

100 mW
Posts: 38
Joined: Feb 26 2019 5:14pm

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

Post by NIPSEN » Mar 12 2019 5:50pm

Hello, everyone,
I need to convert a 6 pin motor side cable to a programming cable,
for that I would need to know the colors (or function) of the wires of the wheel speed sensor corresponding to these numbers, and especially the colors purple (RST), orange (GND), black (SWIM), brown (VCC):

Image

Could someone with a programming cable help me?
Thanks !

Rydon   100 W

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

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

Post by Rydon » Mar 12 2019 9:24pm

casainho wrote:
Mar 12 2019 6:14am

So, TSDZ2 main gear on the coaster brake does not have a clutch??

I wounder if when rider backpedals to brake, if it is possible the motor to keep rotate a bit on forward... I mean, how fast is the reaction of the rider to brake?? does the original firmware immediately stops the motor and free it?? Can you feel any kind of delay??
That is correct. The coaster brake motor does not have a clutch. It does not freewheel at the cranks.

The OEM firmware stops immediately when you stop pedaling with no delay. This is only true of coaster brake motor with controller for coaster brake motor. I put a regular (non-coaster brake) controller with OEM firmware on a coaster brake motor and it had a delay. When you stop pedaling, the pedals rotate forward for a fraction of a second, about 1/8 of a rotation. The FOS firmware seems to also have this delay but not quite as much.
casainho wrote:
Mar 12 2019 1:26pm
Rydon, I have a different idea if what can be happening. Please help to test/validate this ideas.

So you are reporting for when users use the coast brake TSDZ2 version, that is a direct drive motor (has no clutch like TSDZ2 regular version).

Since I remember for my very little experience with coast brakes, to brake, user needs very little amplitude of movement of back pedaling. I really think it is not enough to get almost any regen current. I have another theory:

When we pedal forward or backward, our firmware was not developed to detect the backward pedaling because that is not a need for most of us that uses a regular TSDZ2 and has the clutch to avoid the back pedaling.

On coast version TSDZ2, the torque sensor detects pedal torque for both pedal directions. Also, the pedal cadence is calculated for both directions. Guess what?? When you pedal backwards, you get motor assistance and in this case, it assist you against your movement direction!! The harder you pedal, the harder more motor assistance you get against you!! Does this make sense?? If so, please validate this by looking at PWM value on LCD3 that increase when motor assistance increase!! Please see if the PWM increases when you back pedal.

At assist level 0, even if you back pedal, the PWM value is always 0. Try that way and see if that works ok because if so, we just need to detect cadence in backward direction and stop motor assistance on that situation.
Ok, we tested the coaster brake in assist level 0. It had heavy resistance pedaling backward similar to the other assist levels. I do not have the bike in the shop but will have it tomorrow and will run more tests for PWM and torque sensor readings pedaling backward. Let me know if you need me to test anything else as I will only have it for a few hours.

Rydon   100 W

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

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

Post by Rydon » Mar 12 2019 9:31pm

NIPSEN wrote:
Mar 12 2019 5:50pm
Hello, everyone,
I need to convert a 6 pin motor side cable to a programming cable,
for that I would need to know the colors (or function) of the wires of the wheel speed sensor corresponding to these numbers, and especially the colors purple (RST), orange (GND), black (SWIM), brown (VCC):

Image

Could someone with a programming cable help me?
Thanks !
This picture answers your question. You can find it on github with the pin descriptions here: https://github.com/OpenSource-EBike-fir ... 3-to-TSDZ2

tsdz2-plug.jpg
tsdz2-plug.jpg (55.24 KiB) Viewed 525 times

casainho   1 GW

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

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

Post by casainho » Mar 12 2019 11:56pm

Rydon wrote:
Mar 12 2019 9:24pm
Ok, we tested the coaster brake in assist level 0. It had heavy resistance pedaling backward similar to the other assist levels. I do not have the bike in the shop but will have it tomorrow and will run more tests for PWM and torque sensor readings pedaling backward. Let me know if you need me to test anything else as I will only have it for a few hours.
For now I can simulate your issue with pushing my bicycle backwards.

I wonder if the controller is different and has no low pass filter on the throttle signal. You may remember the video I recorded about 1 year ago showing a graph in real time on troque sensor signal, we can see there the delay because of the low pass filter.

Maybe you could look at the LCD3 torque sensor values and check if you see less delay on the torque sensor signal at increase/decrease?? Like when quick pull the pedals and push??
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.

NIPSEN   100 mW

100 mW
Posts: 38
Joined: Feb 26 2019 5:14pm

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

Post by NIPSEN » Mar 13 2019 3:14am

Rydon wrote:
Mar 12 2019 9:31pm
NIPSEN wrote:
Mar 12 2019 5:50pm
Hello, everyone,
I need to convert a 6 pin motor side cable to a programming cable,
for that I would need to know the colors (or function) of the wires of the wheel speed sensor corresponding to these numbers, and especially the colors purple (RST), orange (GND), black (SWIM), brown (VCC):

Image

Could someone with a programming cable help me?
Thanks !
This picture answers your question. You can find it on github with the pin descriptions here: https://github.com/OpenSource-EBike-fir ... 3-to-TSDZ2


tsdz2-plug.jpg
Hello, i think this picture is from the 6 pins LCD side, not from wheel speed sensor.
Last edited by NIPSEN on Mar 13 2019 5:29am, edited 1 time in total.

ri53hu   10 mW

10 mW
Posts: 22
Joined: Apr 30 2018 3:56am
Location: Zlíňák

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

Post by ri53hu » Mar 13 2019 3:36am


NIPSEN   100 mW

100 mW
Posts: 38
Joined: Feb 26 2019 5:14pm

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

Post by NIPSEN » Mar 13 2019 5:25am

ri53hu wrote:
Mar 13 2019 3:36am
nipsen cheat here on the post. https://github.com/hurzhurz/tsdz2/blob/ ... ramming.md
This picture is from LCD side 6 pins, are you sure that it is the same with wheel speed sensor side ?

Image

ri53hu   10 mW

10 mW
Posts: 22
Joined: Apr 30 2018 3:56am
Location: Zlíňák

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

Post by ri53hu » Mar 13 2019 2:53pm

Connect the programmer to the speed sensor connector:
Attachments
IMG_20190313_204455.jpg
IMG_20180914_095252.jpg
IMG_20180914_095252.jpg (27.35 KiB) Viewed 417 times
Last edited by ri53hu on Mar 13 2019 3:09pm, edited 1 time in total.

Rydon   100 W

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

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

Post by Rydon » Mar 13 2019 3:00pm

NIPSEN wrote:
Mar 13 2019 3:14am
Hello, i think this picture is from the 6 pins LCD side, not from wheel speed sensor.
The picture is for both. The wiring charts and signals are different but the wire colors to pin mappings are the same. Most speed sensor connectors are black like the display connectors. Yours is yellow. If you still doubt just meter it out. :)

NIPSEN   100 mW

100 mW
Posts: 38
Joined: Feb 26 2019 5:14pm

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

Post by NIPSEN » Mar 13 2019 3:31pm

Thanks ri53hu and Rydon for your help. :thumb:

perryscope   100 mW

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

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

Post by perryscope » Mar 13 2019 4:21pm

buba wrote:
Feb 15 2019 7:38am
Okay, anyone want to test out the 0.19.0 beta 1? :wink:

Here is a link to the hex file for the KT-LCD3:
https://drive.google.com/open?id=1kgcgk ... kDKftLnotw

Here is a link to the wiki:
https://github.com/OpenSource-EBike-fir ... 9.X-(BETA)

Here are some changes:

* Added a new sub field in the odometer field temporarily called Energy where user will see energy consumption and estimated range

* Added a function that measures and calculates consumed watt-hours per traveled distance since power on

* Added a function that estimates range since power on depending on how much capacity is left

* More accurate watt-hour measurement, do not forget to update the capacity of your battery

* More accurate time measurement

* Safer Walk Assist and Cruise

* Added option to enable or disable motor power limit quick-set-menu in the main screen

* Added option to set motor power limit in the configuration menu

* Merged previous configuration menu LCD Setup with configuration menu General Setup for better and faster setup. This also optimizes program size, see the wiki for more information

* Added option that enables user to enable or disable display of motor temperature in the odometer field

* Changed order in the Main Screen Setup menu in the configuration menu

* Changed order in the odometer field

* Added two new Main Screen Setup items

* Heavily optimized code size and speed, also cleaned up code and comments
I am testing version-0.19.1-(BETA) but the wiki menu numbers don't seam to be right has this changed?

I have 11 menu's but the list of menu's in the wiki...

https://github.com/OpenSource-EBike-fir ... 9.X-(BETA)

..show just 10 menu levels Now?

Looking at the revisions it apears the motor options have moved from menu 10 to menu 8? and menu 10 has been removed/ replaced with advanced menu 11? Is there a later Beta that uses this menu layout thats documented in the Wiki?
Empowered people support rider and techie.
www.empoweredpeople.co.uk

Rydon   100 W

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

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

Post by Rydon » Mar 14 2019 2:41pm

casainho wrote:
Mar 12 2019 11:56pm
Rydon wrote:
Mar 12 2019 9:24pm
Ok, we tested the coaster brake in assist level 0. It had heavy resistance pedaling backward similar to the other assist levels. I do not have the bike in the shop but will have it tomorrow and will run more tests for PWM and torque sensor readings pedaling backward. Let me know if you need me to test anything else as I will only have it for a few hours.
For now I can simulate your issue with pushing my bicycle backwards.

I wonder if the controller is different and has no low pass filter on the throttle signal. You may remember the video I recorded about 1 year ago showing a graph in real time on troque sensor signal, we can see there the delay because of the low pass filter.

Maybe you could look at the LCD3 torque sensor values and check if you see less delay on the torque sensor signal at increase/decrease?? Like when quick pull the pedals and push??
Had a few days bad weather so just did the testing. The torque sensing on a coaster brake motor has the same low pass filter delay as the regular motors. No difference that I could tell looking at the values on the LCD3 while applying torque. One thing that was readily apparent though is that there is no torque reading on the LCD3 display in the reverse direction. Maybe when torque goes to 0 it can be used to cut off the resistance.

Post Reply