• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

TSDZ8 OSF (open source firmware)

I for one would like to have more power with the OSF, but just the throttle. Pedaling feels awesome as it is. @astronaut maybe you have some tips how to make the throttle very responsive with no delay and a nice exponential curve?
 
The last weeks, I tried to improve the motor efficency for OSF for TSDZ8.
The main goal was to let OSF automatically calculate the best lead angle.
After many trials and errors, I hope having a solution (only for 860c version currently).
I put a new version (0.2.0) in github in a branch named test5 (do not try other branches named test1, ...test4, they probablu do not work).

It is here : GitHub - mstrens/OSF_860C at test5

There are many changes in this version in the way the rotating magnetic flux is generated like:
- increased resolution for all angles (use 16 bits instead of 8 bits)
- auto calibration of the positions of the hall sensors
- smoothing of the rotor angle when a hall transitions occurs
- a basis lead angle is calculated based on motor speed and on current
- a correction of lead angle is dynamically added in order to minimise Id (= unproductive current)
- more checks on max current (phase current, rms,...)
- Lot of code previously done in ISR at 19kHz has been moved to a new loop (systick at 1kHz): This new loop manages cadence sensor, torque sensor, wheel speed sensor, lead angle, security checks, ramp up/down).

Please note that:
- at this stage I did not focussed on improving the power delivered by the motor. I did not change limits from previous firmware and I even added some more security checks and those are based on dummy values. So, fine tuning is probably requited).
- this version does not use foc multiplier as lead angle is automatically optimised.
- I did not tested this version on the road but I made a few tests with a trainer. So be careful and test it at your own risk.

If you test it, please put your comments on this forum.
 
The last weeks, I tried to improve the motor efficency for OSF for TSDZ8.
The main goal was to let OSF automatically calculate the best lead angle.
After many trials and errors, I hope having a solution (only for 860c version currently).
I put a new version (0.2.0) in github in a branch named test5 (do not try other branches named test1, ...test4, they probablu do not work).

It is here : GitHub - mstrens/OSF_860C at test5

There are many changes in this version in the way the rotating magnetic flux is generated like:
- increased resolution for all angles (use 16 bits instead of 8 bits)
- auto calibration of the positions of the hall sensors
- smoothing of the rotor angle when a hall transitions occurs
- a basis lead angle is calculated based on motor speed and on current
- a correction of lead angle is dynamically added in order to minimise Id (= unproductive current)
- more checks on max current (phase current, rms,...)
- Lot of code previously done in ISR at 19kHz has been moved to a new loop (systick at 1kHz): This new loop manages cadence sensor, torque sensor, wheel speed sensor, lead angle, security checks, ramp up/down).

Please note that:
- at this stage I did not focussed on improving the power delivered by the motor. I did not change limits from previous firmware and I even added some more security checks and those are based on dummy values. So, fine tuning is probably requited).
- this version does not use foc multiplier as lead angle is automatically optimised.
- I did not tested this version on the road but I made a few tests with a trainer. So be careful and test it at your own risk.

If you test it, please put your comments on this forum.

super exciting stuff. thanks for all your work on this! truly amazing.
 
Hi everyone,
I’m having a strange issue with the TSDZ8 Open Source Firmware.
I successfully flashed the latest mstrens OSF (unfortunately I forgot to backup the stock firmware first, see below the ending..).
I configured everything using the Java Configurator exactly as shown in Ebikebuilder’s video (same settings, same steps).
My display is a DFL11 – it looks absolutely identical to the one in the video, so I selected EKD01 in the configurator just like he did.
The flashing process went fine, no errors reported, and the torque sensor calibration worked perfectly (I ended up with a value around 200, which seemed correct).
However, once on the bike I have two major problems:
Throttle ADC is stuck at 0 all the time (visible in the debug screen).
Torque ADC values look normal and change when I press the cranks, but the motor never starts, no matter the assist level or mode (tried Hybrid, Cadence, Power, eMTB… nothing works).
I then suspected a display compatibility issue. Following some (bad) AI advice I tried flashing the 860C version → immediate error 03 (communication problem) as expected.
In desperation I flashed back Ebikebuilder’s stock 2025 hex file I found on the forum → everything works perfectly again (throttle + assistance)! Which seems, unless I am wrong, to rule out any hardware or display incompatibility problem.
So the controller and the DFL11 display are fully functional with the stock firmware, but something in the OSF + my current config prevents both throttle and pedal assist from working.
Does anyone have an idea what could cause this? Wrong display selection in the configurator even though it looks identical? A specific setting I’m missing? Latest Java Configurator bug with DFL11?
Any help would be hugely appreciated!
Thanks in advance!
 
