Temperature control and Datalogin

ric.de.abreu

Member
Join Date
Aug 2016
Location
Rio de Janeiro
Posts
17
Hi guys

i'm facing a big trouble here.

I'm a intern here and there is no one here to help or guide me in this project.

i just need to build a temperature control and data logger with AB Micrologix 1100.

I have no idea from how to start:confused: as i'm just learning Ladder (alone)o_O, so I really need a BIG help here.🀞🏻

Hardware:
Micrologix 1100
1762-IF4 (will buy)
1762-IQ16 (have but not use)
1762-IQ8W6 (have but not use)

Project Scope:
there are 4 measurements points. 3 outside 1 inside, all taken by PT-100 (4-20 ma)
we just need to log the inside measurement point.

the 3 external points are just for controlling the heating (it can not go too fast, nor the temperature be above a limit).

we will use Advanced HMI for the communication and logging no OPC Server will be used in this project. The Advanced HMI is fine and just needs the PLC part to make all work.

PLEASE, I really need all help i can get in this project.🀞🏻🀞🏻🀞🏻🀞🏻🀞🏻🀞🏻🀞🏻
 
Start by creating a list of the I/O points and a system drawing - Process and Instrumentation or similar. Then create a list of operator adjustments and a list of alarms.

Then write loop descriptions - descriptions in plain language of the operation of each control loop and the sequence of operations.

Then, and only then, start writing the ladder logic. Start with easy items like alarms, then add controls. Don't try to envision the project in total - break it into segments and do each individually as much as possible.
 
So, don't bother with code or the plc yet. Sit down with paper and a pencil and write out how the system would control.

What inputs do you have to work with(The temps here)?
What outputs do you have that can control the process in influence the inputs?

You've got some basic requirements there, temp should not go above a limit and temp shouldn't have too high a rate of change.
Now ask, What happens when it does go above the limit or does change too fast.

Edit - What Tom said!
 
My homework is done. πŸ“š This is the project. latter on I'll add the Thest B witch will be a copy from Teste A

view


view


view


Now guys what is the secons step?🀞🏻🀞🏻🀞🏻🀞🏻
 
So, I see you've defined your IO.

Now what do you have for a loop description or a logic diagram?
In plain terms, Write out how the system should work, this makes it easy to 'translate' to writing your code.

For a simple example -
I want to turn on my heater outputs while my temp input is reading < 50.

In If/Else -
If iTemp < 50
Then oHeat1 = 1, oHeat2 = 1, oHeat3 =1
Else oHeat1 = 0, oHeat2 = 0, oHeat3 = 0

In a sample ladder ( LES I:1.0 50 BST OTE O:0.0/0 NXB OTE O:0.0/1 NXB OTE O:0.0/2 BND ) or see picture.


So you'll need to basically do THIS for your whole program. You have the details, we don't.
If you get stuck on something specific, Folks will be happy to help.

exampleladder.jpg
 
You said you are doing ladder, If you know basic Boolean logic/Boolean algebra it helps a ton.
Stuff in series in your ladder is the equiv of being ANDed together.
Stuff in parallel in your ladder is the equiv of being ORed together.

Your logic, in general, will execute left to right, top down in the ML1100. There are some exceptions, but you probably won't run into them unless you get fancy.

Avoid using the same bit as an output in more than one place.

Document, Document, Document.
 
So, I see you've defined your IO.

Now what do you have for a loop description or a logic diagram?
In plain terms, Write out how the system should work, this makes it easy to 'translate' to writing your code.

For a simple example -
I want to turn on my heater outputs while my temp input is reading < 50.

In If/Else -
If iTemp < 50
Then oHeat1 = 1, oHeat2 = 1, oHeat3 =1
Else oHeat1 = 0, oHeat2 = 0, oHeat3 = 0

In a sample ladder ( LES I:1.0 50 BST OTE O:0.0/0 NXB OTE O:0.0/1 NXB OTE O:0.0/2 BND ) or see picture.


So you'll need to basically do THIS for your whole program. You have the details, we don't.
If you get stuck on something specific, Folks will be happy to help.

i'll white it down in some kind of C or arduino. It is really easier to me.

I do not know bolean logic that well, but i'll give it a try.

thanks a LOT:geek::geek::geek:
 
once again homework done

