KT LCD3 firmware -- Flexible OpenSource firmware for Kunteng KT-LCD3

casainho

10 GW
Joined
Feb 14, 2011
Messages
6,043
I started the project of OpenSource firmware for the popular BMSBattery S series controllers / Kunteng KT and TSDZ2 mid drive motor controllers.

There are a few models of LCDs used on KT controllers and LCD3 seems to be the most complete, that shows for instance the motor real time power in watts.
On TSDZ2, his LCD is really poor, it can't even show the motor real time power in watts nor even the battery voltage :-(

Both KT and TSDZ2 motor controllers use the same microcontroller STM8S105, and the LCD3 also uses the same STM8S105!! This is an opportunity to exploit LCD3 and improve with our own firmware, like adding extra working modes for both KT and TSDZ2 motor controllers :)

LCD3 uses STM8S105C6T6 that has 32kbytes of flash memory, which should be plenty.
The only other IC on the board is the LCD controller Holtek HT1622 that has datasheet in English language, there are even OpenSource Arduino firmware for it.

The flashing and debugging SWIM header is easily accessible on LCD3 board.

Anyone that believes this firmware will bring value and with some time to help??
 
For lcd3 i miss a frocking clock. I can't believe there is none, of course I guess it is not possible as there is no battery for that.

Appart from that, i am not really missing anything. It is more on the controller side rather than the display itself
 
lqbweb said:
For lcd3 i miss a frocking clock. I can't believe there is none, of course I guess it is not possible as there is no battery for that.

Appart from that, i am not really missing anything. It is more on the controller side rather than the display itself
What do you miss on the controller side?
 
Very first code to run on LCD3!! This code waits for a press on the DOWN BUTTON to enable/disable the LCD backlight.

Source code is here: https://github.com/OpenSource-EBike-firmware/Kunteng_LCD3_firmware

[youtube]tBtuenKlblk[/youtube]
 
chilltrout said:
Need Ah's used like on CA :p
Do you know how to calculate that?
 
Not derivative, the opposite. Ah (or better Wh) is the integral of current/power over time. Take power measurements at regular intervals, say 1s, then add up 1/3600 of it to the total.

e.g. exactly 100W for each measurement, over the course of 1 hour, will give you 100 Wh (Watt-hour).
 
1N4001 said:
Not derivative, the opposite. Ah (or better Wh) is the integral of current/power over time. Take power measurements at regular intervals, say 1s, then add up 1/3600 of it to the total.

e.g. exactly 100W for each measurement, over the course of 1 hour, will give you 100 Wh (Watt-hour).
Ok, I got it.

STM8 reads the battery voltage on pin PE7. The current value is sent by the controller over UART. So, to have instantaneous Wh:
- P = U * I;
- P * 1/3600 at each shows the instantaneous Wh
- the trip Wh will be: Wh_total = Wh_total + Wh_instantaneous

As I want to define on LCD3 what is motor assist level in Wh and not in amps, so having Wh should be great to manage the available range of a full charged battery.
 
Have you seen the luna ebike kit with the 2 speeds Xiongda motor hub? That color LCD is using the same protocol or a variant of the Kunteng controller i think.

It would be awesome to have a full LCD display, instead of the LCD3. You could display a lot more information. Maybe the efforts should be spent there instead? What do you think?
 
casainho said:
lqbweb said:
For lcd3 i miss a frocking clock. I can't believe there is none, of course I guess it is not possible as there is no battery for that.

Appart from that, i am not really missing anything. It is more on the controller side rather than the display itself
What do you miss on the controller side?

I am missing a hidden way to make the bike fully legal in Europe. Some sort of password like going to pas level 1 then to 3 and back to 1, or something like that.

Then the speed would be limited to 25 and power to 250w.

LCD related maybe would be useful to display and estimated range for the current battery and current level. I guess you would first need to figure out a way to estimate the remaining Ah, and Ah/h.
 
lqbweb said:
Have you seen the luna ebike kit with the 2 speeds Xiongda motor hub? That color LCD is using the same protocol or a variant of the Kunteng controller i think.

It would be awesome to have a full LCD display, instead of the LCD3. You could display a lot more information. Maybe the efforts should be spent there instead? What do you think?
Good point!!

Can you get a link for an online shop selling the LCD??
 
Must be this one: https://lunacycle.com/double-gear-double-torque-motor/
The display: https://cdn8.bigcommerce.com/s-9vkjq73s/images/stencil/2048x2048/products/998/6424/Luna_Low_Geared_Hub_Motor-35__02538.1482174808.jpg

It doesn't appear to be sold separately. I also doubt it'll be easy to reprogram. And if it is, it won't be easy to work with as it's graphics-based. But I am curious nonetheless, it could have potential.


What about a general-purpose LCD? It would improve flexibility and could be much smaller. A character-based LCD, like the one used on the CA3 could be an idea.

Compared to the fixed-symbols LCDs, you could for example swap the odometer with a wattmeter at the push of a button. Or have it cycle on its own periodically. Or show the motor temperature, but only if it exceeds a certain treshold. As I said, flexibility.

Of course you'd also need some buttons to control the whole thing. There might be LCD cases with built-in buttons already.
 
1N4001 said:
Must be this one: https://lunacycle.com/double-gear-double-torque-motor/
The display: https://cdn8.bigcommerce.com/s-9vkjq73s/images/stencil/2048x2048/products/998/6424/Luna_Low_Geared_Hub_Motor-35__02538.1482174808.jpg

