iRacing - calculate average lap time

Discussion and support for i2 Standard and i2 Pro applications

iRacing - calculate average lap time

Postby Gyster on Thu Feb 21, 2019 12:44 pm

Hi. I am learning to use MoTeC in an effort to help me improve car setups in the iRacing Nascar series. One of the things I would like to do is to display lap times in a table view and display the average lap time for the stint in the last column. I have found a couple ways to display lap times, but have not figured out how to add a column to average the values for each lap. The expression "stat_mean" looks promising, but I do not know how to apply this to get the desired result. Any help is certainly appreciated.

Guy Seela
Gyster
 
Posts: 2
Joined: Tue Feb 19, 2019 10:13 am

Re: iRacing - calculate average lap time

Postby Gyster on Sat Feb 23, 2019 10:12 am

Still working on this average lap time problem, I've been trying to use an outing graph to log lap times (and eventually an average). I notice the function LapLastLapTime channel returns the value of the previous lap time for each lap run. Using this, I can capture lap times for lap numbers 2 and up. So now I just need an expression that will average these values. I've tried lots of variations of the stat_mean function like

stat_mean('LapLastLapTime' [s],'Lap Number'>3,'LapCompleted'), but I'm not familiar enough with math expressions.

I thought this expression would return the last lap time (in seconds), while lap number is greater than 3, and reset the value at each lap completed. I think it may be because I do not understand what the lapCompleted channel returns as a value and whether that is valid input for the "reset" function in this expression. I've also tried stat_start, stat_end, stat_max, and stat_min, but...no joy. :oops: Are there any resources that explain what these channels and functions need for input and produce as output? Or is there an expression that someone has already worked out to calculate average lap times?
Gyster
 
Posts: 2
Joined: Tue Feb 19, 2019 10:13 am

Re: iRacing - calculate average lap time

Postby adrian on Mon Feb 25, 2019 9:54 am

I'm not sure what the "LapLastLapTime" or "LapCompleted" channels are but if you have a "Lap Time" (the actual duration of the lap in seconds) channel then stat_mean() will just work with that. It will take include In and Out laps so you will have to take that into account when you set the conditions.

You can also use a Channel Report with the Lap Time channel, set the worksheet data set to 'Outings' and then in the Channel Report, select the Lap Time channel and 'avg'. You will need to delete "Outings:Laps" from the Headings list.

If you don't have a 'Lap Time' channel you can create one using stat_max() on a 'Running Lap Time' channel and resetting it with Range_Change(Outings:Laps).
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm


Return to i2 Data Analysis Software

Who is online

Users browsing this forum: No registered users and 17 guests