TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Electric Motors and Controllers
Rydon   100 W

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

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

Post by Rydon » Mar 21 2020 8:08pm

vshitikov wrote:
Mar 21 2020 4:33pm
Anybody here complies Casainho code on windows? I have installed everything and finally managed to compile, though some warnings appear but I guess it's because there is some provisionary code. But to do so I had to tweak manually the makefiles and add some declarations because windows handles the directories quite differently. But I'm not sure what i'm getting , only main.bin How to get the .hex file? Sorry didn't have the energy to look into google.
If you get this figured out for windows can you please document it? I would like to compile a version with my own defaults. I flash a lot of TSDZ2 motors and configuring them after flashing them is laborious.

Brlowe   100 mW

100 mW
Posts: 45
Joined: Nov 15 2019 10:16am

Re: firmware v0.6.8 issue

Post by Brlowe » Mar 21 2020 9:46pm

hefest wrote:
Mar 21 2020 2:55pm
Brlowe wrote:
Mar 20 2020 12:00am
Second I have twice had it where I turn the system on and after it is fully on I put my feet on the petals and start to petal and the motor surges the the whole system shuts off. I can repeat this continually. To fix it I have to go back into the settings menu select something then exit and restart it. I do not change anything just have to go into the menu.
Having had the similar sympthoms where my whole drive turned off several times when I start pedaling, and after 4-5 attempts I had a short on my controller power pins resulting in huge spark and melted battery terminals, I would advise you to stop using current firmware and downgrade until we have fix from casainho.

Maybe my issue was due to faulty controller but just to be on the safe side.
Mine has done the same thing, I start to pedal and the motor kicks in with lots of power then shuts off. This will repeat. I can solve it by just going into the settings menu and selecting something then backing out and restarting the system and it works.
Today I had it do a new one, I started to pedal and it went into an uncontrolled full power with out me pedaling. Did it to me twice. I was able to stop by powering down. I’m on v.0.6.8 so I’m either going back to an older version or waiting for a fix. I think the power surges today messed up my blue gear as I can feel something with pedaling now. So ordering some spares.

casainho   10 GW

10 GW
Posts: 4636
Joined: Feb 14 2011 2:43pm

Re: firmware v0.6.8 issue

Post by casainho » Mar 22 2020 2:13am

Brlowe wrote:
Mar 21 2020 9:46pm
Mine has done the same thing, I start to pedal and the motor kicks in with lots of power then shuts off. This will repeat. I can solve it by just going into the settings menu and selecting something then backing out and restarting the system and it works.
Today I had it do a new one, I started to pedal and it went into an uncontrolled full power with out me pedaling. Did it to me twice. I was able to stop by powering down. I’m on v.0.6.8 so I’m either going back to an older version or waiting for a fix. I think the power surges today messed up my blue gear as I can feel something with pedaling now. So ordering some spares.
Please everyone go back to previous version!! I just removed the current firmware version.

I am having the exact same issues but I have a different firmware version because I am developing and I tough this issue was due to the new developments.

I still don't known why this happens... But I am now thinking that the new compiler version, that optimizes a lot the motor controller firmware, causes this issue - at least since I remember, I had this problem only after the last release...
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

dameri   100 W

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

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

Post by dameri » Mar 22 2020 4:04am

I installed v.860C_850C_SW102_v0.6.9 to 850C display and hex 0.55.0 on tsdz2 a couple of days ago. When I turned on the display, it said TSDZ2 firmware error. I tried installing again a few times and the same message came every time.

I had previously used 850C_v0.6.4 and motor v0.53.0. I reinstalled them and everything went well without error messages.

thineight   100 W

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

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

Post by thineight » Mar 22 2020 5:34am

Casainho, not to add complexity to your current bug-fix task.. but did you see the overrun fix code by mbrusa? He did release the files modifications few days ago..
MTB KTM Ultra 29" - City bike DAYTONA 28"

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

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

Post by vshitikov » Mar 22 2020 8:34am

Rydon wrote:
Mar 21 2020 8:08pm

If you get this figured out for windows can you please document it? I would like to compile a version with my own defaults. I flash a lot of TSDZ2 motors and configuring them after flashing them is laborious.
Hi. Yes I will certainly try to document a little more on how to compile on windows, however I'm a relative beginner in the firmware, I'm more into electronics.
Not sure if you already look at this great resource
https://github.com/OpenSource-EBike-fir ... evelopment

I need to rollback version to the stable one that I'm currently using 0.6.7 motor FW 0.54
I only have 850C display so i did not use all the code and I have no means to test other displays
I followed this steps carefully. Once you get the firmware imported in your eclipse - the fun part starts.
First of all you have to install make for windows and tell eclipse about it in a build tools (put a path to the /bin folder where make lives)
Then you have to look carefully through the makefiles and correct some of the hardcoded paths there.
Depending on which version you are using there several makefiles. Make sure you found all of them.
Once your eclipse start to build the code you may find that some include files weren't found. For me it happened because Windows does not understand the syntax -I./ for the current directory I have corrected it to the syntax -I. and it started to build just fine.

I will try to document this once I have a little bit of time and once I have tested everything on my bike

P.S I also had slight trouble installing GNU MCU packs, had to clean the cache of eclipse in order to install the required MCU pack. But I guess it was just my local problem here

casainho   10 GW

10 GW
Posts: 4636
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 22 2020 9:27am

vshitikov wrote:
Mar 22 2020 8:34am
Rydon wrote:
Mar 21 2020 8:08pm

If you get this figured out for windows can you please document it? I would like to compile a version with my own defaults. I flash a lot of TSDZ2 motors and configuring them after flashing them is laborious.
Hi. Yes I will certainly try to document a little more on how to compile on windows, however I'm a relative beginner in the firmware, I'm more into electronics.
Not sure if you already look at this great resource
https://github.com/OpenSource-EBike-fir ... evelopment

I need to rollback version to the stable one that I'm currently using 0.6.7 motor FW 0.54
I only have 850C display so i did not use all the code and I have no means to test other displays
I followed this steps carefully. Once you get the firmware imported in your eclipse - the fun part starts.
First of all you have to install make for windows and tell eclipse about it in a build tools (put a path to the /bin folder where make lives)
Then you have to look carefully through the makefiles and correct some of the hardcoded paths there.
Depending on which version you are using there several makefiles. Make sure you found all of them.
Once your eclipse start to build the code you may find that some include files weren't found. For me it happened because Windows does not understand the syntax -I./ for the current directory I have corrected it to the syntax -I. and it started to build just fine.

I will try to document this once I have a little bit of time and once I have tested everything on my bike

P.S I also had slight trouble installing GNU MCU packs, had to clean the cache of eclipse in order to install the required MCU pack. But I guess it was just my local problem here
You don't need Eclipse to build the code. Eclipse is needed only if you want to develop and debug.

For the ones looking to build with specific configurations, just need to edit the eeprom.h file, the default values. Then, to build the code, you just need to call the Makefile and have the GCC (compiler, etc) to build the code.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

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

Post by vshitikov » Mar 22 2020 9:57am

casainho wrote:
Mar 22 2020 9:27am

You don't need Eclipse to build the code. Eclipse is needed only if you want to develop and debug.

For the ones looking to build with specific configurations, just need to edit the eeprom.h file, the default values. Then, to build the code, you just need to call the Makefile and have the GCC (compiler, etc) to build the code.
Hi Casainho. Yes, I needed eclipse cause I wanted to get familiar with your code and probably customize it for my own use and maybe even collaborate on improvements. I'm not familiar with eclipse as I was using Keil previously but I'm slowly figuring things out. Currently we are confined in France so instead of riding bike we get to program the firmware :)
Last edited by vshitikov on Mar 22 2020 4:12pm, edited 1 time in total.

Blaster   1 µW

1 µW
Posts: 1
Joined: Mar 22 2020 11:25am

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

Post by Blaster » Mar 22 2020 11:31am

Hey Casainho

So I have the 0.5.0 beta 7 firmware in combination with the 850c display that was delivered by ecocycles in the us. I am totally loving it. However I don't have the street mode on my display, which I REALLY REALLY REALLY would like to have. Is there any possibility to enable it?

Regards

Brlowe   100 mW

100 mW
Posts: 45
Joined: Nov 15 2019 10:16am

Re: firmware v0.6.8 issue

Post by Brlowe » Mar 23 2020 12:43am

casainho wrote:
Mar 22 2020 2:13am
Brlowe wrote:
Mar 21 2020 9:46pm
Mine has done the same thing, I start to pedal and the motor kicks in with lots of power then shuts off. This will repeat. I can solve it by just going into the settings menu and selecting something then backing out and restarting the system and it works.
Today I had it do a new one, I started to pedal and it went into an uncontrolled full power with out me pedaling. Did it to me twice. I was able to stop by powering down. I’m on v.0.6.8 so I’m either going back to an older version or waiting for a fix. I think the power surges today messed up my blue gear as I can feel something with pedaling now. So ordering some spares.
Please everyone go back to previous version!! I just removed the current firmware version.

I am having the exact same issues but I have a different firmware version because I am developing and I tough this issue was due to the new developments.

