If a thing behaves erritacally when motors are turned on the cause is almost always lack of power supply decoupling.