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

Turning on the starting option kicks the motor on for a few seconds, then it stops. Is the cadence sensor internal to the motor somewhere?

The original firmware and display worked this morning before I spliced in the 850C. Does the original firmware use the cadence sensor also, or does it just multiply the torque value?

casainho said:
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....
 
The cadence sensor is on the motor controller, it is a small piece of black plastic but it has some wires and a connector on the board. Maybe you can try to remove and connect again.

Or maybe take the v0.19.0 sources, on ebike_app.c, change the calculation of cadence:

Code:
static void read_pas_cadence(void)
{
  // cadence in RPM =  60 / (ui16_pas_timer2_ticks * PAS_NUMBER_MAGNETS * 0.000064)
  if((ui16_pas_pwm_cycles_ticks >= ((uint16_t) PAS_ABSOLUTE_MIN_CADENCE_PWM_CYCLE_TICKS)) ||
      (ui8_g_pedaling_direction != 1)) // if not rotating pedals forward
  { 
    ui8_pas_cadence_rpm = 0; 
  }
  else
  {
    ui8_pas_cadence_rpm = (uint8_t) (60 / (((float) ui16_pas_pwm_cycles_ticks) * ((float) PAS_NUMBER_MAGNETS) * 0.000064));
  }
}

To this:

Code:
static void read_pas_cadence(void)
{
  ui8_pas_cadence_rpm = 60; 
}

That will force a fixed value. Should make your system work using the torque sensor input only. But be careful, something may start up the motor, keep brakes pressed when not pedaling.
 
Rafe said:
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.

Hmm... Okay I see your point. This problem is a bit tricky. Would you be happy if I reduce the de-bounce time ever so slightly? Have your tried if it causes any major problems?

Another option is to add a configuration variable and have the user configure the debounce time.



Rafe said:
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.

I have only added more sensitivity values so that should not change your experience other than the curves are altered just a couple of percent in certain parts. If you had a previous sensitivity of 3 you should increase that to 5 for instance. You should have the same experience as before but with less hunting. Could you check this and let me know if you are satisfied?

Really did not want to release something that you felt was a downgrade, sorry about that. And I do understand your concern.
 
thineight said:
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.

Brakes will override everything! :)



thineight said:
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?

Have considered this before but thought that I made a good compromise with the current implementation. Will get back to you and the community regarding this soon!
 
spiked said:
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

Hello Neil,

No, the torque sensor either gives values in ADC units or in kilograms depending on where you are looking. If you were in the Advanced Setup and tried to calibrate the torque sensor then the value you saw was in kilograms.

So sorry for the late reply!
 
vadda said:
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:

I am very glad to hear that you are happy with the A8, Vadda! Thank YOU! :D

And if you do not mind me asking, when is eMTB usable and when is it not? I just want to understand where eMTB lacks.
 
honestly, I am not motivated to update.
I don't like the logic of emtb ... and the walk assist is fine as it was before.

buba said:
What you would want(?):
Motor power = (Pedal torque * pedal cadence * [assist multiplier]) ^ X
yes, I'd give it a chance :)
however as I said it is not a big problem for me, I find that the power mode is already very emtb :)
I still have the curiosity to see how it could be, but I can't have everything :)
 
andrea_104kg said:
honestly, I am not motivated to update.
I don't like the logic of emtb ... and the walk assist is fine as it was before.

buba said:
What you would want(?):
Motor power = (Pedal torque * pedal cadence * [assist multiplier]) ^ X
yes, I'd give it a chance :)
however as I said it is not a big problem for me, I find that the power mode is already very emtb :)
I still have the curiosity to see how it could be, but I can't have everything :)

I would LOVE if the entire community jumps in this discussion because this is very important!

What is the best default assist logic? Power Assist or Torque Assist? Because eMTB should be based on the best. Below are some differences explained between Power Assist and Torque Assist:

Power Assist

Power Assist will control the assistance depending on the measured pedal power. Pedal power is calculated from pedal torque and pedal cadence. So if the pedal cadence is high but the pedal torque is low it will still provide a lot of assistance. Below are some examples so we can better understand how Power Assist works.

Let us start with applying a lot of pedal torque but in a situation where the cadence is very low:

50 W (pedal power) = 1 RPM (pedal cadence) * 50 Nm (pedal torque)

The user is applying 50 Nm of torque and the cadence is 1 RPM. The motor will provide 50 W of assistance if the assist multiplier is 1. This means that it feels like we need to apply a lot of pedal torque to get 50 W of assistance. Let us call this "demanding" on our knees and body.

