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

perryscope said:
So when do I use eMTB mode?

Well to be honest not for the above situation, ie not on the road when you come to a hill but want to keep a steady pace. Instead
its for when you come to the tricky single track stuff, when you need a very quickly responding motor with full range of power. I think of it as a 'focused' mode, by that i mean you use it when your focused on every little direction change and hopping over rocks etc. Your classic Mountain Biking. For that its great. you don't have to touch the assist levels, just ride on one gear and on
the brakes.

Having less assistance levels makes it quicker to jump in and out of eMTB mode as you have less button presses so the overall experience is much cleaner and tailored for the specific rider.

Its quite different to how I had it configured in 0.19.0 but personally so far I prefer it, I may add one more assist level to give me a little more finer control for road riding. but i cannot now ever think why i would need anything like the number of assist levels i was running in 0.19.0 ( 9 )

:bigthumb:
 
ok, I apologize, I admit I was a little provocative :) but I wanted to understand more this emtb level.
Elem, you don't know how much I envy you for your weight of only 64kg. Every once in a while I ride with cyclists of your weight and I realize that it's something else. Their battery has an infinite duration and uphill they literally fly :) I think that with this weight any engine is perfect, even a hub bpm.
I didn't want to discourage the development of the emtb mode. What I don't understand is why the starting mode for emtb development is torque mode and not power mode.
I think that at the end of the development we will arrive at a mode very similar to power mode.
As for the engine, despite my weight I never broke a blue gear (two engines, 36v with 2500km and a 48v with 1300km) in 48v I unfortunately broke the big freewheel after only 1000km.
 
andrea_104kg said:
Sorry if I insist but I am not clear where you want to arrive with emtb. If you want a progressive level the power mode is already perfect, anyone can try it.
Just set a high multiplier and you can easily get from a few watts to the maximum. Just look at the wattmeter and you can see the value rise in a perfectly progressive way.
So I don't understand what emtb could do.
The idea of using a no linear, exponential, puzzles me also, I wish I could better understand my needs and try automate but It is not straightforward in my mind.

Just to be clear, the throttle input sensor signal varies from 0 to 100%. As we control the motor current and it can be from 0 to 18 amps (or other lower value defined on configurations by the user), we just map the 0 - 100% throttle input to 0 - 18 amps of motor current output.

The pedal human power input works just like the throttle input signal, however, the human power starts at 0 but the max value is not 100%, is instead a value that depends on the user -- like for me can be 150W when I am felling good or around 50W when I am tired and so I increase the assistance level when I am tired.

Having an exponential, can be interesting, I think because I can give the regular 150W but I can also give 500W or more on peaks, I can't sustain 300, 400 or 500W for longer and so maybe here I would like to have the exponential, having an higher a assist because I can't output linearly my human power (like if I double my power output, I feel much more tired than double), at least this is what I feel.

As for implementing this exponential, I am doing the same for the torque sensor full calibration where I am using 8 points and defining the curve on calc sheet on computer. Maybe the same code implementation could be used for the eMTB (by the way, eMTB seems a marketing keyword, the way I see this, it should apply to any ebike, city ebike, every ebike).

I think we could provide a default curve for eMTB but let user tweak it if needs, by configuring the 8 points on display, after user changes our provided sample on a calc sheet.
I think then we could implement the firmware in a way that assist levels change the point transition from linear to exponential and/or graph shift on x or y axis.
 
andrea_104kg said:
ok, I apologize, I admit I was a little provocative :) but I wanted to understand more this emtb level.
Elem, you don't know how much I envy you for your weight of only 64kg. Every once in a while I ride with cyclists of your weight and I realize that it's something else. Their battery has an infinite duration and uphill they literally fly :) I think that with this weight any engine is perfect, even a hub bpm.
I didn't want to discourage the development of the emtb mode. What I don't understand is why the starting mode for emtb development is torque mode and not power mode.
I think that at the end of the development we will arrive at a mode very similar to power mode.
As for the engine, despite my weight I never broke a blue gear (two engines, 36v with 2500km and a 48v with 1300km) in 48v I unfortunately broke the big freewheel after only 1000km.

