• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

TSDZ8 OSF (open source firmware)

Do you use 860c display? If not did you setup the right params and flash the config?
No, I only have the EDK01 display. Yes, I entered all the parameters on Java. I'm attaching a photo, but the motor has little power. It doesn't extend. Could you send me the version to use on the EDK01? Does it have much more power? Thank you very much.
 

Attachments

  • IMG_9166.jpeg
    IMG_9166.jpeg
    4.7 MB · Views: 27
No, I only have the EDK01 display. Yes, I entered all the parameters on Java. I'm attaching a photo, but the motor has little power. It doesn't extend. Could you send me the version to use on the EDK01? Does it have much more power? Thank you very much.
Did you set motor watts and battery amps and select tsdz8 in motor? Also try motor foc 29. Make sure pas level 5 is highest setting u can put. Try torque or hybrid
 
That seems good to know. Considering you need the j-link for the controller anyway. Still need an separate power source for the display, I assume?
Turns out jtlink power is too unstable to flash. I cooked up another bootloader box and first attempt my display is back 💪
 
I still haven't seen an answer to the question about throttle response time. Is there a way with osf to make the thumb throttle acceleration instant similar to a motorcycle? My tsdz8 seems to have a full second or two of delay to any pedal or throttle input
 
  • Like
Reactions: hgg
I still haven't seen an answer to the question about throttle response time. Is there a way with osf to make the thumb throttle acceleration instant similar to a motorcycle? My tsdz8 seems to have a full second or two of delay to any pedal or throttle input
be careful what you wish for :D
(860c display only)
 
  • Like
Reactions: hgg
i only really messed with source for 860c, i have an ek01 i can test with tho but im not sure what to do to make it work for the factory displays. im not sure either to go with reconfiguring or going the java config route, since my throttle power is controlled with torque angle offset (i think its called, the unnused slot with 860c)
if mstrens can shed some light on the difference between firmwares and if its easy enough to switch between i could try. i thought about making a crosspaltform one that supported all, i will experiment with that route at some point
 
i only really messed with source for 860c, i have an ek01 i can test with tho but im not sure what to do to make it work for the factory displays. im not sure either to go with reconfiguring or going the java config route, since my throttle power is controlled with torque angle offset (i think its called, the unnused slot with 860c)
if mstrens can shed some light on the difference between firmwares and if its easy enough to switch between i could try. i thought about making a crosspaltform one that supported all, i will experiment with that route at some point
It is not an easy task to migrate changes in 860c version to the VLCD5 (and similar) version. mbrusa does not want to have only one source code for both. It makes maintenance quite difficult. There no so many differences in motor.c but many in ebike_app.c
 
Just for information here the result of last days:

At this stage I have a code running where all angles are in q8.8 (8 bit decimal) instead of uint8.
I also noticed an issue in the enlapsed_time (= time since last hall pattern change and also the time over one full rotation).
I do not know why but I had to use the option that uses an ISR at each hall front instead of the option that captures the time via a timer. This issue generates unregular rotor position and so unstabality.

I have some code prepared to use a PLL (or an alfa, beta) to further improve the rotor position (smoother).
I hope to test it to morrow.
With a PLL it is less required to perform a hall position calibration.

I did not yet put any new code on github (perhaps to morrow if tests are successful).

On the other side, I further looked to a full FOC implementation. I made a draft of code (just for the foc) and let chatgpt estimate the exucution time. It is evaluated to about 15 usec. So it could in principe be executed in the second part of the PWM timer after ADC conversions. In first part of PWM cycle, I could calculate the rotor position with the code I am currently testing (it is estimated to 15 usec). For a full implementation, there are also quite many changes to do in the slow loop (40Hz).
Note : With a full foc implementation, there is no nead to calculate a lead angle anymore.
 
I've just ordered a

Waveshare ESP32-S3 7inch Capacitive Touch LCD​

Out of sheer boredom and I'm gonna create my own display firmware for osf with some fancy fun UI as a side project. Since a lot of the code for packets etc is there already from 860c the hardest part is already done. It will either be a fun project or a huge headache 🤣 in the meantime I will try port my 860c tweaks over to normal osf for anyone with the other displays
 
I tried for 12 hours straight to port my tweaks to normal osf
It hurts my head too much 😭😂
Would've probably been easier adding single displays at a time to 860c source. They're a lot more different than I originally though out 🤨
 
i only really messed with source for 860c, i have an ek01 i can test with tho but im not sure what to do to make it work for the factory displays. im not sure either to go with reconfiguring or going the java config route, since my throttle power is controlled with torque angle offset (i think its called, the unnused slot with 860c)
if mstrens can shed some light on the difference between firmwares and if its easy enough to switch between i could try. i thought about making a crosspaltform one that supported all, i will experiment with that route at some point
is it possible that we can use the osf that msrens has created and modify it to have instant acceleration and wheelies wheelies wheelies? i want to get launched and unfortunatly cant find a 860c display with the 6pin connection and throttle for my tsdz8.
 