Now, look at the next scenario:

50 W (pedal power) = 50 RPM (pedal cadence) * 1 Nm (pedal torque)

We have the same pedal power as before. But look at the difference in pedal torque and pedal cadence. We only need to provide 1 Nm of torque for the same pedal power. The difference is that we need to rotate the pedals at 50 RPM. Therefore the motor power assistance will remain the same compared to the first scenario: 50 W if the assist multiplier is 1. This is less demanding but we get the same assistance.

This is usually why we had to have the Startup Boost feature. Because to get normal assistance in normal conditions we had to have something to give us more assistance during startup. Whenever we write functions, or patches, to make other functions work better it is because we are trying to approximate our function to another "mystery" function that already, naturally, has the patches built in its algorithm. Power Assist became better when the torque sensor was utilized more making Startup Boost less needed.

Here is another scenario. When the pedal RPM is 0 and we apply a lot of torque to the pedals we get no assistance! Because no matter how much torque we apply in the formula below it will always be zero. Even though we want a lot of assistance.

0 W (pedal power) = 0 RPM (pedal cadence) * 1000 Nm (pedal torque)

So the result is we get no assistance when we have zero cadence. So we need to write a patch to trick the Power Assist to assist us from startup. And another Patch to assist us more during startup and less when at speed in normal riding conditions.



Torque Assist

Now let us look at Torque Assist:

Y Nm (Motor torque) = X Nm (pedal torque)

The more torque you apply the more the motor will assist you. Almost as if the force you apply on the pedals is increased by a multiplier. You push twice as hard, you get twice as much assistance. At speed you do not push as hard because you are rotating the pedals faster and the motor will not assist as much. In those cases you also need less assistance.



The Torque Sensor

The torque sensor is by far the most important part and is the fundamental piece that enables us to have a great experience. If it is lacking it does not matter how perfect of an riding mode algorithm you have, it will not work. In those cases, Power Assist wins because it is using another sensor, the cadence sensor. Using another sensor effectively masks the lacking torque sensor. The result is that Power Assist will feel better in those cases.



Conclusion

So what is the best algorithm? I would love for anyone to come with a great explanation. I am afraid the answer is very subjective and there is no other way than introducing as many riding modes as possible so everyone can choose for themselves. But if someone has a perfect riding mode in mind that fits all users, with or without a torque calibration, I would love to read about it and implement that!

As for eMTB, I recommend to test the Alpha 8 to experience the latest changes.

- If you feel it could be better implemented by using the Power Assist logic please let me know why.

- If anyone has tried out Marcoqs version of eMTB please write a couple of lines of the differences between his eMTB and our version.

- If anyone has tried out the Bosch version, how does our eMTB compare?
 
I think that is better the power function but that takes in consideration the speed.
Example 60rpm*1nm-(5kmh) 55w
60rpm*1nm-(40kmh) 20w you can let the users to choose the exponential of the speed positive or negative
Example 60rpm*1nm- (5kmh)^-1
60rpm*1nm-(5kmh)^2
This can change the orientation of the curve, positive or negative.
Then for low level rpm assist you can use this formula
rpm*nm+nm - speed^x
 
e3s said:
I think that is better the power function but that takes in consideration the speed.
Example 60rpm*1nm-(5kmh) 55w
60rpm*1nm-(40kmh) 20w you can let the users to choose the exponential of the speed positive or negative
Example 60rpm*1nm- (5kmh)^-1
60rpm*1nm-(5kmh)^2
This can change the orientation of the curve, positive or negative.
Then for low level rpm assist you can use this formula
rpm*nm+nm - speed^x

Good suggestion! But you are suggesting Power Assist with power functions with an exponent. Using a exponent requires very much computation and space. And the function is actually Power and Torque Assist merged into one, similar to the previous Power Assist and Startup Boost. Maybe the best thing is to merge Power Assist and Torque Assist into one and pick whatever riding mode gives most amount of assistance at any give moment?

This -> rpm*nm+nm - speed^X is Torque Assist but we can not change the X. X depends on the speed, gear and other hardware parameters.

EDIT: Actually, rpm*nm+nm - speed^X is not really Torque Assist if we limit the parts of the functions somewhat. We need to investigate it further to be sure. It might be a special Power Assist with a cadence adjustment factor. I have no idea how this feels but who knows, this is maybe the perfect riding mode! :wink:
 
