Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 SPC Control Chart Tools for .Net
 Display control limits until the end of x-axis
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

quahys

Malaysia
7 Posts

Posted - 25 Jun 2013 :  03:36:41  Show Profile  Reply with Quote
Hi.

Let's say I have set 50 datapoints to be shown within a chart view. However, I only have 30 datapoints for the chart. Is there a way to extend the control limits until the end of x-axis?

quinncurtis

1586 Posts

Posted - 25 Jun 2013 :  09:11:48  Show Profile  Reply with Quote
Sorry, but because the software supports variable control limit lines for many of the spc chart types, the control limit lines are only drawn up to the last sample interval in the data, not to the end of the x-axis.
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 16 Jan 2014 :  15:00:43  Show Profile  Reply with Quote
I think I may be running into something similar.



Notice the UCL and LCL labels are smooshed together and partly obfuscating the x-axis. Thing is, data seems to be complete, so not sure why they'd end up there?

Any way to move them to the right end of the chart?
Go to Top of Page

quinncurtis

1586 Posts

Posted - 16 Jan 2014 :  15:08:53  Show Profile  Reply with Quote
The first thing to look at is the fact that the sigma values for your data are 0. Which makes everything invalid. An SPC chart REQUIRES that the a sample subinterval has data normally distributed about the mean. I assume that somehow you have started entering in invalid data, or data which you are simulating. But you cannot enter simulated data that has no sigma (i.e. every value in a sample subgroup is the same), because that invalidates the central tenant of SPC Charts.

The second thing to look as why the first and second sample interval means are an order of magnitude apart. It looks like something is wrong there too. If you permit the first point in the chart, it will wildly distort the graph y-axis auto-scaling, which will prevent you from seeing the normal variation in the 100-200 range.

And last, you are using 5 sample per subgroup, which is OK for test (assuming subgroup data varies about the mean), but a very poor choice for a mean-sigma production chart. Because if you research it, you will find that the recommended minimum number samples per subgroup for a mean-sigma chart is 10.

So correct the data and the chart should auto-scale much differently.
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 16 Jan 2014 :  15:34:17  Show Profile  Reply with Quote
Hi there, and thanks for replying so quickly!

Indeed the data is contrived and sigma is zero because our people just entered the same value over and over for testing. However, I explicitly set the control limits with a call to SetControlLimitValues. My expectation was that this would draw horizontal lines at the supplied locations on the y-axis and label those them with the supplied values. It's unclear to me why the label for XBAR would be on the right as expected, while the labels for UCL and LCL would be located in apparently random locations. (It would be different if UCL and LCL were being computed.)

Even if I adjust my range such that the data is all within an order of magnitude, the location of the UCL and LCL remains somewhat random.
Go to Top of Page

quinncurtis

1586 Posts

Posted - 16 Jan 2014 :  16:09:52  Show Profile  Reply with Quote
Sorry, but we do not know how to reproduce your problem. I don't think it has anything to do with the control limits only being drawn to the last value data point. See if you can reproduce it by making some sort of simple change to one of our example program, and then describe/show the changes. If that is not possible, you will need to send us an example program (the simplest possible) which uses valid data, which reproduces the problem. Zip up the complete product and send it to support@quinn-curtis.com.

One thing, if you are are going to set the control limits manually, you must call SetControlLimitValues BEFORE you start adding any data to the chart.
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 16 Jan 2014 :  18:19:53  Show Profile  Reply with Quote
Thank you for the offer. Unfortunately, it would take me the better part of a day to extract a test case from this spaghetti and I'm on a tight time schedule. (I know. Strange for the software biz.) ;-)

I did manage to work around the issue by adding spec limits and setting the control limit labels all to empty string. The spec limits are appearing on the right at the expected y-values (yea!) but alas, they are not associated with horizontal lines, even though I set the correct chart attribute:
TheDataChart.PrimaryChart.AddSpecLimit(SPCChartObjects.SPC_LOWER_SPEC_LIMIT, val1, "L SPEC", new ChartAttribute(Colors.DarkRed, 3.0));
TheDataChart.PrimaryChart.AddSpecLimit(SPCChartObjects.SPC_UPPER_SPEC_LIMIT, val2, "H SPEC", new ChartAttribute(Colors.DarkRed, 3.0));
TheDataChart.PrimaryChart.AddSpecLimit(SPCChartObjects.SPC_CONTROL_TARGET, val3, "TARGET", new ChartAttribute(Colors.DarkRed, 3.0));

