Integrating fuel rate over 5 min

Discuss issues and ideas you have to configuring displays with PowerVision
jballard

Re: Integrating fuel rate over 5 min

Post by jballard » Thu Apr 07, 2011 9:38 am

Hello Shruti,

Give us a little more information and we will gladly assist you.What kind of design problem are you having and what are you looking to accomplish?

Thanks for posting.

Regards,

Jonathan Ballard
ShrutiK
Posts: 34
Joined: Sun Feb 06, 2011 2:03 am

Re: Integrating fuel rate over 5 min

Post by ShrutiK » Thu Apr 07, 2011 10:24 am

Hello Jonathan,

I've attached my design problem in my post.

Actually, I've to find the integration of "J1939.Engine.Fuel Rate" parameter over the 5,10,15,20 and 25 minutes.The message rate for this parameter is "100msec" and is composed of first 2 bytes of “Fuel Economy” message (Msg rate: 100msec, PGN: 65266).

The parameter is there in database as shown in my attachment.I've created the state diagram too but I couldn't write a script for finding integration of "J1939.Engine.Fuel Rate" parameter over the 5,10,15,20 and 25 minutes.

If you need any other information please let me know so that I can try to provide it to you.

Thanks and regards,
Shruti
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: Integrating fuel rate over 5 min

Post by ksaenz » Mon Apr 11, 2011 9:15 am

This will be easier with fuel used instead of fuel rate.
Take a snapshot of fuel used every minute and compare it with previous snapshots.
If you are not receiving fuel used you can calculate it yourself using fuel rate.
If this doesn't make a lot of sense I can post a sample config.
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: Integrating fuel rate over 5 min

Post by ksaenz » Thu Apr 14, 2011 9:39 am

The attached configuration does the following.

State Machine:
  • Adds the fuel rate and keeps track of the number of samples.
    After 60 seconds it divides the sum over the number of samples to get the average fuel rate over 1 minute.
Script:
  • Add the fuel used up to the last minute plus the average fuel rate divided by 60(minutes) to get the current fuel used.
    Subtract the fuel used x minutes ago from the current fuel used, multiply by 60(minutes) and divide by x (minutes) to get the fuel rate average over the last x minutes.
Page:
  • Instantaneous Fuel Rate
    Sum of Fuel Rate
    Count of Fuel Rate Samples
    Average Fuel Rate every 60 seconds
    Average Fuel Rate last 5 minutes
    Average Fuel Rate last 10 minutes
    Average Fuel Rate last 15 minutes
    Average Fuel Rate last 20 minutes
    Average Fuel Rate last 25 minutes
Attachments
fuel rate over 5 min.db3
(3.04 MiB) Downloaded 27 times