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

jbalat said:
casainho said:
And I did saw your video and I known because I did the development that the latest version of 0.51.0 has improvements on the issues you did show in the video. So my suggestion to everyone is to update to the latest version.

Hi Casainho, I have been trying to keep up too.. as you know I have the KT LCD3 and I'm on version 20 beta 1 which I'm really happy with. I thought the new version 0.51 now only supports 850c display correct ? From my reading it seems the 850c code isn't as mature as the lcd3 yet ?

If so Is there any way to get it to work on the LCD3, I would love to try 0.51..?


To me it is obvious that KT-LCD3 fork has ended with mature release 0.20 beta1 and I can understand the reasons why Casainho ended support for LCD3 but I am also little skeptical about the maturity level of the new releases like 0.51 which are only based on v0.19.
There are too many improvements I don't want to loose:

buba said:
Changelog from the stable 0.19.0:

- Smoother motor torque control
- Overall faster acceleration, much more responsive and more adjustable/customizable
- Named the previous riding mode Power Assist
- Introduced Torque Assist, Cadence Assist and eMBT Assist
- A new automatic calibration process for the cadence sensor
- A new Advanced Mode for the cadence sensor with quicker response times
- A new light mode configuration where users can choose to enable/disable/remember light state through a power cycle
- External light configuration where users can configure the lights to flash, brake-flash when braking and much more!
- Startup without pedal rotation now with adjustable torque threshold
- Improved the KT-LCD3 firmware and updated it to be able to communicate with the new 0.20.0 motor controller firmware
- Added an adjustable button debounce timer for Walk Assist.
- Added a slight button debounce timer for Cruise
- Improved Walk Assist with soft-start
- Improved Walk Assist and Cruise safety
- Cruise much smoother and accurate
- More customizable Street Mode
- Smoother motor control to prolong life of the blue and metal gear
- Brakes now immediately disable the motor
- TSDZ2 coaster brake version can enable system braking by applying backwards torque
- More error codes/states that make the firmware safer to use and protects the hardware
- Higher resolution on the torque sensor output and increased operating range
- Better system calibration during startup
- Adjustable ADC torque conversion for accurate human power in the operating range of the TSDZ2 torque sensor
- Much more accurate data displayed on the KT-LCD3 with a new highly adjustable filter
- Better filtering used in the motor controller firmware
- Improved EEPROM controller
- EEPROM "Reset to defaults" and other functions now operate as intended
- New and improved wheel speed sensor and cadence sensor code
- Improved ADC conversion accuracy for current, voltage and therefore wattage and watt-hour measurements
- Changed and simplified configuration menu (KT-LCD3)
- Added new symbols for readability (KT-LCD3)
- Solved bugs with the TSDZ2 Coaster Brake version
- Backwards motor rotation is now detected and displayed as 0 ERPS
- System changes responsiveness depending on wheel speed
- Extensive refactoring throughout the entire system
- Simplified code for future development and display support, highly modular
- And much more... See the 0.20.0 wiki for even more information!
 
I was waiting for the SW102 flash with the phone update but it seems it is not going to happen soon. So I was thinking on giving a second try to the solderless method with a second display. But I have some questions:

1. Is it the current SW102 firmware stable and usable?
2. Is there anyone using the firmware and display for everyday commuting?
3. Where is the SW102 firmware file located?
4. Right now my motor is flashed with V0.19 using marcoq configurator. Do I have to flash it again with a base V0.19?

Thanks
 
stefkrger said:
Today I had a scary experience with the stable 0.19 FW and a SW102 display. While I was riding I noticed the motor was constantly giving assistance even though I was not pedaling. Display showed some error message (only thing I remember it had a file state.c in it). I tried to turn off the system on the display but it did not react. I have the TSDZ2 without throttle and so no power cutoff break levers either.

Luckily I was driving through a park so I could let the wheel spin on the wet grass while I disconnected the battery. That was the only way to stop the motor.

Has anyone experienced something similar? I imagine this can be quite dangerous.

After a restart everything seemed to be back to normal.

