EcoRenovator  

Go Back   EcoRenovator > Improvements > Geothermal & Heat Pumps
Advanced Search
 


Blog 60+ Home Energy Saving Tips Recent Posts


Reply
 
Thread Tools Display Modes
Old 03-24-14, 10:47 AM   #1
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default Design New WTW System Controls Please

This has been copied from 1st thread that was getting too long:

http://ecorenovator.org/forum/geothe...em-please.html



NiHaoMike:
"At 50C (122F) condensing and 10C (50F) evaporating, expect about 3.78 COP (12.9 EER/14.7 SEER) and 64C (147F) discharge temperature."

So I'm interested in is system throughput: can this be estimated from above info?

jeff5may:
Water BTU out = Water BTU in + compressor work done

BBP
Does "50C (122F) condensing" relate to water temp. out?

jeff5may:
"Sort of... Condensing temperature is PT chart value derived from condensing pressure. This is the temp in the condenser where most of the heat transfer will occur. Hot gas discharged from the compressor will quickly de-superheat and settle at this temperature until it is all condensed (latent heat transfer). Past this point, the liquid cools rapidly (sensible heat transfer)."

BBP
"BTW, how do I control condensing temperature? Is it by controlling evaporator input temp/flow?"

jeff5may:
"Condensing temp follows condensing pressure. Condensing pressure follows many things, mainly water temps and flow rates in heat exchanger, compressor discharge pressure, TXV flow rate,etc. Since it is not controlled by a pressure control valve, it is free to do what it wants (until it trips a high pressure limit - bad thing)."


BBP
"Is this the condenser HX your talking about? "mainly water temps and flow rates in heat exchanger"

I don't think I want it Running-Wild, not sure

I want to control the maximum temperature of the water ouput from condenser?

I'm pretty sure I could via a variable speed pump on ouput water from condenser. Increase speed would drop temp.
Or
As in: controlling evaporator input water temp./flow
Or
As in: controlling TXV bulb temp up or down with Thermoelectric Peltier Cooler/heater
or power resistor for heating, via Arduino
Any Ideas?"

"I have been thinking of a simple servo system: I have a high quality adjustable Fenwall thermal switch, make on rise. Mount it on outside of compressor output tube."

If thermal sw. senses high temp. (adjustable) have it power a power resistor that is in contact with TXV bulb. As bulb warms up the TXV opens more.



NiHaoMike "You'll want to have a PID loop controlling the superheat, not just on off. The amount of heat needed to "shift down" the superheat to the correct amount will depend on many factors."



jeff5may"IMHO, adding intentional superheat or subcooling to the equation is"
1. Playing with danger
2. Not very effective (SENSIBLE HEAT TRANSFER)
3. Too easy

That is , if your compressor and heat exchangers can do their respective jobs, it is best to match flow rates rather than add more variables. The refrigerant circuit shouldn't need to be forced to run away from it's closed-loop operation.

Here's what works for me. Regardless of whether I use capillary tubes or TXV for metering, I set my system charge during summer conditions. Above a certain temperature, a TXV acts as a fixed-orifice device (usually 50-60 degF depending on sensing bulb charge) and superheat increases naturally. There is a maximum operating pressure, disclosed by mfr., above which the valve is always open full bore. This property is built in as another fail-safe to keep the head pressure from soaring into the range where it can damage the compressor.

After the charge is set (hot condenser), I set the superheat on a TXV under winter conditions. I get up in the morning, before it gets too hot outside, and turn the evaporator to ice by blocking off the airflow sufficiently. I take PT readings, and adjust the TXV slightly. Remove blockage, watch what happens. If superheat is off, I adjust again. A little bit of TXV adjustment goes a long way. Also, during low temp, low airflow conditions (frosting of coil) is the time the evaporator is most likely to flood.

After setting system charge and TXV, I focus my attention on airflow. Usually, with the window shakers, there is much more airflow outdoors than indoors. When it gets cold outdoors, there is still too much airflow indoors to get warm enough air temp thru the condenser. I block off a portion of the indoor coil to force a temperature rise. This is the "Ghetto Hyper-Heat Mode". And it actually works, too."


NiHaoMike,
"That will net a lower efficiency unless you're dealing with a cap tube system that won't operate properly with too low of a condensing temperature. And that would be nowhere as efficient as doing it right with a TXV."