Here is an example of why eMTB mode is perfect for me (and maybe for many others). Heavy bike, generally with heavy cargo. Power assist multiplier fails to provide high assistance at low RPM's since I (human) am unable to develop much power (to multiply by the motor) due to simple bio-mechanical limitations. Previously this was solved by having boost assist, which had bugs and TBH a bit random :)

Power assist is a poor proxy for an assist motor. The motor by definition provides the most assist when you are generating the most power. Not actually when you need it, eg accelerating or climbing.

Torque mode however is much better suited to map against human bio-mechanical limitations. That is bio-mechanically, when pushing against a rotating lever to "power" a bike, a human's power curve looks a lot like a bell curve, low power output at low RPM, peaking around 70-100 RPM.

Torque from a human however starts very high at zero RPM and ultimately decreases to zero when you are using all of your output "spinning" your legs.

The beauty of eMTB is that it manages the assist multiplier in a way to complement human power delivery. As the RPM and human power goes up the power from the motor goes down. Right now I am running exp1.3 which gives me around 1:1 power at 90 RPM, and 2.5:1 power at low RPM.

Anyway for me it is near perfect, providing substantial assist when accelerating (pushing harder on pedals = more torque), providing a lower steady state assist once I am up to speed, but also being available for emergency power on demand.

Buba - loving the responsiveness of the new code! Great job. Really hope the coming advanced calibration of the torque sensor will enable further granularity.

Cheers
 
andrea_104kg said:
Elem, you don't know how much I envy you for your weight of only 64kg. Every once in a while I ride with cyclists of your weight and I realize that it's something else. Their battery has an infinite duration and uphill they literally fly :) I think that with this weight any engine is perfect, even a hub bpm.
I have the same ~100 kgs as you and 173 cms weight as you. There will always be young, more light, fit, health with any impairment people. That is why is strategic for me to develop this ebike technology on my free time, in OpenSource way. Technology can help the others like you and me to be able doing sports, get more health and enjoy nature, in the company of that others. I keep learning also for the ELegs project, I am not alone on this vision, recently there was news about a group of scientists trying develop it specifically for sports running and walking: The exosuit is designed to aid rehabilitation for walkers and runners: https://www.runnersworld.com/uk/gear/tech/a28757836/wearable-running-robot/

I bet you don't run because your body weight. I don't but I would like to. Almost every runner is light, on the 60 kgs or less. And heavy runners probably have more injuries on knees and column due to being heavy, then they will not able to run anymore.

Until we have our ELegs, we should take the most advantage possible of our own developed EBikes.
 
andrea_104kg said:
ok, I apologize, I admit I was a little provocative :) but I wanted to understand more this emtb level.
Elem, you don't know how much I envy you for your weight of only 64kg. Every once in a while I ride with cyclists of your weight and I realize that it's something else. Their battery has an infinite duration and uphill they literally fly :) I think that with this weight any engine is perfect, even a hub bpm.
I didn't want to discourage the development of the emtb mode. What I don't understand is why the starting mode for emtb development is torque mode and not power mode.

Do not apologize for anything! It is good to have discussions! :)

Using first principles you can rather quickly see that Power Assist has a couple of traits that do not assist users in the most optimal way. Some users might prefer that experience but that is not the point.

Power Assist is actually based on how much power and effort you put into the system. So when you want to start riding and the cadence is zero it will never ever assist you. No matter how hard you push the pedals. We trick Power Assist to start assisting users because we know that assist from startup is desirable.

Also, Power Assist needed the Startup Boost feature. We needed to mask the shortcomings of that mode and write more code so it would work better and be more responsive when users needed it the most. In 0.20.0 this is solved in many ways but what I want to point out is that we have always felt that Power Assist can be very demanding and we often need to increase the multipliers to have appropriate assistance in certain situations.

Power Assist: more effort and sweat from user -> More Assistance (Needs an okay torque sensor for operation because it is helped by the cadence sensor for calculation)

