Heat Treatment Batch Planning Optimization in Casting

In the highly competitive landscape of modern manufacturing, traditional industries like foundries face relentless pressure to enhance efficiency and reduce costs. The implementation of information management systems has digitized production data, paving the way for intelligent and automated production planning. A critical yet often under-optimized area in foundry operations is the planning of heat treatment batches. Heat treatment is indispensable for enhancing the mechanical properties and relieving internal stresses of cast components. However, improper batch planning, known as charge planning, is a direct contributor to various heat treatment defects, including distortion, cracking, and inconsistent mechanical properties due to non-uniform thermal cycles.

This article, written from my perspective as a practitioner and researcher in foundry optimization, delves into the complexities of the Heat Treatment Charge Planning (HTCP) problem. I will present a detailed methodology that combines classification techniques with an advanced genetic algorithm to develop optimal furnace charge plans. The core objective is to minimize operational costs and heat treatment defects by simultaneously considering furnace combining constraints, furnace capacity utilization, and order delivery deadlines.

The Heat Treatment Charge Planning Problem: A Detailed Description

Unlike generic batch scheduling, the HTCP problem is governed by stringent metallurgical and operational constraints. The primary goal is to group a set of heterogeneous castings, each belonging to a specific customer order, into a predefined number of furnace charges (or batches). Each charge is processed together in a heat treatment furnace with a fixed capacity. An optimal plan must balance three often-conflicting objectives, all of which influence the likelihood of heat treatment defects and overall plant performance.

The first and most critical factor is the furnace combining constraint. Not all castings can be heat-treated together. The compatibility is determined by their required heat treatment cycles, primarily characterized by:

  1. Cooling Method: Castings requiring different quenching media (e.g., air cool, furnace cool, oil quench, water quench) cannot be combined. Mixing cooling methods would inevitably lead to severe heat treatment defects like quench cracking or soft spots.
  2. Austenitizing/Soaking Temperature: Castings combined in a single charge must have similar target soaking temperatures. The maximum permissible temperature deviation (e.g., ±25°C or ±50°C) is a critical process parameter. Exceeding this range means some castings are under-treated (leading to lower strength) while others are over-treated (increasing brittleness), both classified as critical heat treatment defects.

The second factor is furnace capacity utilization. Each furnace cycle consumes significant energy. Maximizing the weight or volume loaded per charge reduces energy cost per kilogram of treated metal and improves overall equipment effectiveness (OEE). Low utilization directly increases operational costs.

The third factor is order delivery deadlines. Foundries must adhere to promised delivery dates. Delays can result in contractual penalties and loss of customer trust. Therefore, the planning system should prioritize castings with nearer due dates to ensure timely delivery.

Manually creating a plan that optimally balances these factors is a formidable challenge for production planners. Sub-optimal plans result in wasted furnace capacity, delayed orders, and most importantly, increased risk of heat treatment defects due to inappropriate groupings. The following table summarizes the core parameters of a typical HTCP problem instance.

Table 1: Core Parameters of the Heat Treatment Charge Planning Problem
Parameter Symbol Description Unit/Type
$N$ Total number of castings requiring heat treatment Integer
$P$ Number of furnace charges (batches) to be planned Integer
$G$ Maximum weight capacity of a furnace kg
$L$ Minimum economic load weight for a furnace charge kg
$g_i$ Weight of casting $i$ ($i = 1, 2, …, N$) kg
$T_i$ Remaining days until the delivery deadline for casting $i$ days
$CM_i$ Required cooling method for casting $i$ (e.g., 1=Air, 2=Oil) Categorical
$ST_i$ Required soaking temperature for casting $i$ °C
$ΔST_{max}$ Maximum allowed soaking temperature difference within a charge °C

Mathematical Formulation of the HTCP Problem

