Controlling multiple motors using encoders. Function and example