Last edited by buffalobillpatrick; 03-24-14 at 11:02 AM..
buffalobillpatrick is offline   Reply With Quote
Old 03-24-14, 11:12 AM   #2
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

NiHaoMike "You'll want to have a PID loop controlling the superheat, not just on off. The amount of heat needed to "shift down" the superheat to the correct amount will depend on many factors."

I think I can steal some ideas & code on PID on Arduino.
Could you list the factors in order of importance?

From Wikipedia:
"A proportional-integral-derivative controller (PID controller) is a control loop feedback mechanism (controller) widely used in industrial control systems. A PID controller calculates an "error" value as the difference between a measured process variable and a desired setpoint. The controller attempts to minimize the error in outputs by adjusting the process control inputs.
The PID controller algorithm involves three separate constant parameters, and is accordingly sometimes called three-term control: the proportional, the integral and derivative values, denoted P, I, and D. Simply put, these values can be interpreted in terms of time: P depends on the present error, I on the accumulation of past errors, and D is a prediction of future errors, based on current rate of change.[1] The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve, a damper, or the power supplied to a heating element.
In the absence of knowledge of the underlying process, a PID controller has historically been considered to be the best controller.[2] By tuning the three parameters in the PID controller algorithm, the controller can provide control action designed for specific process requirements. The response of the controller can be described in terms of the responsiveness of the controller to an error, the degree to which the controller overshoots the setpoint, and the degree of system oscillation. Note that the use of the PID algorithm for control does not guarantee optimal control of the system or system stability.
Some applications may require using only one or two actions to provide the appropriate system control. This is achieved by setting the other parameters to zero. A PID controller will be called a PI, PD, P or I controller in the absence of the respective control actions. PI controllers are fairly common, since derivative action is sensitive to measurement noise, whereas the absence of an integral term may prevent the system from reaching its target value due to the control action."
buffalobillpatrick is offline   Reply With Quote
Old 03-24-14, 01:43 PM   #3
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

http://playground.arduino.cc/Code/PI...y#.UzGkRY7FVaE

Code:
/********************************************************
 * PID Adaptive Tuning Example
 * One of the benefits of the PID library is that you can
 * change the tuning parameters at any time.  this can be
 * helpful if we want the controller to be agressive at some
 * times, and conservative at others.   in the example below
 * we set the controller to use Conservative Tuning Parameters
 * when we're near setpoint and more agressive Tuning
 * Parameters when we're farther away.
 ********************************************************/

#include <PID_v1.h>

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Define the aggressive and conservative Tuning Parameters
double aggKp=4, aggKi=0.2, aggKd=1;
double consKp=1, consKi=0.05, consKd=0.25;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint, consKp, consKi, consKd, DIRECT);

void setup()
{
  //initialize the variables we're linked to
  Input = analogRead(0);

  Setpoint = 100; //.…………………..MODIFY TO MATCH COMPRESSOR OUTPUT TEMP DESIRED

  //turn the PID on
  myPID.SetMode(AUTOMATIC);
}

void loop()
{
  Input = analogRead(0); //.…………………………………………...READ COMPRESSOR OUTPUT TEMP

  double gap = abs(Setpoint-Input); //distance away from setpoint
  if(gap<10)
  {  //we're close to setpoint, use conservative tuning parameters
    myPID.SetTunings(consKp, consKi, consKd);
  }
  else
  {
     //we're far from setpoint, use aggressive tuning parameters
     myPID.SetTunings(aggKp, aggKi, aggKd);
  }

  myPID.Compute();
  analogWrite(3,Output); //.……………………..CONTROL GATE OR BASE OF POWER TRANSISTOR
} //.…………………………………………………………...THAT HEATS TXV BULB

Last edited by buffalobillpatrick; 04-04-14 at 12:38 PM..
buffalobillpatrick is offline   Reply With Quote
Old 03-25-14, 10:18 AM   #4
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Somewhere I saw a heat pump control flow chart, now I can't find it?

Time delay-on-make for the compressor & SSR are not very expensive cost.

Arcking contactor is bad idea around propane.

BBP

http://ecorenovator.org/forum/attach...1&d=1395760686
Attached Thumbnails
Click image for larger version

