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

casainho said:
So master is now updated.

Thank you! :thumb:

casainho said:
I have a question to you, since you are experienced with the torque sensors, etc.
...

I don't know, if I understand your questions in the right way.

First you have to be careful with the physical quantities.

energy = work = force * distance. The physical unit is (N*m) = (J). As you see from the units, a torque is already an energy.

power = energy / timeinterval. The physical unit is (N*m/s) = (J/s) = (W).

For our electric motor:

electrical power = U_batt*I_batt = mechanical power + losses (heat :shock: )

mechanical power = 2*PI*torque_motor*erps/(no. of polepairs)

torque_motor = km * I_motor (1), where km is a motor constant, see e.g. here.

We define for the motor power:

P_mech_motor = Assistlevel*P_human

2*PI*torque_motor*erps/(no. of polepairs) = Assistlevel*2*Pi*torque_human*cadence

with (1) you get:

2*PI*km * I_motor*erps/(no. of polepairs) = Assistlevel*2*Pi*torque_human*cadence

I think this is the relation you were looking for?!

Some more math:

For the TSDZ2 the gear ratio cadence/erps is always constant. Other way round, you can write

cadence = constant_ratio*erps. (2)

with (2) follows:
2*PI*I_motor*km*erps/(no. of polepairs) = Assistlevel*2*PI*torque_human*constant_ratio*erps

If you bundle all constants in one:
I_motor*erps = constant * Assistlevel*torque_human*erps

as you see, erps can be cancelled out of the equation:

I_motor = constant * Assistlevel * torque_human

I hope this helps ?! :D

regards
stancecoke
 
Rydon said:
izeman said:
What setup do you guys recommend for UPDATING both, the display and the controller?
Following the WIKI, it's recommended to cut off the connector of the 850C, and hardwire it to an extension wire that fits to the TSDZ2's original plug hardness? So you need an extension wire and cut that to the correct length, so one end is soldered to the display and the other end (female connector) fit's to the TSDZ2's male connector.
And then you need a second extension wire cut in two pieces. One piece to update the display (eg via bootloader mode) and the other one to update the controller (via STLink).
So far correct? Or is there a better way?

Best to use the green higo female connector on the 850C as is. It is the same connector on the SW102. If you have an 8 pin male higo connector on your controller, you can get a harness that adapts the TSDZ2 8 pin male to either of those displays from Electrify Bike Co. It essentially adapts the TSDZ2 to Bafang style displays, throttles and brake cutoffs.
Thanks, but unfortunately I have the no-brakes 6-pin version of the motor. So I have to find a solution for that. There are two possibilities as i see it:

I got the XH18 display with my motor, which of course has the correct 6 pin connector for the motor controller. I can connect this to the motor, cut off the display and cut off the connector of the 850C and solder them together. But then I can update it anymore with the recommended TSDZ2 extension wire, as I did right know.

So I need to use the 850C connector as is, connect the extension wire to it, and wire that to the controller wire with the cut off XH18 wire?!?

Any other and better ideas?
 
I installed 850C_v0.6.2 and v0.51.0. Torque sensor calibration didn't work for me. My ADC values are very low compared casainhos values. My 0 kg ADC value is 146 and casainho has 292, my 78 kg (my weight) ADC value is 281, casainho has on 54 kg 378 ADC. Perhaps it requires a torque sensor adusting. However, even without the torque sensor calibration, the program works just fine. I'm going to do the torque sensor adjusting on next engine maintenance and try again torque sensor calibration after that.

I think (not very sure) battery goes down faster. I have driven only two rides and weather was very windy.

Many thanks for developing :bigthumb:
 
I installed versions 850C_v0.6.2 and v0.51.0, I did a little test without calibrating the torque sensor, very nice the little power trickle with assistance level 1, very flexible at all levels.
I then calibrated the torque sensor which looks fairly linear. The values are very different from those of Casainho, 140 to 0 kg, 265 to 65 kg.
I measured the weights with a scale inserted between my foot and the pedal, variations of + - 10 or 15 ADC on several measures, the 0 kg varies from 137 to 140.
on the other hand
The walking assistant does not cut, forced to use the cut by the brake.
If I back up with the bike, the engine starts, the pedals turn when I back up and also with the walking aid, this can be the cause?
The same impression as Dameri that the battery discharges quickly, not yet sure at only 10 kms of test.



Thanks for all this works.
 
casainho said:
I am still learning and testing. I hope others can share results so we all can learn.