To formally define the optimization challenge, I formulate the HTCP as a multi-objective integer programming model. The model aims to find the best assignment of $N$ castings to $P$ charges. A key concept in this model is the “central casting” for each charge. This central casting defines the nominal process parameters for its batch. The cost of adding another casting to the charge is evaluated relative to this central casting, which helps quantify the risk of process-induced heat treatment defects.

Decision Variable:
$$
X_{ij} =
\begin{cases}
1, & \text{if casting $i$ is assigned to the charge with central casting $j$} \\
0, & \text{otherwise}
\end{cases}
$$
Note that $X_{jj} = 1$ indicates that casting $j$ is the central casting for a charge.

Objective Function:
The goal is to minimize the total cost $Z$, which aggregates penalties for poor furnace utilization, metallurgical mismatch, and delayed orders.
$$
\min Z = \sum_{j=1}^{N} \Bigg[ p \cdot \Big( G \cdot X_{jj} – \sum_{i=1}^{N} g_i \cdot X_{ij} \Big) \Bigg] + \sum_{i=1}^{N} \sum_{j=1}^{N} \Big( C_{ij}^{miss} \cdot X_{ij} + C_{i}^{due} \cdot X_{ij} \Big)
$$
Where:

  • $p$: Unit cost penalty for unused furnace capacity (kg).
  • $C_{ij}^{miss}$: Mismatch cost between casting $i$ and central casting $j$. This directly models the compatibility constraint to prevent heat treatment defects. It is derived from the difference in their soaking temperatures. A simple yet effective measure is the squared deviation: $C_{ij}^{miss} = \alpha \cdot (ST_i – ST_j)^2$, where $\alpha$ is a weighting factor. For incompatible cooling methods, $C_{ij}^{miss}$ can be set to an infinitely large value.
  • $C_{i}^{due}$: Tardiness cost factor for casting $i$. It should decrease as the delivery date approaches. A function like $C_{i}^{due} = \beta / \sqrt{T_i}$ (where $\beta$ is a weight) ensures castings with nearer deadlines are prioritized.

Constraints:

  1. Each casting can be assigned to at most one charge:
    $$ \sum_{j=1}^{N} X_{ij} \leq 1, \quad \forall i=1,…,N $$
  2. The total number of planned charges must equal $P$:
    $$ \sum_{j=1}^{N} X_{jj} = P $$
  3. The total weight in any charge $j$ must be between the minimum load $L$ and maximum capacity $G$:
    $$ L \cdot X_{jj} \leq \sum_{i=1}^{N} g_i \cdot X_{ij} \leq G \cdot X_{jj}, \quad \forall j=1,…,N $$
  4. A casting can only be assigned to a charge that has a designated central casting:
    $$ X_{ij} \leq X_{jj}, \quad \forall i,j=1,…,N $$
  5. Binary decision variables:
    $$ X_{ij} \in \{0, 1\}, \quad \forall i,j=1,…,N $$

This model is a complex 0-1 integer program. Solving it directly for real-world problem sizes (N > 100) using exact methods is computationally prohibitive. Therefore, I developed a hybrid heuristic approach that decomposes the problem intelligently.

Hybrid Solution Methodology: Classification and Improved Genetic Algorithm

The proposed solution strategy is a two-stage process designed to handle the complexity efficiently while strictly respecting the metallurgical constraints that govern heat treatment defects.

Stage 1: Generating Candidate Charge Sets via Classification

The first stage acknowledges that the fundamental furnace combining constraint drastically reduces the feasible solution space. We should not try to combine all castings indiscriminately. The process is as follows:

Step 1 – Primary Classification by Cooling Method: Partition the entire set of $N$ castings into distinct subsets $U_1, U_2, U_3, U_4$ corresponding to the four primary cooling methods (e.g., Air, Furnace, Oil, Water). Castings from different subsets are absolutely incompatible to avoid catastrophic heat treatment defects.

