• 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 made some research with Gemini IA to know how manufacters like Bosh, Yamaha manage the assistance in function of torque, cadence and assist level.
It seems that the assistance is mainly based on torque and not on cadence.
Furthermore, it seems that inside a given assist leve(e.g. eco, tour), the assistance is not proportional to the torque.
They uses a curve (profile) to change the sensitivity: Assistance grows slowly for low human torque, grows much more in the middel and saturates for high human torque.

For level like eco, even at the maximum human torque, the motor does not deliver the max power.
On the opposite, on level turbo, the motor delivers already his max power when the human torque is much less than the maximum human torque and so it just keep the max power even if the user press more on the pedal.

For TSDZ8, the power assist mode uses a formula like assistance = torque * cadence * some ratio (up to the max power). This is quite different.
For TSDZ8 the mode that is the most similar to Bosch Yamaha is the torque assist mode where the motor power is proportional to the human torque (as measured by the sensor) up the max power (defined in the configurator for motor and battery). So this is quite similar to the principle of Bosh and Yamaha. Still in TSDZ8, up to the max power, the power is just proportional (linear) to the sensor torque (and assist % defined for the selected assist level). For TSD8, I already added a concept of expo in order to change the linear relation but I expect that this concept has not been largely used. Furthermore, when used, expo is applied in the same way for all levels.
Still in TSDZ8 the power is stricly proportional to the human torque as meassured by the torque sensor.
Note : it seems that measurements are linear with weight on pedal up to 50 kg which is normally enough in practice.


In order to offer more flexibility, I could make some changes:
The assistance level is defined in TSDZ8 with a number in range 0...254 (0= no assistance, 254 = max assistance).

Without changing the configurator/860C display, each number could combine 2 different meanings:

- the last digit (0...9) could identify a curve. So there could be up to 10 curves. Each curve convert human torque (in % from the useful range) into a % of power motor.
Each curve could give a different sensitivity (=profile) of the torque sensor over the used range.
All curves have the same first (0%,0%) and last (100%, 100%) points but will differs in between.
E.g. curve 0 = linear curve = like now = constant sensitivity over the whole torque range.
1...9 = curve that grows less than the linear curve for low weights and grows faster in the upper part).The user get relatively less assistance for low weight and relatively more dor high weight.

- the assist level could then be defined by the value discarding the last digit. So there would be only 25 different levels instead of 254.


Value e.g. 32 would say : apply a level similar to actual level 30 (discard last digit) but instead of a linear response apply curve nr 2 (so with just a littel less progessivity for low weight and a little more for high weight).

Value e.g. 59 would say : apply a level similar to actual level 50 but instead of a linear response apply curve nr 9 (so with much much less progessivity for low weight and much much more for high weight).



Then, the motor power would be calculated based on a formula like : 4000W * selected level * output from the selected curve.

Selected level = value without last digit / 240; So 245 -> 240/240 = 1 = 100%; 52 -> 50/240 = 0.20 = 20%

Output of the selected curve would depend on % of the human torque inside the useful range.
Note: the useful range depends itself on the selected level because for a high level, the max power is alredy reached for a human torque less than the maximum human weight. Then the "useful" is reduced.
E.g. with 4000w in the formula, a max power of 1100W (23A X 48V), a max human weight of 50kg:
- if level = 200, then the max power 1100W would already be reached with a weight of 17 kg (1100/4000*250/200*50) ; So useful range is 0...17 kg
- if level = 100, then the max power 1100W would be reached with a weight of 34kg (1100/4000*250/100*50); so usefull useful range is 0...34 kg
- if level = 50, then the max power 1100W would never be reached. At 50 Kg, max power would be 4000 * 50 /250 = 800W; here usefull range is 0...50kg.

