Hello,
I modify this program in "PID Controller". I gave Autotune and commands line is so big. I have question, i can optimize this program about 2kb memory? I don't have idea how can reduce the weight program and give the program to add on.
Your question is not easy to understand but I think that you are asking how to reduce the size of the program. It is difficult to give advice because you have not provided all of your code, some of which is presumably in separate header or .ino files in the IDE.
I wonder then if a quadcopter program is what you should be attempting with all the inherent dangers that an out of control quadcopter implies.
Have you any experience of flying and tuning a quadcopter with a commercial flight controller board ? If not and you are determined to use an Arduino then perhaps you should be considering the Ardupilot board.
This is a project to do. I have just programmed, and someone else check it out and will control. I write here but we can me say what is bad and we can i fix this. For me it's a lot because of something you even more know.