PDA

View Full Version : AFR calculator program



surfersamu
11-19-2013, 01:33 PM
Hey watssup

As an assignment for my java programming class.. I did a program that calculated AFR with the formula that monochrome stated.

NMAFR = DAFR * MAFR / AAFR

To calculate AFR value for your tune. Just one single AFR value at a time. You could do this in excel as well.. is a fairly simple program or function.
You need to java JAVA environment installed other than that is not gonna work... i think.
http://java.com/en/download/index.jsp

This is the code in case you think I am being sneaky and sending you a virus:

import javax.swing.JOptionPane;
public class desiredAfr {

public static void main (String [] args){
double mafr;
do {
mafr=Double.parseDouble(JOptionPane.showInputDialo g("Enter your fuel map AFR: "));
double aafr=Double.parseDouble(JOptionPane.showInputDialo g("Enter your actual AFR: "));
double dafr=Double.parseDouble(JOptionPane.showInputDialo g("Enter your desired AFR: "));

double nmafr=(dafr*mafr)/aafr;

JOptionPane.showMessageDialog(null, "Your new AFR value: "+ String.format("%.2f",nmafr));
}
while(mafr != 0);
}
}

https://www.dropbox.com/s/hnj4gqnerysc4uo/AFR%20Calculator.zip
This is my dropbox link.. when you hit download it might ask you if you really want to download it.. it looks risky.. it only says that because I am sending you and Exectuable file... do not click on discard..just click on the litthe arrow next to it and click: keep.

http://i70.photobucket.com/albums/i117/surfer_samu/afrcalculator_zpsa45ce622.jpg (http://s70.photobucket.com/user/surfer_samu/media/afrcalculator_zpsa45ce622.jpg.html)

Greg E
11-19-2013, 04:49 PM
Awesome!!! Great work!

Since then I came up with an even easier way to tune. Set the fuel table to your desired AFR and use the MAF smoothing table to do the percentage correction. ;)

Chris@Rvengeperformance
11-19-2013, 05:21 PM
this is good, be slightly careful though. Depending on where and how exactly you start a pull the afrs can move just a bit. Me personally I wouldn't go more than 50-70% of the way there in each adjustment, but apparently my caution didn't help me, LOL.

surfersamu
11-19-2013, 10:16 PM
That's pretty cool... !! kind of like a safc.. but then Karmen HZ would be equivalent to Load?

I got a question.. for my AFR values.. I have a NA.

I am trying to make a guide of what AFR values represent on the fuel map.. this is stock afr map.
could you correct me on this picture if you see anything wrong?

http://i70.photobucket.com/albums/i117/surfer_samu/fueldivision_zpsa354dd72.jpg (http://s70.photobucket.com/user/surfer_samu/media/fueldivision_zpsa354dd72.jpg.html)