TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Electric Motors and Controllers
casainho   1.21 GW

1.21 GW
Posts: 3920
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by casainho » Jan 24 2020 8:51am

mctubster wrote:
Jan 23 2020 11:17pm
The 850c code is still missing the polish of the LCD3, lots of missing bits, odo, soc, light flashing and so on.
You need to read the documentation!! Odometer and battery SOC are surely available and working very well.

Light flashing is not implemented because I do not consider a priority comparing to make SW102 firmware at pair with 850C.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

famichiki   100 W

100 W
Posts: 128
Joined: Jul 12 2019 9:00am

Re: Tsdz2 open source firmware only for lcd03

Post by famichiki » Jan 25 2020 6:33am

mctubster wrote:
Jan 14 2020 1:51pm
1 - Measured voltage is too high. Likely due to a change buba made to improve the voltage measured but appears there is a constant that is wrong
Can you elaborate on this please?

michih.   100 mW

100 mW
Posts: 39
Joined: Nov 11 2018 8:33am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by michih. » Jan 25 2020 1:13pm

The 0.20 works perfectly with the lcd3! Thanks for the great software! The only thing I don't like is the wrong volt display.

Mfg Michael

famichiki   100 W

100 W
Posts: 128
Joined: Jul 12 2019 9:00am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by famichiki » Jan 25 2020 5:59pm

michih. wrote:
Jan 25 2020 1:13pm
The 0.20 works perfectly with the lcd3! Thanks for the great software! The only thing I don't like is the wrong volt display.

Mfg Michael
What are you findings and how have you measured them?

OSF is reporting 0.5V higher than what my bluetooth BMS reads, so if yours is the same then try these settings below.

The correction to BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X512 was proposed by Stempelo on Github.
https://github.com/stempelo/TSDZ2-Smart ... a158532d4e

/src/controller/main.h

Code: Select all

// ADC battery voltage measurement
#define BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X512           44
#define BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X1000          86

// ADC battery current measurement
#define BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X512           87
#define BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X100           17

andrea_104kg   100 W

100 W
Posts: 180
Joined: Mar 05 2018 5:51pm

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by andrea_104kg » Jan 26 2020 6:55am

version 20 beta 1 is practically perfect on lcd03. I think it would be interesting to make it compatible with lcd05, it's cheaper, small but not too much and easy to read and leaves room to put a smartphone on the handlebar.
On lcd03 the voltage is 0.3v higher than the real but it is not a real problem.
 

michih.   100 mW

100 mW
Posts: 39
Joined: Nov 11 2018 8:33am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by michih. » Jan 26 2020 8:32am

famichiki wrote:
Jan 25 2020 5:59pm
michih. wrote:
Jan 25 2020 1:13pm
The 0.20 works perfectly with the lcd3! Thanks for the great software! The only thing I don't like is the wrong volt display.

Mfg Michael
What are you findings and how have you measured them?

OSF is reporting 0.5V higher than what my bluetooth BMS reads, so if yours is the same then try these settings below.

The correction to BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X512 was proposed by Stempelo on Github.
https://github.com/stempelo/TSDZ2-Smart ... a158532d4e

/src/controller/main.h

Code: Select all

// ADC battery voltage measurement
#define BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X512           44
#define BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X1000          86

// ADC battery current measurement
#define BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X512           87
#define BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X100           17
Thanks, unfortunately I have no idea what to do with it. On 13s is 1.1v higher.....
Can you send me a finished file?


Kt LCD 4 would be interesting


Mfg Michael

famichiki   100 W

100 W
Posts: 128
Joined: Jul 12 2019 9:00am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by famichiki » Jan 26 2020 5:53pm

Open the firmware folder and navigate to the /src/controller folder.

Open main.h in a text editor.

Find these lines in particular:

Code: Select all

// ADC battery voltage measurement
#define BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X512         44 
#define BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X1000        87  // conversion value verified with a cheap power meter
I'm using 52V and reducing the X1000 value by 1 equals approximately -0.5V.

(87 / OSF reported voltage) * actual voltage = new X1000 value (round this up or down to get closest to actual voltage)

But at this stage I don't know if the discrepancy is the same for everyone, depends on battery type or varies individually.

So you will need to experiment with changing that 87 value, saving the file, re-compiling and flashing.

Note that BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X512 is related, and calculated at..

(BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X1000 / 1000) * 512

