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

andrea_104kg said:
what's the logic of new emtb?
Thank's for your hard work!
Thank's for your hard work!
Thank's for your hard work!
Thank's for your hard work!
Thank's for your hard work!
Thank's for your hard work!
Thank's for your hard work!

Thank you, thank you and thank you! :)

It is the same logic as before and it is based on pedal torque. Did you wish for it to be based on pedal power?

Current eMTB logic:
Motor torque = Pedal torque ^ X

What you would want(?):
Motor power = (Pedal torque * pedal cadence * [assist multiplier]) ^ X

EDIT: There are many ways to implement different riding modes. But there is usually no way to measure how "good" a riding mode is except evaluating feedback from users. The feedback is based on the experience and feeling from actually testing the riding mode. Sadly, this means that something can be perceived as good by some but not so much by others. Therefore it is very beneficial to have several different riding modes and also use this great community as a feedback loop. (Feedback is gold so thanks!)

eMTB has been improved, in some small way or another, four times in the 0.20.0 firmware version. I can only imagine that it is going to change even more in the future. What I am trying to say is that this project is in continuous development and we are working in steps defined by releases. So whatever is released in the 0.20.0 is only the stepping stone for the future improvements and changes.
 
Hi Buba,
it's possibile to have more filtered values in sub-field where it's show the istantaneous Amp absorbed and fill the First character with a symbol like "A" ?
I think it's a good thinks fill, where it's possibile, all the first character of any sub-field to improve readibility.

Thanks
 
vadda said:
Hi Buba,
it's possibile to have more filtered values in sub-field where it's show the istantaneous Amp absorbed and fill the First character with a symbol like "A" ?
I think it's a good thinks fill, where it's possibile, all the first character of any sub-field to improve readibility.

Thanks

That is a good suggestion and is otherwise very possible to implement. But there is only a small amount of available program space left in the KT-LCD3. It would be very difficult to add more characters and logic to handle those characters. A lot of work needed to rewrite the print functions and try to optimize away other things so everything can fit, if at all possible.

I am very sorry about this, Vadda! But what I can do is to put it on a list of suggestions. So you know that it is at least written down if for any reason there is some space in the future!

If you want me to increase the filtering on the current, voltage, cadence or any other data please let me know. That is very simple to do and I have no problem changing that. On the contrary, would love to hear some thoughts about that from you or anyone else!
 
Hi Buba,

I was reviewing and trying to understand the eMBT code. At the start you define some strings for each level of eMBT assist ... what are these values and how are they used?

Also trying to understand the /20 ... is that simply a scaling factor to convert "torque" to current supplied by the controller?

Cheers
 
casainho said:
Peetsyo said:
If the motor overheats , does it switch off as if switched off from button (display goes off) or motor just becomes unresponsive and display stays on ?
Can you switch on immediately after that and ride on ?

I am not sure if i have problem with battery connection or the motor actually overheats.
Which version of our OpenSource firmware are you using?

v 0.16
 
Peetsyo said:
casainho said:
Peetsyo said:
If the motor overheats , does it switch off as if switched off from button (display goes off) or motor just becomes unresponsive and display stays on ?
Can you switch on immediately after that and ride on ?

I am not sure if i have problem with battery connection or the motor actually overheats.
Which version of our OpenSource firmware are you using?

v 0.16
Are you using the temperature sensor? In any case, if motor overheats, the display never turns off.

Well, unless there is any kind of short circuit and your BMS is shutting off.
 
mctubster said:
Hi Buba,

I was reviewing and trying to understand the eMBT code. At the start you define some strings for each level of eMBT assist ... what are these values and how are they used?

Hello, Mctubster!

Those values are in an array called a lookup table. We use that whenever there is are heavy computational operations that would take more time to compute than to simply access a precalculated value from memory. Another reason for using lookup tables is to limit library dependencies and also reduce the program space needed to solve those operations.

When using a lookup table we only waste time and program logic to retrieve values from a certain address in the program memory. That value holds the answer to our calculation instead of having to calculate it.

Here is an example showing a function that would take a lot of operations to calculate:

eMTB_currentTarget = PedalTorque^1.85

But if this is precalculated and the results are stored in the array we can just get the result from the appropriate address in the array:

eMTB_currentTarget = powerFunction_1_85[PedalTorque]



mctubster said:
Also trying to understand the /20 ... is that simply a scaling factor to convert "torque" to current supplied by the controller?

Cheers

The /20 is to scale the curves so you are totally correct. This was primarily used when developing the original eMTB. But it is not needed in the new eMTB code in Alpha 8. Have not yet pushed the Alpha 8 so you are looking at the Alpha 7 code.

Let me know if you have more questions! I think it is important to keep the code simple and accessible to everyone! That ensures that we have the highest probability for users to try out their own changes. That would be very exciting and would result in a much faster development! So always let me know if there is anything you would want me to simplify or if you see any room for improvement.

Cheers!
 
Alpha 8 is ready for you!

------------------------

Here is the wiki (work in progress):
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/0.20.0-(DEVELOPMENT)-%7C-KT-LCD3-%7C-TSDZ2-%7C-Manual

