Innovative Algorithm for Washing Machine: Unbalance and Inertia Detection