Step 2 – Secondary Classification by Soaking Temperature: For each cooling-method subset $U_k$, further classify castings based on their soaking temperature $ST_i$. Given the maximum allowed temperature spread $ΔST_{max}$, we generate overlapping “candidate sets”. A candidate set is defined by a temperature window $[t – ΔST_{max}/2, t + ΔST_{max}/2]$. The window center $t$ starts from the lower bound of $ST$ in $U_k$ and moves in steps (e.g., 10°C) until it exceeds the upper bound. All castings within a window are, by definition, thermally compatible and thus have a low inherent risk of thermal mismatch heat treatment defects.

Step 3 – Candidate Set Evaluation and Selection: This process generates many candidate sets. To focus computational effort, we evaluate and rank them. A good candidate set should not only be compatible but also have high weight and urgent orders. I propose the following scoring function $f_{score}$ for a candidate set $S$:
$$
f_{score}(S) = \sum_{k \in S} \frac{g_k}{T_k}
$$
A higher score indicates a set with larger casting weights ($g_k$) and/or tighter deadlines (smaller $T_k$). We select the top $R$ (e.g., $R=5$) candidate sets from each cooling-method group for the next stage. This step ensures we work with promising, feasible subsets from the start.

Table 2: Example of Candidate Set Generation and Ranking
Cooling Method Group Temperature Window [°C] Number of Castings Total Weight [kg] Score $f_{score}$ Rank
Oil Quench [850, 950] 17 10,406 742.7 5
Oil Quench [950, 1050] 18 9,796 895.1 3
Oil Quench [1000, 1100] 19 10,653 934.6 1
Air Cool [650, 750] 25 13,044 925.4 2
Water Quench [850, 950] 17 9,458 844.2 4

Stage 2: Optimizing within a Candidate Set using an Improved Genetic Algorithm (IGA)

For each selected candidate set $S$, the problem reduces to: “Given $|S|$ compatible castings, how do we partition them into one or more charges to maximize furnace utilization and meet deadlines?” This is still a combinatorial problem, perfect for a metaheuristic like a Genetic Algorithm (GA). However, standard GAs can get trapped in local optima. I developed an Improved GA (IGA) with several key enhancements.

1. Chromosome Encoding and Decoding:
A chromosome is a permutation of the casting IDs in $S$. For example, for a set of 10 castings: [5, 3, 4, 2, 10, 7, 9, 8, 1, 6]. This sequence is decoded into charges sequentially: we start adding castings to Charge 1 in the order given until adding the next casting would exceed the furnace capacity $G$. Then, we start Charge 2 with the next casting, and so on. This variable-length grouping is a natural representation.

2. Fitness Function:
The fitness evaluates a decoded charge plan. We want to minimize a composite cost. For a charge $c$ with $n_c$ castings, we define:

  • Thermal Homogeneity Cost ($C^1_c$): To minimize heat treatment defects related to temperature spread, we use the variance of soaking temperatures within the charge. Let $t_{mean}^c$ be the mean soaking temperature in charge $c$.
    $$ C^1_c = \frac{1}{n_c} \sum_{i \in c} (ST_i – t_{mean}^c)^2 $$
  • Capacity Under-utilization Cost ($C^2_c$): The unused capacity: $C^2_c = G – \sum_{i \in c} g_i$.
  • Deadline Cost ($C^3_c$): To prioritize urgent orders, we use the mean of the square root of remaining days: $ C^3_c = \frac{1}{n_c} \sum_{i \in c} \sqrt{T_i} $.

The total fitness $F$ for a chromosome (plan) is the reciprocal of the weighted sum over all charges:
$$ F = \frac{1}{\sum_{c \in \text{plan}} (w_1 \cdot C^1_c + w_2 \cdot C^2_c + w_3 \cdot C^3_c) } $$
where $w_1, w_2, w_3$ are user-defined weights reflecting the importance of preventing heat treatment defects, maximizing utilization, and meeting deadlines, respectively. A higher $F$ is better.

3. Enhanced Genetic Operators:

  • Selection: Tournament selection with a small size (e.g., 2) is used for its efficiency and selective pressure.
  • Crossover: To maintain diversity and effectiveness, the IGA randomly alternates between two well-known operators for permutation-based encodings: Partially Mapped Crossover (PMX) and Two-Point Order Crossover (TPOX). This prevents the search from being limited by the biases of a single operator.
  • Mutation: An inversion mutation operator is used, where a substring of the chromosome is selected and its gene order is reversed.

4. Simulated Annealing (SA) based Population Update:
Instead of the standard generational replacement, I employ an SA-inspired acceptance rule for offspring. If a new child chromosome has better fitness than its parent, it always replaces it. If it is worse, it may still replace the parent with a probability $P_{accept}$:
$$ P_{accept} = \exp\left(-\frac{\Delta F}{T}\right) $$
where $\Delta F$ is the fitness decrease, and $T$ is a “temperature” parameter that decreases over generations: $T_{new} = \lambda \cdot T_{old}$ with $\lambda < 1$. This mechanism allows the algorithm to escape local optima early in the search.

5. Reset Operator:
If the global best fitness does not improve for a consecutive number of generations, the population is considered stagnant. A reset operator is triggered: all chromosomes with fitness below the current population average are randomly re-initialized. This injects new genetic material and helps the search explore new regions of the solution space.

The overall flowchart of the IGA within the hybrid framework is summarized below conceptually: Generate Candidate Sets -> For each top candidate set -> Run IGA (Initialize Pop -> Evaluate -> While not terminated: Select -> Crossover (PMX/TPOX) -> Mutate -> SA Acceptance -> Apply Reset if stagnant) -> Record Best Plan -> Select the overall best plan from all candidate sets.

Simulation Experiments and Analysis

To validate the effectiveness of the proposed model and IGA, I conducted simulation experiments based on data from a medium-sized jobbing foundry. A dataset of 150 castings was constructed with realistic attributes for weight, soaking temperature, cooling method, and delivery deadline. The furnace capacity $G$ was set to 5,000 kg, and the minimum load $L$ to 4,000 kg. The maximum allowed soaking temperature difference $ΔST_{max}$ was set to 100°C.

Stage 1 Results: Following the classification stage, the castings were grouped by cooling method. For the Oil Quench group, five candidate temperature windows were generated and ranked. Their details are shown in Table 2.

Stage 2 – IGA Configuration and Comparison: For each of the top 5 candidate sets, I ran both a standard GA and the proposed IGA. The parameters were: Population Size=40, Crossover Rate=0.8, Mutation Rate=0.05, SA Initial Temperature=2000, Cooling Rate $\lambda$=0.95, Reset Trigger=20 generations of stagnation. The objective weights were set as $w_1=0.002$, $w_2=2$, $w_3=8$, emphasizing capacity and deadlines while controlling for heat treatment defects via the thermal variance term. Each algorithm was run 10 times per candidate set.

Table 3: Performance Comparison of Standard GA vs. Improved GA (IGA)
Candidate Set Algorithm Best Fitness Average Fitness Worst Fitness Avg. Time (s)
#1 (Oil, 1000-1100°C) Standard GA 0.1165 0.1127 0.1062 1.88
Improved IGA 0.1165 0.1164 0.1159 2.15
#2 (Air, 650-750°C) Standard GA 0.1021 0.0991 0.0961 2.00
Improved IGA 0.1045 0.1025 0.0998 2.38
#3 (Oil, 950-1050°C) Standard GA 0.1200 0.1145 0.1082 1.83
Improved IGA 0.1200 0.1200 0.1200 2.15

The results clearly demonstrate the superiority of the IGA. While both algorithms sometimes find the same best solution, the IGA shows significantly higher average and worst-case performance across all candidate sets. This robustness is critical for practical application. The slightly longer run-time of the IGA is a worthwhile trade-off for obtaining consistently high-quality plans that effectively balance all objectives and minimize risks like heat treatment defects.