Hi @mstrens I tested newest version of your software and its working very smooth, and quite good but:
-the odometer and trip A/B don't show the km traveled, even though the current speed is displayed correctly.
-throttle doesn't stop after releasing the throttle, and the engine continues to run. To stop, I have to turn the engine off or use the brake sensor. It might be a problem with my throttle, so it would be good if someone else could check and confirm this.
Turning off/on again doesn't helped.
I did not test the maximum speeds because the road conditions were difficult.
 
Hi @mstrens I tested newest version of your software and its working very smooth, and quite good but:
-the odometer and trip A/B don't show the km traveled, even though the current speed is displayed correctly.
-throttle doesn't stop after releasing the throttle, and the engine continues to run. To stop, I have to turn the engine off or use the brake sensor. It might be a problem with my throttle, so it would be good if someone else could check and confirm this.
Turning off/on again doesn't helped.
I did not test the maximum speeds because the road conditions were difficult.
Thanks for the feedback.
I checked the code for the odometer and I found the bug. It should be fixed in next version.
About Throtle: I made my tests in cadence assist mode and the motor stops always when I release throttle while not pedaling.
Perhaps you should check the offset that you defined for you throttle. You can see the values on the display. If the value displayed when you release throttle is lower than the throttle offset and that the motor continues to run (without pedaling and torque apply) then it would be a bug in the new version but I did not find it.
 
maybe you have some tips how to make the throttle very responsive with no delay and a nice exponential curve?
Firstly, I did not say that the OSF is perfect. Secondly, I do not use the throttle lever, but in Torque mode, the motor is responsive and has a good curve. Sometimes all depends on configuring settings via SW102 (or other disp.) a lot.
 
hi all,
i've got a TSDZ8 that I just installed OSF on, with an EKD01 display. my biggest problem is that it's way slower in top RPM compared to before. for example, in my lowest gear i used to be able to go above 30kph (actually riding the bike), now even if i lift the back wheel, i only reach 18kph. since this applies even when off the ground, it doesn't seem the power is being limited here - i've got a 52V battery and high power settings. pedal assist stops pretty early, just like the throttle.

does anyone have an idea what i could do? thanks in advance!
 
nope, I experience the same lack of power regardless if i'm in street mode or not. (or at least if i interpret street mode correctly, that is when i long press power+up to switch between a more limited mode vs default)
post a Java table with the settings you had and we'll see
 
This is photo of your settings from your ini file, in my opinion try to:
1)Motor type change to Tsdz8
2) Try lower motor acceleration f.e 40-60
3) You can try also little bit lower Decceleration I use also 19kHz in Duty cycle freq
4) Try startup assist without pedaling tres disable
5) Battery current 40A seems to me to be to high I use c.a 25(factory 23A)
6) Battery cut off can be to high (45V even to 52V battery) a d maybe this occure problems with lack of power
7) try to disable Torque sensor adv
8)Try Assist mode on startup change to f.e Power, should be better.

Sheets 2 and 3 of Java cfg sees to be ok,
Check also distance between magnet and speed sensor, it shouldnt be to close because this can also decrease your motor power.
 

Attachments

  • 20251125_195036.jpg
    20251125_195036.jpg
    2.1 MB · Views: 49
thanks! I've messed around a lot with settings since, turns out half my problem was that torque-sensing didn't translate to motor power, only the startup boost options did. also, the "spider 3" version of the latest firmware didn't have pedal assist but only throttle, which was fixed by using the other firmware logic. now on no load I can get it to spin up to 63km/h instead of bouncing back from the EKD01 display's 60k limit, which sounded promising at first glance. however, in practice, even though I get plenty (1400W-ish) of power at first (with no startup assists), it drops off from 30 to about 40km/h. even with great effort, I am unable to hit soeeds north of like 42, at which point - again - it feels like practically no assist, with the displayed power hovering between 700-850 watts.
This is on a bike which, with the factory firmware, gets to 40 easy, topping out between 50-55, while sustaining 1200-1400W power. I just want to fix the abysmal throttle response of stock :D
 
One of the best features of OSF is the possibility to "continue with errors". On the TSDZ2, i break torque shafts about every 2 years. While order a new one, I can still use the bike in cadence mode. I dont want to go 30km without motor anymore. I could (hopefully), but its no fun. I think the overcurrent bug cost me the last shaft: I cannot let the other bikes win, so I use too much leg power until the next red light when I restart the motor :) And its great for repairing. Without it, I would never have found the faulty cadence-sensor on a brand new TSDZ8 (which I bought 2nd hand after it ran about 10km). BTW: Its hard to find (impossible) the sensor but the sensors from the TSDZ2 fit (after a bit of dremeling).
 