Ok, couple of users here reported their values after the calibration.. and after some km.
http://www.jobike.it/forum/topic.asp?TOPIC_ID=76426&whichpage=58
It's noticeable a trend for the minimum to increase over time.
One user is trying also with loctite to hold the sensor after the calibration.
Making the calibration stable looks an important goal to achieve now.
 
thineight said:
casainho said:
I am still learning and testing. I hope others can share results so we all can learn.

Ok, couple of users here reported their values after the calibration.. and after some km.
http://www.jobike.it/forum/topic.asp?TOPIC_ID=76426&whichpage=58
It's noticeable a trend for the minimum to increase over time.
One user is trying also with loctite to hold the sensor after the calibration.
Making the calibration stable looks an important goal to achieve now.
I mean share the calibration graph and the experience with the full calibration linearization.
 
casainho said:
I mean share the calibration graph and the experience with the full calibration linearization.

Ah, no one there is using the 850c display yet, so no experience with the linearization.
Some are using the original displays (marcoq) and some others the lcd3.
But the problem of the drift is physical and affects all the releases.. after the hardware calibration the minimum increases over time.
V.19 and v.20 users will lose some range of the "good linear part" of the sensor curve , whereas your linearization will lose accuracy over time because the chart populated with initial ADC_value Vs force will change.
Maybe the rest values become stationary after a while, therefore the calibration can be repeated at a later stage and maintain stability... That's why my original question to you.
 
xlxc34 said:
Hi,

I have a very tempermental TSDZ2 which sometimes seems to turn on and run no problem, and other times I get no response unless I REALLY crank down on the pedals, in which case I might get a few 10s of Watts. I thought this might be a dodgy torque sensor, so I bought a new one and it seems to work just fine (checking the raw values on the 9 -> 2 menu it responds really well to changes in torque and has a baseline value of 35). However, I still have this problem where one in maybe every 2 or 3 times I use the bike I get no response, and turning it on and off again doesn't help. Any help with this will be VERY, VERY much appreciated as I am growing tired of starting off my 13 mile ride home with a bike that's 10kg heavier and has a load more resistance on a random basis!

Thanks!

I suspect you are sometimes resting your feet on the pedals while turning on the motor. This stops the torque sensor from calibrating correctly and will give less assistance.
 
thineight said:
Maybe the rest values become stationary after a while, therefore the calibration can be repeated at a later stage and maintain stability... That's why my original question to you.
I see. My values are stable, at least since I did developed this code.

Well, at least all values should change a little over time so the previous ones can be quick adjusted on the display.
 
mctubster said:
I suspect you are sometimes resting your feet on the pedals while turning on the motor. This stops the torque sensor from calibrating correctly and will give less assistance.
Latest firmware warns user to keep pedals free until the calibration finish, that is one of the reasons to use the latest version.
 
For those running Power Assist Mode on v0.20, do you feel it favours cadence over torque input? I don't get much assist when more pedal effort is required, such as climbing a hill with dropping cadence or maintaining a high speed. On flat ground up to a certain effort it seems fine.
 
dameri said:
I installed 850C_v0.6.2 and v0.51.0. Torque sensor calibration didn't work for me. My ADC values are very low compared casainhos values. My 0 kg ADC value is 146 and casainho has 292, my 78 kg (my weight) ADC value is 281, casainho has on 54 kg 378 ADC. Perhaps it requires a torque sensor adusting. However, even without the torque sensor calibration, the program works just fine. I'm going to do the torque sensor adjusting on next engine maintenance and try again torque sensor calibration after that.

I think (not very sure) battery goes down faster. I have driven only two rides and weather was very windy.
Please follow the calibration wiki page, there is not problem at all with different values of torque sensor compared to mine -- the issue is that!! all of them output different values.

You just need to have different weights like 5, 10, 15, 20 kgs + using your own weight and then, put the values on the display.

About the battery, I didn´t changed anything about it and I was carefully measuring the timings after this change.
 
Hello,

I need some ideas from people who installed/worked on the torque sensor. SO far I got the service manual from casainho and I have some clues.
I will try to create a tutorial after I have a way of putting it back.

How did you removed the torque sensor from the frame? I mean the actual torque sensor that is pressed inside the frame. What are the options other that bashing it with a big hammer?

Also how did you press it in while not loosing the small springs?

Thanks!
 
stancecoke said:
I don't know, if I understand your questions in the right way.

First you have to be careful with the physical quantities.

