The motor runs at half the speed

Ok, I didn't want to bother you adding all my code, but when I trid it says that it exceeds the allowed length (9500 characters)..

But later I found that someone uses constrain() after map():

turn = map(ch1,1000,2000,-500,500);
turn = constrain(turn, -255, 255);

I will try it later.