Bosch eMTB is a mixe of 2 mode in fact .
standard assist are : eco/tour/speed/boost
when they introduced eMTB they said : eMTB replace speed and it use tour and speed variables, but you need a bit more torque in eMTB ( about 10% more torque ) for the same rpm to get power .
what mean : eco is 55% assist, tour 120%, speed 200%, boost 300% .
eMTB as a range extender of use but torque facor is more importante than in other mode .

sometimes ( very rare ) it s easier to use tour mode than eMTB mode .

the facts : some ppl ( about 10% in french forum ) choiced to go back to previous sytem and remove eMTB mode replacing it by the "old" speed mode .

marcoq eMTB defaut value is near a pure torque mode with a factor ( 1.3 defaut )
when i tested it i found it was very hard to get power from this mode, soo i began changing some value to make it usefull for my own use .
in half of my ride when i was in eMTB mode it was often more easy for me to switch to precedent mode than stay in eMTB witch needed to many torque to use it .

in marcoq eMTb mode it's same logic than in bosch logic : TSDZ2 are eco/speed/tour/turbo and eMTB replace speed, soo when you need easily run in eMTB mode you go tu turbo ( witch i thinck it s a good logic, but what actually used in EMTB tsdz2'mode is also usefull, exepted you must remenber to lower pedaling when you are in eMTB to go back to other assist because going back from eMTB you will get more power ... etc )

Soo marcoq'eMTB mode is close to a pure torque mode, with default values, changing some parameters make it softly more usefull, depend users ...
 
elem said:
Bosch eMTB is a mixe of 2 mode in fact .
standard assist are : eco/tour/speed/boost
when they introduced eMTB they said : eMTB replace speed and it use tour and speed variables, but you need a bit more torque in eMTB ( about 10% more torque ) for the same rpm to get power .
what mean : eco is 55% assist, tour 120%, speed 200%, boost 300% .
eMTB as a range extender of use but torque facor is more importante than in other mode .

sometimes ( very rare ) it s easier to use tour mode than eMTB mode .

the facts : some ppl ( about 10% in french forum ) choiced to go back to previous sytem and remove eMTB mode replacing it by the "old" speed mode .

marcoq eMTB defaut value is near a pure torque mode with a factor ( 1.3 defaut )
when i tested it i found it was very hard to get power from this mode, soo i began changing some value to make it usefull for my own use .
in half of my ride when i was in eMTB mode it was often more easy for me to switch to precedent mode than stay in eMTB witch needed to many torque to use it .

in marcoq eMTb mode it's same logic than in bosch logic : TSDZ2 are eco/speed/tour/turbo and eMTB replace speed, soo when you need easily run in eMTB mode you go tu turbo ( witch i thinck it s a good logic, but what actually used in EMTB tsdz2'mode is also usefull, exepted you must remenber to lower pedaling when you are in eMTB to go back to other assist because going back from eMTB you will get more power ... etc )

Soo marcoq'eMTB mode is close to a pure torque mode, with default values, changing some parameters make it softly more usefull, depend users ...

Thank you for your detailed reply! :) Very interesting!

Does anyone have Marcoqs eMTB code and does it work better than our implementation? Our eMTB is also pure torque and it does not use the cadence whatsoever.
 
as i m testing my son'bike ( FS900 bosh epowered ) this week i will move back to v 0.20 later ( may be monday or later ) to test it .

i will go back to give you feeling about eMTB from 0.20 and eMTB ( modified with my settings ) marcoq one .
 
elem said:
as i m testing my son'bike ( FS900 bosh epowered ) this week i will move back to v 0.20 later ( may be monday or later ) to test it .

i will go back to give you feeling about eMTB from 0.20 and eMTB ( modified with my settings ) marcoq one .

Thank you! That would be great! :bigthumb:
 
Rafe said:
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.

I am making an alpha where you can set the button bounce time. In your case your would want it to be 0 so it deactivates immediately. I hope that is okay with you.



Rafe said:
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.

I want that smile back so please test eMTB and let me know if you are happy with it after changing the sensitivity so it fits your old sensitivity value. I will await your feedback.


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


I have set more values and tried to improve the eMTB response so all users can find a perfect value. If anyone feels the old eMTB is better in any way please let me know. But before doing so. Configure and find your new sensitivity value as it is not transferable from the Alpha versions before Alpha 8.

