For example if I want to make my quadrotor hover at a particular height, can't this be achieved by using an altitude sensor, and to correct it's position due to disturbances, can't we just write some if conditions such that depending on certain ranges of the IMU certain motors will increase or decrease it's speed and bring it back to the original position. Hence what is the use of designing controllers for a quadrotor using pid/lqr/h-infinity etc?
can't it be achieved by using an altitude sensor
Feeding the sensor data back to motors = feedback control. So you're actually answering your own question. So I'm leaning more on that you're questioning the control techniques like PID, etc.
If you just had some
if's everywhere in the code instead of a continuously modulated control loop, short answer, it wouldn't be accurate, it wouldn't be efficient, it wouldn't be practical, it wouldn't be straightforward to implement.
I suggest you read a bit about Theory of Control Systems even before going through the answers here but I'll answer your questions briefly. Controllers can help with the following:
Improving steady state accuracy by decreasing the steady state errors.
As the steady state accuracy improves, the stability also improves.
Reducing the offsets produced in the system.
Maximum overshoot of the system can be controlled using controllers.
Reducing the noise signals produced in the system.
Slow response of the over damped system can be made faster with the help of these controllers.
using [a] sensor and to correct it's position due to disturbances
Anything that corrects an action by means of sensors is a controller.
depending on certain ranges of the IMU certain motors will increase or decrease it's speed
This sounds a 'stepwise control with deadband' controller.
You can do this - the controller on my lathe is stepwise with deadband as it's easy and sometimes it works well enough where the system dynamics allow it - there's enough inertia in the lathe that we don't need anything very complicated. Generally linear control and PID give better results where the system has to respond to rapidly changing loads. It's unlikely that a quadcopter will be as forgiving as a chunk of rotating iron.