Autonomous Robot, motor driver

You should add a small delay in there to see the change. Also for that particular segment, I would swap analogWrite(PWML, speed), with analogWrite(PWML, i);//