Part of the problem was that I was creating the limits after the data was on the chart, so that piece of feedback was very helpful. I'm no longer doing that however, and I still don't have horizontal lines.

Thoughts?

Thanks
Tony
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 16 Jan 2014 :  18:25:42  Show Profile  Reply with Quote
FYI, here's what the chart looks like with the spec limits on it. (I've eliminated the extreme outlier point.)

Go to Top of Page

quinncurtis

1586 Posts

Posted - 16 Jan 2014 :  19:17:42  Show Profile  Reply with Quote
Sorry, but we do not know what the problem is. It still look like you are entering data before you set the limits, but you say that is not the case.

You will probably have to try and create for us an example which fails. All you have is some data, and some limits. You should be able to take one of our example programs (BatchVariableControlCharts.BatchXBarRChart, or SPCApplication1) and modify it to reproduce your problem. It should take more that 10 minutes. It will take us no longer than 5 minutes to identify the problem once we have the example.

We recreated a similar example. It took us all of 60 seconds. The picture is below. The relevant code is shown below:

this.PrimaryChart.AddSpecLimit(SPCChartObjects.SPC_LOWER_SPEC_LIMIT, 18.3, "L SPEC", new ChartAttribute(Color.Green, 3.0));
this.PrimaryChart.AddSpecLimit(SPCChartObjects.SPC_UPPER_SPEC_LIMIT, 39.6, "H SPEC", new ChartAttribute(Color.Yellow, 3.0));

double[] controllimitvalues = { 30, 24, 36, 10, 0, 22 };
this.ChartData.SetControlLimitValues(controllimitvalues);

// Must have data loaded before any of the Auto.. methods are called
SimulateData();

// Calculate the SPC control limits for both graphs of the current SPC chart (X-Bar R)
// this.AutoCalculateControlLimits();


// Scale the y-axis of the X-Bar chart to display all data and control limits
this.AutoScalePrimaryChartYRange();
// Scale the y-axis of the Range chart to display all data and control limits
this.AutoScaleSecondaryChartYRange();
// Rebuild the chart using the current data and settings
this.RebuildChartUsingCurrentData();


If you want we can send you the complete source file. It just replaces one from the BatchVariableControlCharts example program.




Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 16 Jan 2014 :  20:30:13  Show Profile  Reply with Quote
Thank you for this.

I saw your earlier reply. I've spent the last hour installing and configuring SPCApplication1 (WPF) such that it is almost identical to what we have in our million line production application.

Naturally, the spec lines show up when run from the modified sample code. It too bad there's no way for me to serialize the internal state of the object so I can compare the bad one to the good one. I may have to spring for your source code just so I can step into the RebuildCharUsingCurrentData() routine and see what it's doing.
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 16 Jan 2014 :  20:47:43  Show Profile  Reply with Quote
The difference between the modified example app and our production app is that ours places the labels for the specs at the correct location, but draws the lines for them at y = 0.0. The modified example application puts both the lines and the labels for the specs at the correct location. However both applications are apparently doing exactly the same thing in exactly the same order.

When I examine PrimaryChart.ControlLimitData in the debugger in either application, the results look identical.

Obviously there's something I'm overlooking...
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 16 Jan 2014 :  21:10:25  Show Profile  Reply with Quote
And yes, I can make the modified example app exhibit the errant behavior exactly by entering data before I set the limits, however that's not what I'm doing in the production app.
Go to Top of Page

quinncurtis

1586 Posts

Posted - 17 Jan 2014 :  08:16:54  Show Profile  Reply with Quote
Try and lock out your own data update routine. Instead, use one of our SimulateData methods (pull it from BatchVariableControlCharts.BatchXBarRChart) routines and simulate the data immediately after you set the control limits.

