Adaptive production systems and measurement and control equipment for optimal energy consumption and near-to-zero emissions in manufacturing processes