{"id":176,"date":"2026-05-13T23:00:36","date_gmt":"2026-05-13T23:00:36","guid":{"rendered":"https:\/\/quantitativequill.xyz\/?p=176"},"modified":"2026-05-13T23:09:57","modified_gmt":"2026-05-13T23:09:57","slug":"spc-charts-in-r-for-semiconductor-process-monitoring","status":"publish","type":"post","link":"https:\/\/quantitativequill.xyz\/index.php\/2026\/05\/13\/spc-charts-in-r-for-semiconductor-process-monitoring\/","title":{"rendered":"SPC Charts in R for Semiconductor Process Monitoring"},"content":{"rendered":"<p>In semiconductor manufacturing, maintaining consistent process performance across wafers and across batches is critical for device performance. One of the most powerful tools for monitoring this consistency is the <b>Statistical Process Control (SPC) Chart<\/b>. In this tutorial, we walk through how to apply SPC charts in R to simulate thin film deposition data, covering X-bar and R charts, control limit calculations, and practical interpretation for process engineers.<\/p>\n<p>If you are new to R for data analysis, you may also find my earlier post on <a href=\"https:\/\/quantitativequill.xyz\/index.php\/2024\/06\/15\/spreadsheets-common-mans-programming-tool\/\">spreadsheets as a common programming tool<\/a> a useful foundation before diving into statistical methods.<\/p>\n<h3 class=\"wp-block-heading\">Why SPC Matters in Process Monitoring<\/h3>\n<p>Semiconductor manufacturing processes require tight control over critical parameters to ensure consistent device performance, yield, and reliability. Across processes such as deposition, etch, lithography, and thermal treatments, even small variations in factors like temperature, pressure, gas flow, or power can lead to measurable shifts in material properties and device characteristics. Statistical Process Control (SPC) provides a real-time method for detecting process drift early, enabling engineers to identify and correct deviations before they result in out-of-specification wafers or reduced manufacturing yield.<\/p>\n<p><b>Key SPC concepts for process monitoring include:<\/b><\/p>\n<ul class=\"wp-block-list\">\n<li><strong>X-bar chart:<\/strong> Tracks the average value of a critical process parameter (such as film thickness, critical dimension, or electrical performance) across subgroups, such as wafers or lots, over time to monitor process stability.<\/li>\n<li><strong>R chart (range chart):<\/strong> Tracks the variability within each subgroup, helping identify changes in process consistency, uniformity, or equipment performance.<\/li>\n<li><strong>Control limits:<\/strong> Statistically derived boundaries (typically \u00b13 standard deviations from the process mean) that define the expected range of normal process variation, distinct from engineering specification limits.<\/li>\n<li><strong>Run rules:<\/strong> Additional statistical tests, such as multiple consecutive points above or below the center line, used to detect subtle trends, shifts, or non-random patterns before they become significant process issues.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">Generating Synthetic Thin Film Thickness Data<\/h3>\n<p>For this walkthrough, we simulate thickness measurements from a hypothetical LPCVD silicon nitride process. This is a <b>synthetic dataset<\/b> created for illustrative purposes: we model 25 subgroups (batches) with 5 wafers each, a target thickness of approximately 2000 angstroms, and an intentional drift introduced in the final batches.<\/p>\n<p>The synthetic data uses a mean of 2000 angstroms with a standard deviation of 15 angstroms, with a +5 angstrom per batch drift added in the last 5 batches. This mimics a real-world scenario where a chamber component such as a heating element begins to degrade, causing a gradual upward shift in deposited thickness.<\/p>\n<p>We deliberately avoid claiming specific crystallographic orientations or substrate materials for this simulated data. The process environment is modeled as a generic polycrystalline thin film on a crystalline substrate, using peak intensity parameters consistent with typical nitride film characterization.<\/p>\n<h3 class=\"wp-block-heading\">Building X-bar and R Charts in R<\/h3>\n<p>The R code below uses the <code>qcc<\/code> package, one of the most widely used libraries for SPC analysis. If you do not have it installed, run <code>install.packages(\"qcc\")<\/code> first.<\/p>\n<pre class=\"wp-block-code\"><code>\n# Load package\nlibrary(qcc)\n\n# Generate synthetic thickness data (angstroms)\nset.seed(42)\nn_batches &lt;- 25\nn_wafers &lt;- 5\nthickness &lt;- matrix(nrow = n_batches, ncol = n_wafers)\n\nfor (i in 1:n_batches) {\n  drift &lt;- ifelse(i &gt; 20, (i - 20) * 5, 0)\n  thickness&#91;i, ] &lt;- round(rnorm(n_wafers, mean = 2000 + drift, sd = 15), 1)\n}\n\n# Create qcc objects\nbatch_thickness &lt;- as.data.frame(thickness)\n\n# X-bar chart\nxbar_chart &lt;- qcc(batch_thickness, type = \"xbar\",\n                  title = \"X-bar Chart: LPCVD Film Thickness\",\n                  xlab = \"Batch Number\", ylab = \"Mean Thickness (A)\")\n\n# R chart\nr_chart &lt;- qcc(batch_thickness, type = \"R\",\n               title = \"R Chart: LPCVD Film Thickness Range\",\n               xlab = \"Batch Number\", ylab = \"Range (A)\")\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\">Interpreting the Control Charts<\/h3>\n<p>When you run this code, the X-bar chart (shown below) will show <b>all points within the upper and lower control limits for the first 20 batches<\/b>. This indicates a stable, in-control process \u2014 exactly what a process engineer wants to see during routine production.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"550\" src=\"https:\/\/quantitativequill.xyz\/wp-content\/uploads\/2026\/05\/image-1.png\" alt=\"Image\" class=\"wp-image-178\" srcset=\"https:\/\/quantitativequill.xyz\/wp-content\/uploads\/2026\/05\/image-1.png 699w, https:\/\/quantitativequill.xyz\/wp-content\/uploads\/2026\/05\/image-1-300x236.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n<p>Beginning around batch 21, the mean thickness will begin to climb above the center line. By batch 23, one or more points may fall <b>above the upper control limit (UCL)<\/b>, signaling that the process has shifted. The R chart should remain stable throughout, indicating that the within-batch uniformity (wafer-to-wafer variation) has not changed \u2014 the problem is a shift in the mean, not an increase in variability.<\/p>\n<h3 class=\"wp-block-heading\">Applying Run Rules for Earlier Detection<\/h3>\n<p>Standard control limits alone may not detect gradual drifts quickly enough. Run rules add sensitivity:<\/p>\n<ul class=\"wp-block-list\">\n<li><b>Rule 1:<\/b> One point beyond the 3-sigma control limit.<\/li>\n<li><b>Rule 2:<\/b> Seven consecutive points on the same side of the center line.<\/li>\n<li><b>Rule 3:<\/b> Two out of three consecutive points beyond the 2-sigma warning limit.<\/li>\n<\/ul>\n<p>In our simulated data, the <b>7-point run rule (Rule 2) would flag the drift as early as batch 22<\/b>, before any individual measurement exceeds the control limits. This is the practical value of SPC: catching problems before they produce out-of-spec material.<\/p>\n<p>R&#8217;s <code>qcc<\/code> package supports run rules via the <code>rules<\/code> argument. Adding <code>rules = rulesets(c(\"rule1\", \"rule2\", \"rule3\"))<\/code> to the <code>qcc()<\/code> call will annotate violations directly on the chart.<\/p>\n<h3 class=\"wp-block-heading\">Practical Applications for Process Engineers<\/h3>\n<p>SPC charts are not limited to thickness. They can be applied to any measurable property:<\/p>\n<ul class=\"wp-block-list\">\n<li><b>Refractive index<\/b> from ellipsometry measurements across a wafer batch.<\/li>\n<li><b>Film stress<\/b> from wafer curvature measurements before and after deposition.<\/li>\n<li><b>Sheet resistance<\/b> for conductive thin films measured by four-point probe.<\/li>\n<li><b>Uniformity<\/b> calculated as (max &#8211; min) \/ (2 * mean) within a wafer.<\/li>\n<\/ul>\n<p>The same R code structure shown above works for any of these variables. Simply replace the thickness data with your measurement values and the control chart logic remains identical.<\/p>\n<h3 class=\"wp-block-heading\">Beyond Basic SPC: What Comes Next<\/h3>\n<p>Once you have SPC charts running, the next step is often <b>process capability analysis (Cpk)<\/b>, which compares the natural process variation to the specification limits. A Cpk value below 1.33 typically indicates that the process needs improvement. We will cover capability analysis in a future post.<\/p>\n<p>For readers interested in comparing multiple analytical approaches, our post on <a href=\"https:\/\/quantitativequill.xyz\/index.php\/2025\/01\/01\/predicting-diabetes-comparing-logistic-regression-svms-and-random-forests\/\">comparing logistic regression, SVMs, and random forests for classification<\/a> demonstrates the kind of rigorous model comparison that complements SPC methodology in a broader data science toolkit.<\/p>\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n<p>SPC charts provide a straightforward, statistically grounded method for monitoring thin film deposition processes in real time. With just a few lines of R code using the <code>qcc<\/code> package, process engineers can detect drifts in mean thickness, identify changes in wafer-to-wafer variability, and trigger preventative maintenance before scrap material is produced. This blog uses a synthetic dataset to illustrate the workflow, but the same approach applies directly to real production data.<\/p>\n<p>The combination of <b>X-bar charts, R charts, and run rules<\/b> gives process engineers a practical early warning system. In future posts, we will extend this framework to multivariate SPC (Hotelling&#8217;s T-squared) and explore how control charts integrate with broader statistical methods such as <b>Design of Experiments (DOE)<\/b>, which we will cover in a subsequent blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn to build X-bar and R control charts in R for monitoring thin film deposition thickness. Includes worked R code with synthetic LPCVD data.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"SPC Charts in R for Semiconductor Process Monitoring - The Quantitative Quill","description":"Learn to build X-bar and R control charts in R for monitoring thin film deposition thickness. Includes worked R code with synthetic LPCVD data."},"footnotes":""},"categories":[119,120],"tags":[],"class_list":["post-176","post","type-post","status-publish","format-standard","hentry","category-data-analysis","category-thin-films"],"_links":{"self":[{"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/posts\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=176"}],"version-history":[{"count":2,"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/posts\/176\/revisions"}],"predecessor-version":[{"id":180,"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/posts\/176\/revisions\/180"}],"wp:attachment":[{"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quantitativequill.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}