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

cavi said:
2: trip distance. It would be nice if it did not reset when you turned off the power. As sometimes you have to reboot mid ride....

I second that strongly... :p Trip Time same...
 
Hi, I do not want to offend the writer of the wiki/configurations menu, but i must admit: i have comprehension problems due to laxk of knowledge most probably.

I would like to calibrate the torque sensor. I think i understand what i need to do, however i need to understand the following three entries in the technical configurations:
Entries beginning
Pedal side x Current side of the pedal the firmware considers. This value depends on correct calibration at startup of the system: the pedals need to be vertical pointing to ground. You can select on Configurations to be left or right pedal to point to ground at startup, based on your preferences. This is needed to the system can know in which pedal are you doing the force with your legs, since the weight is measured differently on each pedal due to the torque sensor.
Weight with offset x Weight on the pedals and this value can have an offset representing a no zero value at startup when there are zero weight on pedals.
Weight without offset x Same as previous but with offset removed.
Entries end.

pedal side: does it mean i have to select the pedal that i will step on at startup, meaning: if i want to use the right pedal first, i have to select "left" and the left pedal has to face downwards when i switch on the display? that is how i understand this. is this correct?

weight with offset:
what is this at all? can someone pls. give me an example how and when this occurs ? i have absolutely no clue what this refers to...
Weight without offset accordingly...no clue

Sorry...
 
Pedal side is which pedal is down toward the ground when turning the bike on.

Weight with offset is the torque sensor converting its reading to a weight in kg after calibration. It helps to check if you did it right: does the 5kg object register as 5kg on the display after calibration or is it off? Note that it’s not a precision scale so within a kilo or two is still good.

Weight without offset is the same but without using the calibrated values.
 
skestans said:
Pedal side is which pedal is down toward the ground when turning the bike on.

Weight with offset is the torque sensor converting its reading to a weight in kg after calibration. It helps to check if you did it right: does the 5kg object register as 5kg on the display after calibration or is it off? Note that it’s not a precision scale so within a kilo or two is still good.

Weight without offset is the same but without using the calibrated values.

Thanks very much, I may have an idea now... :roll: :wink:
 
cavi said:
1: throttle, it seems that the throttle is tied to the assist level, or it feels that way, it does not seem to give me full power. Maybe I have it set wrong?

I agree with this 100% The throttle should offer full power regardless of assist mode. a couple users have been discussing this lately but we are in the minority and casainho does not normally use the throttle.

I would be happy to try and fix this and do a pull request, but I just ask for a little high level theory of how the throttle works in the code.

casainho, if you read, this, can you take a look at the problem or maybe leave a note here about how the throttle is intended to work in the code?
 
cavi said:
One other software issue that bugs me is that the trip meter resets every time you kill the power. Many times on a ride I will stop and turn off the bike and then when I restart the trip meter has reset....... Could we possibly change this for next firmware, then maybe like the BBSHD press both up and down at once and it would reset?

I'm currently working on it !

What is already done : 2 trip memories ("A" and "B") with :
  • time
  • distance
  • average speed
  • max speed

Trip A and B are independant. Datas are saved/load in EEPROM.
It's working fine for me, I have to test it again to be sure.

I now have to implement the reset feature : manually and automaticaly (for 850/860C as SW102 has no RTC).

As soon as all will be done, I'll made a pull request.

My source code is available here ("WIP-trips-memories" branch) : https://github.com/Kenny-54/Color_LCD/tree/WIP-trips-memories
But I did not provide on Github the compiled firmware so if you want to test it you'll have to compile it yourself, or MP me.
 
Hi, I think I have killed my 860C by making a mistake with my wiring.

It had previously successfully flashed to 1.0 Beta (splash screen confirmed)

I made my own harness to connect 860C to TSDZ2, read much info, wiki etc. and checked carefully to get it right. Could not get a sucsessful flash with STLink v2 following wiki instructions.
Tried Aliexpress 1t4 cable, no luck.
Discovered 1T4 cable wiring is different, hacked the harness to pieces, tried again, Sucsessfully flashed TSDZ2 (according to software) with 1.0 beta.

Display won't come on at all, Tried hot wiring brakes and throttle to read on and off in different combo's as I saw an old post from Casainho that the brake's can stop it booting.

Is there =ny way I can confirm the display is dead?

Could it still be alive due to the fact I flashed the TSDZ2 successfully with it connected in it's current state?

If I have to replace it will I regret getting a SW102 to save a few $$?
 
gatorsean said:
I would be happy to try and fix this and do a pull request, but I just ask for a little high level theory of how the throttle works in the code.

casainho, if you read, this, can you take a look at the problem or maybe leave a note here about how the throttle is intended to work in the code?
Looking at the code, I can´t understand why throttle does work as you guys are saying.

Please look at the code, mainly on:

Code:
  // throttle
  apply_throttle(&ui16_m_adc_target_current, ui8_assist_enable);

And put the questions here that you may have when trying to understand the code.
 
