0
$\begingroup$

I've seen with drones that the norm of programming them is to create three loops, for each axis, but I'm not quite sure what a control loop is when the code must run in a sequential manner.

Programmatically, what IS a control loop?

$\endgroup$
4
$\begingroup$

A control loop is:

  1. Get a reference
  2. Get a feedback
  3. "Decide what to do" given the reference and feedback
  4. Perform an action (or not) based on the decision.

This process continuously repeats.

Generally, if you have multiple control loops on one controller, you perform each step in turn for each control loop - get all references, get all feedbacks, run the actual control algorithm to generate the control signal, then write the control signal as appropriate.

$\endgroup$
2
$\begingroup$

I think Chuck's answer is quite accurate. Just to add, there are two types of control loops. What Chuck has described is a closed control loop, and hence has a feedback loop to make sure the output is same as reference input or the set point.

Open loop, on the other hand, doesn't need a feedback loop as the control action is independent of the process output.

$\endgroup$
  • 1
    $\begingroup$ Well, kind of. Open loop assumes a feedback, where closed loop measures a feedback. For example, you may want to move a small vehicle from point A to point B. Not a problem, as long as you can establish a relationship between motor encoder counts and distance travelled. This then becomes your feedback - you travel X encoder counts and you assume the robot is now at position Y. There is a model for how the inputs affect the outputs, and that model becomes the basis for "measuring" (assuming) outputs. $\endgroup$ – Chuck Jul 19 '17 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.