A Real-Time Algorithm for Fault Detection in Construction Machinery