What level of assistance were you using? I had the same issue with marcoq V0.19 and Vlcd5 display in assistance 4. After that I have ridden 150 miles in level 3 only with no issues at all
 
Yesterday I was able to ride my handcycle on a set of rollers for the first time. I learned a lot about my power assist during that ride. I am using v20 Beta with an LCD3.

I tried the 48 Volt experimental setting and I was able to pedal up to 113 cadence and 105 consistently, where before I could only get to and consistently pedal at 90. That extra 15 could come in handy at times.

When I started the system up with no pressure on the pedals or coaster brake in every setting I have except for EMTB the rotation of the motor on the rollers was very inconsistent. Hard and easy spots, it didn’t matter what gear I was in or what assist level the motor was at from 1.0 to 6.0 it was very inconsistent with hard and easy areas. In EMTB it was much smoother but not completely smooth but useable. The lower the cadence and the lower the power the less consistent it was and the higher the power and higher the cadence the more consistent it was.

Then I shut off the system pulled back on the pedals against the coaster brake to the position that my derailleur is in when it feels best when I’m riding. I measured the pull force at about 50 kilograms and tried it again. Now after pulling back 50kg as the system boots when I ride on the rollers, it didn’t matter which setting I was in, which gear I was in or what cadence I was at even down to 25 rpm or cadence
it was very smooth. I could ride at 2.0 and it had more power than before at 6.0.
If I pull less than this my system doesn’t have enough power for me and if I pull more than this the system wants to run. And I need to stop the rotation, it doesn’t take a lot of effort to stop rotation but if I don’t stop the rotation it will continue to go forward.

I think this is the resolution that casainho & buba have been talking about?
In the new version 850C_v0.6.2 and v0.51.0. After you calibrated your torque sensor will it be as smooth as it is when I pull back on the torque sensor in v20b?
When the system boots up in v51 without pulling back will it have the same power I have when I pull back with v20?

Thanks, Jeff
 
New firmware: Motor max current and Battery max current

I implemented the configuration on the display of the motor max current, so currently we can configure both battery max current and motor max current. The code is now ready to control the motor current, maybe I will implement it soon depending on my tests but I would like to have feedback of users -- for that, please configure the display numeric fields to show:
- human power (only if with torque sensor calibrated!)
- motor power
- motor current
- battery power.

Also configure different motor max current values to see how you feel... The battery max current value should be the max allowed by your battery pack.

For a better understanding, for motor max current, I use a value of 10 amps for my 10 years old son ebike, to reduce the amount of torque since he is small and light. And I use a value of 25 amps for my ebike. The battery max current value, I am keeping at the previous of 16 amps -- we still need more testing to see if there is advantage to increase this value like to 20 or 30 amps.

Release 850C_v0.6.3

Sorry, this firmware works only for 850C display as currently there is an issue with SW102 display firmware.

Changelog:
- other than the battery max current, motor max current value can now be configured on the display (I use a value of 10 amps for my 10 years old son ebike, to reduce the amount of torque since he is small and light. I use a value of 25 amps for my ebike)
- motor current value can now be shown on display numeric fields or graph
- fixed the issue where motor would give a quick when leaving the configurations menu

More information here: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-firmware-on-Bafang-850C-LCD
 
jeff.page.rides said:
Then I shut off the system pulled back on the pedals against the coaster brake to the position that my derailleur is in when it feels best when I’m riding. I measured the pull force at about 50 kilograms and tried it again. Now after pulling back 50kg as the system boots when I ride on the rollers, it didn’t matter which setting I was in, which gear I was in or what cadence I was at even down to 25 rpm or cadence
it was very smooth. I could ride at 2.0 and it had more power than before at 6.0.
If I pull less than this my system doesn’t have enough power for me and if I pull more than this the system wants to run. And I need to stop the rotation, it doesn’t take a lot of effort to stop rotation but if I don’t stop the rotation it will continue to go forward.

Thanks, Jeff

