大鹏温湿度的控制与实现(7)

2019-07-13 16:32

洛阳理工学院毕业设计(论文)

SBUF=num2; while(!TI); TI=0; ES=1;}

void TDisp2()

{ uchar num11,num12,num21,num22; num11=num1/100+'0'; num12=(num1/10)+'0'; write_com(0x80+0x40+0x0b);

write_date(num11);

write_com(0x80+0x40+0x0c);

write_date(num12); num21=num2/100+'0';

num22=(num2/10)+'0'; write_com(0x80+0x40+0x0e);

write_date(num21);

write_com(0x80+0x40+0x0f);

write_date(num22);}

void main() { init_1602()

D_init(); send_init();发送

delay(40);

while(1)

{ wendu=readT();

if(wendu<= num1) { BZ=0;

delay(1500); BZ=1;

delay(1500);

28

洛阳理工学院毕业设计(论文)

key5=0;}

if(wendu>num1&&wendu

key5=1;

key6=1;} if(wendu>=num2) { BZ=0;

delay(1500); BZ=1; delay(1500); key6=0;}

if(key1==0)

{ delay(500); num1=num1+10;}

if(key2==0)

{ delay(500); num1=num1-10;}

if(key3==0)

{ delay(500); num2=num2+10;}

if(key4==0)

{ delay(500); num2=num2-10;} while(!key1);

delay(500); while(!key1); TDisp1();

TDisp2();} } void ser() interrupt 4 { RI=0; wendu=SBUF; flag=1;}

29

洛阳理工学院毕业设计(论文)

附录3

#include \

#define uchar unsigned char #define uint unsigned int

uchar tem0 , tem1; uchar temp0 , temp1;

uint f=0; //初值

/****************************************************************************

* 名称: timer0()

* 功能: 定时器1,每50000us中断一次。 * 入口参数:

****************************************************************************/

void timer0() interrupt 1 {

EA =0; TR0=0; TR1=0;

TL0=0xFF; //重装值 定时50000us OX4BFFH TH0=0x4B;

tem0 = TL1; //读数 tem1 = TH1;

TL1=0x00; //定时器1清零 TH1=0x00;

30

洛阳理工学院毕业设计(论文)

f=1; //作标注位

TR0=1; TR1=1; EA=1; }

/****************************************************************************

* 名称: timer1()

* 功能: 计数器,用于计数将555输出的频率,以计数相对湿度。 * 入口参数:

****************************************************************************/

void timer1() interrupt 3 //T1中断,表示计数的频率溢出,超出了可测量的频率范围,显然在这里不可能。所以重新启动。

{

EA =0; TR0=0; TR1=0;

TL0=0x00; //重装值 定时50000us TH0=0x4C;

TL1=0x00; //定时器1清零 TH1=0x00;

TR0=1; TR1=1; EA=1; }

31

洛阳理工学院毕业设计(论文)

外文资料翻译

Introductions to PID Controllers

PID controllers can be stand-alone controllers (also called single loop controllers),controllers in PLCs, embedded controllers, or software in Visual Basic or C# computer programs.

PID controllers are process controllers with the following characteristics: (1) Continuous process control

(2) Analog input (also known as “measurement” or “Process Variable” or “PV”)

(3) Analog output (referred to simply as “output”) (4) Setpoint (SP)

(5) Proportional (P) , Integral (I) , and/or Derivative (D) constants

The absolute error

This means how big is the difference between the PV and SP. If there is a small differencebetween the PV and the SP-then let’s make a small change in the output. If there is a largedifference in the PV and SP-then let’s make a large change in the output. Absolute error is the“proportional” (P) component of the PID controller.

The sum of errors over time

Give us a minute and we will show why simply looking at the absolute error (proportional)only is a problem. The sum of errors over time is important and is called the “integral” (I)component of the PID controller. Every time we run the PID algorithm we add the latest error tothe sum of errors. In other words Sum of Errors=Error1+Error2+Error3 +Error4+….

32


大鹏温湿度的控制与实现(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:BOSS系统行业现状及发展趋势分析

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: