ShadowDash, how can I increase the averaging on a gauge?
Moderators: jsmcortina, muythaibxr
ShadowDash, how can I increase the averaging on a gauge?
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?
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?
-
- 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?
You can make a smoothed OutputChannel in a custom.ini file. There is a smoothing function smoothBasic().
This is what it would look like:
you will want to play around with the number 50 a bit as that drives how many records it smooths over.
This is what it would look like:
Code: Select all
[OutputChannels]
smoothFuelLevel = { smoothBasic( yourCurrentFuelLevelChannel, 50 ) }
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
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
Re: ShadowDash, how can I increase the averaging on a gauge?
Awesome! Worked perfectly, thanks!
Re: ShadowDash, how can I increase the averaging on a gauge?
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).
Edit: Found it, just had to change the valuedigits flag from 0 to 1 (or 2).
-
- 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?
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 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 awayaw113sgte 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?
Can you elaborate a little bit on how you created a fuel gage?
Thanks you;
Ernie
Ernie
Re: ShadowDash, how can I increase the averaging on a gauge?
ErnieJones wrote: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 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 awayaw113sgte 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?
Can you elaborate a little bit on how you created a fuel gage?
Code: Select all
[OutputChannels]
smoothFuelLevel = { smoothBasic(adc7, 50 )-514 }
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.
-
- 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?
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
Ernie