Interesting temperature controller design. -Advice seek-

Hi to all... And first of all thank of you comments...

This is an interesting desing.... we be using arduino mega, to control not one but two refrigeration units, (a main unit that keep running almost all the time, and a secondary unit, that is in case of an emergency or a heavy load). Each unit is conformed by two main components; the compressor (that on and off on demand of cold) and the evaporator (this will keep almost all the time running to keep the air moving inside the box).

This is a basic control diagram of how to control one unit;

Full Size

The tricky parts;

A test button to test booth units and cooling capacity...

An lcd menu to modify the low and high set points.

An failure variable ( For instance, when a low pressure fail occurs may be just for one or two seconds and then re-start the operation normally, yet this will cause a damage on the long run to the unit... so we need a variable to add all the failures in case there is more than one or two.

Add a delay to the compressor start.- each time the compressor will need to start even if the control has begun to operate, we need to delay the start for a number of seconds (Ex.- 30-3000)

The interesting part;

As I mention earlier on the post, we will have two units, one main unit for the day to day operation, and another in case of the main unit don't run, or there is a huge load, and this lead us to the interesting part;

I'm thinking in using a digital temperature probe, take a sample and wait an "x" time then take another sample, the delta between the two measurements will be the ratio of cooling... and this will give us the "heavy load factor"...

So for instance; If I have lets say 1Ton... that chill at a delta of 1°C/5min this will be "OK" and the main unit resume operation alone...

But, lets say the main unit is low on refrigerant, the load is very hot, or the chiller is at ambient temperature...

1 Ton wil chill at a delta, lets say 1°C/ 10min...

This must alert the system and once the temperature haven't reach the minimum Delta... start the bakcup unit, to help to cool faster the load.

I know there are many considerations, in here, like the limit of BTU per square foot of air, the capacity of the units and the minimum and maximum rate that products can be cool down without stress them. But for the sake of the control, we consider that already calculated by the refrigeration engineer. (aka... myself XD).

HARDWARE;

For this project we will be using this hardware; (will be refreshed along the project)

Hardware

The transients filters will be add along with the contactors coild to avoid high voltage peaks. This was learned in another board I make some time ago. Will be something like this;

Know there will be very interesting because there a 220V control part, a 5v logic coming from the arduino and a 3 or 4 sensors will be hooked up to the arduino (mechanical protections from low pressure, and high pressure control) I dont decide the best way to go on this if I use 220 V to operate an inverse relay or Im use 24VAC and use a couple od diodes and a resistor divider to have a 5VDC to the arduino digital pin.

Well... Currently Im working on the two machines diagram and some others I will upload here.

Thanks for your comments, I have done some like this before but, this is the first time I make something soo complex.

Kind Regards.
-Alex.

Well I'm in the process of creating the dual control flow diagram, I believe will be easier to see and track the specific task each one, so, I divide the big problem in to smaller ones.

This controls will help to track specific problems in subroutines, and to see clearly diagrams of each part of the control. All of them are beta versions, so I might add more stuff once in a while.

Full Size

Full Size

Well... I made the basic squem for two units...
I will leave here, plus the link to see in more detail.

Full Size

Has you can tell, there are some subroutines, I will promptly start to work on each individual piece of code, then name it along the control squares I made early, to know how to assemble to code in one big program, sitill have many doubts and its seems like none concrete question, but I think I got one;

Will be better to program this on a finite state machine, or in a regular void loop?
I know the diagrams shows a void loop configuration, but this tries to exemplifies the decision the program will solve at each state.

Also, and learned form the las time I make an electronic board I will Add a watch dog timmer, to prevent freezing.

Well. For know, I hope some one can keep me in the rigth direction.

Kind Regards.
-Alex.

Alex,

To be honest, I haven't waded through all of your plans, but if you are attempting to interface any equipment operating at high voltages to a humble little 5 v. Arduino, you'd best read up on optoisolators and use those to interface the high voltage stuff to the Arduino.

Good Luck

jrdoner:
Alex,

To be honest, I haven't waded through all of your plans, but if you are attempting to interface any equipment operating at high voltages to a humble little 5 v. Arduino, you'd best read up on optoisolators and use those to interface the high voltage stuff to the Arduino.

Good Luck

Hi and thanks for the reply... Yes the optoisolators come as standard in the 8 relay module, for the outputs.

Now as the inputs I have tree differents paths each one with is individuals pros and cons...
First is to put in series a 220v coil relay and use the no contac to read 5v at the arduino... Simple an don mess the rest of the wiring.

Second... Use 5VDC to pass trough the cables and contacts... Easy and effective but a real mess in the troubleshooting.

Third.- use a 220/24VAC step down transformer... Then use a dividider resistor to get let's say 7vac and then a diode bridge...

Will return with each different desing, but I think the first one is the way to go.

Is fantastic whath this litte boards can do...

Kind Regards.
Alex.

it is not hard to separate those inputs that are friendly and those that will cause damage.

you can use analog input for temperature.
you can use analog input for current if you use a current transducer. this can also give you an on/off for any AC power line.

you have the outputs covered.

what strikes me is that if you monitor compressor power use and run time. discharge pressure and temperature.
super heat and also post condenser, then post evaporator and pressure input
also ambient heat entering the condenser and the discharge temperature of the condenser.
condenser fan power use.

lots of things to monitor, you can calculate BTU evaporator, BTU condenser, I think you can determine charge level of the refrigerant.

certainly unit efficiency.

to address your actual question.

voidloop() vs state machine.

most definitely, you have processes where the State Machine will be the proper choice.

dave-in-nj:
you have the outputs covered.

what strikes me is that if you monitor compressor power use and run time. discharge pressure and temperature.
super heat and also post condenser, then post evaporator and pressure input
also ambient heat entering the condenser and the discharge temperature of the condenser.
condenser fan power use.

lots of things to monitor, you can calculate BTU evaporator, BTU condenser, I think you can determine charge level of the refrigerant.

certainly unit efficiency.

Very certainly a lots of data can help to the equipment to be more efficient .... And if we add a litte wifi module or Ethernet we can stream data to web and have on real time efficiencies and temperatures, event an alert system... But for know I will complete this block of problems.

I must admit you have a quite educated tougth on thath... Are you a refrigeration colleague?

Ok... I was thinking almost the same... Time ago I saw a finit state machine library ... Will sear it.. And start to make the first pieces of code.... I never have done this before... Me wiz can run along?

Thanks for the reply.

-Alex.

Well it was a very busy week... but I start to make some advancements on subrutines.

FullSize

I will start to add some diagrams to show more clearly the idea.

I guess the temperature readings will keep on the main loop...
Even when most of the process are in some FSTM library... I guesss.

Regards.

Hi,
Sorry but none of your images or links work.

If you use REPLY rather than QUICK REPLY and it has an attachment facility, so you can post your sketch and other files as attachments.

At the moment I have very little idea about what you want to accomplish.

Tom.... :slight_smile:

TomGeorge:
Hi,
Sorry but none of your images or links work.

If you use REPLY rather than QUICK REPLY and it has an attachment facility, so you can post your sketch and other files as attachments.

At the moment I have very little idea about what you want to accomplish.

Tom.... :slight_smile:

Hi Tom and thanks for the observation... yes in deed they were some broken link, must be a skydrive problem... still I add an link to see the full size of the image more comfortable.

I remain in wait for your comments.

Thanks a Lot.

-Alex.

Hi
No sorry mate, nothing is displayed the page opens to a clear screen.
And only one image is displayed in your posts, the rest are blank.

Please attach files.

Tom..... :slight_smile:

Jeeeeees something is happening to sky drive, ok ok not a problem, tomorrow morning I will attach all the files... Sorry for the inconvinience I also will leave the sky drive directory in case of new uploads.
Thanks again!
Alex.

Lets see if theres is acces to drive...

Drive folder

Hi,
No problems, the diagrams worked this time.
In the second flowchart you still have two decision diamonds that have three outcomes, but only two are labeled.

Tom..... :slight_smile:

Jess Skeydrive is getting worse... Yet the link of the public folder works and is more fast and dont have to download a thing... They say I have a massive amount of traffic. :o
Ya rite...

I'm currently working on the DeltaT sub-routine I hope will be ready today.

I add some stuff to the drive...

The basic setup ot the ds1820 temperature IC.

The Fritzing file

And here is the sample code;

float Tm_dt1 = 0; //First Temperature Measurement for obtain DeltaT
float Tm_dt2 = 0; //Second Temperature Measurement for Delta T 
float deltaT = 0;   // Delta T or Rate of cooling 
unsigned long Tim_int_dt = 0; //Interval to read Delta T or time between measurements 
unsigned long Dt_time = 0;   //Var to make the delay  
unsigned long current_time = 0; //Time for each loop  


void setup(){

 pinMode(9, INPUT); 
 current_time = millis(); 
 Dt_time = millis(); 
}

void loop(){

current_time = millis(); 

 if( Tm_dt1 == 0){
 Tm_dt1 = digitalRead(9); //Read and store the first temp
 } 


if(current_time - Dt_time => Tim_int_dt){

 Tm_dt2 = digitalRead(9); //Takes the second temp measurement 

 deltaT = Tm_dt2 -Tm_dt1; //Obtain DeltaT or Rate of cooling 

 current_time = millis(); //Re start the cronometer 

}

Is a quick Snipp... Will be ready and tested soon .

Regards.
-Alex.