Torque Assist: more torque applied from user -> More Assistance (Needs a really good torque sensor for operation because it is only based on how hard the user is pushing the pedals)

Final and the most important point: all modes are different and there is no right or wrong. We have this amazing firmware so everyone can pick and choose whatever they want.


andrea_104kg said:
I think that at the end of the development we will arrive at a mode very similar to power mode.

This will not be the case due to everything explained above. Also, eMTB Assist is built upon Torque Assist, and Torque Assist is theoretically the most natural assist mode because it measures human torque and converts it to motor torque. But everything depends on how well the torque sensor operates. Actually, if both Power and Torque Assist would have a great torque sensor we would have a great experience from both modes. It would simply be a preference of assist logic. eMTB would then be a mode where you can more easily reach maximum motor power and still maintain good bike control.
 
casainho said:
andrea_104kg said:
Sorry if I insist but I am not clear where you want to arrive with emtb. If you want a progressive level the power mode is already perfect, anyone can try it.
Just set a high multiplier and you can easily get from a few watts to the maximum. Just look at the wattmeter and you can see the value rise in a perfectly progressive way.
So I don't understand what emtb could do.
The idea of using a no linear, exponential, puzzles me also, I wish I could better understand my needs and try automate but It is not straightforward in my mind.

Just to be clear, the throttle input sensor signal varies from 0 to 100%. As we control the motor current and it can be from 0 to 18 amps (or other lower value defined on configurations by the user), we just map the 0 - 100% throttle input to 0 - 18 amps of motor current output.

The pedal human power input works just like the throttle input signal, however, the human power starts at 0 but the max value is not 100%, is instead a value that depends on the user -- like for me can be 150W when I am felling good or around 50W when I am tired and so I increase the assistance level when I am tired.

Having an exponential, can be interesting, I think because I can give the regular 150W but I can also give 500W or more on peaks, I can't sustain 300, 400 or 500W for longer and so maybe here I would like to have the exponential, having an higher a assist because I can't output linearly my human power (like if I double my power output, I feel much more tired than double), at least this is what I feel.

As for implementing this exponential, I am doing the same for the torque sensor full calibration where I am using 8 points and defining the curve on calc sheet on computer. Maybe the same code implementation could be used for the eMTB (by the way, eMTB seems a marketing keyword, the way I see this, it should apply to any ebike, city ebike, every ebike).

I think we could provide a default curve for eMTB but let user tweak it if needs, by configuring the 8 points on display, after user changes our provided sample on a calc sheet.
I think then we could implement the firmware in a way that assist levels change the point transition from linear to exponential and/or graph shift on x or y axis.

I have several times tried to explain this without trying to correct anyone but eMTB uses no exponential function. I should have been more clear so apologies from me to the community. It uses a power function. For anyone interested:

https://socratic.org/questions/how-does-an-exponential-function-differ-from-a-power-function

https://chargerisk.com/science/power-expo.php

An exponential would be a very bad idea to use. We simply just want a curve so therefore we use power functions. What we configure is how much (or how sensitive) the assistance should be. A linear function is a straight line. A power function appropriately configured is a slight curve. An exponential would be more of a switch.

When using a properly configured power function it will slightly offset the shortcomings of the torque sensor. And also improve the response so when someone wants normal power with normal pedal torque they get just that, but if they immediately need more power and want the system to respond with less force (more sensitive) they can also get that from the same mode.
 
I think is soon to test emtb as the human power mode and torque mode, as both depend on a good full calibrated torque sensor. Also we known the torque sensors are very different from motor to motor, so, even more confusing on the results of emtb.
 
casainho said:
I think is soon to test emtb as the human power mode and torque mode, as both depend on a good full calibrated torque sensor. Also we known the torque sensors are very different from motor to motor, so, even more confusing on the results of emtb.

That is totally true. A good full calibrated torque sensor would make all the difference.
 
buba said:
I have several times tried to explain this without trying to correct anyone but eMTB uses no exponential function.
I missed that.
 