Jeff its very easy on the LCD3 to set your own levels of power, have a look at the user manual
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/0.20.0-%28DEVELOPMENT%29-%7C-KT-LCD3-%7C-TSDZ2-%7C-Manual
and you can set all the parameters to your own configuration, the default ones are just a guide and a starting point. As I have said before, set your display to output Motor Watts and then ride it on say the rollers, taking note of what Watts is comfortably best for you. I then set up a level, say No 5 to match that output. The others I scaled up and down to slightly overlap to give a bit of scope for those days you want a bit of a "blast " and some less to give me a workout.

Its not to difficult and you should be able to customise your engines output to your requirements without having to frig the system by pulling back on the cranks at start up unless there is some software gremlin in there that we are not aware of.
 
Waynemarlow said:
If I pull less than this my system doesn’t have enough power for me and if I pull more than this the system wants to run. And I need to stop the rotation, it doesn’t take a lot of effort to stop rotation but if I don’t stop the rotation it will continue to go forward.

Jeff its very easy on the LCD3 to set your own levels of power, have a look at the user manual
Because all torque sensors on TSDZ2 are different, and some are bad in sensitive, you only get the best results if you use the latest firmware version and do the torque sensor full calibration. Also the last firmware version has improve torque sensor sensitivy by 4x and also the current control by 4x, so you will have much better experience with the latest firmware on the difficulties you are having.
 
Casainho, I agree that you can get a rogue torque sensor, but I think Jeff may well just need to set up the power output to his requirements which even with a rogue sensor he should be able to do, just the linear ramp of the sensor may not be the best.

The other side of the story is that he needs a rearward motion to activate his brakes which I think only the factory units and V20 has at the moment. Now there's also a whole lot of nice features in the V20 which is way better than the V19, it would be pretty cool if you could incorporate the latest V20 with your software torque sensing as now that would be pretty cool.

Thanks for all the efforts though.
 
Waynemarlow said:
Now there's also a whole lot of nice features in the V20 which is way better than the V19, it would be pretty cool if you could incorporate the latest V20 with your software torque sensing as now that would be pretty cool.
I don't understand. The latest version is not V19 anymore, is version V53 and is much better.

I think V053 is much better than V20. But please make a list, after testing and comparing each feature, give details and prioritize the items on the list, then I can see what I can bring from the V20, if anything relevant.
 
Waynemarlow said:
Casainho, I agree that you can get a rogue torque sensor, but I think Jeff may well just need to set up the power output to his requirements which even with a rogue sensor he should be able to do, just the linear ramp of the sensor may not be the best.
I think the problem may be his torque sensor lack of sensitivy, and then he needs to setup a very high assist level multiplier and then he looses sensitivity at startup -- hence the dangerous situation the motor doesn't not stop if he reduces the force with arms, meaning bad experience, no good torque sensor, more like a PAS or on/off throttle system.

This is my interpretation after reading his explanation:

If I pull less than this my system doesn’t have enough power for me and if I pull more than this the system wants to run. And I need to stop the rotation, it doesn’t take a lot of effort to stop rotation but if I don’t stop the rotation it will continue to go forward.
 
casainho said:
I don't understand. The latest version is not V19 anymore, is version V53 and is much better.

I think V053 is much better than V20. But please make a list, after testing and comparing each feature, give details and prioritize the items on the list, then I can see what I can bring from the V20, if anything relevant.
Indeed the latest firmware is the v0.53 with many interesting stuff, I think the main stopper to update to it and try is that many of us already wired the LCD3 and after all it is a good display that includes all the necessary data. In my opinion many users would prefer to keep that one instead of the 850c. Personally I would consider the smaller sw102 rather than the "bulky" 850c.
Since the latest stable firmware for LCD3 is the very good v.20 I see the point that many of us would like to keep that release alive, to be discussed on the new post dedicated to the LCD3.
By the way.. I did not find the new post that andrea104kg should have opened few days ago, can anybody share the link?
 
