# Why do we need to design controllers (feedback) for controlling a quadrotor?

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?

• You mean if you want to hover (so with null angular velocity) you could trigger motors if the IMU is non null ? This is the idea behind the feedback control, you use the IMU reading as feedback ... – N. Staub Dec 10 '18 at 9:00

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:

• 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.