Name:	IMG_2659.jpg
Views:	1136
Size:	481.8 KB
ID:	4182  

Last edited by buffalobillpatrick; 03-25-14 at 11:18 AM..
buffalobillpatrick is offline   Reply With Quote
Old 03-25-14, 10:31 AM   #5
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Replace light bulb with power resistor on TXV bulb.


http://ecorenovator.org/forum/attach...1&d=1395761409
Attached Thumbnails
Click image for larger version

Name:	tip120-lightbulb1-400x225.jpg
Views:	1979
Size:	11.9 KB
ID:	4183  
buffalobillpatrick is offline   Reply With Quote
Old 03-25-14, 10:54 AM   #6
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

FROM Ko_deZ post #1172 in Manifesto thread:

"This is what you need to do for temperature sensors:

For X number of sensors you need:
2 1N914 diodes
X LM35
X 18kOhm resistors

And some whire. Standard twisted pair or a coaxial cable or whatever you like. If the cable is very long ( > 10 meters ), I would add a small capacitor across the sensor and between output signal and ground all the way out by the sensor, as well as one between ground and signal at the arduino, just to remove any noise that is picked up along the way.

LM35 - Precision Centigrade Temperature Sensor

There are loads of differenty types of temperature sensors, but this one is very easy to use. Also, it gives you a quite accurate temperature range of -55C to +150C. Unfortunately the resolution is not very good, but it is more than good enough for our use.

For the output relays, you need to do like this:

http://www.arduino.cc/playground/upl...ing/relays.pdf

You can use any digital output except 1,2 and 13. I use 13 as a status diode thingy. You will see in the code comments. It is on for either 1, 2, 3 or 4 seconds in a 5 second period to indicate which state it is in.
If you wonder why A0 is connected to the two diodes, that is to get an input reference, as this temperature sensor gives an output signal that is 0V compared to ground at 0C, and 10mV up or down is one C. Analog input 0 will be reference voltage for the temperature sensors. You also get these with Farenheit I believe, in that case, some of the numbers must be changed. Get the Celcius, it is the logical way of measuring temperature anyway

The text at the start should explain most of it. I did leave out a few settings, and I don't utilize the indoor and outdoor temperature. I just left the readings in there so that you could add the probes and get a reading on the serial interface.

WARNING: NOT TESTED IN REAL LIFE!
I did do some simple testing here with a breadboard, but that is the complete extent of it.

Allright, here is the code:"

Code:
/* First some legal mumbo jumbo:

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.


 * This is a crude implementation for a state for controlling a
 * ground souce heat pump machine.
 *
 * Written by Morgan Tørvolt <morgan@torvolt.com>.
 *
 * Analog inputs:
 *
 * T1 - indoor temperature, connects to A1
 * T2 - outdoor temperature, connects to A2
 * T3 - accumulator tank temperature, connects to A3
 * T4 - ground loop temperature out, connects to A4
 *
 * Digital outputs:
 *
 * D3 - Relay for ground loop water pump
 * D4 - Relay for warm side water loop to accumulator tank
 * D5 - Relay for starting the heat pump
 *
 * Defined settings for temperatures and such. Set those below this comment section
 *
 * TEMP_TYPE    : CELCIUS or FARENHEIT
 * TEMP_START   : T3 temperature for when the HP should start
 * TEMP_STOP    : T3 temperature for when the HP should stop
 * TEMP_SHUTOFF : T4 temperature that is critically
 *                cold (freezing) and the HP should stop
 * DELAY_BOOT   : Time to wait when powering up in seconds
 * DELAY_START  : How long to run the water pumps before turning
 *                on the HP in seconds
 *
 * State 0: All off
 *   Wait 2 minutes before doing anything. Blink diode 1 second on and 1 second off
 *   Go to state 1 after two minutes
 * State 1:
 *   If T3 < TEMP_START, go to state 2
 *   Blink diode on 2 sek, off 1 sek
 * State 2:
 *   Turn on D3 and D4 (start water pumps), leave D5 off (HP)
 *   Wait for 2 minutes, then go to state 3
 * State 3:
 *   If T4 > TEMP_SHUTOFF and T3 < TEMP_STOP, leave HP and water pumps running using D3, D4 and D5
 *   If T4 < TEMP_SHUTOFF or T3 > TEMP_STOP, jump to state 1
 *
 */