double[] controllimitvalues = { 30, 24, 36, 10, 0, 22 };
spcChart.ChartData.SetControlLimitValues(controllimitvalues);

SimulateData(30);

What are the results?

Also, are you using concurrent threads with our software in any way?
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 17 Jan 2014 :  15:48:05  Show Profile  Reply with Quote
I can plot control lines just fine. The problem is that the correspondent labels end up getting plotted at apparently random locations. That's why I'm working with spec lines now. The labels for those plot all the way to the right of the graph as expected. The problem is that the actual spec *lines* plot at y = 0.0 no matter where they're set unless I copy my code to the sample application (where I'm using exactly the same data with its zero variance, etc.) Then both the spec lines and the correspondent labels plot as expected.

Since I'm working with spec limits instead of control limits, I varied what I did from your instructions:

1. I add the spec limits.
2. I simulate the data. The version of this function to which you directed me does not take any parameters, but I assumed the 30 is meant to be the upper bound on the for loop, so I adjusted it. I also needed to pass in the chart control:

private void SimulateData(SPCBatchVariableControlChart spcChart)
{
// batch number for a given sample subgroup
int batchCounter = 0;

for (int i = 0; i < 30; i++)
{
// Important to make a new ChartCalendar object each time
ChartCalendar timestamp = (ChartCalendar)startTime.Clone();

// randomize the timestamp a bit
int randomminute = (int)((timeincrementminutes - 1) * ChartSupport.GetRandomDouble());
timestamp.Add(ChartObj.MINUTE, randomminute);

// Simulate a sample subgroup record
DoubleArray samples = spcChart.ChartData.SimulateMeasurementRecord(100, 130);
// Update chart data using i as the batch number
batchCounter = i;
// Add a new sample record to the chart data
spcChart.ChartData.AddNewSampleRecord(batchCounter, timestamp, samples);
// Simulate passage of timeincrementminutes minutes
startTime.Add(ChartObj.MINUTE, timeincrementminutes);
}

}


3. I plotted the chart.

Now I neither have data on the chart (probably because the y-axis is scaled from 0 to 10.0 in spite of the fact that I called AutoScalePrimaryChartYRange after adding the data) nor spec line labels. Spec lines are still at y = 0.0.

I confess I didn't take the time to comprehend your simulate function.

I think my next step is to get your source and step into it so I can see what's going on.
Go to Top of Page

quinncurtis

1586 Posts

Posted - 17 Jan 2014 :  16:11:50  Show Profile  Reply with Quote
Your company has had this software for almost three years. Is this the first time it has been used? Or did you have an application which worked, and now it doesn't anymore? It seems strange that after three years you can't get the most basic control limit function to work in your program, while all of our examples work fine.

If you want to purchase the source code in order to try and debug it, that's up to you. Our source is pretty complicated though. If I were you I would just scrap every line of code you have which uses our classes, by removing the references to our DLLs from the project. Then then start from scratch by adding in a known module which you know works (i.e. our example programs). Then step by step evolve that back into what you need in your actual application. At some point it may stop working again, in which case you will have some idea as to what caused it.

If you are unable to reproduce the problem in any program outside of your large application program, we are willing to look at that if you are willing to send us the complete project.
Go to Top of Page

TonyCoolearth

USA
14 Posts

Posted - 17 Jan 2014 :  16:32:32  Show Profile  Reply with Quote
The software has been working fine. Our customer asked us to change the control limits to spec limits so instead of varying as you go, they are fixed and independent of the data. (And indeed, they are really "spec" limits. They come out of our spec table.)

In practice they never encountered the control limit labels showing up at weird places (or didn't notice) because their process produces valid data and presumably the chart scales correctly in that instances, however, the idea is to have horizontal lines that never vary and the control limits appear to vary over time.

The person who integrated your controls left the company so I'm trying to figure out what he did. Starting over and working backward is not something I'm willing to do at this point. I'm more likely to just plot horizontal lines on top of the control.

We've got your source now. I may ask you for help with it as I step through it. I will certainly inform you of anything I find.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07