None Notebook

This notebook contains material from cbe30338-2021; content is available on Github.

< 4.0 Process Analytics | Contents | Tag Index | 4.2 State Estimation >

Open in Colab

Download

4.1 Data/Process/Operational Historian

4.1.1 Introduction

4.1.1.1 Terminology

4.1.1.2 Major Vendors of Data Historians

Data historians is about a $1B/year market globally, poised to grow much larger with the emerging Industrial Internet of Things (IIoT) market.

4.1.1.3 Example: OSIsoft PI System

4.1.1.4 Process Analytics

Process analytics refers to analytical tools that use the data historian to provide usable information about the underlying processes.

4.1.2 The tclab Data Historian

The tclab Python library support the Temperature Control Lab includes a very basic and no-frills implementation of a time-series data base. The purposes of the data historian are to

Documentatiion is available for the tclab Historian and associated Plotter modules.

Historian is implemented using SQLite, a small, self-contained SQL data system in the public domain. SQLite was originally developed in 2000 by D. Richard Hipp who was designing software for a damage-control systems used in the U.S. Navy aboard gui}ded missile destroyers. Since then it has become widely used in embedded systems including most laptops, smartphones, and browsers. If you used Apple photos, messaging on your smartphone, GPS units in your car, then you've used SQLite. It estimated there are over 1 trillion SQLite databases in active use. Much of the success is to due to the licensing terms (free!) and an extraordinarily level of automated code testing assuring a high level of reliability.

Below we will introduce useful capabilities of the Historian that will prove useful as we explore more sophisticated control algorithms and strategies.

4.1.2.1 Data Logging

4.1.2.1.1 Creating a log

An instance of a data historian is created by providing a list of data sources. An instance of a lab created by TCLab() provides a default list of sources in lab.sources.

4.1.2.1.2 Accessing Data using .columns and .fields

There are several approaches to accessing the data that has been recorded using the historian. Perhaps the most straightforward is to access the 'tags' with h.columns and to access the values with h.fields as shown here.

4.1.2.1.3 Accessing Data by Name logdict

Often you only need data corresponding to specific tags. You can access the data directly using .logdict[].

4.1.2.1.4 Accessing Data using pandas

The Python pandas library provides an enormous range of commonly tools for data analysis, it is among the most widely used libraries by data scientists. Data collected by the historian can be converted to a pandas data frame with one line of code.

4.1.2.1.5 Specifying additional sources

As we develop increasingly complex control algorthms, we will wish to record additional data during the course of an experiment. This is done by specifying data sources. Each source is defined by a (tag, fcn) pair where tag is string label for data, and fcn is a function with no arguments that returns a current value. An example is

['Q1', lab.Q1]

where Q1 is the tag, and lab.Q1() returns the current value of heater power reported by the hardware.

The following cell presents an example where two setpoints are provided for two control loops. The setpoint tags are SP1 and SP2, respectively. Setpoint SP1 is specified as a Python constant. The historian requires a function that returns the value of the which is a function of time. This has to be

['SP1', SP1

4.1.2.2 Persistence

4.1.2.2.1 Saving to a file

4.1.3 Plotter

The Plotter class provides a real-time graphical interface to an historian. It provides some simple facilities for

< 4.0 Process Analytics | Contents | Tag Index | 4.2 State Estimation >

Open in Colab

Download