energy = work = force * distance. The physical unit is (N*m) = (J). As you see from the units, a torque is already an energy.

power = energy / timeinterval. The physical unit is (N*m/s) = (J/s) = (W).

For our electric motor:

electrical power = U_batt*I_batt = mechanical power + losses (heat :shock: )

mechanical power = 2*PI*torque_motor*erps/(no. of polepairs)

torque_motor = km * I_motor (1), where km is a motor constant, see e.g. here.

We define for the motor power:

P_mech_motor = Assistlevel*P_human

2*PI*torque_motor*erps/(no. of polepairs) = Assistlevel*2*Pi*torque_human*cadence

with (1) you get:

2*PI*km * I_motor*erps/(no. of polepairs) = Assistlevel*2*Pi*torque_human*cadence

I think this is the relation you were looking for?!

Some more math:

For the TSDZ2 the gear ratio cadence/erps is always constant. Other way round, you can write

cadence = constant_ratio*erps. (2)

with (2) follows:
2*PI*I_motor*km*erps/(no. of polepairs) = Assistlevel*2*PI*torque_human*constant_ratio*erps

If you bundle all constants in one:
I_motor*erps = constant * Assistlevel*torque_human*erps

as you see, erps can be cancelled out of the equation:

I_motor = constant * Assistlevel * torque_human

I hope this helps ?! :D

regards
stancecoke
Seems you did understand :)

On current code, we are controlling this: electrical power = U_batt*I_batt.

The idea is that P_human = electrical power, so, we control the I_batt. Important to say that I_motor is also controlled to stay always at 30 amps.

When in the end you have: I_motor = constant * Assistlevel * torque_human

I am looking to control in other way, I do not want to control I_motor because as you explain very well with the math, when the cadence/erps increase, the I_motor decreases as also our torque_human.

What I am looking to do is to capture the our human Power (and not energy as I did say before, thanks for clarification) because it increases when the cadence increases, unlike our human torque.

On the motor side, the issue is the same, I want to be able to maintain or increase the motor torque when the cadence increases but as you explained, the motor torque/I_motor decreases with the cadence/erps.

Maybe we need to control 2 variables at the same time??

I_battery = I_motor * Duty_cycle
 
casainho said:
I want to be able to maintain or increase the motor torque when the cadence increases

OK, with this the "Assistlevel" in the formula P_mech_motor = Assistlevel*P_human will no longer be a constant. The ratio P_motor/P_human will be a function of the cadence.

Of course you can program it this way.

I_motor = constant * Assistlevel * torque_human * (1+ cadence/constant_divider)

Example: if you set the Assistlevel (chosen assist level in the display) to 100% of human power and the constant_devider to 90, you will get 200% assistance at the cadence of 90.

Bosch defines the motor power as a function of speed and the user can build his own personal assistance characteristic.

bosch_fahrmodi.png


https://www.pedelec-biker.de/2015/09/bosch-nyon-individuelle-fahrmodi.html

regards
stancecoke
 
casainho said:
dameri said:
I installed 850C_v0.6.2 and v0.51.0. Torque sensor calibration didn't work for me. My ADC values are very low compared casainhos values. My 0 kg ADC value is 146 and casainho has 292, my 78 kg (my weight) ADC value is 281, casainho has on 54 kg 378 ADC. Perhaps it requires a torque sensor adusting. However, even without the torque sensor calibration, the program works just fine. I'm going to do the torque sensor adjusting on next engine maintenance and try again torque sensor calibration after that.

I think (not very sure) battery goes down faster. I have driven only two rides and weather was very windy.
Please follow the calibration wiki page, there is not problem at all with different values of torque sensor compared to mine -- the issue is that!! all of them output different values.

You just need to have different weights like 5, 10, 15, 20 kgs + using your own weight and then, put the values on the display.

About the battery, I didn´t changed anything about it and I was carefully measuring the timings after this change.

So, I don't know what I've doing wrong. Assist was very poor with torgue sensor enabled. I just followed wiki instructions. I'll try again at weekend.
Here is my values, 25 kg and 46 kg are estimate, others real weights.
 
So, I think you need to focus on the values around the knee of the graph, maybe trying to measure 5 values near around, because that zone will have a big impact on the values calculated. Also I think is important for you try to imagine a soft round curve passing on/near all the points and so you can estimate some of that values.

As we can see, your torque sensor is like mine, good sensitivity only from 0 up to 20 kgs.

