如何做好基于状态的控制

在本系列以前的博客中, we discussed what state-based control is and how it works; its advantages and disadvantages; and how it all fits in the hierarchy of automation. This fourth and final blog of the series discusses the methodology and approaches used for implementing state-based control.

在当今竞争激烈的环境下, 每个人都想要更快, Cheaper, 和更好的, 这可以看作是约束条件:

  • Time
  • Cost
  • Quality

通常, 在一个项目中做到这三点是不可能的, but we can strategically focus on each at various stages to achieve all three. 同样的道理, an efficient and effective state-based control (SBC) work process has three key elements:

  • 敏捷方法
  • 面向对象编程
  • 迭代测试

敏捷编程方法

敏捷方法 uses a set of principles or value comparisons as a guide to help speed us through; thus, 重点是更快. 敏捷宣言如下:

个体和相互作用 流程和工具
工作软件 Over 全面的文档
应对变化 遵循计划
客户协作 合同谈判

While there is value in the items listed on the right, the items on the left have more value. 每一种都有时间上的结果.

个人和交互优先于过程和工具

When projects are confined to detailed processes or are generating all the work using specific tools and methods, we find the 80/20 rule in play – 80% of the work takes 20% of the time, 而另外20%的工作却要花费80%的时间. 为了更好地处理这20%的工作, we can let individuals have decision-making power through team interactions.

工作软件胜过全面的文档

SBC项目经常在文档中陷入困境. While we want to be accurate and complete, we need to get a sense for just how so. 随着战略发展的细节越来越多, 我们就越会发现自己在走兔子的路. 这是人性. 我们用图画来思考. If I say “dog,” you don’t think D-O-G, you get the image of a dog in your mind. If I say, “敏捷的棕色狗,图像变得更加清晰, 但那是因为一张图片胜过千言万语. So, we must focus more on working software and see what the program does to get the picture.

对变化做出反应,而不是遵循计划

Now that we see the general concept, let’s apply the 80/20 rule. 因为变化发生了, plans change; thus, we can see how constantly reworking the plan consumes time while having a set of guard rails saves time.

客户协作优先于合同谈判

Because of the complexity of SBC projects, they are challenging to estimate. Spelling out all the details in a contract becomes time consuming. By collaborating and setting boundaries, we can apply the 80/20 rule.

In doing so, we benefit from the first of our three constraints, time.

面向对象编程

SBC适合面向对象编程. Basic intelligence is built into the templates (library objects) and then leveraged by instancing these objects for each specific use. Thus, each device has both basic intelligence from its library object and specific intelligence from its connected logic.

例如, an Analog Input Object can be called from a template library to build a Level object. The template would contain configuration that allows various levels of alarms (high, low, 高了, low-low), as well as Instrument Fault and Out of Service calculations. In this way, template objects can be configured to match the field devices that they represent. One standard object can be instanced (reused by naming it after each specific device, 如LT-10101)重复.

然后,每个单元都成为智能对象的集合, 每个都包含自己的信息和说明.

In this example, we also have an SFC (step diagram) with Step objects. The information in the steps can be used to operate the other objects in the unit and information from the other objects can be used to transition the steps.

代码可能看起来像这样:

Step.加热IF RxLt.meas > RxLt.AlmL_Sptp AND步骤.fill
MixerDO.cmd IF.混合而不是RxLT.almLL

The Step Transition object takes information from the Level object, 即其测量值和低报警设定值. This tells the process to move from the Fill Step to the Heatup Step. Once the process reaches temperature it moves from heatup to Mix. The Mixer see the step movement AND that the Reactor Low-Low level alarm is not on and turns itself on.

面向对象编程:

  • 模块化代码,使其可重用
  • 允许使用模板和库
  • Allows intelligence to be built into devices, equipment and units

These attributes benefit the second of our constraints, cost.

迭代测试

迭代测试使用分层循环概念. Layered testing refines the product with independent protection layers, improving the quality. 这需要模拟. A medium fidelity simulation with dynamic responses such as emulating feedback signals and process values based on device actions is sufficient. 例如, 计算水箱的液位, 你累积流入和流出之间的差异, where each flow depends on the position of the valve controlling it.

The first layer of testing is the initial debug where the programmer works the process through the steps (states) to fix any programming issues. The next layer of testing is with the manufacturing representative to determine what changes need to be made to fit the needs of the facility. Each of these first two layers may take several cycles to complete. 最后一层是细化程序的操作.

Additional modifications can and should be made during startup, as it is often discovered that what we thought we wanted it to do and what we actually want it to do are not always the same. This iterative or multilayered recycling approach to testing allows:

  • 需要修复的bug
  • 意图有待澄清
  • 程序的完善

These attributes benefit the last of our constraints, quality.

竞争优势

以国家为基础的控制项目很快就能收回成本, giving you a competitive advantage with better asset utilization and improved quality and safety. 使用敏捷方法的三阶段方法, object-oriented programming and iterative testing can make for an amazing project completed on time, 物美价廉.