Adaptive production systems and measurement and control equipment for optimal energy consumption and near-to-zero emission