Performance and scale ·Case· 2014–2017

From customer order to raw materials: production planning for a manufacturing execution system

Manufacturing Execution System · Developer, then assistant team leader

Planners at the client plants built production plans by hand, in spreadsheets. Orders shipped late, some machines stood idle while others were overloaded, and raw materials ran short or were bought too early. We built a scheduler into the product to replace the spreadsheets: it starts from a customer order, breaks it into every production step, gives each one a machine and a time slot, and works down to the raw materials to order. The difficulty was that a cannery, an injection-moulding shop and a cookware press shop organise production in completely different ways. Plants that adopted it stopped planning by hand; the smaller plants with long processes kept their spreadsheets.

Problem
production was planned by hand in spreadsheets, so orders went out late, machines stood idle while others were overloaded, and raw materials were missing or bought too early.
Deciding constraint
one product had to plan very different kinds of production — batches in tanks and vessels, continuous lines, machines paired with moulds — without breaking material traceability.
Choice
a scheduler that works from the customer order down to a machine and time slot per step and the raw materials to order, with a planning model for each kind of production.
Result
plants that adopted it turned orders into machine schedules and raw-material lists without hand work, and ordered stock from the schedule. Smaller plants with long processes kept planning by hand.

Why it matters now

Most of the work I do today comes back to the same three questions: what does the business need from its data, how does planning turn an order into work, and how do you change a running system safely — here, inside a one-hour stop. This is where I learned them.

For your technical team How it was diagnosed, the options rejected and why, what went wrong, and the decision record. About 6 min read

Context and scope

A manufacturing execution system (MES) covers production automation, quality and traceability on the plant floor. This one was built as a product by a software company and sold to about 20 manufacturing clients, each running it in its own plant or plants, across food, consumer goods and materials processing. A typical plant had 2–6 production lines, 10–30 users and 2–10 connected machines. The system covered picking, stock, scheduling, production, quality control, labelling, traceability and shipping.

In scope: the scheduler, and the work around it that the role covered. Out of scope: integration with each client's ERP, label printers and scales, which was already part of the product before this work.

Drivers

Constraints

  • Material traceability was a requirement of the product: every change had to keep it intact.
  • Some plants could stop for only about an hour, so a release had to fit that window.
  • One product served canning lines, injection-moulding cells and metal presses, which each organise production differently.

Scenarios

  • When a customer order is entered, it becomes production steps, each with a machine and a time slot, plus a list of raw materials to order. Measured by whether planners still kept a spreadsheet beside it.
  • When a machine breaks down, a quality issue appears or an urgent order arrives, the schedule is replanned and delays are flagged. Measured by the alerts on delays and planning inconsistencies.
  • When a release goes to a plant that can stop for only about an hour, it is tested at the client in a low-activity period, after the automated tests, code review and QA. Measured by production incidents after release.

Options

  • Keep planning by hand

    Fits when
    the plant is small and its processes are long enough to plan by hand.
    Breaks when
    the plan has to change — a breakdown, an urgent order, a quality hold — and in the edge cases no spreadsheet handles.
  • One batch scheduler for every plant

    Fits when
    production runs in batches, in tanks and vessels.
    Breaks when
    a plant flows continuously, or schedules machines paired with moulds: batch slots do not describe it.
  • Chosen

    A scheduler with a planning model per kind of production

    Fits when
    one product serves industries that organise production differently.
    Breaks when
    a new industry fits none of the models, and each model is more code to maintain.

The scheduler started as the second option and became the third (What went wrong).

The decision and how it works

The scheduler starts from a customer order. It breaks the order into every production step, assigns a machine and a time slot to each, and works down to raw materials. It then produces the list of raw materials that need to be ordered.

Material planning alone was not enough for an MES: plants needed execution scheduling on the shop floor. The scheduler plans against finite capacity — machines, labour and tooling — and sequences jobs to reduce changeovers, cleaning and setup time. Each plant sees its schedule as a Gantt chart, in the office and on the floor. When a machine breaks down, a quality issue appears or an urgent order arrives, it replans, and it alerts on delays and on inconsistencies in the plan. The goals were machine optimisation, less paperwork and less inventory, with raw materials ordered closer to when production needs them rather than held as a precaution.

Each kind of plant needed its own planning model:

Kind of plant Planning model Gantt rows Planning logic
Canned food Batch and process Preparation, cooking, fillers, seaming, retorts, cooling, packing Release batches in step with sterilisation capacity and packaging availability
Injection moulding Finite capacity Each machine, moulds, auxiliary equipment, finishing Allocate orders to compatible machine–mould combinations
Metal cookware Finite capacity along a routing Cutting, presses, stamping, CNC, welding, coating, assembly Schedule jobs through a routing of dependent operations

How the move was made

Planning moved from spreadsheets to the scheduler under the release constraint above: every release had to fit about an hour at the plant, which shaped how changes were tested and shipped (below).

How the decision was kept true

Automated tests ran across the product, the scheduler included, and the whole team wrote them. Before each release, scripts ran those tests and built the packages. Code review and a QA engineer worked closely with the team, and there were fewer production incidents once they were in place. Each release was then tested at the client in a low-activity period, to fit the one-hour window and keep traceability intact.

What went wrong

Built for batches first. The scheduler was designed around batch planning: lots in a tank or vessel, each in a time slot. Plants whose production flows through continuous stages, such as a canning line from filling to packing, did not fit, and most plants turned out to combine the two. The scheduler ended with two views, batch planning and process planning, combined per kind of plant. I would start from that distinction today, before writing the first planning rule.

Planners with working spreadsheets did not see the need. Many still used their spreadsheets and asked why they would need the scheduler, since the sheets worked for them. What the sheets did not handle was replanning and the edge cases. In small plants with long processes, hand planning was enough, and they kept it.

I did not measure. None of the improvements was measured before and after, so this case has almost no figures. That is where I learned to measure first.

Operations, scale and the team

The team was four developers, one QA engineer, two technical support and two operational support staff. The tested range is the one the plants give: 2–6 lines, 10–30 users, 2–10 machines, about 20 clients.

Other work in the same role:

  • Database performance. As plants and data volumes grew, queries slowed across the product. I ran a full review of the database, with profiling, rewrote the hierarchical queries and added indexes, and queries became faster across the product.
  • Duplicated code was consolidated into shared components.
  • Product direction: gathering requirements from client plants and defining the roadmap as the product moved into new industries.
  • Delivery as assistant team leader, in the last two years: code reviews, CI/CD, and onboarding the QA and support staff.

Results

  • Manual planning steps removed where the scheduler was adopted: orders became machine schedules and raw-material requirements without hand work.
  • Optimised stock: raw materials ordered from the schedule.
  • Fewer production incidents once code review and QA were in place.
  • Fewer errors after duplicated code was consolidated.
  • More confidence in each release, and slightly faster releases, once scripts ran the automated tests and built the packages.

Stack: .NET, WPF (MVVM), 3-tier architecture, SQL Server, CI/CD.

On a different stack

The structure — order, steps, machine and time slot, raw materials — does not depend on the platform. It was built on .NET and SQL Server; on another stack the data model and the flow carry over, and the storage and the solver differ.

Where to start?

Describe the problem in a few minutes: what it is about, a little context and how to reach you.