PID is something that will work for this, and there are other controllers out there that will work such as Take Back Half (TBH).
Here are some resources to help you better understand these algorithms.
PID:
- http://georgegillard.com/programming-guides/introduction_to_pid_controllers_ed2-pdf?format=raw
- PID Controller - BLRS Wiki
TBH:
The George Gillard article is very good, as it provides a lot of information in an easier to understand way, provides nice pseudocode, and discusses the process of tuning PID.
Hope these help!