enum { CELCIUS, FARENHEIT };

#define TEMP_TYPE       CELCIUS
#define TEMP_START      40
#define TEMP_STOP       50
#define TEMP_SHUTOFF    1
#define DELAY_BOOT      120
#define DELAY_START     120

// General program code. Go further down
// if you don't want to know what is going on
// in the background

void blinkDiode( int on, int period )
{
  if( ( ( millis() / 1000 ) % period ) < on )
  {
    digitalWrite( 13, HIGH );
  }
  else
  {
    digitalWrite( 13, LOW );
  }
}

float getTemperature( int input )
{
  int raw = static_cast< int >( analogRead( input ) ) - static_cast< int >( analogRead( A0 ) );
  switch( TEMP_TYPE )
  {
  case CELCIUS:
    // 1024 states across 5V gives 4.8828 mV per step. For celcius, 10 mV = 1C, so we multiply by 0.48828 to get celcius
    return raw * 0.48828;
  case FARENHEIT:
    // °F = (°C × 9/5) + 32
    return ( raw * 0.8789 ) + 32;
  }
  // This should never happen
  return 0;
}

void setOutputs( int output_3, int output_4, int output_5 )
{
    digitalWrite( 3, output_3 );
    digitalWrite( 4, output_4 );
    digitalWrite( 5, output_5 );
}

void setup()
{
  // declare all digital pins as output pins:
  for( int i = 2; i <= 13; ++i )
  {
    pinMode( i, OUTPUT );
    digitalWrite( i, LOW );
  }

  Serial.begin( 9600 );
}

int           state      = 0;   // We start in state 0
unsigned long waitUntil  = 0;
bool          diodeState = 0;

 void loop()
{
  delay( 50 ); // No need to rush things, and also make sure we don't overflow the serial interface
  Serial.print( "State: " );
  Serial.print( state );
  Serial.print( " Temps: " );
  Serial.print( getTemperature( A1 ) );
  Serial.print( " " );
  Serial.print( getTemperature( A2 ) );
  Serial.print( " " );
  Serial.print( getTemperature( A3 ) );
  Serial.print( " " );
  Serial.println( getTemperature( A4 ) );
  switch( state )
  {
  case 0:
    setOutputs( LOW, LOW, LOW );
    if( millis() > DELAY_BOOT*1000 )
    {
      state = 1;
    }
    blinkDiode( 1, 5 ); // on 1 of 5 seconds
    break;
  case 1:
    setOutputs( LOW, LOW, LOW );
    if( getTemperature( A3 ) < TEMP_START )
    {
      waitUntil = millis() + DELAY_START * 1000;
      state = 2;
    }
    blinkDiode( 2, 5 ); // on 2 of 5 seconds
    break;
  case 2:
    setOutputs( HIGH, HIGH, LOW );
    if( millis() > waitUntil && millis() - waitUntil < 20000 ) // Just making sure that things does not get screwed up when the unsigned long overflows.
    {
      state = 3;
    }
    blinkDiode( 3, 5 ); // on 3 of 5 seconds
    break;
  case 3:
    setOutputs( HIGH, HIGH, HIGH );
    if( getTemperature( A3 ) > TEMP_STOP || getTemperature( A4 ) < TEMP_SHUTOFF )
    {
      state = 1;
    }
    blinkDiode( 4, 5 ); // on 4 of 5 seconds
    break;
  }
}
I like the "blink diode" feedback, I have done that years ago when I had no other way to communicate from microcode.


Has anyone implemented this???

BBP

Last edited by buffalobillpatrick; 04-04-14 at 12:40 PM..
buffalobillpatrick is offline   Reply With Quote
Old 03-25-14, 11:54 AM   #7
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Code:
For 120VAC 1phase heater or motor PWM control: 

Arduino: use zero crossing interrupt from (IL250), delay from 0 to 8.3 MS (0 = most power), use MOC3020 (Random-phase optoisolator Triac driver) to fire Triac (BTA-12-600)

TOTALLY UNTESTED!!

#include <TimerOne.h>	// Avaiable from Arduino Playground - Timer1

#define AC_PIN 8	            // Output to Opto AC Triac