Manually calculate that and disregard the decimal places. For example, if you change X1000 to 85 then X512 will need to be..

(85 / 1000) * 512 = 43

In addition to there was a miscalculation with the ADC battery current values identified after the beta release.

BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X512 should be 87 (not 102), being....

(BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X100 / 100) * 512 where X100 = 17.

So, your values for those need to be as below.

Code: Select all

// ADC battery current measurement
#define BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X512         86
#define BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X100         17  // conversion value verified with a cheap power meter

famichiki   100 W

100 W
Posts: 128
Joined: Jul 12 2019 9:00am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by famichiki » Jan 28 2020 2:22am

I've made good progress with the motor overrun issue, the second video below is what I was previously experiencing in v0.19 and v0.20 initially had similar characteristics. Perhaps some motors are affected more than others, or maybe it just doesn't bother some people as much as me. But this is now a big improvement and I'm very happy. :D



For those who haven't seen what I was experiencing before...


Elinx   100 W

100 W
Posts: 162
Joined: Aug 09 2019 6:58am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by Elinx » Jan 28 2020 2:41am

famichiki wrote:
Jan 28 2020 2:22am
I've made good progress with the motor overrun issue, .......
Nice to see that you have found at last a working solution and it isn't a hardware problem.

casainho   1.21 GW

1.21 GW
Posts: 3920
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by casainho » Jan 28 2020 3:05am

famichiki wrote:
Jan 28 2020 2:22am
I've made good progress with the motor overrun issue, the second video below is what I was previously experiencing in v0.19 and v0.20 initially had similar characteristics.
Great!! Can you please explain what was the issue and what was your solution??
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

michih.   100 mW

100 mW
Posts: 39
Joined: Nov 11 2018 8:33am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by michih. » Jan 28 2020 10:33am

Cool, we need the software including the volt adjustment.😁😁😁

Mfg Michael

famichiki   100 W

100 W
Posts: 128
Joined: Jul 12 2019 9:00am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by famichiki » Jan 28 2020 6:14pm

michih. wrote:
Jan 28 2020 10:33am
Cool, we need the software including the volt adjustment.😁😁😁

Mfg Michael
I will test this for a while to make sure there are no problems, but I've posted all the info about doing the volt adjustment because that will possibly vary for everyone. Once we get some reports back from people about their adjustment then we can determine if the code should be updated.

michih.   100 mW

100 mW
Posts: 39
Joined: Nov 11 2018 8:33am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by michih. » Jan 29 2020 3:41am

famichiki wrote:
Jan 28 2020 6:14pm
michih. wrote:
Jan 28 2020 10:33am
Cool, we need the software including the volt adjustment.😁😁😁

Mfg Michael
I will test this for a while to make sure there are no problems, but I've posted all the info about doing the volt adjustment because that will possibly vary for everyone. Once we get some reports back from people about their adjustment then we can determine if the code should be updated.
I saw the volt adjustment. but unfortunately I can't do it.

mfg michael

michih.   100 mW

100 mW
Posts: 39
Joined: Nov 11 2018 8:33am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by michih. » Jan 31 2020 2:18am

now it works with this value:

#define BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X512 43
# definiere BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X1000 85

#define BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X512 87


big thx!!!!!!


mfg michael

casainho   1.21 GW

1.21 GW
Posts: 3920
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by casainho » Jan 31 2020 2:21am

@famichiki, can you please explain what was your solution for the overrun issue?
casainho wrote:
Jan 28 2020 3:05am
famichiki wrote:
Jan 28 2020 2:22am
I've made good progress with the motor overrun issue, the second video below is what I was previously experiencing in v0.19 and v0.20 initially had similar characteristics.
Great!! Can you please explain what was the issue and what was your solution??
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

thineight   100 W

100 W
Posts: 220
Joined: Oct 05 2018 3:53am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by thineight » Feb 09 2020 7:58am

Hello, quick question on v.20 beta1 (buba) + LCD3 display.
Is the cruise working on your bike?
This is a function I practically never use, but I remember during the debug of buba's alfa versions the cruise was working just pressing the DOWN button while the bike is 10+ km/h, in that case the bike was keeping on going the actual speed even without the pedal rotation.

Now on beta1 (never tried the cruise) I am not able to switch the cruise on. Walk assist is working as intended, I'm saying that because the procedure to activate walk assist and cruise is exactly the same, depending on the bike speed.
Thanks for the feedback.
MTB KTM Ultra 29" - City bike DAYTONA 28"

