DRAC Recalibration Assistant

sytyguy

Moderated User
I'm teaching a small class on "Intro to C/C++ Programming" and we're into the math phase now (just starting), so I wrote some simple programs in C to show the usage of basic math calculations in functions. Some of the coding is long winded, but I did that to show the steps (some of the code is wrong intentionally, so don't pick apart the code, you programmers
icon_smile.gif
.)

Anywho, the program just allows you to enter tire/gearing info and come up with the input ratio for the DRAC controller so that you can recalibrate it for speedo compensation. I wrote it for the class, but figured it may help some of you (I rounded pi and the input ratio to the sixth decimal place.)

http://www.georgiasyty.com/code/drac.exe

I wrote it for DOS for compatibility reasons. You can see some of the other simple programs in the root directory if you'd like (there's a 1/4 mile calculator, HP calculator, tire tool, etc...) All used to show different things in C.

I debugged the code, but not the math too much. If you spot an error, let me know or make the code change in the raw data yourself and send it to me.

HTHs somebody.

Hood
 

mattw

Active member
Re: DRAC Recalibration Assistant

Pretty cool program.. There was at one point a perl cgi script being hosted somewhere.. It did the same thing but it would also reference the table of the different jumper settings, pick the closest match to your ratio, and tell you how to set the jumpers...


-Matt
 

sytyguy

Moderated User
Re: DRAC Recalibration Assistant

I'll make those changes when we get into pointers and whatnot. Then, I'll develop it into a Windows program when we get to that point. I'll use it as a progressive teaching aid.

Hood
 

turbodig

Active member
Re: DRAC Recalibration Assistant

sytyguy said:
I'm teaching a small class on "Intro to C/C++ Programming" and we're into the math phase now (just starting), so I wrote some simple programs in C to show the usage of basic math calculations in functions. Some of the coding is long winded, but I did that to show the steps (some of the code is wrong intentionally, so don't pick apart the code, you programmers
icon_smile.gif
.)

Anywho, the program just allows you to enter tire/gearing info and come up with the input ratio for the DRAC controller so that you can recalibrate it for speedo compensation. I wrote it for the class, but figured it may help some of you (I rounded pi and the input ratio to the sixth decimal place.)

http://www.georgiasyty.com/code/drac.exe

I wrote it for DOS for compatibility reasons. You can see some of the other simple programs in the root directory if you'd like (there's a 1/4 mile calculator, HP calculator, tire tool, etc...) All used to show different things in C.

I debugged the code, but not the math too much. If you spot an error, let me know or make the code change in the raw data yourself and send it to me.

HTHs somebody.

Hood


You might like this... written in a very c-like language called Winbatch.
(www.winbatch.com)
I like it because it does all the windows dialog stuff for you. (Sorta like VB)


Does turbo compressor map calculations. I posted the link to the exe a while back.



Code:
MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`Turbo Compressor Calculations`
MyDialogX=015
MyDialogY=070
MyDialogWidth=178
MyDialogHeight=200
MyDialogNumControls=026
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`

MyDialog001=`037,175,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`105,175,036,012,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`043,005,030,012,EDITBOX,cid,"262",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog004=`043,035,030,012,EDITBOX,rpm,"2000",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog005=`043,051,030,012,EDITBOX,ambienttemp,"90",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog006=`043,069,030,012,EDITBOX,ambientpress,"14.7",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog007=`043,087,030,012,EDITBOX,boostpress,"20",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog008=`043,105,030,012,EDITBOX,eff,"72",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog009=`043,123,030,012,EDITBOX,ictempdelta,"0",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog010=`001,007,036,016,STATICTEXT,DEFAULT,"Displacement (CID)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog011=`001,037,016,008,STATICTEXT,DEFAULT,"RPM",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog012=`001,049,032,016,STATICTEXT,DEFAULT,"Ambient Temp",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog013=`001,067,036,016,STATICTEXT,DEFAULT,"Ambient Pressure (PSI)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog014=`001,085,036,016,STATICTEXT,DEFAULT,"Boost Pressure (PSI)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog015=`001,103,036,016,STATICTEXT,DEFAULT,"Compressor Efficiency",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog016=`001,125,036,010,STATICTEXT,DEFAULT,"IC Temp Delta",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog017=`081,007,072,008,STATICTEXT,DEFAULT,"Engine Displacement",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog018=`081,039,072,008,STATICTEXT,DEFAULT,"Engine RPM",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog019=`081,053,084,008,STATICTEXT,DEFAULT,"Turbo Intake Air Temp (Deg. F)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog020=`081,069,072,016,STATICTEXT,DEFAULT,"Ambient Air Pressure at Turbo Intake (Absolute)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog021=`081,089,080,008,STATICTEXT,DEFAULT,"Boost Pressure (Gauge Pressure)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog022=`081,109,092,008,STATICTEXT,DEFAULT,"Compressor Efficiency (Percent)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog023=`001,139,164,042,STATICTEXT,DEFAULT,"",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog024=`043,020,030,012,EDITBOX,VE,"100",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog025=`081,023,092,008,STATICTEXT,DEFAULT,"Volumetric Efficiency (Percent)",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog026=`003,023,016,008,STATICTEXT,DEFAULT,"VE",DEFAULT,100,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")

while (1)
;rpm = 2800
;cid = 262
;ambienttemp = 70
;ambientpress = 14.7
;boostpress = 22
;temp = 70
;eff = .78
ambienttempr = ambienttemp + 460
;ictempdelta = 0

effpct = (eff / 100.00)
vepct = (ve / 100.00)

pressratio = (ambientpress+boostpress)/ambientpress
calctempr = ambienttempr + (ambienttempr *(-1 + (pressratio**0.263))/ effpct)
calctemp = calctempr -460 -ictempdelta
cfm = (rpm * cid)/ (3456) * vepct

lbmin = ((ambientpress + boostpress) * cfm * 29)/(10.73 * (calctempr - ictempdelta))

kgsec = (lbmin/60)/ 2.2

MyDialog023=`001,139,164,042,STATICTEXT,DEFAULT,"CFM = %cfm%.%@CRLF%Pressure Ratio = %pressratio% %@CRLF%Airflow in lb/min = %lbmin%. %@CRLF%Airflow in Kg/Sec = %kgsec%. %@CRLF%Outlet Temp = %calctemp%",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")
Endwhile
:cancel

;Message("Calculation Results"," CFM = %cfm%. Airflow in lb/min = %lbmin%. Airflow in Kg/Sec = %kgsec%. Outlet Temp = %calctemp%")
 

sytyguy

Moderated User
Re: DRAC Recalibration Assistant

Schweet....thanks Dig. I had seen that some time ago, but I never followed up on it (I do programming in my spare time - helluva hobby, huh?). Thanks for the reminder.

:tup:

Hood
 
Top