Waynemarlow said:
jeff.page.rides said:
Then I shut off the system pulled back on the pedals against the coaster brake to the position that my derailleur is in when it feels best when I’m riding. I measured the pull force at about 50 kilograms and tried it again. Now after pulling back 50kg as the system boots when I ride on the rollers, it didn’t matter which setting I was in, which gear I was in or what cadence I was at even down to 25 rpm or cadence
it was very smooth. I could ride at 2.0 and it had more power than before at 6.0.
If I pull less than this my system doesn’t have enough power for me and if I pull more than this the system wants to run. And I need to stop the rotation, it doesn’t take a lot of effort to stop rotation but if I don’t stop the rotation it will continue to go forward.

Thanks, Jeff

Jeff its very easy on the LCD3 to set your own levels of power, have a look at the user manual
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/0.20.0-%28DEVELOPMENT%29-%7C-KT-LCD3-%7C-TSDZ2-%7C-Manual
and you can set all the parameters to your own configuration, the default ones are just a guide and a starting point. As I have said before, set your display to output Motor Watts and then ride it on say the rollers, taking note of what Watts is comfortably best for you. I then set up a level, say No 5 to match that output. The others I scaled up and down to slightly overlap to give a bit of scope for those days you want a bit of a "blast " and some less to give me a workout.

Its not to difficult and you should be able to customise your engines output to your requirements without having to frig the system by pulling back on the cranks at start up unless there is some software gremlin in there that we are not aware of.

Thanks, but I know how to set it all up. My watts are set at 700w, my amps are set at 16a and I have 4 possible settings in power assist (1)1.0 (2)2.0 (3)4.0 (4)6.0 with eMTB set at 20. If I don't pull back against the coaster brake when I turn on it on I can only use (4) and eMTB and I get tired fast on the trail. On the rollers like I talked about before there's very inconsistent pedaling with hard and easy spots. If I pull back 50kg when I start the system I can use all the settings on the trail depending on how hard the trail is and how hard I want to work and on the rollers, it's very smooth no hard and easy spots.
What I would like is the ability to put in the settings a percentage and when you start up the power assist it thinks that I'm pulling back 50kg or what works best for that ride or rider when were not preloading the torque sensor.
Basically a torque-assist sensitivity setting. By doing this everyone that has a standard motor that can't preload the torque sensor will have the same benefit of adjusting the sensitivity of the torque sensor. By doing that not only do you get the power needed when you don't have the strength, you also as I found out yesterday it's very smooth with no hard and easy spots.
I call that a win-win! buba knew what to do and was working on the project before he disappeared. casainho is going about it at a different way but may end up with the same result.
 
thineight said:
Indeed the latest firmware is the v0.53 with many interesting stuff, I think the main stopper to update to it and try is that many of us already wired the LCD3 and after all it is a good display that includes all the necessary data. In my opinion many users would prefer to keep that one instead of the 850c. Personally I would consider the smaller sw102 rather than the "bulky" 850c.
Since the latest stable firmware for LCD3 is the very good v.20 I see the point that many of us would like to keep that release alive, to be discussed on the new post dedicated to the LCD3.
KT-LCD3 firmware development is frozen, no point discussing issues that were already solved and/or improved on latest firmware version, that could only be developed because the project moved forward.

Good idea to use the other dedicated post and I just updated this post title, so there is no confusion, to:

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

I would like to keep moving the project forward, in slow and small steps. With focus on which is more relevant and carefully choosing features that I think I will keep doing the maintenance.
 
thineight said:
casainho said:
I don't understand. The latest version is not V19 anymore, is version V53 and is much better.

I think V053 is much better than V20. But please make a list, after testing and comparing each feature, give details and prioritize the items on the list, then I can see what I can bring from the V20, if anything relevant.
Indeed the latest firmware is the v0.53 with many interesting stuff, I think the main stopper to update to it and try is that many of us already wired the LCD3 and after all it is a good display that includes all the necessary data. In my opinion many users would prefer to keep that one instead of the 850c. Personally I would consider the smaller sw102 rather than the "bulky" 850c.
Since the latest stable firmware for LCD3 is the very good v.20 I see the point that many of us would like to keep that release alive, to be discussed on the new post dedicated to the LCD3.
By the way.. I did not find the new post that andrea104kg should have opened few days ago, can anybody share the link?

Ciao thineight,
ecco il link
https://endless-sphere.com/forums/viewtopic.php?f=30&t=104232
 
OpenSource EBike app, for TSDZ2 and SW102 display

My wife and me, we were discussing the mobile app design. It is way easier to replicate what is already done on 850C. Here are the wireframes, showing a possible design. Everything is still in development, everything still can change:

[youtube]0rlo1Xn28W0[/youtube]

My wife repository on Github: https://github.com/aleixonunes/eBikeOpenSource
 
casainho said:
Waynemarlow said:
If I pull less than this my system doesn’t have enough power for me and if I pull more than this the system wants to run. And I need to stop the rotation, it doesn’t take a lot of effort to stop rotation but if I don’t stop the rotation it will continue to go forward.

Jeff its very easy on the LCD3 to set your own levels of power, have a look at the user manual
Because all torque sensors on TSDZ2 are different, and some are bad in sensitive, you only get the best results if you use the latest firmware version and do the torque sensor full calibration. Also the last firmware version has improve torque sensor sensitivy by 4x and also the current control by 4x, so you will have much better experience with the latest firmware on the difficulties you are having.

It sounds like I'm going to need to replace the display with a 860c and see how all the changes work? I want to jump to the 860c and hope it all works and at sometime in the foreseeable future the forth button will be usible? The main reason that I want to skip the 850c is so it is more visible in direct sunlight.
 
Hi - I just upgraded to the latest 850c and motor firmware (came from lcd3). While i briefly had 0.20beta i noticed it had a very gentle throttle initiation whereas 0.52 goes *clank* in the drivetrain/gear/slack when i press the throttle. Also was wondering if it's possible to speed up and smooth out UI actions and button responsiveness? there seems to be a sort of inconsistent lag between button press and UI action. Just wondering as I like to quickly change PAS and its hard to run through the pas numbers through quick button presses. Thank you
 
casainho said:
OpenSource EBike app, for TSDZ2 and SW102 display

My wife and me, we were discussing the mobile app design. It is way easier to replicate what is already done on 850C. Here are the wireframes, showing a possible design. Everything is still in development, everything still can change:

[youtube]0rlo1Xn28W0[/youtube]

My wife repository on Github: https://github.com/aleixonunes/eBikeOpenSource
Nice job!
 
ezrider1199 said:
Hi - I just upgraded to the latest 850c and motor firmware (came from lcd3). While i briefly had 0.20beta i noticed it had a very gentle throttle initiation whereas 0.52 goes *clank* in the drivetrain/gear/slack when i press the throttle.
I don't have a throttles on my ebikes so I can't develop. But I think you can improve by reducing the current ramp value and also the motor max current value. Keep the battery current at a value you wish, like for instance 16 amps.

ezrider1199 said:
Also was wondering if it's possible to speed up and smooth out UI actions and button responsiveness? there seems to be a sort of inconsistent lag between button press and UI action. Just wondering as I like to quickly change PAS and its hard to run through the pas numbers through quick button presses. Thank you
It is not PAS, what you change are the assist levels.

The limitation comes because we have possibility to detect quick, quick + long and long press on each button. With that we are doing much more than original firmware does but the button reaction is slower.
 
I briefly did some stuff in arduino that involved buttons and long presses. It's kind of a hassle to work with and i think the trick was to time how long it was pressed. If <50ms its a short click, if >50ms its a long click. You should also give a buffer time (say 50ms) after clicks so you can have ability to chain click actions. If nothing is clicked on in that buffer time then you enter an action state. All these numbers can be tuned to maximize user friendliness and speed. This would also improve navigation in menus and responsiveness especially for people who tinker constantly with many options. Maximum lag in this scenario would be 50ms but even a bit more would be ok too
 
ezrider1199 said:
Hi,

