Target flow range for flow control shrinked by 15% from each side, ver. 2.18.2051
This commit is contained in:
parent
68413867ad
commit
82acf60f2e
@ -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<float, float>(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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user