buba said:
casainho said:
I think is soon to test emtb as the human power mode and torque mode, as both depend on a good full calibrated torque sensor. Also we known the torque sensors are very different from motor to motor, so, even more confusing on the results of emtb.

That is totally true. A good full calibrated torque sensor would make all the difference.
So why not start using right now the torque sensor full calibration code? Even because it could be reused for the power curve of emtb?
 
mctubster said:
andrea_104kg said:
ok, I apologize, I admit I was a little provocative :) but I wanted to understand more this emtb level.
Elem, you don't know how much I envy you for your weight of only 64kg. Every once in a while I ride with cyclists of your weight and I realize that it's something else. Their battery has an infinite duration and uphill they literally fly :) I think that with this weight any engine is perfect, even a hub bpm.
I didn't want to discourage the development of the emtb mode. What I don't understand is why the starting mode for emtb development is torque mode and not power mode.
I think that at the end of the development we will arrive at a mode very similar to power mode.
As for the engine, despite my weight I never broke a blue gear (two engines, 36v with 2500km and a 48v with 1300km) in 48v I unfortunately broke the big freewheel after only 1000km.

Here is an example of why eMTB mode is perfect for me (and maybe for many others). Heavy bike, generally with heavy cargo. Power assist multiplier fails to provide high assistance at low RPM's since I (human) am unable to develop much power (to multiply by the motor) due to simple bio-mechanical limitations. Previously this was solved by having boost assist, which had bugs and TBH a bit random :)

Power assist is a poor proxy for an assist motor. The motor by definition provides the most assist when you are generating the most power. Not actually when you need it, eg accelerating or climbing.

Torque mode however is much better suited to map against human bio-mechanical limitations. That is bio-mechanically, when pushing against a rotating lever to "power" a bike, a human's power curve looks a lot like a bell curve, low power output at low RPM, peaking around 70-100 RPM.

Torque from a human however starts very high at zero RPM and ultimately decreases to zero when you are using all of your output "spinning" your legs.

The beauty of eMTB is that it manages the assist multiplier in a way to complement human power delivery. As the RPM and human power goes up the power from the motor goes down. Right now I am running exp1.3 which gives me around 1:1 power at 90 RPM, and 2.5:1 power at low RPM.

Anyway for me it is near perfect, providing substantial assist when accelerating (pushing harder on pedals = more torque), providing a lower steady state assist once I am up to speed, but also being available for emergency power on demand.

Buba - loving the responsiveness of the new code! Great job. Really hope the coming advanced calibration of the torque sensor will enable further granularity.

Cheers

Again, you are spot on and explained everything better than I ever could! Absolutely perfect!

Only reason why the theory might not work for everyone is due to the difference in the torque sensors. Some have good, some need to calibrate. But when everything is calibrated it should be closer to theory.

And thank you for the kind feedback! Means a lot!
 
casainho said:
buba said:
I have several times tried to explain this without trying to correct anyone but eMTB uses no exponential function.
I missed that.

Should have been even more clear when I explained.



casainho said:
buba said:
casainho said:
I think is soon to test emtb as the human power mode and torque mode, as both depend on a good full calibrated torque sensor. Also we known the torque sensors are very different from motor to motor, so, even more confusing on the results of emtb.

That is totally true. A good full calibrated torque sensor would make all the difference.
So why not start using right now the torque sensor full calibration code? Even because it could be reused for the power curve of emtb?

I am away the next couple of hours but when I come back I would love to take a look at the code. I really think a good torque sensor would make a great difference. And if a calibration can help it is beneficial for all users!
 
I build the hex from the code, leon's branch with release.bat. Motor flash is ok. On LCD i get Adress XXXX is out of range and will be ignored! I am using SM8 x6 to write. Any ideas?

Also tryed to flash the *.ihx files alpha7 from the google drive. The LCD does not boot at all. I am using ST visual programer.

I installed 0.19 from hex files and managed to finally get it working with a reset to defaults.

How did you installed 0.20 ?!
 
There is something we are all forgetting in relation to how the motor feels, gearing. Many of us are using 10 speed rear mechs which are quite close ratio, others are using 7 and 8 speed which are quite wide ratio.