safeaschuck said:
It had previously successfully flashed to 1.0 Beta (splash screen confirmed)
The display always show that first screen independent of the TSDZ2 communication. If your display is ok and with corrected flashed firmware, it will show that screen for sure.
 
Benoit said:
As soon as all will be done, I'll made a pull request.
I am waiting for it!! When you do it, I will test and make a new version.

And about the FOC x2, I tested it and it does not work. I see on the display the angle, after a certain amount like 15, to jump to values like 60 and the motor stops to work as expected. I was luck to not burn anything, the current controller seems to work well and protect on this case.
 
casainho said:
Benoit said:
As soon as all will be done, I'll made a pull request.
I am waiting for it!! When you do it, I will test and make a new version.

Yesterday I added the manual reset feature. But I made it very simple, within the configuration screen.
I have to see to do that from the main screen.
And autoreset is not yet working. I hope it will be done this week.
 
casainho said:
vshitikov said:
We should probably upload this troubleshooting in wiki so it may help other people. And also tell people not to set the battery cutoff voltage to low.
Maybe a specific page with explanation of the sysptoms, why that happens and the solution. That page could be linked both from configurations battery cut off voltage and FAQ.

Hi Casainho,
Just updated Wiki with the troubleshooting information when controller firmware gets corrupted and how to restore it using option bytes. I could not upload pictures right away in the wiki, it requires push access to the directory. But the pictures are not necessary anyways.
 
vshitikov said:
casainho said:
vshitikov said:
We should probably upload this troubleshooting in wiki so it may help other people. And also tell people not to set the battery cutoff voltage to low.
Maybe a specific page with explanation of the sysptoms, why that happens and the solution. That page could be linked both from configurations battery cut off voltage and FAQ.

Hi Casainho,
Just updated Wiki with the troubleshooting information when controller firmware gets corrupted and how to restore it using option bytes. I could not upload pictures right away in the wiki, it requires push access to the directory. But the pictures are not necessary anyways.
Please prepare the option bytes HEX file and full notes, as you made it with external dependencies: "First find the option bytes from the ECO cycles website" -- is possible that external website change the link or simple disappears and we should try avoid this dependency.

1. can you please save that HEX file for the option bytes?
2. write the instructions? - maybe you can create a specific wiki page with the instructions and then link it on the FAQ page. I can give you write access or if is more simple to you, just send me by PM.
 
cavi said:
For the best hill start performance I would setup as the following:

Motor current control = torque
Assist w/o pedal = enable
Startup BOOST = disable
Startup BOOST duration = 5
Startup BOOST fade = 6.5
Motor current ramp = 10a (maximum)
Calibrate your torque sensor then enable calibrations
Motor current max = 20a

I used these settings and it solved the lack of the boost function. The assist w/o pedal rotation enable helps to deliver the power quicker.
I prefer to use the control power instead of torque. I am using high cadence and low gears.
 
Nfer said:
I prefer to use the control power instead of torque. I am using high cadence and low gears.
So I am not alone, in the preference to control motor current - power mode and using high cadence and low gears. The field weaking is really great for the ones that prefer high cadence!!
 
Nfer said:
cavi said:
For the best hill start performance I would setup as the following:

Motor current control = torque
Assist w/o pedal = enable
Startup BOOST = disable
Startup BOOST duration = 5
Startup BOOST fade = 6.5
Motor current ramp = 10a (maximum)
Calibrate your torque sensor then enable calibrations
Motor current max = 20a

I used these settings and it solved the lack of the boost function. The assist w/o pedal rotation enable helps to deliver the power quicker.
I prefer to use the control power instead of torque. I am using high cadence and low gears.

Motor control / Motor ctrl torque If set to "torque", the motor current (torque) will be equal to: measured pedal torque * assist level factor. If set to "power", the motor current will be equal to: measured pedal power * assist level factor (the measured pedal power is equal to: pedal torque * pedal cadence).

I don't have this setting available?
I have V1.0.0, Is there a newer version of 1.0.0 were you can change motor current control to or from the torque control or power control?
 
jeff.page.rides said:
Where in the settings with version 1.0.0 do you change motor current control to or from the torque control or power control?
Find it on the configurations wiki page.
 
Nfer said:
cavi said:
For the best hill start performance I would setup as the following:

Motor current control = torque
Assist w/o pedal = enable
Startup BOOST = disable
Startup BOOST duration = 5
Startup BOOST fade = 6.5
Motor current ramp = 10a (maximum)
Calibrate your torque sensor then enable calibrations
Motor current max = 20a

I used these settings and it solved the lack of the boost function. The assist w/o pedal rotation enable helps to deliver the power quicker.
I prefer to use the control power instead of torque. I am using high cadence and low gears.

I am glad that the settings worked well for you. Many miles of riding and testing on hills around here during lockdown helped me find those settings.
 
casainho said:
jeff.page.rides said:
Where in the settings with version 1.0.0 do you change motor current control to or from the torque control or power control?
Find it on the configurations wiki page.

