Adding Math Channels to CSV File, Max/Min Values

Discussion on the RaceCapture App - Windows, Android, OSX and Linux.

Moderators: JeffC, stieg

Post Reply
harveyf
Posts: 8
Joined: Fri Aug 30, 2013 12:23 am
Location: New Hill, NC
Contact:

Adding Math Channels to CSV File, Max/Min Values

Post by harveyf »

I am trying to add a math channel to a CSV file. I am using the output of a track session entered into Excel. I add 2 columns in which I attempt to smooth the X and Y accelerometer data using Excel smoothing functions. The resulting values in the Excel file look reasonable. When I upload the resulting file into RaceAnalyzer, it shows the max min values as +/-1000 instead of +/-2. Thus the graphing resolution appears to be destroyed, since the limits of the vertical axis on the graph are +/1000. I reviewed the Excel numbers and there are certainly no numbers greater than the existing values. Certainly none in the range of 1000. I can see the max/min values of 1000 when I import the data but I don't see anything in the raw file that would delineate these values. I am using the same header format as for the existing G loads, with a slightly different name. I don't see any way to change them to +/- 2. Help anyone?
Harvey Ferris

brentp
Site Admin
Posts: 6275
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi Harvey,

What are the column names you're using for the G channels? They should be labeled AccelX, AccelY, AccelZ.

Could you post your sample CSV file here fore review?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

harveyf
Posts: 8
Joined: Fri Aug 30, 2013 12:23 am
Location: New Hill, NC
Contact:

Post by harveyf »

I copied and pasted the names of the existing acceleration columns and changed the name by adding an S to the header name. I did this for X and Y but not G or yaw.

"AccelX"|"G"|30 "AccelXS"|"G"|30 "AccelY"|"G"|30 "AccelYS"|"G"|30 AccelZ|"G"|30 Yaw|"Deg_Sec"|30
-0.127 -0.127 0.143 0.143 0.94 -18.337
-0.089 -0.089 0.241 0.241 1.004 -2.132

So I added 2 acceleration columns. I was hoping to plot both the unsmoothed and the smoothed data together, to see how it worked. Since you asked, I am assuming the format of the column headers somehow assigns the max/min values?
Harvey Ferris

harveyf
Posts: 8
Joined: Fri Aug 30, 2013 12:23 am
Location: New Hill, NC
Contact:

Post by harveyf »

Well Brent, I guess that was a pretty broad hint on your part. I deleted the 2 columns of "unsmoothed raw" data, leaving 4 columns of X, Y, Z and Yaw with your standard headers. The data loaded successfully with limits set at +/2, so that issue is resolved. I gather that you have the limits hardwired somewhere based on these specific headers?

As far as the smoothing effort, I had used exponential smoothing that is part of Excels extended package of formulas. It really did not do what I wanted, the lines are still pretty "squiggly", to use a technical term. I will look for another algorithm.
Attachments
Temp1.jpg
Temp1.jpg (177.59 KiB) Viewed 5006 times
Harvey Ferris

dimondjack
Posts: 101
Joined: Tue Jan 15, 2013 1:37 pm

Post by dimondjack »

Check out this thread:
http://www.autosportlabs.org/viewtopic.php?t=3836

If you want to check out my filtering spreadsheet, you can open/download it here:
https://drive.google.com/file/d/0B9Dlhi ... sp=sharing

The sheet only works if you have the same sampling and cutoff frequency. To get new values, go here:
http://www-users.cs.york.ac.uk/~fisher/ ... /trad.html

(For other filters, go here and choose: http://www-users.cs.york.ac.uk/~fisher/mkfilter/)

You should enter:
1: Butterworth, high pass
2: (leave blank)
3: Order = 2
4: Enter your sample rate
5: Enter your cutoff frequency (where you want all data above to be attenuated) - I would try 1-10 Hz for Accel
6: Leave blank
7: do not tick
8: blank

Hit submit.
Scroll down to "gain at dc". Enter this in "gain"
Scroll down to "recurrence relation" Enter the value before y[n-2] as y0 and the value before y[n-1] as y1.

Your dad should update!

To enter new data, I simply delete the "raw data" from column B, and then paste in my new data. I then copy/paste the values from the "offset corrected" column back in to my data file in an [channel]_filt column and go on my merry way.

Yes, this is manual, to be honest it is incredibly quick once you get it down and I haven't been using the kart much for the past few months. I'm also hoping it ends up in software for future RA's.

harveyf
Posts: 8
Joined: Fri Aug 30, 2013 12:23 am
Location: New Hill, NC
Contact:

Post by harveyf »

Thanks DiamondJack, I'll give it a whirl. Harvey
Harvey Ferris

dimondjack
Posts: 101
Joined: Tue Jan 15, 2013 1:37 pm

Post by dimondjack »

No problem. This solution is definitely a "hack". I may end up just building some code in Matlab, but most people don't have access to it. Let me know if this works out for you.

FYI, the reason that there are two filtered columns in the sheet is because low pass filters add an offset to the data. You run the data through the filter a second time backwards to move the correct data points back in line with your time data.

David

brentp
Site Admin
Posts: 6275
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Be sure to try out the latest firmware (1.2.6) which has accelerometer smoothing built in). If it's not sufficient with what you need, let us know so we can tune it better. In the future we will be adding the ability to configure the filter Alpha.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply