How can I make the altitude more stable in autonomous flight?

Like explained in the Methodically configure and tune ArduCopter the best GNSS receivers are uBlox F9P or septentrio. And you should use an Helical antenna.