I still don't known why this happens... But I am now thinking that the new compiler version, that optimizes a lot the motor controller firmware, causes this issue - at least since I remember, I had this problem only after the last release...
What version should we roll back too?

r0mko   10 W

10 W
Posts: 79
Joined: Jan 20 2017 8:06pm

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

Post by r0mko » Mar 23 2020 8:47am

Hi all. I've fried my controller by trying to update to v0.56 TSDZ2 FW.
ETu4coxWsAYV7fV.jpeg
ETu4coxWsAYV7fV.jpeg (490.91 KiB) Viewed 569 times
ETu4cowXsAAO8Pf copy.jpg
ETu4cowXsAAO8Pf copy.jpg (459.49 KiB) Viewed 569 times
ETu4cotWAAMmgmt copy.jpg
ETu4cotWAAMmgmt copy.jpg (429.03 KiB) Viewed 569 times
I have another 2 spare controllers from my old 36V motors (the dead is 48V). I've flashed the same FW and tried to run it on 48V. Everything seemed to be ok, but then the controller stopped working. Somehow it shows short circuit on battery inputs. This is really strange, since
For the TSDZ2 motor versions found on online shops (36V, 48V, 52V, whichever power in watts, with throttle or without) the motor controller electronic board is just the same.
Now I'm wondering whether or not to try my second spare 36V controller to run on 48V or replace the motor to 36V one and the battery as well and order a new 48V controller from Aliexpress. Any suggestions/thoughts?
@casainho

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

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

Post by vshitikov » Mar 23 2020 9:32am

r0mko wrote:
Mar 23 2020 8:47am
Hi all. I've fried my controller by trying to update to v0.56 TSDZ2 FW.
Maybe it's your motor that has a problem? maybe one of your wadings has a short spire? People did not report here any issues with damaging the controller because of the new firmware. Unless it's your PWM got crazy because of the FW update...

casainho   10 GW

10 GW
Posts: 4636
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 23 2020 9:33am

r0mko wrote:
Mar 23 2020 8:47am
Hi all. I've fried my controller by trying to update to v0.56 TSDZ2 FW.
I removed already that firmware version. I am trying to solve the issues.

It is interesting to see how dangerous the motor control can be!! it is very easy to make a mistake on the firmware and then fire and black smoke!!
Last edited by casainho on Mar 23 2020 9:39am, edited 1 time in total.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

r0mko   10 W

10 W
Posts: 79
Joined: Jan 20 2017 8:06pm

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

Post by r0mko » Mar 23 2020 9:37am

vshitikov wrote:
Mar 23 2020 9:32am
r0mko wrote:
Mar 23 2020 8:47am
Hi all. I've fried my controller by trying to update to v0.56 TSDZ2 FW.
Maybe it's your motor that has a problem? maybe one of your wadings has a short spire? People did not report here any issues with damaging the controller because of the new firmware. Unless it's your PWM got crazy because of the FW update...
The motor itself seems to be fine: all the windings seem to have normal resistance about 1,4 Ohms. It also reacts properly on poking with a Li-Ion 3,6V cell (jerks and tries to move). So I assume that the motor is fine.

r0mko   10 W

10 W
Posts: 79
Joined: Jan 20 2017 8:06pm

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

Post by r0mko » Mar 23 2020 9:39am

casainho wrote:
Mar 23 2020 9:33am
It is interesting to see how dangerous the motor control can be!! it is very easy to make a mistake on the firmware...
It may become even more dangerous in when a bike in your room is surrounded by fragile stuff like windows, furniture and cats. I would better sacrifice a controller than hurt a living being.

r0mko   10 W

10 W
Posts: 79
Joined: Jan 20 2017 8:06pm

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

Post by r0mko » Mar 23 2020 9:42am

casainho wrote:
Mar 23 2020 9:33am
it is very easy to make a mistake on the firmware and then fire and black smoke!!
The smoke was actually white. Nevertheless, I'm still stuck: should I try to run a 36V controller on 48V? Are you sure that they're all the same?

casainho   10 GW

10 GW
Posts: 4636
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 23 2020 9:47am

r0mko wrote:
Mar 23 2020 9:39am
casainho wrote:
Mar 23 2020 9:33am
It is interesting to see how dangerous the motor control can be!! it is very easy to make a mistake on the firmware...
It may become even more dangerous in when a bike in your room is surrounded by fragile stuff like windows, furniture and cats. I would better sacrifice a controller than hurt a living being.
I had already, a few times, to run VERY FAST to outside the place where I develop, because I was afraid the battery could explode. Luckily it was only really bad smell and black smoke...

You should wait for a new firmware version or try an older one, and, use a fuse in series with the battery wire to try avoid the same to happen (I would say a car fuse of 5 amps).
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