그래서 jtlink(V9 이상인 경우)를 사용하여 860 디스플레이에 OSF를 플래시할 수 있고 값비싼 부트로더 봇은 필요 없습니다.
여러 번 시도해서 업데이트가 되었고, 10% 정도 진행된 후 실패했습니다. 계속 실패했습니다. 9시간 후에 세거 대신 윈도우 com 드라이버를 사용해 보기로 하고 np를 플래시했습니다. 망가진 줄 알았습니다 :|
Hi! Thank you so much for sharing this valuable information you gained after 9 hours of hard work. It's incredibly helpful.

I also have a J-Link V9 clone and I'm planning to flash the OSF onto my 860C display. I was worried I might run into the exact same flashing failure you did.

If you don't mind, could I ask a few more questions?

  1. Could you please tell me a bit more about the "Windows COM driver" you used? Was it the generic one that Windows automatically installs?
  2. Would you mind explaining the process of how you switched from the Segger driver to the Windows COM driver? (e.g., did you change it manually in the Device Manager?)
  3. Most importantly, could you share the pinout you used to connect the J-Link to the 860C's PCB? A photo of the connection would be amazing, if you have one.
  4. Lastly, I was also wondering which flashing software you used after changing the driver.
Any extra detail you could provide would be a huge help for others like me following in your footsteps. Thanks again for sharing your valuable experience!
 
is it possible that we can use the osf that msrens has created and modify it to have instant acceleration and wheelies wheelies wheelies? i want to get launched and unfortunatly cant find a 860c display with the 6pin connection and throttle for my tsdz8.
you just need the cable that plugs into your controller and splits into 4, 1 for display, 1 for throttle and 2 brake sensors. i tried for 14 hours to port it :( on my 860 firmware i did a lot of ui 8 to ui16 conversions, relinked functions to different inputs, set phase amps/bat amps and motor power in firmware and told it go ignore values my screen would set because that was a bottleneck (ive successful built an update to increase them now tho) then i had to link up the ui16s in ebikeapp to match firmware. i also recalibrated adc battery amps measurement so its showing the correct amp for me now(was reading 6.25% mroe than it actually was) didnt seem like much but i was changing it over time and didnt realise how much it was xD - I did start with a fresh clone of normal OSF too with no mods
first attempt after getting it to compile, bike was a limp, display showed like 4 watts power lol i think with normal osf its probably conflicting with the many different display configs, theres so many variables that need to match up just to please compiler alone. so i think when i flashed the java config it messed a few things up. i tried setting default values in firmware to bypass the java config and i got error 1 on my ekd01. however, i do believe u can use the sw102 display with the 860c firmware too :)

if mstrens or anyone wanna try port in tweaks; i did a little write up of the most important things i can remember doing
youll see a lot ui16 battery functions - either put them back to ui8 if thts the default or change all to ui16(thts the easy part, just search + replace all) dont forget to update your defines etc 1760581587397.png
 

Attachments

  • Hazza_tweaks.txt
    15.3 KB · Views: 9
Hi! Thank you so much for sharing this valuable information you gained after 9 hours of hard work. It's incredibly helpful.

I also have a J-Link V9 clone and I'm planning to flash the OSF onto my 860C display. I was worried I might run into the exact same flashing failure you did.

If you don't mind, could I ask a few more questions?

  1. Could you please tell me a bit more about the "Windows COM driver" you used? Was it the generic one that Windows automatically installs?
  2. Would you mind explaining the process of how you switched from the Segger driver to the Windows COM driver? (e.g., did you change it manually in the Device Manager?)
  3. Most importantly, could you share the pinout you used to connect the J-Link to the 860C's PCB? A photo of the connection would be amazing, if you have one.
  4. Lastly, I was also wondering which flashing software you used after changing the driver.
Any extra detail you could provide would be a huge help for others like me following in your footsteps. Thanks again for sharing your valuable experience!
i just uninstalled the segger device and it defaulted to windows default driver, you can find it in "ports" in device manager
i connected
rx - tx
tx -rx
grd - grd
5v - 5v
basically the same setup using a custom usb2uart usb with a buck converter in
the jtlink uses uart through comm
i would not recommend it whatsoever, not sure if it ws an unstable power issue or what
a usb2uart costs £4-8 and worked for me first time
it came wth lots of them little breadboard cables for easy connection
theres a "diy bootloader box" tutorial somewhere on github but i alwasy take half an hour to find it its so hidden lmao, keep forgetting to bookmark it
i used apt burn tools
if you really want to try it ill upload a pic of my jlink from my phone since i cant find the pinout online
 
