Back to guides
4
8 min

AI for Casting & Foundry Optimization

Defect Prediction, Simulation Surrogates, and SME Foundry Challenges

Defect Prediction from Process Parameters

Casting defects — shrinkage porosity, gas porosity, hot tears, cold shuts, misruns, sand inclusions — are the bane of every foundry. Rejection rates of 5-15% are common in Indian foundries, and for complex geometries (automotive manifolds, hydraulic valve bodies, pump impellers), rates can reach 25-30%. Each rejected casting wastes metal, energy, moulding sand, and furnace time.

The traditional approach: Methoding engineers use experience and empirical rules (modulus method for riser design, gating ratios from AFS guidelines, pouring temperature from metal fluidity tests). When defects occur, they adjust parameters iteratively — raise pouring temperature, change gating, modify risering. This trial-and-error cycle takes weeks and wastes dozens of castings.

Open data/casting-process-data.csv in the code panel. Each row represents a production casting with: alloy grade, pouring temperature, pouring time, gating ratio (sprue:runner:ingate), riser dimensions, mould type (green sand, no-bake, shell), sand properties (GCS, moisture, permeability), and the resulting quality (defect type, defect location, severity, accept/reject).

Building a Defect Prediction Model

Features:
  alloy: grade, C%, Si%, Mn%, CE (carbon equivalent), liquidus_temp
  process: pouring_temp, pouring_time, superheat, gating_ratio
  riser: riser_modulus, riser_neck_ratio, number_of_risers
  mould: mould_type, GCS, moisture%, permeability, mould_hardness
  geometry: casting_weight, section_modulus_max, section_modulus_min,
            modulus_ratio (max/min), volume_surface_area_ratio
Targets:
  defect_probability (0-1)
  defect_type (shrinkage, gas, hot_tear, cold_shut, sand_inclusion, none)
  defect_location (cope, drag, junction, thin_section, riser_junction)
Model: XGBoost multi-output classifier

The most important predictive features, ranked by SHAP importance:

RankFeatureWhy It Matters
1**Superheat** (pouring temp - liquidus)Too high → gas pickup, metal penetration. Too low → cold shuts, misrun
2**Section modulus ratio** (max/min)High ratio → isolated heavy sections → shrinkage
3Riser modulus / casting modulusMust be > 1.2 for directional solidification. Below → the casting feeds the riser
4Sand moistureExcess moisture → steam generation → gas porosity
5Gating ratioPressurized vs unpressurized systems affect turbulence and air aspiration

Practical Application

At a Belgaum SG iron foundry producing automotive flywheel housings (15 kg, 400 castings/day), a defect prediction model trained on 6 months of production data (72,000 castings) reduced shrinkage rejection from 8.2% to 3.1%. The key finding: the model identified that sand moisture above 3.8% in combination with superheat above 80°C created gas-assisted shrinkage porosity that methoding engineers had been attributing to risering inadequacy. The fix was process control (tighter sand moisture monitoring), not design change (more risers).

Casting Simulation Surrogates

Full casting simulation (ProCAST, MAGMA, SOLIDCast) solves Navier-Stokes for mould filling, Fourier's equation for solidification, and Niyama criteria for shrinkage prediction. A single simulation takes 4-24 hours depending on mesh resolution and geometry complexity. For a foundry that needs to quote 20 new parts per week, running full simulations on each is impractical.

Open data/simulation-parameters.json — it contains input-output pairs from MAGMA simulations: casting geometry descriptors, process parameters, and simulation results (fill time, last point to solidify, hot spot locations, Niyama criterion values, shrinkage volume).

Training a Surrogate

A surrogate model learns the mapping from geometry + process parameters to simulation outputs, without solving PDEs:

Training data: 2,000 MAGMA simulation runs (varied geometries and parameters)
Geometry encoding: voxelized 64×64×64 occupancy grid
Process features: pouring_temp, pouring_time, mould_type, HTC_values
Targets: hot_spot_locations (3D coordinates), shrinkage_volume (cm³),
         Niyama_min, fill_completeness (%)
Architecture: 3D-CNN on voxel grid + MLP on process features → concatenated → output heads

