quadcopter tunings PID

hey:
i was working to make my own flight controller, i already made the code using arduino uno, it works, but i tried so much to get PID tuning values, but i can't reach to the optimum value always it is not stable , so any idea to get them, or any one has arduino code for quadcopter flight controller and can help me in this?

Take a look into MultiWii.

lg, couka