|
@@ -766,7 +766,7 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
|
}else{
|
|
|
|
|
|
current_pressure = calculate_averagepressure();
|
|
|
- current_speed = current_pressure - prev_pressure;
|
|
|
+ current_speed = (current_pressure - prev_pressure)*(1000/interval_time);
|
|
|
prev_pressure = current_pressure;
|
|
|
|
|
|
//qDebug(" PositivePressure_Add, current_pressure : %f target: %f", current_pressure, expect.target);
|
|
@@ -790,13 +790,18 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
|
if((1 == exceed_times) && (stable_count > keep_times)){
|
|
|
count = keep_times+10;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ //阀门密闭性测试阶段,压力达到4.5以上就退出, 不管是上升阶段还是下降阶段
|
|
|
+ if(m_stage == Test_Stage_ValveTest){
|
|
|
+ count = keep_times+10;
|
|
|
+ }
|
|
|
#if 1
|
|
|
|
|
|
- if(exceed_times <= 2){
|
|
|
+ if(exceed_times <= 1){
|
|
|
delay_count = 15*(1000/interval_time);
|
|
|
- }else if(3 == exceed_times){
|
|
|
+ }else if(2 == exceed_times){
|
|
|
delay_count =10*(1000/interval_time);
|
|
|
}else{
|
|
|
delay_count =5*(1000/interval_time);
|
|
@@ -821,9 +826,7 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
|
if(current_pressure >= expect.target && current_pressure < expect.target + 0.01){
|
|
|
count++;
|
|
|
|
|
|
- //if(((false == bOpen_intake) && count >=10*(1000/interval_time))||((stable_count > keep_times)&&(false == bOpen_intake))){
|
|
|
- // count = keep_times+10;
|
|
|
- //}
|
|
|
+ //该区间有点窄,如果存在漏气较快的情况,进气阀关闭后,压力快速下降,很难进入该区间。就会陷入震荡
|
|
|
|
|
|
if(false == bOpen_intake){
|
|
|
//在进气阀关闭,压力回落过程中,两种情况触发加压过程退出
|
|
@@ -844,6 +847,11 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
|
}else{
|
|
|
count=0;
|
|
|
|
|
|
+ //解决 超出稳压时间 且压力下降过快的问题, 第一次低于目标值了也退出
|
|
|
+ if((delay_count == 5*(1000/interval_time)) && (stable_count > keep_times)){
|
|
|
+ count = keep_times+10;
|
|
|
+ }
|
|
|
+
|
|
|
if(delay_count > 0){
|
|
|
delay_count--;
|
|
|
}
|
|
@@ -858,32 +866,32 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(NULL != pPIDouter && NULL != pPIDinner && 0 == delay_count){
|
|
|
+ if(NULL != pPIDouter && NULL != pPIDinner && 0 == delay_count){
|
|
|
|
|
|
- speed_target = pPIDouter->calculate(expect.target, current_pressure);
|
|
|
+ speed_target = pPIDouter->calculate(expect.target, current_pressure);
|
|
|
|
|
|
- //qDebug(" PositivePressure_Add, pPIDinner speed_target:%f, current_speed:%f", speed_target, current_speed);
|
|
|
- double inc = pPIDinner->calculate(speed_target, current_speed);
|
|
|
+ //qDebug(" PositivePressure_Add, pPIDinner speed_target:%f, current_speed:%f", speed_target, current_speed);
|
|
|
+ double inc = pPIDinner->calculate(speed_target, current_speed);
|
|
|
|
|
|
- unsigned short position = bvoffset +inc;
|
|
|
+ unsigned short position = bvoffset +inc;
|
|
|
|
|
|
+ //qDebug(" PositivePressure_Add, position : %d", position);
|
|
|
+ if(bvposition != position){
|
|
|
//qDebug(" PositivePressure_Add, position : %d", position);
|
|
|
- if(bvposition != position){
|
|
|
- //qDebug(" PositivePressure_Add, position : %d", position);
|
|
|
- if(bv.SetPosition(position))
|
|
|
- bvposition = position;
|
|
|
- }
|
|
|
-
|
|
|
+ if(bv.SetPosition(position))
|
|
|
+ bvposition = position;
|
|
|
+ }
|
|
|
|
|
|
- }else{
|
|
|
|
|
|
- if(0 == delay_count){
|
|
|
- qDebug(" PositivePressure_Add, NULL = pPIDouter NULL == pPIDinner ");
|
|
|
- }
|
|
|
+ }else{
|
|
|
|
|
|
- //qDebug(" PositivePressure_Add, NULL = pPIDouter NULL == pPIDinner ");
|
|
|
+ if(0 == delay_count){
|
|
|
+ qDebug(" PositivePressure_Add, NULL = pPIDouter NULL == pPIDinner ");
|
|
|
}
|
|
|
|
|
|
+ //qDebug(" PositivePressure_Add, NULL = pPIDouter NULL == pPIDinner ");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|
|
@@ -1344,6 +1352,14 @@ void TestService::run()
|
|
|
ret_v = Pressure_Keep(m_standard.interval_time, start_value, end_value);
|
|
|
m_step = Test_Step_KeepEnd;
|
|
|
|
|
|
+ double offset = 0;
|
|
|
+ //修正 强制初始压力为 positive_target
|
|
|
+ if(start_value != m_standard.positive_target){
|
|
|
+ offset = m_standard.positive_target - start_value;
|
|
|
+ start_value = m_standard.positive_target;
|
|
|
+ end_value -= offset;
|
|
|
+ }
|
|
|
+
|
|
|
m_tank.m_comparts[m_compartmentid].m_result.sysstart_pressure = start_value;
|
|
|
m_tank.m_comparts[m_compartmentid].m_result.sysend_pressure = end_value;
|
|
|
|
|
@@ -1401,7 +1417,7 @@ void TestService::run()
|
|
|
ret_v = Pressure_Keep(m_standard.interval_time, start_value, end_value);
|
|
|
m_step = Test_Step_KeepEnd;
|
|
|
|
|
|
- float offset = 0;
|
|
|
+ double offset = 0;
|
|
|
//修正 强制初始压力为 0
|
|
|
if(start_value != 0.0){
|
|
|
offset = start_value;
|
|
@@ -1571,7 +1587,7 @@ void TestService::run()
|
|
|
emit sigState(m_compartmentid+1, "加压", "");
|
|
|
QThread::msleep(2000);
|
|
|
|
|
|
- texpect.volume = 0;
|
|
|
+ texpect.volume = 5;
|
|
|
texpect.target = m_devinfo.m_testinfo.m_target;
|
|
|
texpect.timeout = 5*60; //5分钟
|
|
|
ret_v = PositivePressure_Add(texpect);
|