The surrogate runs in < 1 second vs 8+ hours for full simulation. Accuracy is ±15% on shrinkage volume prediction — not good enough to replace simulation for final validation, but excellent for:

  • Quick screening — which of 20 new quotation parts need full simulation vs can be risered from experience?
  • Riser/gating optimization — testing 100 riser positions in minutes rather than days
  • Real-time process adjustment — if pouring temperature deviates, what is the impact on this specific casting geometry?
  • Indian Foundry Context

    Most Indian foundries (especially SMEs in Belgaum, Coimbatore, and Rajkot clusters) do not own simulation software — licenses cost ₹15-40 lakh/year. A cloud-based surrogate service, trained on simulations run centrally, could democratize casting simulation for the SME sector. The foundry uploads a 3D model and process parameters, gets hot spot predictions and risering suggestions in minutes.

    Indian Foundry Clusters: SME Challenges

    Open data/defect-analysis.json — it contains defect investigation reports from multiple foundries with root cause analysis.

    Belgaum (SG Iron & Grey Iron)

    Belgaum is India's foundry capital — 300+ foundries producing SG iron and grey iron castings for automotive, pump, and valve applications. Key AI opportunities:

  • Inoculation optimization — SG iron nodularity depends on inoculant type, addition rate, and fade time. A model trained on spectrometer + image analysis data predicts nodularity from ladle treatment parameters, replacing the current practice of pouring test coupons and waiting for metallography.
  • Charge calculation — SG iron charge mix (pig iron, steel scrap, returns, FeSi, FeMn, Mg treatment alloy) must hit tight composition targets (C: 3.4-3.8%, Si: 2.2-2.8%, Mn < 0.3%). AI-assisted charge optimization minimizes alloy cost while hitting targets — savings of ₹1-3/kg are typical.
  • Coimbatore (Pump & Valve Castings)

    Coimbatore foundries produce complex pump impellers and valve bodies in grey iron, SG iron, and stainless steel. The challenge here is thin-section integrity — impeller vanes at 4-6mm thickness are prone to cold shuts and misruns.

    AI contribution: predicting fluidity index from composition and pouring conditions, and recommending minimum pouring temperature for a given section thickness. This replaces the conservative approach of pouring 30-40°C above necessary — which wastes energy and increases gas defects.

    Rajkot (Diesel Engine Components)

    Rajkot foundries supply diesel engine blocks and heads — complex grey iron castings with tight porosity specifications (CT Level 2 or better per ASTM E446). AI-based radiographic image analysis automates shrinkage classification, replacing manual comparison with reference radiographs.

    Input: digitized radiograph (DR panel, 16-bit greyscale)
    Model: U-Net segmentation for indication detection +
           classifier for ASTM E446 severity level
    Output: indication_locations, severity_level (1-5), accept/reject per customer spec
    Accuracy: 96% agreement with ASNT Level III radiographer

    Process Control for Foundries

    Spectrometer Data Integration

    Modern foundries have OES (Optical Emission Spectrometry) for composition analysis, but the data often sits in isolated spectrometer software. AI integration pulls spectrometer results into the production system and:

  • Compares actual composition to aim composition before pouring
  • Predicts properties from composition (UTS, elongation, hardness for SG iron grades)
  • Flags heats where composition drift indicates furnace refractory erosion (rising Si, Al) or charge material contamination (unexpected Cr, Cu from mixed scrap)
  • Thermal Analysis Integration

    Cooling curve thermal analysis (ATAS, QuiK-Cup) provides pre-pour quality indicators: liquidus arrest, eutectic undercooling (for grey/SG iron), and carbide risk. AI models correlate thermal analysis parameters with as-cast microstructure and properties — predicting graphite morphology (Type A vs D vs E in grey iron), carbide tendency, and nodule count in SG iron before the casting solidifies.

    Key Takeaways

  • Defect prediction identifies root causes that experience misses — the interaction between sand moisture and superheat causing gas-assisted shrinkage is exactly the kind of multi-factor pattern that ML captures.
  • Simulation surrogates democratize casting design — < 1 second predictions make simulation-quality guidance available to SME foundries that cannot afford ₹15-40 lakh/year software licenses.
  • Indian foundry clusters have specific AI opportunities — inoculation control in Belgaum, fluidity prediction in Coimbatore, radiographic classification in Rajkot. Each cluster has a dominant product type with a dominant defect mode.
  • Process integration is the prerequisite — spectrometer data, thermal analysis, and production records must flow into a unified system before AI can add value.
  • This is chapter 4 of AI for Metallurgy & Materials.

    Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.

    View course details