四、思考题
1、流量对象与液位对象有什么区别?流量控制系统的参数整定要注意 哪些问题? 答:(1)
①流量对象应用流量传感器,对于设定的流量值,系统会在达到 该流 量时以大致稳定的流速往水箱注水;
②液位对象以设定的液位高度为基准,传感器一直对高度进行测量, 达到设定高度后立即停止注水,并一直检测,当液面未达到设定值,
10
再次注水以此反复。
(2)注意数学模型的正确建立,在建模过程中减少盲目性,但是该 方法较为复杂,在过程控制进行中直接进行工程正定,该方法简单, 计算方便,但是参数不一定最佳,但实用;在此采用现场实验整定的 方法,这种方法注意改变比例积分的参数,并有比较性地改变,有比 较好得效果。
附实验程序:
实验二 传感器、执行器实验#include
void main()
{ PT_AIConfig ptAIConfig; PT_AIVoltageIn ptAIVoltageIn; float advalue; float h; float q=0;
FILE *fp=fopen(\ long DriverHandle; ULONG num1=0,num2=0; int count;
11
USHORT over=0;
PT_CounterEventStart ptCounterEventStart; PT_CounterEventRead ptCounterEventRead;
DRV_DeviceOpen(0,&DriverHandle); while(!kbhit())
{ptAIConfig.DasChan=0;//AI 通道 0
ptAIConfig.DasGain=0;//Gain Code,+/-5V
DRV_AIConfig(DriverHandle, (LPT_AIConfig)&ptAIConfig);
//读取指定 AI 通道的电压值
ptAIVoltageIn.chan = 0;//通道 0
ptAIVoltageIn.gain = 0;//Gain Code,+/-5V ptAIVoltageIn.TrigMode = 0; //内部触发
ptAIVoltageIn.voltage = (FLOAT far *)&advalue;//返回电压值 DRV_AIVoltageIn(DriverHandle,(LPT_AIVoltageIn)&ptAIVoltageIn);
printf(\ value=%f!\\n\
ptCounterEventStart.counter=0;
DRV_CounterEventStart(DriverHandle,&ptCounterEventStart);
ptCounterEventRead.counter=0;
ptCounterEventRead.overflow=&over; ptCounterEventRead.count=&num1; DRV_CounterEventRead
(LPT_CounterEventRead)&ptCounterEventRead);
DRV_CounterEventRead (DriverHandle, &ptCounterEventRead); printf(\ Sleep(1000);
ptCounterEventRead.counter=0;
ptCounterEventRead.overflow=&over; ptCounterEventRead.count=&num2; DRV_CounterEventRead
(LPT_CounterEventRead)&ptCounterEventRead);
(DriverHandle,
(DriverHandle,
12
DRV_CounterEventRead (DriverHandle, &ptCounterEventRead); printf(\
count=num2-num1; q=0.0122*count+0.3412; h=advalue*80;
printf(\ fprintf(fp,\ fprintf(fp,\ }
fclose(fp);
DRV_CounterReset(DriverHandle,0); DRV_DeviceClose( &DriverHandle ); }
实验三 系统动态特性的测试
#include
void main() {
long DriverHandle_v;
PT_AIConfig ptAIConfig;
PT_AIVoltageIn ptAIVoltageIn; float advalue;
DRV_DeviceOpen(0,&DriverHandle_v); //打开设备
13
//AI 配置
ptAIConfig.DasChan=0;//AI 通道 0
ptAIConfig.DasGain=0;//Gain Code,+/-5V
DRV_AIConfig(DriverHandle_v, (LPT_AIConfig)&ptAIConfig);
//读取指定 AI 通道的电压值
ptAIVoltageIn.chan = 0;//通道 0
ptAIVoltageIn.gain = 0;//Gain Code,+/-5V ptAIVoltageIn.TrigMode = 0; //内部触发
ptAIVoltageIn.voltage = (FLOAT far *)&advalue;//返回电压值
DRV_AIVoltageIn(DriverHandle_v,(LPT_AIVoltageIn)&ptAIVoltageIn);
long DriverHandle;
ULONG num1=0,num2=0; int count; USHORT over=0;
PT_CounterEventStart ptCounterEventStart; PT_CounterEventRead ptCounterEventRead;
DRV_DeviceOpen(0,&DriverHandle);
ptCounterEventStart.counter=0;
DRV_CounterEventStart(DriverHandle,&ptCounterEventStart);
ptCounterEventRead.counter=0;
ptCounterEventRead.overflow=&over; ptCounterEventRead.count=&num1; DRV_CounterEventRead (DriverHandle, (LPT_CounterEventRead)&ptCounterEventRead);
DRV_CounterEventRead (DriverHandle, &ptCounterEventRead); printf(\ Sleep(1000);
ptCounterEventRead.counter=0; ptCounterEventRead.overflow=&over; ptCounterEventRead.count=&num2;
14