I received a 850c from pswpower and am trying to flash it. I noticed it doesnt fit into my 4-1 cable because it came with a female end so i attempted to put on a new male connector (luckily had a spare). Cut it up and see that the colors are off and the pin positions dont match with what tsdz2 is expecting. So I tried to figure out and match up the pins according to this
3GaLDI1.jpg
.

Here's where I am now

jpccstL.jpg
.


Currently I am able to plug an unflashed 850c to my controller and see it start up but I can't get it to flash... is there anything i can verify? I assume that because the 850c can startup that my wiring should be ok. The APT program doesn't show much in the way of errors. Thanks

Tsdz2 display --> 850c
Gnd, Black --> black
Batt V+, Red --> purple
Rx, Yellow --> white
Tx, Green --> green
5v, Blue --> orange

izeman said:
redwater said:
VIN - orange
Rx - white <--- Tx from UART
+26-54V - brown
Tx - green <--- Rx from UART
GND - black

Colours from 850C cable ofcourse.
Thanks. And Vin/Orange is same voltage as Brown wire? And for programming, does it need Orange or Brown wire to be powered? It's hard to see from pictures.

Hello everyone,

I too decided to embark on the trail of installing TSDZ2 on my bicycle as reading through the forum it felt like the right motor for my needs :)
Along the way I also decide to install open source firmware together with 850c display.
I'm currently in the process of trying to flash the firmware on 850C using bootloader and a DIY bootloader box as mentioned in TSDZ2_wiki. However i ran into some problems during the process and would like to ask for help :)

My situation:
I've connected the components for the DIY bootloader box using the guide provided in TSDZ2_wiki:
https://github.com/OpenSource-EBike-fir ... bootloader

After that, I've connected it to my PC and to my 850c display. All seems fine as before installing the firmware I've tried to power on the display it it starts up and shows all the data (current time, voltage (note: it displays 29.8V while being powered from my PC via bootloader box), km/h etc.).
So now I've identified my COM port (COM3), installed the required drivers, and opened the APT burn tools (v1.3) to start the flashing process.
Next up in the APT burn tools window I've selected my COM3 port, opened it, after that I've selected the firmware for 850c display and pushed he update firmware after which the program showed "waiting..." sign.
I've pushed my power button, but the display did not show anything, the flashing did not start and the message in the program kept repeating "waiting...". It seems I can not get the 850c display to flash.
What I've noticed in the program is that while it's waiting on the input from the display the numbers values near "Tx" (at the bottom of APT burn tools window) are constantly changing and increasing, while number near "Rx" stays at "0". Does this mean there is a problem with Rx connection?

I've followed the wire connection diagram in TSDZ2 wiki and the info on how to splice and connect the 5pin extension wire given by user ezrider1199 and later on user izeman in their posts. I've checked multiple times whether all the wires are connected correctly and it seems that everything is as show in the TZDZ2 wiki.

Does anyone else had the issue of display not flashing and has a solution to my situation? :)

P.S I've got my display from PSPOWER and it sayson the back of dispalay "850c tftgdv2.3clb60 xf2.0" and "V5.2 201909210119".

SOLUTION:
In my case i've tried switching Tx and Rx wires and flash again. To my surprise it worked! Yuppi! :)
This might no be the case to others, but I'll post my final wiring by colors that I have below:

My 5pin extension wires are connected as follows:
(I've identified wire labels according to this image:
http://i.imgur.com/3GaLDI1.jpg)

5pin extension cable white wire (I identified it as "RxD") -> USB to UART connection point "RxD"
black wire ("GND") -> DC booster connection point "OUT-" (GND)
green wire ("TxD") -> USB UART connection point "TxD"
red (i guess it's brown"ish") ("P+") -> DC booster connection point "OUT+" (P+)
orange wire -> left it unconnected (just dangling there on the side)

DC booster connection point "IN+" -> USB to UART connection point "5V"
DC booster connection point "IN-" -> USB to UART connection point "GND"

This solution might be specific to my situation therefore I would suggest to try it at own risk and only if all else fails (try rechecking if you identified the connection points correctly and if you connected everything correctly according to TSDZ2 wiki guide).
 
Back
Top