02-18-15, 12:45 PM | #31 |
Master EcoRenovator
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
|
I convert function input parameter "float PSI" into array index:
//convert PSI to array index work = ((PSI - 30.0) / 10.0); I = work; //drop decimals to get array index, //I is an int (whole number) work is a float (decimals) I use the decimal portion to interpolate between array elements: decimals = work - I; //restore decimals for interpolation between array points Val = R290_Saturation_Temp[I]; //get array value Next_val = R290_Saturation_Temp[I+1]; //get Next array value Span = Next_val - Val; //Calc Span Saturation_Temp = Val + (Span * decimals);//interpolate between array points Code:
float calc_R290_Saturated_Temp(float PSI, int Which_sensor) { //Array element [0] contains Saturation_Temp *F for 30PSI, //Array element [1] contains Saturation_Temp *F for 40PSI,...................> //Array element [27] contains Saturation_Temp *F for 300PSI, //Array element [28] contains Saturation_Temp *F for 310PSI float R290_Saturation_Temp[] = {7.93, 18.80, 28.42, 36.91, 44.59, 51.63, 58.13, 64.21, 69.90, 75.27, 80.35, 85.18, 89.78, 94.19, 98.41, 102.50, 106.40, 110.20, 113.80, 117.30, 120.80, 124.10, 127.30, 130.40, 133.50, 136.50, 139.40, 142.20, 145.00}; float Val, Next_val, Span, Saturation_Temp, decimals, work, low, hi; int I; if (Which_sensor == Sensor_150){ low = 30.0; hi = 150.0; } else{ /*Sensor_300*/ low = 60.0; hi = 300.0; } if ((PSI >= low) && (PSI <= hi)) //Bounds check { // in bounds, continue //convert PSI to array index work = ((PSI - 30.0) / 10.0); I = work; //drop decimals to get array index //I is an int (whole number) work is a float (contains decimals) decimals = work - I; //restore decimals for interpolation between array points Val = R290_Saturation_Temp[I]; //get array value Next_val = R290_Saturation_Temp[I+1]; //get Next array value Span = Next_val - Val; //Calc Span Saturation_Temp = Val + (Span * decimals);//interpolate between array points return (Saturation_Temp); } //end if in bounds else {return (-1);} // error return, out of bounds } // end calc_R290_Saturated_Temp |
02-18-15, 01:00 PM | #32 | |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
|
PT Chart
BBP,
OK, it didn't take as long as I thought, I had saved data from before. Here is the heart of the matter, if you need me to make it into a line of code, let me know. Quote:
Best, -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... |
|
The Following User Says Thank You to AC_Hacker For This Useful Post: | buffalobillpatrick (02-18-15) |
02-18-15, 01:23 PM | #33 | |
Master EcoRenovator
Join Date: Aug 2012
Location: Toronto
Posts: 958
Thanks: 40
Thanked 158 Times in 150 Posts
|
Quote:
|
|
The Following User Says Thank You to Mikesolar For This Useful Post: | buffalobillpatrick (02-18-15) |
02-18-15, 01:32 PM | #34 | |
Master EcoRenovator
Join Date: Aug 2012
Location: Toronto
Posts: 958
Thanks: 40
Thanked 158 Times in 150 Posts
|
Quote:
It is called a flooded evaporator. |
|
02-18-15, 01:40 PM | #35 |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
|
BBP,
I haven't read every post here, but I think that you need an incrementally-variable EEV. The PWM thingy wants square-wave input with varying duty cycle, in order to 'mimic' analog control. I think that an incrementally variable (analog) valve would be better. The EEVs I've seen use a little teeny stepper motor that turns the adjustment screw. -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... |
02-18-15, 01:42 PM | #36 | |
Master EcoRenovator
Join Date: Aug 2012
Location: Toronto
Posts: 958
Thanks: 40
Thanked 158 Times in 150 Posts
|
Quote:
|
|
02-18-15, 01:45 PM | #37 |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
|
Then on with the show...
-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... |
02-18-15, 01:47 PM | #38 |
Master EcoRenovator
Join Date: Aug 2012
Location: Toronto
Posts: 958
Thanks: 40
Thanked 158 Times in 150 Posts
|
Now to just get a program that will monitor subcooling and adjust the valve accordingly. It also has to open it a bit at start up till the temps settles.
|
02-18-15, 02:01 PM | #39 |
Master EcoRenovator
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
|
A/C did I get this right?
How did you come up with such an accurate formula?? Code:
float calc_R290_Saturated_Temp(float x) { float a = -4.03085122205E+001; float b = 1.81496452942E+000; float c = -1.01201804003E-002; float d = 3.05234258195E-005; float e = -3.37963005786E-008; return (a + (b * x) + (c * x*x) + (d * x*x*x) + (e * x*x*x*x)); } // end calc_R290_Saturated_Temp OR Arduino floating point math is a bit in-accurate. I would bet on this option, as Arduino does floating point by actually doing integer add operations. This one line of code: y = ( a + (b * x) + (c * x*x) + (d * x*x*x) + (e * x*x*x*x)); Produces 348 bytes of Arduino object code. At 30PSI: formula = 5.83*F, table = 7.93*F, difference = -2.1*F At 300PSI: formula = 143.75*F, table = 142.2*F, difference = +1.55*F Last edited by buffalobillpatrick; 02-18-15 at 07:08 PM.. |
02-18-15, 06:05 PM | #40 |
Supreme EcoRenovator
|
Here is your datasheet for the ex2. It seems to be a damped solenoid valve with a period of about 15 seconds from full shut to full on. A 6 second period on a pwm would not make it walk around much between pulses.
http://www.emersonclimate.com/europe...EX2__35016.pdf The EX3 and up to EX8 are true stepper motor driven designs. All these EX series valves seem to be PRICEY, if they can be found. |
The Following User Says Thank You to jeff5may For This Useful Post: | buffalobillpatrick (02-18-15) |
|
|