Waynemarlow   1 kW

1 kW
Posts: 314
Joined: Jul 09 2016 7:22am
Location: Bucks, England

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by Waynemarlow » Feb 09 2020 10:40am

In the V20 you have to activate the cruise function in the setup screen, I think it’s default is off in the initial setup.

thineight   100 W

100 W
Posts: 220
Joined: Oct 05 2018 3:53am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by thineight » Feb 09 2020 12:33pm

Waynemarlow wrote:
Feb 09 2020 10:40am
In the V20 you have to activate the cruise function in the setup screen, I think it’s default is off in the initial setup.
Of course it is activated. The relevant submenu 0 has value 1.
Do you confirm that after you press DOWN for a second or so your cruise starts working?
MTB KTM Ultra 29" - City bike DAYTONA 28"

Waynemarlow   1 kW

1 kW
Posts: 314
Joined: Jul 09 2016 7:22am
Location: Bucks, England

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by Waynemarlow » Feb 09 2020 2:53pm

thineight wrote:
Feb 09 2020 12:33pm
Waynemarlow wrote:
Feb 09 2020 10:40am
In the V20 you have to activate the cruise function in the setup screen, I think it’s default is off in the initial setup.
Of course it is activated. The relevant submenu 0 has value 1.
Do you confirm that after you press DOWN for a second or so your cruise starts working?
Sorry I have never used the cruise function and have mine disabled. Unfortunately my motor is US at the moment ( water ingress from a damaged plastic side cover ) and awaiting delivery of a controller from PSW ) so can't test for you.

mctubster   100 W

100 W
Posts: 226
Joined: Feb 26 2018 6:21am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mctubster » Feb 09 2020 3:12pm

thineight wrote:
Feb 09 2020 12:33pm
Waynemarlow wrote:
Feb 09 2020 10:40am
In the V20 you have to activate the cruise function in the setup screen, I think it’s default is off in the initial setup.
Of course it is activated. The relevant submenu 0 has value 1.
Do you confirm that after you press DOWN for a second or so your cruise starts working?
Yes my cruise works. Beta 1. Double check the config including target speed

thineight   100 W

100 W
Posts: 220
Joined: Oct 05 2018 3:53am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by thineight » Feb 09 2020 3:41pm

mctubster wrote:
Feb 09 2020 3:12pm
thineight wrote:
Feb 09 2020 12:33pm
Waynemarlow wrote:
Feb 09 2020 10:40am
In the V20 you have to activate the cruise function in the setup screen, I think it’s default is off in the initial setup.
Of course it is activated. The relevant submenu 0 has value 1.
Do you confirm that after you press DOWN for a second or so your cruise starts working?
Yes my cruise works. Beta 1. Double check the config including target speed
Thanks, will check. To activate it, you simply press and hold the DOWN button, right?
Just for comparison, what are your settings for the cruise submenu?
0: 1
1: ?
2: ?
3: ?
Thanks a lot
MTB KTM Ultra 29" - City bike DAYTONA 28"

mctubster   100 W

100 W
Posts: 226
Joined: Feb 26 2018 6:21am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mctubster » Feb 11 2020 5:10pm

thineight wrote:
Feb 09 2020 3:41pm

Thanks, will check. To activate it, you simply press and hold the DOWN button, right?
Just for comparison, what are your settings for the cruise submenu?
0: 1
1: ?
2: ?
3: ?
Thanks a lot
Yes hold the DOWN button over 10? km/h

0:1
1:1
2:25 km/h
3:1

mittkonto   10 mW

10 mW
Posts: 34
Joined: Mar 02 2019 2:31am

Re: TSDZ2 open source firmware only for KT-LCD3 (v0.19.0 / v.0.20.0beta1)

Post by mittkonto » Feb 17 2020 10:08am

0.20, makes every ride an early christmas. Can't wait to see what sw102 and 850c when its a bit more mature around the curve! I have seen the awesome torque calibration work that has been done, though my torquesensor is not health personified, I'm holding off a bit. Thanks devs and testers again!!!
By the wholesome Code Gods of Muchgivings!!? A tidy TSDZ2 spliced cable and a nice chunk of HIGO-Z812-B with a tad of temperature mods sprinkled on top, you say?

Post Reply