ElectricMotorcycleForum.com

  • November 27, 2024, 08:42:00 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: 1 [2] 3

Author Topic: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus  (Read 5854 times)

Mudface

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #15 on: April 08, 2019, 09:46:09 PM »

Is it not possible to use the standard dash?
I (here we go) assume that it's a LCD screen?
Logged

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #16 on: April 09, 2019, 10:07:54 PM »

Is it not possible to use the standard dash?
I (here we go) assume that it's a LCD screen?

The standard dash LCD is hardwired to display exactly what it already displays and not a single item more. DigiNow ‘s ability to display other parameters happens by sending messages of the same format with different values for the alternative parameters. It’s a bit of a hack, albeit reasonable.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #17 on: April 09, 2019, 10:09:34 PM »

Thanks very much for publishing the code. What kind of collaboration seems appropriate to you?

The code suggestions above seem reasonable to me. One of us could make a github pull request to implement them for you if it’s not fun for you to do those changes.

I’m recovering from a trip but will try to have a better look later.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #18 on: April 09, 2019, 11:17:49 PM »

Hi Richard, no problem sharing the code, Others could benefit from it making their own projects or just copying (bits of) this one :)

I have no idea what a pull request is or what it should do on github  ;D . I'm a hobbyist programmer and I suspect pacificcricket is a programmer by profession.

I do appreciate suggestions. And as for his suggestions, I don't see real valid reasons to change the code. All the suggestions just add more lines of code and do not improve the readability. (in my opinion!)

Here's my view on things:
Using a switch instead of multiple if-statements could be valid but does not add any functionaltity or even clarity from my point of view. The If statements are very clearly for 1 single CANID and broken down byte by byte. Adding case and break lines just clutters the code (again MY opinon). I do agree that after the first if statement the rest would be better off using "else if" instead of a new "if" because then the routine is faster because when it has found the right canID it skips the rest. Maybe a switch case statement does the same, i wouldn't know. I'm just a (novice) hobbyist programmer.

The comment regarding the color definitions would ADD 12 definition lines at the top of the code for the same 12 lines it takes now to define the colors (every colour statement is just use once). I just dont see the point in that. it's adding (lines of) code with no real purpose (for ME).
The same for the grouping of the arithmetic "buf[1] + 256*buf[2] should be buf[1] + (256*Buf[1])".  Well that is just basic arithmetic. If that is not clear enough that you must multiply before adding than the brackets are not going to help either. Again, it's more (lines of) code for no clear reason (again for ME)
next would be the macro definitions for the same line. WHY ? is it not clear enough that byte 1 and 256* byte 2 are added ?? Defining a macro "Magic(buf,1,2)"  does not really make it any clearer (to ME). and again would just add some lines of code.
The last comment regarding integer arithmetic because of using a long could be valid. I don't know because i don't know what all that means. I have a general idea though. But in this way the displayed value is accurate for all values the parameter can get to in the real world, so.....

I would be very happy to add or change functionality for this project. But i'm not likely going to change the code to accomodate these (style) changes. I'd like to spend my (limited) time on adding things like :

* compass direction and distance to the nearest EVSE station and display that on the screen as well so i don't have to have my phone app ready all the time. I have ordered a small GPS receiver for this. Any suggestions for searching through a database of EVSE-POIS and selecting the nearest one with direction and distance would be extremely appreciated.  8) A warning when range minus distance to the nearest EVSE is below a certain threshold is also easy (making the range display in red for example)
* an altitude indicator. That would be an easy one with the addition of a GPS receiver. The higher the altitude the better the range because of the thinner air  ;D (off course climbing to that higher altitude costs more battery, but still nice to know the altitude)
* GPS logging onto the SD card that can be put into the TFT screen. after a long trip it's always nice to have the route on a map inbetween the photo's of the trip  ;)

Upon request i shared the code and eveyone is free to use it or bits from it. That benefits us all!!. After all the idea came from someone else on this forum. I expanded his good work with functionality that i liked and all the values are accurate and work well.

