Process Control Toolbox for Python
To make working with python and scipy easier for a process control engineer, it would be useful to have a set of prepackaged and more specialised tools and perhaps even a UI. Note that this is for Process Control engineers (rather than control engineers) and therefore has little emphasis on noiseless and high-order analysis techniques (such as poles/zeros, classical LTI formulations a la Matlab).
Objectives
- Make Process Control Engineering tasks easier and faster:
- loading and saving data and workspaces? (temporary GUI, many different file formats, including Excel)
- virtual arrays (for arrays larger than memory, numpy.load(mmap_mode=...) should work now (since Nov 2008 in SVN, but no numpy package released since then? pythonxy?), BUT numpy.memmap looks more suitable (need to get array in there in the first place - how to do this?) )
- loop analysis (for any type of controller (stand-alone, constraint, FF+FB, ...) and any available data (PV),(PV,CO),(PV,SP,CO),(PV,SP,CO,mode))
- inter-loop analysis (interaction between loops, via PV or (PV,CO))
- loading and saving data and workspaces? (temporary GUI, many different file formats, including Excel)
- have consistent tools for ad-hoc analysis AND routine monitoring
- A single language (Python) to learn for all the functionality.
Approach
- hierarchical software interfaces
- interface layers
- functions (useful basic functions not provided by existing packages)
- objects (objects to handle specific application, pulls together all the functions necessary)
- GUI wizards (specifically to make it easier for humans, no good for scripting!)
- objects contain knowledge of loop, e.g.
- user estimated deadtime (or at least an indication from an application class such as flow-loops, level loops, etc.)
- base all signal processing on this (e.g. resampling, autocorr max delay, auto model fitting ranges)
- type of loop: FB, FF, ... (or should these be specialised classes?)
- standalone vs cascade vs constraint loop
- data available: PV, PV+CO, PV+CO+SP, PV+CO+SP+FF+mode, ... (based on vectors supplied)
- user estimated deadtime (or at least an indication from an application class such as flow-loops, level loops, etc.)
- interface layers
- isolated GUIs or all-in-one persistent GUI for all functions? or just one loop analysis graphical report?
- a utility kick-off UI which can invoke the UI from specific packages
- pure python (with numpy, and possibly scipy)
Sub-Packages
This is a super-package for a series of process control relevant packages, i.e. "pctools" will (eventually) include the following packages:
- pce
ToDo / Ideas
- check my existing notes on automatic loop analysis for ideas
- see Csense report (per loop) attached for an example (also check Matrikon Loop Doctor again)
- idea: PCA, then just use top two components to plot plant variable variation on a 2D XY plot, to gain insight - will it be useful?
- matplotlib.mlab contains many useful functions, including PCA (prepca)
- name:
- pctools
- pce (..engineering, as opposed to operating system process control)
- pctools
matrix of MaxCorrellations
- pref use existing high level mpl functionality
- colour coded matrix w corr, lag
- loop
- methods all functional in non-visual data mode, some with visual capability
- optionally set visualisation for progressive calcs
- .visualise=True
- also provide .chart() methods for results
- Wizards for infrequent tasks
- usually can't remember how to do things, so a step by step process would help
- produce a formatted report on output
- a text wizard is probably just as good as a GUI wizard (usually lots of text explanation and little input at each step)
- perhaps generate a simple menu/input/wizard class that would take a dictionary/list input to drive the wizard
- can Traits UI be used in a text environment? - No!
formlayout (same author as pydee) provides a very good option (nested list specification, Qt UI) - http://code.google.com/p/formlayout/
IOTk is another option (console get and display functions), but lower level functions only (no quick list configuration) http://pypi.python.org/pypi/IOTk
- candidate tasks
- linear regression (?)
- design a simple filter (for data smoothing)
- loop functions (Identification, Tuning, etc)
- PC Widgets for pydee (dockable)
- eg PID tuning sim
- need to be runnable outside pydee also! or perhaps make a new application based on pydee but runnable from pydee!
- so, start with just matplotlib applications
- output only in widget (options in call or object)
- text menus to drive more complex???
- later, make proper Qt GUI versions
- but doesn't this lose zoom-pan of pylab
- check how pydee does it
- code to allow stand-alone or docked mode
- make sure I build on mlab and pylab (Matplotlib) which have some good functionality
- Naming ideas (for pctools and dynsim):
- suffixes: -lab, -desk, -lib,
- prefixes: auto-, multi-,
- SCADA-type displays
- can configure quite easily using Qt-Designer
additional Qt Widgets can be found at http://qt-apps.org/ and choosing Qt Widgets from the side menu
Files