It doesn't appear to be sold separately. I also doubt it'll be easy to reprogram. And if it is, it won't be easy to work with as it's graphics-based. But I am curious nonetheless, it could have potential.


What about a general-purpose LCD? It would improve flexibility and could be much smaller. A character-based LCD, like the one used on the CA3 could be an idea.

For example swap the odometer with a wattmeter at the push of a button. Or have it cycle on its own periodically. Or show the motor temperature, but only if it exceeds a certain treshold. As I said, flexibility.

Of course you'd also need some buttons to control the whole thing. There might be LCD cases with built-in buttons already.
After thinking a bit more in all this:

- yes, that color LCD does not seem popular, that is a disadvantage (as also we can't know if it is easy to develop firmware for it)
Also, since it is graphic and color LCD, will be much more complex the graphical part so a bigger project -- and let's not forget about the project for the mobile app: we can do the mobile app instead and then sky is the limit -- we just don't have mobile app because we don't develop it because he hardware is ready like Kunteng controllers!! The bluetooth module is cheap or can be even DIY!!

- general-purpose? that would mean DIY and this is not the idea of the project, to make hardware.

For example swap the odometer with a wattmeter at the push of a button. Or have it cycle on its own periodically. Or show the motor temperature, but only if it exceeds a certain treshold. As I said, flexibility.
LCD3 can do all that, it has 3 buttons and we can put numbers some letters - on the odometer we have space for 5 numbers/letters available and 1 point. We can also write 1999 on wattmeter (but we can disable W symbol if needed).
The disadvantage is that the symbols / mask is fixed but we still has the option to hide or show some symbols.
From the hardware side, LCD3 is kind of cheap (for instance, TSDZ2 LCD is 10€ more expensive and can't even show battery voltage or motor real time power) and is watter prof.

12315292_1655301114739578_995327619_o__23778.1448941661.jpg
 
Finally got control of the LCD symbols!!

- This code waits for a press on the UP BUTTON to enable/disable all the LCD symbols.
- This code waits for a press on the DOWN BUTTON to increase the LCD backlight value.

[youtube]PsO61AmgcDQ[/youtube]
 
How likely is it that this can be made to work with the LDC5 display as well?

Also, I thought I saw a picture of the insides of an LCD5, but I can't find it now. If you know of one, please give me a pointer. Thanks!

-dg
 
If more developers help, I think I will not be hard:

https://opensourceebikefirmware.bitbucket.io/development/Motor_controllers--BMSBattery_S_series--LCD_control_panel.html

13-2.png
 
Addressing all segments in sequence, for testing:

[youtube]C2tCnObt6L8[/youtube]
 
Hi,

just opened up my display and noticed mine has a different display driver (SHT32E22) but it looks like its pin compatible for the connected pins as far as i could see..

hopefully its also firmware compatible so we dont need multiple firmwares.

is the test code up on the repository?
 

Attachments

  • IMG_20180516_185132.jpg
    IMG_20180516_185132.jpg
    277.9 KB · Views: 9,651
nieles said:
Hi,

just opened up my display and noticed mine has a different display driver (SHT32E22) but it looks like its pin compatible for the connected pins as far as i could see..

hopefully its also firmware compatible so we dont need multiple firmwares.

is the test code up on the repository?
I quick looking at datasheet seems it works just as the same way, the commands, signals, etc. Also the PCB seems to be the same!!!

Yes, best code is on github. You can just try and see if you get the same result as I show on the video!!
 
Hi casainho,
I don't get on the forum as much as I used to but know you've been working for a while on these KT projects. Good stuff. I am interested in this KT display project. Like others have mentioned, I think it would be cool if you could get one of the outputs to display real-time current (A) and/or accumulated current (Ah) (like the Cycle Analyst).

Sorry I'm not a developer so can't help you with coding. In any case, I wish you good luck!
 
rote said:
Hi casainho,
I don't get on the forum as much as I used to but know you've been working for a while on these KT projects. Good stuff. I am interested in this KT display project. Like others have mentioned, I think it would be cool if you could get one of the outputs to display real-time current (A) and/or accumulated current (Ah) (like the Cycle Analyst).

Sorry I'm not a developer so can't help you with coding. In any case, I wish you good luck!
Thank you for the feedback.

I don't know nothing about cycle analyst and I lack experience about such features, understand their need and value as also how they shoild be implemented.

Can you gius please write a list of features you th8nk should be implemented and explain how it should be implemented and why it is important to have that feature??

Ideally, that list should be written on the issue tracker so we don't loose track of each point:

https://github.com/OpenSource-EBike-firmware/Kunteng_LCD3_firmware/issues
 
Hi casainho

I was wondering if by lcd settings the slow start mode that sinewave controllers have could be removed or even better, decide by levels how we prefer this ?
 
Antenor said:
Hi casainho

I was wondering if by lcd settings the slow start mode that sinewave controllers have could be removed or even better, decide by levels how we prefer this ?
LCD shows only limited information sent by the controller like wheel speed, battery current and voltage, etc.
Also they can send commands to the controller like predefined assist levels like 0 up to 5. It is up to controller to implement the important features and not the LCD -- that's why the first project was to develop the firmware for the KT motor controllers.
 
@Nieles, how are you going??

I pushed code that implements the concept of LCD frame buffer. We write the bits we need to enable to the frame buffer and finally send all the frame buffer to LCD so it is updated. This is working and the "W" symbol is now enabled with: lcd_enable_w_symbol(1);
 
Back
Top