If this logic gives good results, it would be possible to apply it also for "power" mode and "eMTB" mode.
When one of those mode would be selected, the logic would be the same as for torque mode but with other assistance level and different profiles (depending on the set up in configurator/860C display.

Comments on this proposal are welcome.
 
Indeed, I think a non fully linear reponse curve, with saturation at higher weight will feel more natural.
It seems to me that the ability to change the shape of the response curve is already implemented in the TSDZ2 860C/SW102 display firmware by @mbrusa, with the 'Torque angle adj' parameter. Isn't this similar to what you propose ?
 
Indeed, I think a non fully linear reponse curve, with saturation at higher weight will feel more natural.
It seems to me that the ability to change the shape of the response curve is already implemented in the TSDZ2 860C/SW102 display firmware by @mbrusa, with the 'Torque angle adj' parameter. Isn't this similar to what you propose ?
I am not sure that the torque angle adj can change the profile in such a big proportion as I plan with curve. I think also it has an impact mainly on the profile at low weight. I expect it does not significantly change the profile at high weight.

At very high assiste level, when saturation occurs for a quite low weight, the transition on TSDZ2 is abrupt: motor power increases fast up to the limit and then does not increases anymore. In my proposal, if the curve is in "S" (like Bosh/Yamaha), the transition to saturation becomes smooth. Still I am not sure that the user can really feel the difference.

Another more important difference is the fact that ,in my proposal, the curve could be different for each level and each assist mode. The adj parameters (offset, angle, range) in mbrusa apply in the same way for all levels and all modes.

Note: there seems to be a big difference in the torque sensor itself between TSDZ2 and TSDZ8. For TSDZ2, the curve (ADC versus weight) I have seen have a knee already at 25 kg while the TSDZ8 has it at 50 Kg. If it is really so, the TSDZ8 sensor itself provides a linear response on a much larger range (that will probably be large enough to cover the whole user range in practice for most users). Perhaps this is not true for all motors. To be confirmed, it would require that more users calibrate their motor and publish the results.
 
Hi, I’m currently using version OSF_TSDZ8_860C_SPIDER_3_V00_02.04.hex.
Since the implementation of the dynamic FOC control, the motor response has improved significantly. I noticed that when setting Torque Angle Adj to 20, which gives a linear response, the motor delivers a lot of power immediately even with low pressure on the pedals, and it easily reaches the maximum current I have set (16 A).
In fact, I set the value to 25, and the response at low pedal pressure improved. However, I also noticed that changing the value by just one unit can significantly affect the motor response.
Therefore, in my opinion, @mstrens’ proposal could help provide greater control over the motor response according to each user’s individual needs.
 
Hi, I’m currently using version OSF_TSDZ8_860C_SPIDER_3_V00_02.04.hex.
Since the implementation of the dynamic FOC control, the motor response has improved significantly. I noticed that when setting Torque Angle Adj to 20, which gives a linear response, the motor delivers a lot of power immediately even with low pressure on the pedals, and it easily reaches the maximum current I have set (16 A).
In fact, I set the value to 25, and the response at low pedal pressure improved. However, I also noticed that changing the value by just one unit can significantly affect the motor response.
Therefore, in my opinion, @mstrens’ proposal could help provide greater control over the motor response according to each user’s individual needs.
I forgot to mention that I’m using Hybrid mode. Regarding this, I did some research using Gemini, including some simulations involving cadence, pedal pressure, etc. (always from a theoretical perspective), and I noticed that in Hybrid mode, with the values I have set, Torque mode is active almost all the time.
 
today i tried out the test6_with_pll OSF_TSDZ8_VLCD_SPIDER_3_V00_02.04
The issues i had before are mostly gone, it doesnt go in weird "pushes" or jumps in hills and it goes fairly smoothly, also it feels as strong or maybe very slightly weaker than the original firm when used in cadence mode, im currently triying configurations on hybrid mode to try to make that one closer to the original firm too

but i have encountered 2 issues

1 street mode doesnt limit to 25kmh no matter what i do
2 tried checking wether street mode properly activates, by having the offroad mode( on advance settings) have the throttle when pedaling, and then have street mode with the throttle disabled
even when changing modes (having E02 blink for couple of seconds) the throttle doesnt seem to work no matter what, neither does the 25kmh limitation

here i put screenshots of my current settings, im not sure if this issues are bugs of the test branch( could be, there is a reason that its called test branch) or some incorrect settings i have, would be curious if anyone have any pointers regarding this or how to improve my settings
thanks!


1787751672626.png1787751685488.png1787751696924.png
 
Hi guys! New here but was reading a lot of this thread before posting (not all of it).
First off thanks for a great work for developing the firmware, both to mbrusa and mstrens and to all the testers:)

My Jlink from Aliexpress arriving today (at a post office now) so I plan to update from stock to OSF firmware, mainly because I'm using 6s batteries in series (I have quite a few somewhat used ranging from 8400 to 20000mAh). My stock firmware is quite powerfull in modes 1 and 2 (in some cases too powerfull) but throttle response is bad and I can use only about half capacity of 12s battery without limitations and from 50 to about 75% with reduced power output (the best was 6Ah from 8.4Ah battery until total cutoff).

My display for now is B02NU (similar to EKD01 I guess) that has zero usefull info besides voltage and speed (no power meter, nothing).


I have a few questions around SW versions
1) What SW version do you recommend as most stable\userfriendly with stock display? Am I correct to assume v2.04 from 6_test branch? Spider or Katana?
2) Should I upgrade FW version on my B02NU display with Varstrom Tongsheng UART V22 (I've seen it mentioned quite a few times on this forums)

3) Anyhthing I should configure specifically for 2.04 version for stock display?

Also it's currently a sale on Bafang UART SW102 displays on Ali, so I think I will order one. Am I correct to assume that in order to flash the correct firmware I would need an STlink adapter and pry open the SW102 to program through JTAG pins? Can I use arduino FTDI programming adapter instead of STLink (it has 3.3V) or it's a tottally different beast?

Thamks a lot!
 
Another update, wasnt able to get street mode to limit to 25kmh no matter what, but for the rest it all works quite nicely, i am getting the error E09 from time to time to, tried reinstalling everything from 0 just in case the original instalation had any issue, and i will have to check it tomorrow as today is raining

but for now im fairly happy with the firmware, i havent done a proper ride yet tho, just went arround my building and did a small hill closeby
 
did a long ride today, and notice couple of things

keep getting the E09, now i noticed that its mostly after i stop pedaling for a while and i brake

also noticed that all my menus are moved, whats suposed to be on lvl 1 its on lvl 2, whats suposed to be on lvl 2 is on lvl 3, etc

i will barely touch the settings once instaled so i dont mind tho

For the error E09 anyone has an idea on how to fix it? i have to do a full stop every time to restart the bike so its quite anoying
 
Back
Top