Once again my homework is done. Of course I did not compile and there are some bugs and errors at the code. But the idea is there.
The temperature will go up in steps, slowly, without overheat.
Security process are there to lock the door when using N2.
When the temperature converge will be a sign in the supervisory showing.
It saves to a file with time stamp.

This is a GREAT start


Code:
/*
This program is a transcription in C of a Ladder program to control our temperature during the stress test.

Analog Cabinet In
Oximeter (4-20mA)

Digital Cabinet In
Presence Detector

Digital Cabinet OUT
Dor Lock
Sign

Analog Test In
External Temperature 1 - T1 (4-20mA)
External Temperature 2 - T2 (4-20mA)
External Temperature 3 - T3 (4-20mA)
Internal Temperature - Temp (4-20mA)

Digital Test OUT (always the same value)
Resistence 1 - R1
Resistence 2 - R2
Resistence 3 - R3

Nitrogen Freezing - N2

Supervisory parameters
Step - Step for hising the temperature
Cicle - Heat our Freeze
Temperature - Set Point

*/

// Includes
#<stdio.h>

//Declarations Global
float Temperature;
float Temp;
float T1;
float T2;
float T3;

int Res;
int N2;

float Oximeter;
int Detector;

int Lock;
int Fan;
int Sign;

//Functions

//Read and comprare the temperature to the parameters from supervisory
int ReadTemp (int Cicle, float Step){
	printf("/nread the temperature 1 from pt-100 on CLP: ")
	scanf("%f", &T1);
	printf("/nread the temperature 2 from pt-100 on CLP: ")
	scanf("%f", &T2);
	printf("/nread the temperature 3 from pt-100 on CLP: ")
	scanf("%f", &T3);
	printf("/nread the internal temperature from pt-100 on CLP: ")
	scanf("%f", &Temp);
	printf("/n");
	
	switch (Cicle){
		case 1: //heat
			if ((T1+T2+T3)/3 <= Temperature and Temp <= Temperature){
				if ((T1+T2+T3)/3 < Temp + Step){
					return 1;
				}
			}
		case 2: //cool
			if ((T1+T2+T3)/3 >= Temperature and Temp >= Temperature){
				if ((T1+T2+T3)/3 < Temp - Step){
					return 1;
				}
			}
	}
	return 0;
}

char *datetime()
{
    char *array = (char*)malloc(sizeof(char)*25);
    time_t result;
    result = time(NULL);
    sprintf(array, "%s", asctime(localtime(&result)));
    array[25] = '\0';
    return array;
}

//Main Program
int main (){
	//Declarations
	int Cicle;
	int OUT;
	int Start;
	int converg;
	
	float Step;
	
	FILE * fp;
	
	fp = fopen ("file.txt", "w+");
	
	printf("/nread the Oximeter value: ")
	scanf("%f", &Oximeter);
	Oximeter = Oximeter * 4/5 //convert from 4-20 to absule value
	
	do{
		//Oximeter function to lock the doors and star the fan
		if (Oximeter<16 ){
			Fan=1;
			if (Detector = 0){  //needs to add a time at this routine just locks after 2 minutes withot detection
				Lock=1;
			}
		}
		OUT=ReadTemp(Cicle, Step);

		// prints Mon Oct 24 09:39:07 2016-27
		fprintf(fp, "%s-%f/n", datetime(), Temp);
		
		if (OUT = 1  and Cicle = 1) {
			Res = 1;
			N2=0;
		}
		else if (OUT=1 and Cicle=2){
			Res = 0;
			N2=1;
		}
		
		if ((T1+T2+T3)/3 = Temp and Temp = Temperature)
			converg = 1;
		
		
		scanf("%f", &Oximeter);
		Oximeter = Oximeter * 4/5	
	} while Start = 1;
	
	fclose(fp);
	
}
return 0;
 

Similar Topics

I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
580
Hey everyone I'm trynna write a program to a WEST PRO16 temperature controller, but it just won't download the program i made using BlueControl...
Replies
0
Views
740
I am at a loss... I have a pasteurizing system that i need to control product temperature with the speed of the product pump. I currently have a...
Replies
11
Views
2,579
Hello PLC community, I'm looking for advice on a project that I'm going to do for the first time with a PLC (Siemens), the system is to do an...
Replies
7
Views
1,569
I have PID temperature control which will connect to Beckhoff EL4004(0v-10v). How I can program it to let EL4004 to control the temperature?
Replies
7
Views
2,623
Back
Top Bottom