Spent Fuel

nano6 years ago

Hello Anton and others,
When are you planning to make the Spent Fuel report accurate? that is because I have meitrack device with a fuel sensor. I can convert sensor data to volume value and keep it with fuel attribute.
I saw that the system computes spent fuel simply like this (firstFuel-lastFuel), this solution doesn't consider the case if the car got charged in the interval.

The general algorithm to compute spent fuel is not that difficult. But the most difficult part is the fuel data, raw data, is so noisy. So, we need definitely some kind of data analysation technique to approach.

I want to know what you are planning.

-Nano

Anton Tananaev6 years ago

There is no plan at the moment, but if you have any good suggestions I'm happy to hear it. I agree that the most difficult part is the noise in the data. I'm not sure if there are any good and simple solutions to that problem.

Darshan6 years ago

Hello Anton,

I have very less grip on Java but want to add some of the suggestion to smooth the fuel data.

  • Moving average(Or some other filtering algorithm) the fuel data to avoid spikes and quick changes.
  • Drop the first few samples at the vehicle ignition on. As the fuel data take some time to stable
  • Also we can has the fuel refilling events as it is much helpful. But that need noise free data.

Above implementation can help to have

  • Accurate fuel stolen event
  • More Accurate fuel consumption data in route summary and Vehicle fuel average too.

Hope for this implementation soon. :-)

Anton Tananaev6 years ago

For feature suggestions you should use GitHub. Also, I would like to hear more specific suggestions on how you want to filter fuel and detect refuelling.

Darshan6 years ago

Filtering criterion:

  1. Just accept the fuel samples once it stable after the ignition ON. Discard the few samples say 10 samples and use last stable reading.
  2. Ignore the Fuel data when the ignition is off. As all the vehicle will send garbage data when the ignition is OFF.
  3. Average the sample based on configurable moving average window. We can use 10 sample window and make it also configurable from configuration.
  4. Refilling event will be based on the configuration as same as fuel stolen event.

Simple Moving Average Example:

public class MovingAverage {
    public static void main(String[] args) {  
        int n = Integer.parseInt(args[0]);
        double[] a = new double[n];
        double sum = 0.0;
        for (int i = 1; !StdIn.isEmpty(); i++) {
            sum -= a[i % n];
            a[i % n] = StdIn.readDouble();
            sum += a[i % n];
            if (i >= n) StdOut.print(sum/n + " ");
        }
    }
}

sorry has this been updated to the latest Traccar version? still not able to get fuel spent value in the report