r0mko   10 W

10 W
Posts: 79
Joined: Jan 20 2017 8:06pm

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

Post by r0mko » Mar 23 2020 9:50am

casainho wrote:
Mar 23 2020 9:47am
You should wait for a new firmware version or try an older one, and, use a fuse in series with the battery wire to try avoid the same to happen (I would say a car fuse of 5 amps).
No problem, I can build whatever firmware and flash it right away. I need my bike back as soon as possible, so I have to decide:
switch to 36V setup with the old motor, controller and battery
or
put a 36V controller with a 48V motor and run in from the 48V battery

hefest   100 W

100 W
Posts: 154
Joined: Jan 11 2019 4:55am

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

Post by hefest » Mar 23 2020 9:51am

vshitikov wrote:
Mar 23 2020 9:32am
r0mko wrote:
Mar 23 2020 8:47am
Hi all. I've fried my controller by trying to update to v0.56 TSDZ2 FW.
Maybe it's your motor that has a problem? maybe one of your wadings has a short spire? People did not report here any issues with damaging the controller because of the new firmware. Unless it's your PWM got crazy because of the FW update...
That's not completely true. I've fried my controller 7 days ago with the 0.55 firmware. Mentioned that few pages back.

casainho   10 GW

10 GW
Posts: 4636
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 23 2020 9:59am

hefest wrote:
Mar 23 2020 9:51am
That's not completely true. I've fried my controller 7 days ago with the 0.55 firmware. Mentioned that few pages back.
I lost track of which firmware version is working correctly. On my 4 ebikes, I have most all of them damaged so the only solution is to find and solve the issue.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

r0mko   10 W

10 W
Posts: 79
Joined: Jan 20 2017 8:06pm

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

Post by r0mko » Mar 23 2020 10:01am

Another thought. What if we use a 36V motor in a 48V setup? Of course, we need to limit current to, say, 10A in the firmware, but this in theory allows to run the motor at very fast RPM and finally overcome a 90 RPM cadence limitation?

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

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

Post by vshitikov » Mar 23 2020 10:14am

casainho wrote:
Mar 23 2020 9:59am
hefest wrote:
Mar 23 2020 9:51am
That's not completely true. I've fried my controller 7 days ago with the 0.55 firmware. Mentioned that few pages back.
I lost track of which firmware version is working correctly. On my 4 ebikes, I have most all of them damaged so the only solution is to find and solve the issue.
The working firmware is 0.54 I can confirm. since the 0.55 0.6.8 was introduced the various random issues started to appear.

casainho   10 GW

10 GW
Posts: 4636
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 23 2020 11:17am

vshitikov wrote:
Mar 23 2020 10:14am
casainho wrote:
Mar 23 2020 9:59am
hefest wrote:
Mar 23 2020 9:51am
That's not completely true. I've fried my controller 7 days ago with the 0.55 firmware. Mentioned that few pages back.
I lost track of which firmware version is working correctly. On my 4 ebikes, I have most all of them damaged so the only solution is to find and solve the issue.
The working firmware is 0.54 I can confirm. since the 0.55 0.6.8 was introduced the various random issues started to appear.
Thanks for the feedback. I removed the release of 0.55.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

r0mko   10 W

10 W
Posts: 79
Joined: Jan 20 2017 8:06pm

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

Post by r0mko » Mar 23 2020 11:23am

casainho wrote:
Mar 23 2020 11:17am
vshitikov wrote:
Mar 23 2020 10:14am

The working firmware is 0.54 I can confirm. since the 0.55 0.6.8 was introduced the various random issues started to appear.
Thanks for the feedback. I removed the release of 0.55.
There's still a little jerk on 0.54 when I exit settings. Does this depend solely on TSDZ2 FW or the screen FW as well? I've built something which requires 0.54 TSDZ2 FW.

hefest   100 W

100 W
Posts: 154
Joined: Jan 11 2019 4:55am

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

Post by hefest » Mar 23 2020 12:09pm

casainho wrote:
Mar 23 2020 11:17am
vshitikov wrote:
Mar 23 2020 10:14am
casainho wrote:
Mar 23 2020 9:59am
hefest wrote:
Mar 23 2020 9:51am
That's not completely true. I've fried my controller 7 days ago with the 0.55 firmware. Mentioned that few pages back.
I lost track of which firmware version is working correctly. On my 4 ebikes, I have most all of them damaged so the only solution is to find and solve the issue.
The working firmware is 0.54 I can confirm. since the 0.55 0.6.8 was introduced the various random issues started to appear.
Thanks for the feedback. I removed the release of 0.55.
So is the 0.55 first version with new compiler?

Post Reply