mech

CNC G/M Codes & Inventory Models (EOQ, JIT)

The programming and production-planning half of manufacturing interviews: interpolations, canned cycles, EOQ trade-offs and JIT logic.

Tata MotorsBoschL&TMaruti Suzuki

Key formulas

  • Q* = √(2DS/H)

    EOQ (Wilson formula): D = annual demand, S = ordering cost per order, H = holding cost per unit per year; D/S ordering and average inventory Q*/2 trade off.

  • ROP = d̄ · LT + SS

    Reorder point: Average demand during lead time plus safety stock; SS = z·σ_d·√LT for a chosen service level z.

Cheat sheet

  • ▸G-codes: G00 rapid, G01 linear, G02/G03 circular CW/CCW, G17/G18/G19 plane select, G20/G21 inch/mm, G28 home, G40/41/42 cutter comp off/left/right, G54–59 work offsets, G81 drilling canned cycle, G90/G91 absolute/incremental.
  • ▸M-codes: M00 program stop, M03/M04 spindle CW/CCW, M05 spindle stop, M06 tool change, M08/M09 coolant on/off, M30 program end & rewind.
  • ▸CNC interpolations: linear, circular and helical interpolation are built-in; parabolic/cubic come from higher-level CAM post-processors.
  • ▸EOQ (Wilson): Q* = √(2DS/H) — ordering cost S per order vs holding cost H per unit-year; total cost curve is flat near optimum, so EOQ is forgiving.
  • ▸EOQ assumptions: demand constant & known, no quantity discount, instantaneous replenishment, no shortages.
  • ▸JIT/lean: produce only what is needed when needed; kanban pull signals, setup-time reduction (SMED), small lots, supplier integration — inventory is treated as waste hiding problems.
  • ▸Safety stock rises with demand variability and lead-time variability: SS = z·σ·√LT.

EOQ vs JIT inventory philosophy

AspectEOQ (push, classic)JIT (pull, lean)
DriverCost trade-off maths on forecast demandActual downstream consumption (kanban)
Order sizeOptimal batch Q* (often large)Small, frequent lots
Inventory viewNecessary bufferWaste that hides defects/delays
Setup costFixed input SActively reduced (SMED) to shrink batches
Works best withStable, predictable demandReliable suppliers, levelled schedules

Top 4 campus interview questions

MCQ mastery quiz

1. Which G-code performs a straight-line feed move?

2. G02 and G03 command…

3. With annual demand D = 7,200, ordering cost S = ₹250 and holding cost H = ₹40/unit-year, the EOQ is…

4. JIT reduces optimal batch size mainly by…

5. M06 in a CNC program typically…