Software artifacts of the case study reported in the paper Teaching Investment-Aware Automation Design: Combining Industrial Plant Simulations with Techno-Economic Analysis
This repository contains the software artifacts of the case study reported in the paper <i>"Teaching Investment-Aware Automation Design: Combining Industrial Plant Simulations with Techno-Economic Analysis"</i> (see the <b>Case Study: An Automated Production-and-Storage Plant</b> section). Together they implement and evaluate a complete industrial automation solution: a plant that manufactures a boxed product, palletizes it, and stores it in an automated warehouse.▶ Start here: video demonstration<code><strong>VideoDemo/VideoDemo.mp4</strong></code> is a screen-recorded demonstration of the complete case study described in the paper: the 3D plant running in Factory I/O, the PLC program driving it from TIA Portal, and the techno-economic workbook turning the resulting technical figures into NPV, IRR, payback period and benefit–cost ratio.Watching it first is the fastest way to understand what the artifacts below do and how they fit together, without installing Factory I/O or TIA Portal.ContentsThe artifacts correspond to the two phases of the methodology described in the paper.<code>IndustrialPlantSimulation/Factory.factoryio</code>: 3D plant simulationA Factory I/O scene containing the complete 3D digital prototype of the automated production-and-storage plant. In the course, students build this scene <b>from scratch</b>, translating their P&ID into a digital layout by manually placing every conveyor, actuator, and sensor. The scene integrates:<b>Material transport:</b> belt, roller, curved, inclined, loading, chute and straight-spur conveyors; chain transfer; turntable.<b>Handling and processing:</b> machining center, two-axis pick-and-place arm, local pick-and-place station, palletizer, elevator, and a stacker crane with storage rack.<b>Sorting and positioning:</b> pivot-arm sorter, pop-up wheel sorter, pusher, stop blade, positioning bars, and conveyor scales.<b>Sensing:</b> diffuse, inductive, retroreflective, vision and light-array sensors, plus an RFID reader for pallet identification.<b>Role in the workflow.</b> The scene is the process under control: it is coupled to the PLC program for closed-loop validation (see below). It is also the source of the <i>technical inputs</i> consumed by the economic model: the equipment inventory feeds the CAPEX estimate, and the observed cycle times / production rates feed the revenue projection.<b>Requires:</b> Factory I/O (desktop). Open the file directly with <i>File → Open</i>.<code>IndustrialPlantSimulation/LogicControllers/</code>: PLC control programA <b>Siemens TIA Portal V19</b> project (<code>LogicControllers.ap19</code>) holding the control logic for the plant, targeting a <b>Siemens S7-1200</b> PLC. The program is implemented with a combination of <b>Ladder Diagram (LD)</b> and <b>Function Block Diagram (FBD) / Function Blocks</b>, with routines written in <b>Structured Control Language (SCL)</b>.The control logic follows the two-part operational sequence described in the paper:<b>(a) Production and classification:</b> coordinates sensors, the machining center, the robotic pick-and-place arm, the local pick-and-place station and the turntable that routes boxes along the line.<b>(b) Storage:</b> transports, stores and retrieves pallets in the automated warehouse via the stacker crane and rack.<b>Role in the workflow.</b> The program is validated in two stages:<b>Software-in-the-Loop (SIL):</b> TIA Portal's <b>PLCSIM</b> is connected to <code>Factory.factoryio</code> for closed-loop testing, debugging timing, interlocks and sequential logic against the virtual plant.<b>Hardware-in-the-Loop (HIL):</b> the same program is downloaded to a physical S7-1200 PLC driving the simulated process.<b>Requires:</b> Siemens TIA Portal V19 (with S7-1200 support and PLCSIM for SIL testing). Open with <i>Project → Open</i> and select <code>LogicControllers.ap19</code>.<b>Do not reorganize or delete the</b><b> </b><code><strong>LogicControllers/</strong></code><b> </b><b>subfolders.</b> Everything under <code>LogicControllers/</code> (<code>IM</code>, <code>System</code>, <code>XRef</code>, <code>Vci</code>, <code>AdditionalFiles</code>, <code>src</code>, <code>UserFiles</code>, <code>Logs</code>, <code>TMP</code>, …) is TIA Portal's own project directory structure and must stay together, alongside the <code>.ap19</code> file, for the project to open correctly. Some of these folders are <b>empty</b> (e.g. <code>Logs</code>, <code>TMP</code>, <code>src</code>, <code>UserFiles</code>, <code>IM/HMI/S</code>) because they hold only transient or session data, but they are still part of the expected layout, so removing them can make TIA Portal prompt for repair or fail to load the project. To share or clean up the project instead, open it in TIA Portal and use <i>Project → Archive</i> to export a single compact <code>.zap19</code> file.<code>TechnoEconomicEvaluation/TechnoEconomicEvaluation.xlsm</code>: techno-economic modelA <b>macro-enabled Microsoft Excel workbook</b> (VBA) that automates the financial evaluation of the automation project from student-defined parameters. It turns the technical design into an investment decision by computing the project cash flow and the standard viability indicators.<b>What it covers:</b><b>Investment (CAPEX):</b> tangible-asset balance (equipment) and intangible-asset balance (software licenses, integration), estimated from market prices for the physical equivalents of the Factory I/O components.<b>Operating costs (OPEX):</b> fixed costs (licenses, rent, insurance, baseline salaries, maintenance) and variable costs (energy, packaging, production-dependent supplies), plus workforce definition (operators and specialized technicians with monthly wages).<b>Depreciation and amortization</b> of assets over their useful life.<b>Cash flow and viability:</b> annual cash-flow projection yielding <b>NPV</b>, <b>IRR</b>, the <b>payback period (PP)</b>, and the <b>benefit–cost ratio (BCR)</b>.<b>Sensitivity analysis:</b> univariate and multidimensional sheets that show how viability responds to changes in key assumptions (e.g., unit selling price, energy cost, CAPEX).The workbook also contains internal equipment/asset databases with a small VBA-based editor (add / edit / delete items) used to populate the cost tables. Prices are entered in the local currency and converted to USD for reporting.<b>Requires:</b> Microsoft Excel with macros enabled (the file is <code>.xlsm</code>; enable content when prompted).Suggested order of use<b>Watch the demo:</b> play <code>VideoDemo/VideoDemo.mp4</code> for an end-to-end overview of the steps below.<b>Simulate the plant:</b> open <code>Factory.factoryio</code> in Factory I/O.<b>Run the control logic:</b> open <code>LogicControllers.ap19</code> in TIA Portal, connect PLCSIM to Factory I/O (SIL), and validate the sequence; optionally deploy to a physical S7-1200 (HIL).<b>Evaluate the investment:</b> transfer the equipment list and the cycle times / production rates observed in the simulation into <code>TechnoEconomicEvaluation.xlsm</code>, then read off the NPV, IRR, payback period and benefit–cost ratio, and explore the sensitivity scenarios.<b>NOTE</b>These files have been anonymized for double-blind peer review.