Greetz

P.S. This is not meant to be an angry post, not at all and i do think that the comments are meant to improve the code. It is merely my point of view on the proposed changes to be made. They don't add functionality, and that is my main objective.  8)
Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #19 on: April 09, 2019, 11:22:39 PM »

As for improved functionality :)

The dashboard cover i made previiouosly meant that the two buttons on the original dash were not accesable anymore :) So i redesigned the cover to include a small section that can be easily removed to access both buttons.
With all the data on the dash the only thing the buttons will be used for is setting the (daylight savings) time and resetting the trip 2 meter.

I'll post a picture of the new cover later.
« Last Edit: April 09, 2019, 11:47:20 PM by remmie »
Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

pacificcricket

  • Sr. Member
  • ****
  • Posts: 293
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #20 on: April 10, 2019, 03:22:36 AM »

And as for his suggestions, I don't see real valid reasons to change the code.

No worries, it's your project and you're free to run it in your own way :)
Logged

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #21 on: April 10, 2019, 04:20:33 AM »

Agreed all around.

The point usually of code changes that don’t add functionality is to make functionality easier to add. One reason I haven’t augmented existing code bases that parse and display Zero logs is that they’re all very hard to extend.

This is why we have several log parsers and almost no data processing code.

Hell, we can’t even jump to points in a log by date. Every time I parse a log roadside I have to scroll manually through several thousand lines just to get to today’s logs.

So, you can bet I’m going to fork this and take pull requests.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

pacificcricket

  • Sr. Member
  • ****
  • Posts: 293
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #22 on: April 10, 2019, 10:03:37 AM »


The point usually of code changes that don’t add functionality is to make functionality easier to add.

Or make the code less bug prone. Or make it run faster (especially counts for microcontrollers).
Logged

DanyEarth

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #23 on: May 29, 2019, 02:08:30 AM »

Fuckkkkkk I'm in love! I want it!
Logged

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #24 on: May 30, 2019, 12:15:18 AM »

Made some improvements among which a little lid on the 3D printed bracket so i can still reach the 2 pushbuttons on the original dash.

Also a gps module with which i can track a trip (logging every 30 seconds) and see the GPS altitude. Altitude is not varying very much here in the netherlands (highest is about 100 meters :) but still nice to see.

Attached is a new view when charging, the main dial then displays charging amps and I also found the canID's for chargetimetogo, momentary Ampshours left and the total amps hours as reported by the MBB. interestingly when the battery is full the momentary Amphours (124) is larger than the max amphours of 114.
Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #25 on: May 30, 2019, 12:17:20 AM »

Here's a screenshot of the GPS log made by GPSvisualizer

Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #26 on: May 30, 2019, 12:35:40 AM »

That is great progress!

I especially like that temperature is visualized with a little range, but it's a little hard to tell min/max/current values from each other.

Mainly, it's impressive that the layout is good and a healthy amount of information can be displayed in once screen, right down to cel balance.

I guess I might have a try at designing a layout concept in case it would be welcome... something to group values together so it's easier to summarize while riding.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1639
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #27 on: August 27, 2019, 03:05:41 AM »

> Impressed with the new dash of the Zero SR/F dashboard with the TFT screen I tried to create a similar screen for my 2018 Zero SR...

You and crashcash are inspiring!

Logged
our knowledge about Zeros collects here: https://zeromanual.com/

stevenh

  • Sr. Member
  • ****
  • Posts: 398
  • Newington NH
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #28 on: August 27, 2019, 04:31:48 AM »

Awesome work!  Looks great.
Logged
2020 SR/F Premium
2022 Ioniq 5 SEL

ben.m

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Zero SR/F Dashboard on a Zero (D)S(R) using CanBus
« Reply #29 on: August 27, 2019, 01:14:55 PM »

What a big job ! :o impressed !

Do you know what is displayed on the SR/F with the circular colored bars ? This is the % of SoC.
On your pictures it's not, i don't understand what is related to on your's.
Logged
Pages: 1 [2] 3