#define LED_PIN  13                // the number of the LED pin

int   potPin = 0;    // analog input pin A0 for the time delay potentiometer

float potval = 0.0;  // variable to store pot value

//#define VERBOSE 0	          

volatile byte STEP = B11111111;	      	// steps thru code
                                                       
#define FREQ 60.0 	                                              // 60Hz power in USA

float period = 1000000.0 / (2 * FREQ);  //Timer-one PWM period in uS, 60Hz = 8333 (usec)



void setup()
{
    Serial.begin(9600);
    
    delay(10000);

    Serial.println("------ AC Motor Control ---");
  
 
// potentiometer wiper (middle terminal) connected to analog pin 2
// outside leads to ground and +5V 

   potval = analogRead(potPin);               // read the value from the pot
   delay(2);                                  //wait for analogread to finish  

   Serial.print("raw pot value = ");   
   Serial.println(potval);      
 
   potval = mapfloat(potval, 0.0, 1023.0, 0.0, period); // map to 8333.3 microsec
   
   Serial.print("Delay from zero cross to Fire Triac in microseconds = ");
   Serial.println(potval); 
 
    
    pinMode(AC_PIN, OUTPUT);		// Set the Triac fire pin 9 as output

    pinMode(LED_PIN, OUTPUT);

    Timer1.initialize(potval);

    Timer1.disablePwm(9);
    Timer1.disablePwm(10);

   delay(1000);
} 


void Zero_cross_ISR()	        	// zero crossing Interrupt
{			
   STEP = B00000001;
}



void FireTriac_ISR()			//time to fire BTA12-600 AC Triac
{
   int w; 
   
   digitalWrite(AC_PIN,HIGH);      	//turn on trigger

   for (w = 0; w < 100; w++){}          //delay about  100uS
   
  // analogRead(1);                    //delay about 100us   

   digitalWrite(AC_PIN,LOW);            //turn off trigger

   STEP = B00000010;  
}



float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}



void loop() 
{ 
   STEP = B00000000;             
 
   attachInterrupt(1, Zero_cross_ISR, RISING); 	// Attach Interrupt for Zero Cross Detection (IRQ1 is Pin 3)
 
   while (STEP != B00000001){}		//hang until zero cross interrupt sets STEP to 1
 
 // Serial.println(" Zero cross interrupt happened ");

   detachInterrupt(1);	
  
   Timer1.restart();	         

   Timer1.attachInterrupt(FireTriac_ISR, potval);

   while (STEP != B00000010){}		//hang until fireTriac interrupt sets STEP to 2

 // Serial.println(" Triac fired interrupt happened ");

   Timer1.detachInterrupt();
      					 
} 	//end main loop
BBP

Last edited by buffalobillpatrick; 04-04-14 at 12:41 PM..
buffalobillpatrick is offline   Reply With Quote
Old 03-25-14, 02:52 PM   #8
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Parts shipment from Surplus City came.

Thanks to their brief incomplete description, looks like I bought a TXV that is not adjustable! Great





http://ecorenovator.org/forum/attach...1&d=1395776988

http://ecorenovator.org/forum/attach...1&d=1395776988
Attached Thumbnails
Click image for larger version

Name:	IMG_2660.jpg
Views:	1180
Size:	480.1 KB
ID:	4188   Click image for larger version

Name:	IMG_2661.jpg
Views:	1230
Size:	523.7 KB
ID:	4189  

Last edited by buffalobillpatrick; 03-25-14 at 02:54 PM..
buffalobillpatrick is offline   Reply With Quote
Old 03-25-14, 03:32 PM   #9
NiHaoMike
Supreme EcoRenovator
 
NiHaoMike's Avatar
 
Join Date: Oct 2008
Location: Austin, TX
Posts: 1,154
Thanks: 14
Thanked 257 Times in 241 Posts
Default

Most likely, the superheat will be set right where it needs to be.

__________________
To my surprise, shortly after Naomi Wu gave me a bit of fame for making good use of solar power, Allie Moore got really jealous of her...
NiHaoMike is offline   Reply With Quote
The Following User Says Thank You to NiHaoMike For This Useful Post:
buffalobillpatrick (03-25-14)
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Ad Management by RedTyger
Inactive Reminders By Icora Web Design