Friction Dynamics of Foams under Nonlinear Motion