Probably a niche group of people but I used my toseven programming kit to flash osf on the 860c, it seems to have worked first try The toseven kit is handy because its just a Usb-to-uart USB dongle and a 24v power brick for powering the display. The pin out is different so you need to adapt it somehow, I just scaraficed a 5-pin display cable extension to make an adapter for the 860c.

@HazzaHodgson @indexpia here is the diy bootloader box instructions Flash the firmware on 860C 850C using bootloader
 
1000013063.jpg1000013064.jpgi got the Chinese segger here but all jlink v9+ have theuart to comm ports. Easy way to understand is All the pins on the left have 2 functions each and all on the right are just grnd except a few on the top. The other pic is my bodge £8 usb2uart flasher 😂currently I got my 860c display plug disconnected because I was playing around with my sab controller the other night. But basically the way you're looking at it, bottom pin is ground then rx tx (either this order or swapped can't remember) in the middle then the 5v top. 5v and ground to to the buck converter at the top to the "in" side + and - then the"out" side + goes to display 5v and - to display ground. You need a buck converter and set voltage to at least 30 or display won't work.

1 solution that MAY work for you if u have UART on your segger, you can try power display from your bike that way you can skip the whole buck thing. Don't connect it directly to battery though, you'll need to plug it into controller ports power and splice tx +Rx to your segger I think (if someone can confirm)

Also if I wanna try this way , while u do it get a usb2uart and buck for next time and/or if it fails flash. Mine would refuse to boot to home OR power up alltogether when it failed luckily I could still flash it back to working
 
Probably a niche group of people but I used my toseven programming kit to flash osf on the 860c, it seems to have worked first try The toseven kit is handy because its just a Usb-to-uart USB dongle and a 24v power brick for powering the display. The pin out is different so you need to adapt it somehow, I just scaraficed a 5-pin display cable extension to make an adapter for the 860c.

@HazzaHodgson @indexpia here is the diy bootloader box instructions Flash the firmware on 860C 850C using bootloader
Thanks I finally bookmarked it 😂
Just another warning @indexpia if you do get a doner plug use a multi meter while referencing the guide for correct wiring. The cable I used were different colours. Black was for 5v 💀
 
you just need the cable that plugs into your controller and splits into 4, 1 for display, 1 for throttle and 2 brake sensors. i tried for 14 hours to port it :( on my 860 firmware i did a lot of ui 8 to ui16 conversions, relinked functions to different inputs, set phase amps/bat amps and motor power in firmware and told it go ignore values my screen would set because that was a bottleneck (ive successful built an update to increase them now tho) then i had to link up the ui16s in ebikeapp to match firmware. i also recalibrated adc battery amps measurement so its showing the correct amp for me now(was reading 6.25% mroe than it actually was) didnt seem like much but i was changing it over time and didnt realise how much it was xD - I did start with a fresh clone of normal OSF too with no mods
first attempt after getting it to compile, bike was a limp, display showed like 4 watts power lol i think with normal osf its probably conflicting with the many different display configs, theres so many variables that need to match up just to please compiler alone. so i think when i flashed the java config it messed a few things up. i tried setting default values in firmware to bypass the java config and i got error 1 on my ekd01. however, i do believe u can use the sw102 display with the 860c firmware too :)

if mstrens or anyone wanna try port in tweaks; i did a little write up of the most important things i can remember doing
youll see a lot ui16 battery functions - either put them back to ui8 if thts the default or change all to ui16(thts the easy part, just search + replace all) dont forget to update your defines etc View attachment 379186
So you're saying I should be able to buy the 860c display and some adapter that would make it work with my TSDz8? It didn't appear to have the throttle or anything on the links that I found to purchase the 860c. And I think the rest of your message was over my head currently. I did flash the OSF to my bike but didn't feel like it really benefited anyway so I went back to the stock updated firmware that was given to us by someone from tongsheng I think. Every time I tried the osf I either had a fault with my odometer or the screen just wouldn't work at all or no pedal assist. I just finally gave up but that was months and months ago and this was relatively new
 
So you're saying I should be able to buy the 860c display and some adapter that would make it work with my TSDz8? It didn't appear to have the throttle or anything on the links that I found to purchase the 860c. And I think the rest of your message was over my head currently. I did flash the OSF to my bike but didn't feel like it really benefited anyway so I went back to the stock updated firmware that was given to us by someone from tongsheng I think. Every time I tried the osf I either had a fault with my odometer or the screen just wouldn't work at all or no pedal assist. I just finally gave up but that was months and months ago and this was relatively new
Id definitely buy an 860c if you're interested in osf. It's not of a nuisance with the normal displays I think. Do you plug your display straight into controller then throttle into display? The top one is the one I use. It came with my motor
 

Attachments

  • Screenshot_20251016-042022.png
    Screenshot_20251016-042022.png
    561.9 KB · Views: 10
Back
Top