Measurements Related to Product Quality: Custom Alarm Handling and Custom SVB Scripts
- Overview
- A common application of Statistica Quality Control procedures is to monitor ongoing processes, often in real-time. Statistica provides the tools to address practically all scenarios for quality control that occur in real-world applications, from simple shop-floor monitoring of single processes to complex and conditional quality control schemes that may involve hundreds of measurements. The purpose of this topic is to clarify which of the tools available in Statistica are best suited for different quality control applications. As will become clear shortly, the object oriented architecture of Statistica provides functionality that goes far beyond anything available in other specialized quality control software currently on the market, and enables you to create highly customized quality control systems capable of monitoring multiple characteristics.
This topic focuses specifically on two powerful tools:
- The alarm and custom alarm handlers available in Statistica Quality Control, and
- the general Statistica Visual Basic language features, and how they can be combined with the Statistica Quality Control facilities to automate the review of large lists of data streams with quality related measurements.
This topic does not discuss QC monitoring architectures that are based on distributed processing or other more advanced architectural options (supported by Statistica) that can be built when there is a need for multiple processes to operate simultaneously. Contact Statistica for information about those options if the volume of your data streams and your specific demands regarding the speed of processing necessitate using multiple computers.
- A note on licensing
- Note that some of the solutions discussed below require licensing of optional Statistica components offered with the enterprise and/or client/server versions of Statistica products (such as, for example, the In-place Data Processor, which allows you to access and process remote databases of unlimited size "in place," i.e., without having to first import the data and create their copies on the local hardware).
Quality Control Alarms
Application: On-line quality control monitors of real-time data streams, with operator input; real-time update of a single or a few summary charts.
Suppose you have an automated production process that tests and accepts/rejects the final items as they come off the production line. This would be a typical application for an attribute control chart. You could set up a monitor at the place of final testing, and automatically update the attribute control chart (e.g., C-chart) in real time, as the products complete the final testing (and the accept/reject decision is made). When the process changes, e.g., if a particular out-of-control or runs violation occurs, you want to be alerted and take proper action. You could define the out-of-control conditions of interest and the actions you want to take using the options on the Alarms tab of the Options dialog box for the quality control chart.
Using the Automatic action options, you could for example prompt the operator to make an explicit entry into the chart (e.g., assign a Cause or Comment), or execute a particular Statistica Visual Basic script to implement a highly customized response.
Custom SVB Alarm Handler
Application: On-line quality control monitors of real-time data streams, with operator input, real-time update of one or a few charts; highly customized definition of and responses to out-of-control conditions.
To elaborate further on the example discussed so far, you could also execute a custom SVB script as the SVB Handler for the chart. Those scripts can contain separate subroutines for each out-of-control condition, and those routines allow you to implement your own algorithms for determining the severity of the out-of-control condition, and how to respond. For example, you could implement specific and different procedures for every type of out-of-control condition. A typical application of this technique of handling alarms would be to automatically adjust some chart specifications as a result of a particular out-of-control condition. Also, because the Statistica Visual Basic language can call other programs as well, the possibilities to customize the responses to out-of-control conditions are endless. Finally, since the custom alarm handlers are encoded in standard Statistica Visual Basic scripts, you could quickly "hook up" previously designed customized alarm handlers to new charts.
Statistica Visual Basic Scripts for Controlling Complex Processes
Application: Simultaneous automated processing of a large number of real-time data streams, automated responses to out-of-control conditions.
Suppose you have an elaborate production process that generates many streams of data relevant to product quality. These types of situations exist not only in typical industrial production environments, but actually more commonly in the "soft-production" of services, such as loan and credit approval, or personnel selection and training; they are also common in complex Six-Sigma quality control projects that involve practically all measurable aspects of an organization's performance. In those cases, you may have several hundreds of measurements that are automatically updated, and the key management responsible for the process under scrutiny needs to be alerted to a wide variety of problems in any of those measurements.
Statistica provides a unique environment to support such (complex) quality control efforts, by providing a general programming environment for creating and installing the desired monitoring system (via Statistica Visual Basic), and by providing the custom programming services of experienced consultants to accomplish even the most ambitious quality goals. In principle, here is how it works:
First, you connect a Statistica Visual Basic program to your data source; the actual data can either reside on your computer (after you extracted the data from a database), or they can reside inside a remote database, in which case the data source consists of nothing else but the database query that retrieves the data of interest (and the data are processed "in place," which allows for the processing of huge databases; note that those facilities require licensing of the optional, "in place" data processing component that is available from Statistica). The connection to the data can be "static," i.e., it will only be updated at the user's request, or it can be dynamic, in which case the data (and quality control related analyses) are updated whenever new information becomes available. Either way, once the connection to the data is established, you can then sequentially process the list of relevant quality-related measurements, using the complete Statistica environment, testing for alarms and prompting responses as necessary.
- Checking for out-of-control samples in lists of variables
- To provide a more specific example of how this can be accomplished, consider the following simple scenario: You want to process 100 quality related measurements (variables in the data file or database), and check for out-of-control conditions and runs-test violations. Set up the Statistica Visual Basic program to loop through the variables one by one, calling the Quality Control module for each variable. Perform the standard quality control computations, and create (inside the script) the spreadsheets with counts of out-of-control conditions and the spreadsheets for the runs tests. Inside the SVB script, process the cells of those spreadsheets to look for entries that indicate an out-of-control condition; for example, review the cells of the Outliers spreadsheet to detect entries greater than zero.
If such entries in the results spreadsheet exist, you know that an out-of-control condition has occurred. Note that all of this is done inside the SVB script, and up to this point, no actual spreadsheets or graphs ever show up on the screen. Once the program determines that an out-of-control condition has occurred, it creates a visible chart for this measurement or variable and executes any other actions (inside the script) that are desirable for this type of problem.
Note: further custom processing can also be inserted at this stage; for example, it is common in many automated production environments for some measurements to "stray" beyond the customary 3-sigma control limits; however, because the overall process operates at better than, for example, 15 times Sigma (Cpk>15), such alarms are not of interest. In this particular instance you could, for example, adjust from inside the SVB script the control limits to match the overall process performance, so that only those out-of-control conditions cause an alarm that are indicative of "real" problems.Of course, you are not limited to only quality control specific computations in this type of environment. It is often equally informative to review correlations, the residuals of some predefined nonlinear models, etc. Statistica even allows you to apply neural networks (see Statistica Automated Neural Networks) to these types of problems, to "learn" from the overall complex interactions of the many measurements over time, to predict problems in the future.
Once in place, this type of system permits you to monitor a large number of data streams in an environment fully customized to your needs. This type of functionality far exceeds any of the features offered in traditional QC software, which simply cannot address the needs that are common in the modern, highly automated, industrial production or service industries.
- A simple example
- Shown below is a simple example of how to check all variables in an input file in a simple X/MR (individual observations and moving range) chart, for a mean of 100 and standard deviation of 20. The program will create an output report with only those charts that contain at least one out-of-control sample point, in either the X or MR chart.
Option Base 1
Dim Outlier1 As Spreadsheet
Dim Outlier2 As Spreadsheet
Dim report1 As Report
Sub Main
Set report1 = Reports.New("Out of Control Charts")
' Cycle through the variables in the input data
For i = 1 To ActiveDataSet.NumberOfVariables
Dim newanalysis As Analysis
Set newanalysis = _
Analysis (scQualityControl, ActiveDataSet)
With newanalysis.Dialog
.TypeOfChart = scQuaIndividualsAndMRChart
.NonAutoUpdateMode = True
.MakeDefaultSummaryChart = False
End With
newanalysis.Run
newanalysis.Dialog.Variables = i
newanalysis.Run
' Specifications
With newanalysis.Dialog
.CenterValue = "UserDefined 100.00000000"
.SigmaValue = "UserDefined 20.000000000"
End With
' Create outlier spreadsheet; the first spreadsheet is the
' Number of Outliers for the X Chart
Set Outlier1 = newanalysis.Dialog.Outliers(1)
' The second spreadsheet is the Number of Outliers for
' the MR-Chart
Set Outlier2 = newanalysis.Dialog.Outliers(2)
' Pass the Spreadsheet containing the number of out-of-
' control points for the X Chart to the OutOfControl function.
' If any points are out-of-control then the
' corresponding X Chart is sent to the report (report1).
If OutOfControl(Outlier1) = True Then _
report1.SelectionObject = _
newanalysis.Dialog.XBarChart(1)
' Pass the Spreadsheet containing the number of out-of-control
' points for the MR-CHart to the OutOfControl function. If any
' points are out-of-control then the corresponding MR-Chart is
' sent to the report (report1).
If OutOfControl(Outlier2) = True Then _
report1.SelectionObject = _
newanalysis.Dialog.RChart(1)
newanalysis.Close
Next i
report1.Visible = True
End Sub
Function OutOfControl(ByVal NumofOutliers As Spreadsheet) _
As Boolean
OutOfControl = False
'Sets i to the maximum number of cases in the spreadsheet
For i = 1 To NumofOutliers.NumberOfCases
'if the value of the specified cell is not 0 then
'an out-of-control point was encountered
If NumofOutliers.Cells(i,1).Value <> 0 Then
OutOfControl = True
Exit Function
End If
Next i
End Function