dameri said:
So, I don't know what I've doing wrong. Assist was very poor with torgue sensor enabled. I just followed wiki instructions. I'll try again at weekend.
Here is my values, 25 kg and 46 kg are estimate, others real weights.
file.php
 
stancecoke said:
casainho said:
I want to be able to maintain or increase the motor torque when the cadence increases

OK, with this the "Assistlevel" in the formula P_mech_motor = Assistlevel*P_human will be no longer a constant. The ratio P_motor/P_human will be a function of the cadence.

Of course you can program it this way.

I_motor = constant * Assistlevel * torque_human * (1+ cadence/constant_divider)

Example: if you set the Assistlevel (chosen assist level in the display) to 100% of human power and the constant_devider to 90, you will get 200% assistance at the cadence of 90.

Bosch defines the motor power as a function of speed and the user can build his own personal assistance characteristic.
Hmmm, I think I will stick to something more simple for now.

I think I would like to try have as input the pedal human power and control the I_motor, keeping I_battery free to go up to the max current possible of 16 amps.

And I understand that the power relation as you say "The ratio P_motor/P_human will be a function of the cadence", cadence/erps.
I wounder what will be the felling, if it will be easy to understand when we should shift the gears to avoid wasting of power, etc.

All of this because I tried control of I_motor instead of I_battery and I liked the result, but I would like to better understand all of this.
 
casainho said:
So, I think you need to focus on the values around the knee of the graph, maybe trying to measure 5 values near around, because that zone will have a big impact on the values calculated. Also I think is important for you try to imagine a soft round curve passing on/near all the points and so you can estimate some of that values.

As we can see, your torque sensor is like mine, good sensitivity only from 0 up to 20 kgs.

dameri said:
So, I don't know what I've doing wrong. Assist was very poor with torgue sensor enabled. I just followed wiki instructions. I'll try again at weekend.
Here is my values, 25 kg and 46 kg are estimate, others real weights.
file.php

Ok, thanks. I do changes at weekend.
 
casainho said:
but I would like to better understand all of this.

perhaps the grin simulator helps you to understand the physical background:
https://www.ebikes.ca/tools/simulator.html

GTEBikeSimSampleEval.png


regards
stancecoke
 
Haven't read any post from Buba in a while... Are you mate still there?
 
diagonti said:
casainho said:
For testing, I think you can disconnect the wire that power up the motor controller from the display, then, connect directly that wire to the battery voltage. That way the system will work but you will need to cut off the battery power to turn off the system.

Good thought - I disconnected the orange (LCD) and red (motor) leads from each other, and joined the red (motor) end to the brown (LCD)/blue (motor) cable join. I left the now free orange (LCD) lead disconnected.

I still need to hold the power button down (so it does not progress to the next screen - at least I now know this is by design) but the negotiation of firmware versions happens much quicker (presumably because the motor controller is already running and waiting for a signal).

The motor however gives a small kick - this did not happen before. Is the bootup sequence reaching a slightly further state?

FWIW, I have also tested continuity between the cable joints and the 8-pin HIGO-B8 socket, so I am confident the joins are good and that the cable insulation color scheme is as expected.

Thanks again for your help!

Just a quick update - I replaced the display and it appears to be working fine. Now I need to go hook up the brake and speed sensors.

Are the magnetic brake sensors for hydraulic brakes just one big closed circuit that opens when a lever is pulled (wired in series)? Or are they an open circuit that is closed by either lever (wired in parallel)?
 
diagonti said:
Are the magnetic brake sensors for hydraulic brakes just one big closed circuit that opens when a lever is pulled (wired in series)? Or are they an open circuit that is closed by either lever (wired in parallel)?

Brake sensors circuit is open by default (no brake sensors or no lever pressed). It closes if ONE lever is pressed.
See the schematic on the wiki where you can see also the splitter for brake sensors.
 
Hey guys been a while but just wanted to Share some findings regarding peddle cadence using the 36v motor with 10s and 14s battery in 36v and 36v experimental mode.
[youtube]-6dML9fmnhk[/youtube]
 
jbalat said:
Hey guys been a while but just wanted to Share some findings regarding peddle cadence using the 36v motor with 10s and 14s battery in 36v and 36v experimental mode.[/youtube]

Very interesting, thanks. What were your settings for maximum battery current and motor power limit? I'd be interested to know if the torque is reduced in high cadence mode and if so, is it across the whole range or only when you go above what would be considered normal maximum cadence.
 
Back
Top