------------------------

Here is my Google Drive folder with the Alpha 8:
https://drive.google.com/open?id=1CPGT-V1ZX7FCzfhgbrPMYfbYtY4_JH2R

------------------------

Here is my branch where you can see the source code and latest changes:
https://github.com/leon927/TSDZ2-Smart-EBike/tree/testing-pwm-acc

------------------------

Here are the changes from Alpha 7:
- eMTB improved and optimized, more sensitivity values
- Button debounce on Walk Assist and Cruise, very safe implementation
- Overall improvements

------------------------

Comment:
No need to update unless you want to get the latest changes. If you are using eMTB, Walk Assist or Cruise I recommend to update!

------------------------

From previous post:
Alpha 8 will introduce a better eMTB with more options for sensitivity. At the same time it will be drastically space and speed optimized. That means it takes up less program space and executes faster. So the result is that we will have more available space in the motor controller and not compromise on functionality.

The Walk Assist and Cruise will have a really clever button debounce feature that can differentiate accidental activation from real activation. If you accidentally and quickly press the DOWN button it will immediately deactivate Walk Assist or Cruise as soon as you let go. But if you are holding the DOWN button for a longer time the system will understand and allow for some button debouncing. Cruise has a lower debounce time than Walk Assist but that is by design. This is actually a really safe implementation and I hope it will be approved by the community. It is also dynamic so it adjusts for the time the user holds down the button and so on. Needs to be tested and I look forward to feedback.

There will also be some other small changes and improvements in the Alpha 8.
 
buba said:
Alpha 8 is ready for you!
Buba, I saw that your tables of for emtb are really big, even more then the ones already existing the previous firmware version (the ones used for the motor controller).

Why don't you use the way smaller table of 8 points as I implemented for torque sensor full calibration?
 
casainho said:
buba said:
Alpha 8 is ready for you!
Buba, I saw that your tables of for emtb are really big, even more then the ones already existing the previous firmware version (the ones used for the motor controller).

Why don't you use the way smaller table of 8 points as I implemented for torque sensor full calibration?

Mainly due to simplicity during development and feedback. It is far easier and quicker to generate the values in this form and make changes. I have basically automated the process. When we have validated that eMTB is okay and everyone is satisfied with the layout we can further optimize and refactor so we get a really nice and light code. It is always possible to change later on and optimize as much as we need!

(But still decided to optimize slightly and am now using 8 bit tables and not 16 bit.)
 
Re A8, Sorry Buba because I realise you have put a lot of work in.

The mod to the walk assist which means that the bike carries on for another three feet after releasing the button is not acceptable for me. I need the bike to stop as soon as I release the button especially on a route I use which has sections of steps on a cliff. I realise why you've done the mod but as soon as I found the bike kept on moving after a deliberate release I realised the obvious problem and for me it would be safer without the anti bounce facility.


Yesterday I had a smile on my face using eMTB mode because it was perfect and the bike responded as if it knew exactly what I wanted from it, be it just a little power all the way up to full on let rip. It wasn't doing that tonight but I guess I need to get used to 20 levels of sensitivity now.
 
casainho said:
Peetsyo said:
casainho said:
Peetsyo said:
If the motor overheats , does it switch off as if switched off from button (display goes off) or motor just becomes unresponsive and display stays on ?
Can you switch on immediately after that and ride on ?

I am not sure if i have problem with battery connection or the motor actually overheats.
Which version of our OpenSource firmware are you using?

v 0.16
Are you using the temperature sensor? In any case, if motor overheats, the display never turns off.

Well, unless there is any kind of short circuit and your BMS is shutting off.


I do not have temp sensor yet.
I have the programming cable connected , not the speed sensor.

Does it switch off the controller , if there is no speed input for some time ?
 
Rafe said:
Sorry Buba because I realise you have put a lot of work in.

The mod to the walk assist which means that the bike carries on for another three feet after releasing the button is not acceptable for me. I need the bike to stop as soon as I release the button especially on a route I use which has sections of steps on a cliff. I realise why you've done the mod but as soon as I found the bike kept on moving after a deliberate release I realised the obvious problem and for me it would be safer without the anti bounce facility.


Yesterday I had a smile on my face using eMTB mode because it was perfect and the bike responded as if it knew exactly what I wanted from it, be it just a little power all the way up to full on let rip. It wasn't doing that tonight but I guess I need to get used to 20 levels of sensitivity now.
Rafe, do you have the brake sensors installed? I think that is the safest of the options for both the walk assist stop and to save the blue gear on steep rough terrains.
I have not tried the alpha8 but I assume that the brake sensors, if pressed, override the denounce feature.

Hope this can be sorted because I see there are 2 philosophies here :wink:
Buba, in case is there any chance to let the user configure in the menu the preferred option, e.g. option 1 without denounce and option 2 with denounce?
 
Peetsyo said:
Does it switch off the controller , if there is no speed input for some time ?
Yes.
 