I'd love to be able to run it without the speed sensor as I don't really care about the exact speed I'm riding at, would be nice to have the option, not sure it's possible though.
 
hello mstrens, just wanted to ask you if you consider making osf for the newer motor tsdz16
Sorry but I do not plan to make OSF for TSDZ16. I do not have such a motor and so I can't make devlopments for it. If tsdz16 uses the same microprocessor as TSDZ8, I expect someone could try to adapt osf for TSDZ16.
 
Hello, I haven't been able to find the answer to what the difference is between katana and spider version? Which do you all prefere?

I just got the tsdz8 and put the katana version on it. I like it, but could probably fiddle with it some more to get it better. But maybe I should fiddle with spider version instead..?
 
How is this motor working on 48 volt 25 a or higher,does it overheat on long steep climbs?
 
3 weeks ago (see post on 21 nov here above) I published on github a version for 860C display containing many changes.
In the last weeks, I further made small changes in order to improve rotor positioning.
This new version is now available here : GitHub - mstrens/OSF_860C at test6_with_pll

I also updated the version foreseen for stock displays (VLCD5 and similar) in order to provide the same improvements as 860C version (see post of 21 nov for more details). This version is available here : GitHub - mstrens/OSF at test6_with_pll.
As for 860C version, FOC multiplier is not used anymore as lead angle is supposed to be automatically optimised.
Important note : this VLCD5 version compiles but has not been tested at all. At this stage, I hope that there is no (severe) bug. So be carefull if you try it.

Your feedback is welcome.
 
3 weeks ago (see post on 21 nov here above) I published on github a version for 860C display containing many changes.
In the last weeks, I further made small changes in order to improve rotor positioning.
This new version is now available here : GitHub - mstrens/OSF_860C at test6_with_pll

I also updated the version foreseen for stock displays (VLCD5 and similar) in order to provide the same improvements as 860C version (see post of 21 nov for more details). This version is available here : GitHub - mstrens/OSF at test6_with_pll.
As for 860C version, FOC multiplier is not used anymore as lead angle is supposed to be automatically optimised.
Important note : this VLCD5 version compiles but has not been tested at all. At this stage, I hope that there is no (severe) bug. So be carefull if you try it.

Your feedback is welcome.
I tested the latest version of OSF_TSDZ8_860C_SPIDER_3_V00_02.01 and it works very well. The engine runs smoothly and intuitively, with no bugs, and the odometer now works properly. The only thing that could be improved is increasing the available power to 1400-1500W, as the maximum power on a 53V battery was now around 1100-1150W (with max amperage 24A). I know this is more of a question for @mbrusa and a display software, but I think it could be increased to around 28-30A, especially since the motor doesn't overheat, and today, after driving about 10km, it was only around 20°C inside motor and at 5°C outside.

Best regards and thanks for your work, @mstrens
 
I tested the latest version of OSF_TSDZ8_860C_SPIDER_3_V00_02.01 and it works very well. The engine runs smoothly and intuitively, with no bugs, and the odometer now works properly. The only thing that could be improved is increasing the available power to 1400-1500W, as the maximum power on a 53V battery was now around 1100-1150W (with max amperage 24A). I know this is more of a question for @mbrusa and a display software, but I think it could be increased to around 28-30A, especially since the motor doesn't overheat, and today, after driving about 10km, it was only around 20°C inside motor and at 5°C outside

Best regards and thanks for your work, @mstrens
Do you mean what @HazzaHodgson modded (
Release TSDZ8 — Motor Launch Yes / Rider Launch Yes · 8hodgsonkh/OSF_860C ) or something else? I would like to have that too (for vlcd5)
 
Do you mean what @HazzaHodgson modded (
Release TSDZ8 — Motor Launch Yes / Rider Launch Yes · 8hodgsonkh/OSF_860C ) or something else? I would like to have that too (for vlcd5)
No, I meant this new version by @mstrens from here : GitHub - mstrens/OSF_860C at test6_with_pll I tested just 860c, version for vlcd is here : GitHub - mstrens/OSF at test6_with_pll but I havent testet it and I highly recommend you to change display to 860c osf its mch better than vlcd5.
 
Yes, I know you're referring to mstrens' firmware. I meant whether you want this firmware modded the way Hazza did it, or something else? As I understand it, Hazza increased the amperage limit.

I like that the "Street Mode Off" on the VLCD5 is hidden and automatically deactivated when the display is turned off. On the 860c, is the setting directly selectable? Without a secret key combination?
 
Back
Top