So for instance with the 10 speeds, if you accelerate by pressing on the pedals, you will get an almost instant acceleration from the motor but very quickly you will need to change gear to the next gear ( the motor over revs ) at which stage you can feel that you are able to put the motor back into its lower rpm /higher torque and get instant acceleration for a brief moment until you run out of revs again.

I've not yet upgraded to the v20 but I'm thinking that by using the emtb mode we will be able to run less gears with a wider ratio between, as it will compensate the human leg torque ( best at high rpm ) with the best motor torque ( low rpm ). My betting is that we will be able to use much better the new 8spd wide ratio cassettes ( 11 - 42) that are now appearing for sale. That will also help with chain alignment as we should be able to say on the standard 10spd cassette, loose say 3 gears totally.
 
A (translated) description of the emtb bosch system. It seems very clear but different from what you want to get on the tsdz2 or as usual I didn't understand ... :-(

"In the classic system, each level of assistance provides a certain power calculated as a percentage of the power delivered by the cyclist.
For example, the Tour level provides 120%; this means that if the cyclist pushes to 100W, the engine delivers another 120; if the cyclist pushes 200W, the engine delivers 240.
Or: the Turbo level supplies 300%; so if the rider pushes to 100W, the engine delivers 300W; if the cyclist pushes to 200W, the engine delivers 600W (even 250W engines can reach these powers for a short time).

With the new mode Bosch e-mtb instead the logic of operation is very different. In a simple stretch, when the cyclist pushes little, his power is multiplied to 120%. When it is pushing to the maximum, its power is multiplied to 300%. With all the gradations between one extreme and the other. It's like being able to automatically switch from the Tour level to the Turbo level, gradually. Bosch does not provide precise details on the operating algorithms, but in summary this is how it works."

However personally I am VERY satisfied already. Today I did an incredible off-road ride and I managed to climb where I thought it was impossible, soil dried up by the sun and almost reduced to sand, with a 19% gradient, exceptional!
 
in practice in an extremely simplified way:
1) normal mode
Motor power =uman_torque* multiplier
2) emtb
Motor power=uman_torque (multiplier*uman_torque)
As the pressure on the pedals increases, the power multiplier grows. Obvious extremely simplified!
 
andrea_104kg said:
in practice in an extremely simplified way:
1) normal mode
Motor power =uman_torque* multiplier
2) emtb
Motor power=uman_torque (multiplier*uman_torque)
As the pressure on the pedals increases, the power multiplier grows. Obvious extremely simplified!

What might not be so obvious is that the "power multiplier" decreases as the RPM goes up, since human torque is high at low RPM and low at high RPM. I started reading up on bio-mechanics of cycling. It is not simple. I am trying and currently failing to create a "simple" graph to describe what we are discussing now.

And of course further complicating is while we are observing the current (power) going into the motor, at low rpm and high current the motor will be very inefficient and producing a lot of heat rather than mechanical work. I think ;)
 
Obvious extremely simplified, mode 1) exists and works, it's torque mode if it were as you say (and I don't doubt it so) should not exist .... Evidently the formula is more complex, depends on whether the basic principle is exact
 
maximusdm said:
I build the hex from the code, leon's branch with release.bat. Motor flash is ok. On LCD i get Adress XXXX is out of range and will be ignored! I am using SM8 x6 to write. Any ideas?

Also tryed to flash the *.ihx files alpha7 from the google drive. The LCD does not boot at all. I am using ST visual programer.

I installed 0.19 from hex files and managed to finally get it working with a reset to defaults.

How did you installed 0.20 ?!

First try installing the Alpha 7 from my Google Drive:

https://drive.google.com/open?id=1CPGT-V1ZX7FCzfhgbrPMYfbYtY4_JH2R

Press the POWER button a little longer on the display when you want to start it up.

When you have verified that everything works then you can try to build the .ihx from my branch. Start by checking the SDCC version you have installed: sdcc -v

Install the 3.9.0 if you have an earlier version.

