Online Fault Detection: A Smart Approach for Industry 4.0