Optimal Plan Analysis: The best overall plan came from Candidate Set #3. Its decoded details are shown below. This charge achieves 96.8% furnace capacity utilization, a thermal variance of 466.7 (°C)$^2$ (which corresponds to a standard deviation of ~21.6°C, well within the 100°C limit), and serves castings with an average $\sqrt{T_i}$ of 0.916, indicating good urgency compliance.

Table 4: Optimal Charge Plan from Candidate Set #3 (Oil Quench, 950-1050°C)
Casting ID Weight (kg) Soaking Temp. (°C) Days to Deadline
51 441 1040 9
99 608 1000 9
96 676 1050 9
121 578 1010 5
64 369 990 8
143 432 1050 5
148 726 1030 8
19 562 1050 8
114 450 1020 7
Charge Totals/Averages: Count: 9 Σ√T: 8.244
Total Weight: 4,842 kg Avg √T: 0.916
Utilization: 96.8% Temp. Variance: 466.7

When compared to a historically good manual plan from the foundry, the optimized plan showed a 2.3% increase in furnace utilization, a 6.7% reduction in thermal variance (lowering the potential for heat treatment defects), and a 10.5% improvement in the urgency metric.

Discussion and Practical Implications

The proposed hybrid methodology addresses the core challenges of HTCP in a structured and computationally efficient manner. The classification stage acts as a powerful filter, ensuring the genetic algorithm only searches within solution subspaces that are metallurgically sound, thereby proactively reducing the risk of heat treatment defects. The Improved Genetic Algorithm, with its SA-based update and reset mechanism, provides a robust search engine capable of finding high-quality plans consistently.

For foundries, implementing such a system can lead to tangible benefits:

  1. Reduced Energy Costs: Higher average furnace utilization directly decreases energy consumption per ton.
  2. Improved On-Time Delivery: Explicit modeling of deadlines helps prioritize workflow.
  3. Enhanced Quality Consistency: By strictly enforcing and optimizing thermal compatibility within charges, the system minimizes one of the root causes of variability and heat treatment defects, leading to more predictable and higher-quality outcomes.
  4. Decision Support: It provides planners with a scientifically derived, optimized suggestion rather than relying solely on experience, which is crucial for handling complex and large order sets.

Conclusion and Future Work

In this article, I have presented a comprehensive approach to solving the Heat Treatment Charge Planning problem in foundries. The multi-objective integer programming model formally captures the trade-offs between furnace combining constraints (critical to avoiding heat treatment defects), capacity utilization, and delivery deadlines. The hybrid solution, combining initial classification with an Improved Genetic Algorithm featuring simulated annealing and reset mechanisms, proves to be an effective and robust method for generating practical, high-quality charge plans.

The effectiveness was validated through simulation experiments, showing consistent outperformance over a standard GA and tangible improvements over manual planning benchmarks. The integration of this optimization module into broader foundry management systems, such as Enterprise Resource Planning (ERP) or Manufacturing Execution Systems (MES), represents a significant step towards the intelligent, data-driven foundry of the future.

Future research directions include:

  • Incorporating dynamic scheduling aspects where new orders arrive continuously, and furnace status changes.
  • Extending the model to consider multiple furnaces with different capacities, capabilities, and energy consumption rates.
  • Integrating more sophisticated models of heat treatment defects prediction, possibly using machine learning, to refine the $C_{ij}^{miss}$ cost function beyond simple temperature variance.
  • Exploring other advanced metaheuristics or hybrid algorithms to further improve solution speed for very large-scale problems.

By continuing to refine these optimization strategies, foundries can achieve greater efficiency, reliability, and quality in their heat treatment operations, directly combating the costly and quality-diminishing heat treatment defects that arise from sub-optimal planning.

Scroll to Top