Differential waste calculation

Production line is a set of connected machines which often observe the amount of processed good products. Sometimes, a corrupted product rejected by a machine is not captured by a waste counter. In this cases a good way to estimate the number of waste is to observe the good counters of 2 machines, one early in the flow, and second later in the flow.

If the product went out of the first machine, but is never counted by the second machine, it usually means that it was rejected somewhere along the way. Such rejects are called a differential waste.

Settings

Differential waste for a line is calculated as a difference between output counters of two selected machines. With one being the BaseQuantity machine, and the second selected in the line setup:

(or WasteBaseDiffCounter line property)

By default, ‘Waste Base’ machine is assumed to be before base quantity machine in the flow. If this machine is after base quantity in the flow, it means that the line already counted some products as good products, instead of waste. Thus, the difference between the counters in addition to be classified as ‘waste’ needs to be subtracted from the line production.
This can be configured by setting WasteBaseDiffSubtract line property to ‘true’

To calculate output of each of the two machines PackOS looks at the history of Counter Deltas
see: https://ilabo.atlassian.net/wiki/spaces/LW/pages/1828454403

Tracking volume in the buffer

The key challange in the differential waste calculation is to account for a number of products between the two machines. We can’t track each product individually, we only observe counter increases for the two machines. Assuming there are no rejects, each counter increase of the first machine should, after some time, reach the second machine. During this period the increase is ‘in the buffer’ between them.

For the purpose of the waste estimation, we assume that all products ‘in the buffer’ are temporary a waste. After a counter increase on the second (usually base quantity) machine is registered, the products are ‘taken out of the trash', and classified as good production.

To determine what is the real number of wasted products over some period of time, the line need to be emptied. Such event is called a Buffer Reset and is critical to be captured correctly in order for differential waste to work correctly.

Example below shows counter increases on two different machines, and the corresponding buffer size in different moments in time. When the buffer reset is triggered, the current volume from the buffer is classified as waste.

Triggering Buffer Reset

By default, Buffer Reset is triggered each time an order is started or completed on the line. This assumes that:

  • The order is started at a correct time, before the first product is registered by the first machine.

  • The order is completed at a correct time, after the last good product gets out of the base quantity machine

  • There are no products left on the line, between orders

If this assumptions are not true, you can write a Pre-processing function which will trigger a buffer reset checking any condition you need. e.g. when a changeover of a certain type is started.

After such function is created, you can disable the default buffer reset behaviour using a flag in line settings:

Distributing waste from differential waste

After a buffer reset is triggered, the difference of the counters are no longer an estimate and becomes a real calculated waste. But the problem is - that we don’t know exactly when these products has been rejected. So the best we can do is to distribute them proportionally in all overlapping ‘buckets’ according to the manual production algorithms https://ilabo.atlassian.net/wiki/spaces/LW/pages/1845690373/Buckets#Manual-production-and-closed-buffers

Note the conflict between the manual production entries and closed buffers.
If there is a manual entry confirming the number of wasted products over some period of time when the buffer size has been tracked, the manual input will take precedence over the calculated waste, and the period augmented manually won’t be updated, even after a bucket reset.

This has an impact on the way you complete orders.

If an order is completed, with a manual waste confirmation, the production will not change after the bucket reset. However, if the bucket reset happen some time after the order is completed (e.g. after the next order), all orders before the previous reset and the current reset will have their waste re-calculated.