If you previously had 2 in sensitivity try using 3 - 6 in Alpha 8
If you previously had 4 in sensitivity try using 8 - 10 in Alpha 8
If you previously had 6 in sensitivity try using 10 - 12 in Alpha 8
 
there is 2 problms with marcoq'code
1 ; there is no wiki
2 ; you need to flash controleur each time you want to improve a set up

anyway it exist for those don't want to change anything in the systeme exepted the firmware,
soo we need more feedback from marcoq'users to get informations .

But this thread is for OSF firstly, soo the marcoq'thread ( thancks andrea to create it ) : https://endless-sphere.com/forums/viewtopic.php?t=98281
 
Yes, my idea was a start-up boost. Then the formula for power level. But if you say that the start-up boost is ok there's no need for the last formula. For me is the best the power assist for some reasons.
When you go out of the saddle means that you want to train the legs. This is made with high gear and low rpm.
So the addition of the speed takes too much space?
 
start up boost is usefull but dangerous for the nylon gear and in some case for the axle'motor !?

i never used it .
 
e3s said:
Yes, my idea was a start-up boost. Then the formula for power level. But if you say that the start-up boost is ok there's no need for the last formula. For me is the best the power assist for some reasons.
When you go out of the saddle means that you want to train the legs. This is made with high gear and low rpm.

What I tried to explain was that a riding mode should be responsive enough that you do not need patches such as Startup Boost. If you need patches then your riding mode or hardware is lacking basically. Some have stated that Torque Assist is a workout mode because if you have low multipliers you need to push the pedals to actually get help. In Power Assist, over a certain RPM, you only need to rotate the pedals with slight force to get assistance.

High gear and low RPM is what Torque Assist is good at. Power Assist with a high gear and low RPM is Torque Assist. The lower the RPM the closer Power Assist gets to be the same as Torque Assist.

Here is the difference when working out using high or low cadence. Seems that both Power and Torque Assist have their benefits:

https://www.outsideonline.com/1768471/there-fitness-difference-between-high-cadence-and-low-one

So the real question is really what eMTB should be based on. Seeing it is mainly created for mountains where maybe torque is most important I would assume Torque Assist is the way to go. Would love to hear your and others opinion!



e3s said:
So the addition of the speed takes too much space?

The addition of an adjustable exponent (X) takes much program space and computational time: A^X where X is not an integer. If we have a simple Speed adjustment factor it is converted to K*RPM (Speed = K*RPM) and that is doable. That would be the same as using Torque Assist in low speeds/RPM and then converting to Power Assist in high speeds/RPM.
 
Ok... For me the best option is power assist because the torque assist is already in the other levels.
Maybe the level can be changed at a certain rpm. Example my ideal rpm is 60. I go to 90 and the level changes automatically.
About the speed in the formula is only an idea to insert this variable.. Then if it's an exponential or a multiplication factor it's the same result.
Nice idea to consider the speed also in the torque assist formula!
 
buba said:
In Power Assist, over a certain RPM, you only need to rotate the pedals with slight force to get assistance.
But the human power assist mode is pedal torque * pedal cadence, so if your pedaling very fast at 1NM x 100 RPM or slow at 10NM x 10 RPM, you are providing the same energy of 100 Watts and get the same workout!! Because we use gears and we are always changing them often on mtb, the best way for us to keep our pace of heart rate / workout with the different gears, is to use human power mode and not the torque mode. In torque mode we would change our heart rate / workout pace every different gear.

Also, what is the motivation of adding as input the wheel speed to the emtb mode?
 
Because in the climb you have more assist and in the flat less to have an higher average speed. In a climb of 10% you can't use the same power that you use in a flat street with different gears but with the same human power
 
casainho said:
the best way for us to keep our pace of heart rate / workout with the different gears, is to use human power mode and not the torque mode.

Yes, right. About the speed in the formula consider that everyone has different gear ratio in each bike. Example a road bike has high gear ratio, mtb bike less. In the climb a road bike has less rpm and higher nm. It's more difficult with a road bike. At low speed there's need of more assist
 
I think there is some confusion. startup is a problem while emtb is another. emtb must serve to increase more than proportionally the power with a greater pressure of the pedals as if one were changing level but with the assumption of being already in motion. It is true that in mtb it happens to start again uphill but usually you have very broken down ratios and if you don't manage to turn the pedal it means that the climb is so hard that you need the walk assist. moreover it is not even convenient to force the tsdz2 to a very strong assistance at the start. I think the startup problem is more like a city bike in traffic.
 
Back
Top