ShadowDash, how can I increase the averaging on a gauge?

For discussion of other tuning and logging softwares

Moderators: jsmcortina, muythaibxr

Post Reply
aw113sgte
Helpful MS/Extra'er
Posts: 87
Joined: Tue Nov 25, 2014 2:41 pm

ShadowDash, how can I increase the averaging on a gauge?

Post by aw113sgte »

I have a fuel gauge and it bounces around quite a bit. Is there any way to average the values over a time period?

Secondary question and probably a stretch. The fuel level sensor reads from 14-140 ohms. I am currently using a 500 ohm resistor inline with the sensor so the current draw is kept to a minimum. Unfortunatly this means a full sweep of the sensor only changes the ADC value about 100 (out of 1024). This contributes to the bouncing I'm seeing. Any ideas how to get a larger voltage sweep without resorting to an op-amp or similar?
LT401Vette
Super MS/Extra'er
Posts: 12731
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: ShadowDash, how can I increase the averaging on a gauge?

Post by LT401Vette »

You can make a smoothed OutputChannel in a custom.ini file. There is a smoothing function smoothBasic().

This is what it would look like:

Code: Select all

[OutputChannels]
   smoothFuelLevel = { smoothBasic( yourCurrentFuelLevelChannel, 50 ) }
you will want to play around with the number 50 a bit as that drives how many records it smooths over.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
aw113sgte
Helpful MS/Extra'er
Posts: 87
Joined: Tue Nov 25, 2014 2:41 pm

Re: ShadowDash, how can I increase the averaging on a gauge?

Post by aw113sgte »

Awesome! Worked perfectly, thanks!
aw113sgte
Helpful MS/Extra'er
Posts: 87
Joined: Tue Nov 25, 2014 2:41 pm

Re: ShadowDash, how can I increase the averaging on a gauge?

Post by aw113sgte »

Okay, now I'm trying to convert the reading to gallons. The transformation works fine but it seems I'm stuck with an integer variable. Being a motorcycle gas tank with only 2.5 gal capacity, I have to have the ability to use decimals. Can I change the variable to a single or similar?

Edit: Found it, just had to change the valuedigits flag from 0 to 1 (or 2).
ErnieJones
Master MS/Extra'er
Posts: 385
Joined: Thu Jul 17, 2014 4:44 pm

Re: ShadowDash, how can I increase the averaging on a gauge?

Post by ErnieJones »

aw113sgte wrote:I have a fuel gauge and it bounces around quite a bit. Is there any way to average the values over a time period?

Secondary question and probably a stretch. The fuel level sensor reads from 14-140 ohms. I am currently using a 500 ohm resistor inline with the sensor so the current draw is kept to a minimum. Unfortunatly this means a full sweep of the sensor only changes the ADC value about 100 (out of 1024). This contributes to the bouncing I'm seeing. Any ideas how to get a larger voltage sweep without resorting to an op-amp or similar?
How is this working for you? I have a motorcycle and I ditched the stock dashboard in favor of a tablet for my MSII module. Problem I'm having now is that I forget to turn off my signals :lol: :oops: but worse yet, I've run out of gas 4 times now and had to duck-walk to a station - sometimes ones that are far away :o

Can you elaborate a little bit on how you created a fuel gage?
Thanks you;
Ernie
aw113sgte
Helpful MS/Extra'er
Posts: 87
Joined: Tue Nov 25, 2014 2:41 pm

Re: ShadowDash, how can I increase the averaging on a gauge?

Post by aw113sgte »

ErnieJones wrote:
aw113sgte wrote:I have a fuel gauge and it bounces around quite a bit. Is there any way to average the values over a time period?

Secondary question and probably a stretch. The fuel level sensor reads from 14-140 ohms. I am currently using a 500 ohm resistor inline with the sensor so the current draw is kept to a minimum. Unfortunatly this means a full sweep of the sensor only changes the ADC value about 100 (out of 1024). This contributes to the bouncing I'm seeing. Any ideas how to get a larger voltage sweep without resorting to an op-amp or similar?
How is this working for you? I have a motorcycle and I ditched the stock dashboard in favor of a tablet for my MSII module. Problem I'm having now is that I forget to turn off my signals :lol: :oops: but worse yet, I've run out of gas 4 times now and had to duck-walk to a station - sometimes ones that are far away :o

Can you elaborate a little bit on how you created a fuel gage?

Code: Select all

[OutputChannels]
     smoothFuelLevel = { smoothBasic(adc7, 50 )-514 }
That is in my custom.ini.
In my dashboard file, I just had a gauge use the smoothFuelLevel value.
I have both a bar gauge and simple text display under it.
ErnieJones
Master MS/Extra'er
Posts: 385
Joined: Thu Jul 17, 2014 4:44 pm

Re: ShadowDash, how can I increase the averaging on a gauge?

Post by ErnieJones »

I should have been more clear. I was thinking along the lines of an overview of how you connected your fuel level sending unit into the ECU and ultimately the dash.
Thanks you;
Ernie
Post Reply