thineight said:
Rafe, do you have the brake sensors installed? I think that is the safest of the options for both the walk assist stop and to save the blue gear on steep rough terrains.
I have not tried the alpha8 but I assume that the brake sensors, if pressed, override the denounce feature.
Yes, brake sensors are a must and they immediately disabled the motor.
 
Hey all,

Enjoying the 20 beta 3.

Have a question - if my display is set to Imperial, is EVERY applicable menu item in imperial units? Specifically, is the torque sensor reading in menu 10 in pounds? I was checking my calibration with a digital luggage scale, and it appears to be bang on - if the reading on the LCD3 is in pounds...

Thanks!

Neil
 
From previous test i found in " advanced technical data ", using my weight ( 64 kg ) on pedals ;

with V0.19 ;
ADC pedal torque sensor : static = 53, right = 89, left = 86
pedal torque sensor dynamic ( pedaling ) : 0 to 170
human power : average 200/300w, hitting 600w for short time .

with V0.20 alpha 6 ;
ADC torque sensor : static = 217, left and right = 340
torque sensor dynamic ( pedaling ) = hiting 320 witch is less than static and very different than V 0.19

do you thinck it's necessary to calibrate ( hardware ) the torque sensor ?
is there any way to calibrate it without openning the mid drive ( casainho explained ) .

******************************************************************************************************
Testing my son'bike witch is a bosh powered with eMTB
power mode eco/tour/speed/boost, with eMTB replacing speed mode ( using ratio from tour to speed mode ) .
boost is a vast of power
eco work fine if you'r strong pedaling ;)
tour seem too strong for me but must be good for people with weight more than 80 kg
speed/eMTB : same remark than for tour mode

what i found : there is a big accelerating ramp 3* the power of absolute of the mode, too bad if you want to save battery, each times you change gear or level assit or stoping pedaling and pedaling and it s seem it s not customizable ( but may be !? )

accelerating ramp it's about 2 seconds

each level seems to be customizable for power limit ( with bosh program not for user exepted may be with the biggest display nyon ( about 500$ )
the motor is very powerfull and torque sensor very progressive and effective, 3* the stock TSDZ2 sensor i thinck .

power mode seem to work as in OSF , exepted the motor could be push easily to 115 rpm and the power grow with rpm .

accelerating ramp is too strong even in eco mode, lack of power and battery ...

The motor is "only " 75 Nm but you got it even in smaller rpm/gear
 
elem said:
From previous test i found in " advanced technical data ", using my weight ( 64 kg ) on pedals ;

with V0.19 ;
ADC pedal torque sensor : static = 53, right = 89, left = 86
pedal torque sensor dynamic ( pedaling ) : 0 to 170
human power : average 200/300w, hitting 600w for short time .
You should wait for any release we will do for torque sensor calibration or go find on previous messages my explanation how to use a specific version based on 0.19.0 and do the calibration on the firmware only.
 
Hi Buba,
installed A8, all ok.
The debounce on walk assist in now perfect.
:wink:
Thanks
The eMtb was impoved a lot but ,for me, It Is only usabile in certain situation.
:thumb:
 
Hey guys, I have been following this effort for a while and finally got all the equipment today! Thanks for all the work on this.

However, I'm stuck. I got the 850C flashed and the TSDZ2 flashed using the directions from the wiki. Everything seems to communicate ok, however, I am getting no power assist.

Things I tried:
- Torque sensor seems to be reading in the menu.
- The cadence and human power field does not update (Even under aggressive pedaling)
- Walk mode works
- The power-under-no-pedaling works. It goes to 250W then ramps down to zero, then I have no pedal assist.

Any help would be very appreciated.

Here is my hardware:
- "52V" throttle version of the TSDZ2.
- 850C Display
- 14S battery
- No throttle or Brake sensor wired in yet.

My Software:
- Used STM32 to flash using the ST-Link "Bafang_LCD_850C_firmware-v0.4.0.bin"
- Used STVP to flash using "TSDZ2-v0.19.0.hex"

Dat Le
 
rippledabs said:
Hey guys, I have been following this effort for a while and finally got all the equipment today! Thanks for all the work on this.

However, I'm stuck. I got the 850C flashed and the TSDZ2 flashed using the directions from the wiki. Everything seems to communicate ok, however, I am getting no power assist.

Things I tried:
- Torque sensor seems to be reading in the menu.
- The cadence and human power field does not update (Even under aggressive pedaling)
- Walk mode works
- The power-under-no-pedaling works. It goes to 250W then ramps down to zero, then I have no pedal assist.

Any help would be very appreciated.

Here is my hardware:
- "52V" throttle version of the TSDZ2.
- 850C Display
- 14S battery
- No throttle or Brake sensor wired in yet.

My Software:
- Used STM32 to flash using the ST-Link "Bafang_LCD_850C_firmware-v0.4.0.bin"
- Used STVP to flash using "TSDZ2-v0.19.0.hex"

Dat Le
Your issue seems to be the lack of cadence value.

Try enable motor startup without pedal rotation, that should start the motor for a short time as it does not depend of cadence at startup.

If you still have no cadence, I would say that for some reason, your cadence sensor is not working....
 
Back
Top