Let me know how it goes and if I can help in any way!
 
andrea_104kg said:
A (translated) description of the emtb bosch system. It seems very clear but different from what you want to get on the tsdz2 or as usual I didn't understand ... :-(

"In the classic system, each level of assistance provides a certain power calculated as a percentage of the power delivered by the cyclist.
For example, the Tour level provides 120%; this means that if the cyclist pushes to 100W, the engine delivers another 120; if the cyclist pushes 200W, the engine delivers 240.
Or: the Turbo level supplies 300%; so if the rider pushes to 100W, the engine delivers 300W; if the cyclist pushes to 200W, the engine delivers 600W (even 250W engines can reach these powers for a short time).

With the new mode Bosch e-mtb instead the logic of operation is very different. In a simple stretch, when the cyclist pushes little, his power is multiplied to 120%. When it is pushing to the maximum, its power is multiplied to 300%. With all the gradations between one extreme and the other. It's like being able to automatically switch from the Tour level to the Turbo level, gradually. Bosch does not provide precise details on the operating algorithms, but in summary this is how it works."

However personally I am VERY satisfied already. Today I did an incredible off-road ride and I managed to climb where I thought it was impossible, soil dried up by the sun and almost reduced to sand, with a 19% gradient, exceptional!


First of all, I am really glad you like the Power Assist! It is very nice to hear! :)

Can someone confirm that it is possible to see the actual pedal power generated on a Bosch system? I would assume they have a very complex algorithm overall and it is not as simple as Power Assist or Torque Assist.
 
mctubster said:
andrea_104kg said:
in practice in an extremely simplified way:
1) normal mode
Motor power =uman_torque* multiplier
2) emtb
Motor power=uman_torque (multiplier*uman_torque)
As the pressure on the pedals increases, the power multiplier grows. Obvious extremely simplified!

What might not be so obvious is that the "power multiplier" decreases as the RPM goes up, since human torque is high at low RPM and low at high RPM. I started reading up on bio-mechanics of cycling. It is not simple. I am trying and currently failing to create a "simple" graph to describe what we are discussing now.

And of course further complicating is while we are observing the current (power) going into the motor, at low rpm and high current the motor will be very inefficient and producing a lot of heat rather than mechanical work. I think ;)

I would love for some more input and feedback if you have any!
 
andrea_104kg said:
With the new mode Bosch e-mtb instead the logic of operation is very different. In a simple stretch, when the cyclist pushes little, his power is multiplied to 120%. When it is pushing to the maximum, its power is multiplied to 300%. With all the gradations between one extreme and the other. It's like being able to automatically switch from the Tour level to the Turbo level, gradually. Bosch does not provide precise details on the operating algorithms, but in summary this is how it works."

Potentially they are measuring torque and using that to scale the assist multiplier ... if you equate pushing to pushing the pedal harder :)

They prob have more CPU cycles too :)
 
For me Buba the greatest thing you have achieved with version 20 is to make it possible to go back to the blue gear again. The power is still there but is now delivered in a controlled manner. A couple of hundred miles of testing has given me the confidence to take the metal gear out and put the plastic gear back in and the silence is golden. :D

The gear train is the Achilles heel of the TSDZ2 and in the absence of a tougher plastic gear you have achieved a real breakthrough with version 20.
 
buba said:
First try installing the Alpha 7 from my Google Drive:

https://drive.google.com/open?id=1CPGT-V1ZX7FCzfhgbrPMYfbYtY4_JH2R

Press the POWER button a little longer on the display when you want to start it up.

When you have verified that everything works then you can try to build the .ihx from my branch. Start by checking the SDCC version you have installed: sdcc -v

Install the 3.9.0 if you have an earlier version.

Let me know how it goes and if I can help in any way!

So now in order to start I need a long press power button similar for off? For 0.18.2 short press was enough.

For the code I used this configuration since the beginning and worked fine for 0.18.2 included. Did you changed the compiler version since 0.19+? I am getting warns that there is unreachable code for both motor and lcd.

Thanks,
Max.
 
Back
Top