diff --git a/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs b/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs index 9c29d22dc..af7b20edc 100644 --- a/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs +++ b/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs @@ -24,7 +24,7 @@ namespace TBF.BenchControl.Elde.RegulValve readonly IFlowMeter flowMeter; readonly float requiredFlowLo; readonly float requiredFlowHi; - readonly float requiredFlowAve; + readonly float reqFlowAve; readonly float pidCoef; readonly int timeout; readonly bool leaveMeasurementRunning; @@ -92,9 +92,9 @@ namespace TBF.BenchControl.Elde.RegulValve nominalFlow = flowMeter.NominalFlow; - this.requiredFlowLo = requiredFlowLo; - this.requiredFlowHi = requiredFlowHi; - this.requiredFlowAve = (requiredFlowLo + requiredFlowHi) / 2.0f; + this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2.0f; + this.requiredFlowLo = (0.7F * requiredFlowLo) + (0.3F * this.reqFlowAve); /// Move the lower limit 15% of the range up + this.requiredFlowHi = (0.7F * requiredFlowHi) + (0.3F * this.reqFlowAve); /// Move the upper limit 15% of the range down this.pidCoef = pidCoef; if (flowBox == null) throw new ArgumentNullException("flowBox"); @@ -155,7 +155,7 @@ namespace TBF.BenchControl.Elde.RegulValve void StoreTargetPosition(float avgReqFlow, float actPosition) { - if (!regulValve.Dict.ContainsKey(requiredFlowAve)) + if (!regulValve.Dict.ContainsKey(reqFlowAve)) { regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); } @@ -173,13 +173,13 @@ namespace TBF.BenchControl.Elde.RegulValve if (flow != 0) { flowBox.Val = flow; - if (flow >= requiredFlowAve) currentReqFlowHi = requiredFlowAve; /// Decrease upper limit - if (flow <= requiredFlowAve) currentReqFlowLo = requiredFlowAve; /// Increase lower limit + if (flow >= reqFlowAve) currentReqFlowHi = reqFlowAve; /// Decrease upper limit + if (flow <= reqFlowAve) currentReqFlowLo = reqFlowAve; /// Increase lower limit } flowWithinBoundsTime = 0; - if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(requiredFlowAve, out targetPositionLo, out targetPositionHi)) + if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi)) { log.InfoFormat("SetFlowOp:Start() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}", regulValveNr, flowMeter.Idx1, currentReqFlowLo, currentReqFlowHi, targetPositionLo, targetPositionHi); @@ -231,7 +231,7 @@ namespace TBF.BenchControl.Elde.RegulValve { flowWithinBoundsTime = 0; - if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(requiredFlowAve, out targetPositionLo, out targetPositionHi)) + if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi)) { log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}", regulValveNr, flowMeter.Idx1, currentReqFlowLo, currentReqFlowHi, targetPositionLo, targetPositionHi); @@ -396,19 +396,19 @@ namespace TBF.BenchControl.Elde.RegulValve if (regulValve.RegulValveCfg.StoredPositionReuse) { float storedPosition; - if (regulValve.Dict.TryGetValue(requiredFlowAve, out storedPosition)) + if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition)) { /// update the stored valve position - StoreTargetPosition(requiredFlowAve, (rvPosition + storedPosition) / 2.0f); + StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f); log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position", - regulValveNr, requiredFlowAve, rvPosition.ToString("F1"), storedPosition); + regulValveNr, reqFlowAve, rvPosition.ToString("F1"), storedPosition); } else { /// store the valve position - StoreTargetPosition(requiredFlowAve, rvPosition); + StoreTargetPosition(reqFlowAve, rvPosition); log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% <--- Storing a new position", - regulValveNr, requiredFlowAve, rvPosition.ToString("F1")); + regulValveNr, reqFlowAve, rvPosition.ToString("F1")); } } diff --git a/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs b/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs index c00ba22c0..282b58792 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs @@ -102,9 +102,9 @@ namespace TBF.BenchControl.Elde.RegulValveCoax nominalFlow = flowMeter.NominalFlow; - this.finalReqFlowLo = requiredFlowLo; - this.finalReqFlowHi = requiredFlowHi; this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2; + this.finalReqFlowLo = (0.7F * requiredFlowLo) + (0.3F * this.reqFlowAve); /// Move the lower limit 15% of the range up + this.finalReqFlowHi = (0.7F * requiredFlowHi) + (0.3F * this.reqFlowAve); /// Move the upper limit 15% of the range down this.pidCoef = pidCoef; this.measuredFlow = measuredFlow; this.reTryCommands = reTryCmds; diff --git a/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs b/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs index 5ee986b54..211298229 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs @@ -108,10 +108,10 @@ namespace TBF.BenchControl.Elde.RegulValveTandem nominalFlow = flowMeter.NominalFlow; - this.finalReqFlowLo = requiredFlowLo; - this.finalReqFlowHi = requiredFlowHi; this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2.0f; - this.pidCoef = pidCoef; + this.finalReqFlowLo = (0.7F * requiredFlowLo) + (0.3F * this.reqFlowAve); /// Move the lower limit 15% of the range up + this.finalReqFlowHi = (0.7F * requiredFlowHi) + (0.3F * this.reqFlowAve); /// Move the upper limit 15% of the range down + this.pidCoef = pidCoef; this.measuredFlow = measuredFlow; this.timeout = timeout; diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index db126dc82..a472dd2c7 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.18.1050.0")] -[assembly: AssemblyFileVersion("2.18.1050.0")] +[assembly: AssemblyVersion("2.18.1051.0")] +[assembly: AssemblyFileVersion("2.18.1051.0")]