I found it on the wiki page see below, but when I go into the motor configuration screen I don't have the option to choose.
Motor control / Motor ctrl torque If set to "torque", the motor current (torque) will be equal to: measured pedal torque * assist level factor. If set to "power", the motor current will be equal to: measured pedal power * assist level factor (the measured pedal power is equal to: pedal torque * pedal cadence).
 
jeff.page.rides said:
casainho said:
jeff.page.rides said:
Where in the settings with version 1.0.0 do you change motor current control to or from the torque control or power control?
Find it on the configurations wiki page.

I found it on the wiki page see below, but when I go into the motor configuration screen I don't have the option to choose.
Motor control / Motor ctrl torque If set to "torque", the motor current (torque) will be equal to: measured pedal torque * assist level factor. If set to "power", the motor current will be equal to: measured pedal power * assist level factor (the measured pedal power is equal to: pedal torque * pedal cadence).

Then you have installed 1.0.0 X Alpha. Casainho only implemented torque control from 1.0.0 beta and final.
 
mallesepp said:
jeff.page.rides said:
casainho said:
jeff.page.rides said:
Where in the settings with version 1.0.0 do you change motor current control to or from the torque control or power control?
Find it on the configurations wiki page.

I found it on the wiki page see below, but when I go into the motor configuration screen I don't have the option to choose.
Motor control / Motor ctrl torque If set to "torque", the motor current (torque) will be equal to: measured pedal torque * assist level factor. If set to "power", the motor current will be equal to: measured pedal power * assist level factor (the measured pedal power is equal to: pedal torque * pedal cadence).

Then you have installed 1.0.0 X Alpha. Casainho only implemented torque control from 1.0.0 beta and final.

Thanks
 
casainho said:
Benoit said:
As soon as all will be done, I'll made a pull request.
I am waiting for it!! When you do it, I will test and make a new version.

Auto reset is now working but, there is a case it won't work because of how time is saved. As it is reset to 0 every day (RTC_IRQHandler function in rtc.c file), in some cases auto reset won't occur.
Example : if last trip update occurs at 14h and auto reset feature is set to 24 hours. The next day it then should be reset at 14h.
But as RTC counter is reset to 0 every time counter exceed 86399 (SECONDS_IN_DAY variable), the day after at 14h, I won't be able to know that actually 1 day has passed and I'll compare 14h to 14h so 0 second and so no reset.
So auto reset above 24h can't work.

Is there any reason RTC counter is reset everyday ? As it is stored in two 16 bits integers, that's 2^32 seconds = more than 136 years.
Managing date would be difficult I think, but we don't need it. We could just store amount of seconds passed since time has been set and let it increment every second.
 
Benoit said:
casainho said:
Benoit said:
As soon as all will be done, I'll made a pull request.
I am waiting for it!! When you do it, I will test and make a new version.

Auto reset is now working but, there is a case it won't work because of how time is saved. As it is reset to 0 every day (RTC_IRQHandler function in rtc.c file), in some cases auto reset won't occur.
Example : if last trip update occurs at 14h and auto reset feature is set to 24 hours. The next day it then should be reset at 14h.
But as RTC counter is reset to 0 every time counter exceed 86399 (SECONDS_IN_DAY variable), the day after at 14h, I won't be able to know that actually 1 day has passed and I'll compare 14h to 14h so 0 second and so no reset.
So auto reset above 24h can't work.

Is there any reason RTC counter is reset everyday ? As it is stored in two 16 bits integers, that's 2^32 seconds = more than 136 years.
Managing date would be difficult I think, but we don't need it. We could just store amount of seconds passed since time has been set and let it increment every second.

did you add a button to do a manual reset on the screen or do I have to go into the deep settings?
 
Benoit said:
casainho said:
Benoit said:
As soon as all will be done, I'll made a pull request.
I am waiting for it!! When you do it, I will test and make a new version.

Auto reset is now working but, there is a case it won't work because of how time is saved. As it is reset to 0 every day (RTC_IRQHandler function in rtc.c file), in some cases auto reset won't occur.
Example : if last trip update occurs at 14h and auto reset feature is set to 24 hours. The next day it then should be reset at 14h.
But as RTC counter is reset to 0 every time counter exceed 86399 (SECONDS_IN_DAY variable), the day after at 14h, I won't be able to know that actually 1 day has passed and I'll compare 14h to 14h so 0 second and so no reset.
So auto reset above 24h can't work.

Is there any reason RTC counter is reset everyday ? As it is stored in two 16 bits integers, that's 2^32 seconds = more than 136 years.
Managing date would be difficult I think, but we don't need it. We could just store amount of seconds passed since time has been set and let it increment every second.
Since I recall, I used the sample code from ST for RTC. You are free to change if needed.

I am thinking that maybe next version can have the pedal crank length configuration.
 
cavi said:
did you add a button to do a manual reset on the screen or do I have to go into the deep settings?
For now, manual reset is only available in a new menu "Trip memories" in the configuration screen, like all other settings.
I'll do better later.

860C_trip_memories.png
You can induviduallky reset trip A or B, with "Reset trip ..." option, setting it to "yes" (it'll go back to "no" immediately, just like the "reset all settings" in the "Display" menu).
 
Back
Top