Hackaday Dictionary: Open- and Closed-Loop Systems

Today on Hackaday Dictionary, we’re going to talk about the two basic types of control systems: open-loop and closed-loop. We’ll describe the differences between them and explore the various advantages and disadvantages of each. And finally, we’ll talk about what happens when you try to draw a line between the two.

 

light-switch-ok
And there was much rejoicing. Image via Racoon Valley Electric Cooperative

Control Systems

Control systems are literally all around us. They’re illuminating our rooms, laundering our unmentionables, and conspiring to make us late for work. Most of us probably use or interact with at least five control systems before we’re even out the door in the morning. Odds are you’re using a control system to read this article.

When we say ‘control system’, we’re speaking broadly. A control system is defined as any system that exhibits control over a function. It doesn’t matter how big or small the function is. A standard light switch is a simple type of control system. Flip it back and forth and the light is either on or off with no in between. Too bright? Too bad. There is no way to account for light intensity preference, use duration, energy output, or anything else.

speed-queen
A humble clothes dryer. Image via Showplace Rents

Another common example in discussing control system theory is the clothing dryer. Set the timer on the dryer and it will run until time expires. Will it run long enough to dry everything without shrinking anything? The only way to know is to open the door and check.

Both the light switch and the clothes dryer are open-loop systems. The process is a straight line from start to finish, and they operate without concern for their output. Once the light switch is flipped to the on position, current will flow until the switch is reversed. The switch doesn’t know if the bulb is burned out or even screwed into the socket to begin with. And the clothes dryer doesn’t care if your clothes are damp or dry or totally shrunken when time runs out.

 

Stay in the Loop

In a closed-loop system, the process begins the same way it does in an open-loop system. But a closed-loop system has one or more feedback loops in place that can adjust the process. Sometimes the feedback will simply cause the process to repeat until the desired result is achieved.

Both of our open-loop control system examples above could easily be converted to closed-loop systems. A more advanced light switch might take input from a photo cell, or it could poll a motion detector and turn the lights off after a period of no detectable activity in the room. The clothes dryer could be improved with the addition of a moisture sensor. Since the humidity level in the dryer will change during the cycle, why not poll a DHT22 and re-run the process until a predetermined humidity level is reached? Then the dryer becomes a closed-loop system. No more reaching in and fondling the towels and shirt collars to make sure everything is dry. Well, at least in theory.

xkcd_traffic_lights
What are they telling you? xkcd #1116

Some control systems exist in both forms. Traffic lights are a good example of this phenomenon. Some lights are open-loop and simply run on a schedule. Many more of them are closed-loop and will cycle differently depending on traffic flow or information received from other traffic lights. The really smart ones have Emergency Vehicle Preemption (EVP) receivers. This is the system that allows fire trucks and some other emergency vehicles to change the lights in their favor. A device in the vehicle strobes a specific pattern at the receiver module on the light post, and the light changes as soon as possible.

 

cruise-control
Cruise control via Wikipedia

Advantages and Disadvantages

The main advantage of closed-loop systems is fairly obvious: using feedback means more and better control. But there are trade-offs. It’s almost impossible to deal with all the what-ifs in creating any system, and this generates unforeseen issues. They aren’t all bad, though. Maybe you’re sitting peacefully in the corner engrossed in a book, and the motion detector-driven lights shut off because you aren’t moving around enough.  That isn’t ideal, but it’s easy enough to turn the lights back on and keep reading.

The unforeseen issues can be so much worse than sudden darkness. Case in point: robotic vacuum cleaners. Here you have a complexly closed-loop system to take care of one of life’s drudgeries. Should be awesome, right? Yes, but because it is blind to everything but its pre-programmed boundaries, it doesn’t know not to spread messes around.

A lot of closed-loop control systems look great on paper, but their imperfections become clear in execution. Take cruise control for example. Here is a system that’s better at its job than humans are. It will maintain the set speed until you hit the brakes or run out of gas. It will perform as intended whether there is a headwind or a tailwind or you’re towing a boat or transporting rowdy children. But cruise control isn’t aware of cliffs or guard rails or deer darting out in front of the car. Cruise control keeps its head down and does its job until it can’t go on.

Open-loop systems may not be as smart as closed-loop systems, but they often shine in their simplicity. For the most part, they do what you expect them to do. Light goes on, light goes off. And they are arguably more dependable since there are fewer things that can go wrong. Of course, a “simple” open-loop control system can mean a steeper learning curve. It’s not easy to learn to drive a manual transmission. But if you don’t know how to drive one, you’re missing out on some nice advantages, like the ability to push start the thing if you have to, and the option to downshift instead of pumping the brakes in icy conditions. So the question is this: is an open-loop system more valuable than a closed-loop system if it means having more control over the process? Does it depend entirely on the process in question?

tricycle-door-stopper
This tricycle is simultaneously safe and unsafe. Image via Apple Door

Open-Loop vs. Closed-Loop

So where exactly does open-loop end and closed-loop begin? The line seems clear for some systems, but muddy for others. How much feedback is enough to qualify? Add just about anything to a light switch and it seems safe to say that you took it from open- to closed-loop.

More often than not, the line between the two is blurry. Think of a motorized garage door.  You push the button and the door either opens or closes. Push it again and the door moves in the opposite direction. Most modern garage doors have a fail-safe in place to stop the garage door in the event of an emergency. If the door encounters any resistance, it will stop and reverse direction.

The break beam detector is supposed to keep people and their tricycles from being crushed if they happen to be in the way while the door is closing. But it only works if the person or thing breaks the IR beam. There’s only one beam, and it sits about six inches off the floor. The motorized garage door system is actually quite limited because it has no positional awareness. It doesn’t know where it is on the track, it’s just going up and down blindly, waiting for input or resistance.

Not all doors can be counted on to stop if they feel resistance—I tested mine and it kept on going. So if I don’t pull far enough into the garage and then put the door back down, it might hit the protruding rear end of my hatchback. It’s in the way of the door closing, but it sits way too high to break the beam. So is the garage door really, truly a closed-loop system?

26 thoughts on “Hackaday Dictionary: Open- and Closed-Loop Systems

  1. Well, to be honest, most doors have 2 insurances: The beam that prevents the door from closing, and a airpressure sensor that detects when the door is down (to shut it off). Its called “double insurance”.

  2. “Boo” to cruise control; I’ll never use it. Too many people fall asleep at the wheel with the thing set at highway speeds, and too many people trust those tiny sensors to detect the car ahead.

    1. “Those tiny sensors”
      You’re mistaking parking-assist sensors with the actual radar system that’s being used for adaptive cruise control.

      These tiny things are short range ultrasonic sensors used for park assist: https://hackadaycom.files.wordpress.com/2012/02/automotive-parking-sensors.jpg?w=800

      These massive blobs (marked red in pic) are the long range radar sensors for adaptive cruise control:
      http://s42.photobucket.com/user/kreush33/media/photo1-1.jpg.html

      And just to have it all, these are the most recent modules which are not only used for ACC but also for roadsign detection and other fun and helpful stuff – yes, it’s a stereo camera:

    2. Am I the only one who feels that cruise control makes you feel like driving a runaway train?

      The steering starts to feel like there’s something wrong, like it’s not responding right, as if it was a bit “loose” and the car could go any which way at any moment. The moment I put my foot back on the pedal and start throttling manually, it feels alright again.

      I think it’s because when the car controls the throttle, the steering angle changes subtly depending on the load on the engine because it puts forces on the steering geometry, and since I don’t have my foot on the pedal I can’t automatically predict how the steering will respond, so it feels wrong.

  3. I worked on high frequency ~50kHz, high accuracy <0.1 micron closed loop positioning systems. An unacceptably large error turned out to be the state of the art position sensor injecting noise into the loop. A solution turn out to first use the sensor to map the average error over time and then run the system open loop. I had a controls professor that called open loop "robust control."

    1. Was that sensor on the load your only feedback? If so, I would say that slapping an encoder on the drive side and calculating velocity/derivative off of that would have made your whole system much better. Your drive mechanics were most likely resulting in an out of phase resonance, basically at sub-micron levels your encoder read-head is flapping in the wind. So to counteract that, you need something watching your drive to dampen high frequency oscillations.

      I totally agree with the mapping though, take that mapping, use it as your feed-forward control, and tune your control system around it. That is the only way to make an exceptionally robust control system.

    2. Open loop deviates slightly when the conditions change, like a change in air pressure or temperature might change things a little but the difference is consistent – the actuator over/undershoots the same amount each time.

      Closed loop is tuned to particular conditions, so unless it’s continuously learning new parameters and double checking itself, it will amplify errors caused by changes in conditions in a non-predicted way. The “tighter” the tuning of the loop, the more prone it is to start oscillating.

  4. Most dryers have thermostats, usually near the heating element and on the exhaust, they are closed loop, you may consider they are open loop when not using heat just tumble drying however only for the old ones new energy efficient dryers do sense and act on the drum spin.

  5. This has got to be one of the worst articles in HaD in a long time and one of the worst articles about open-loop vs. closed loop systems. The examples are rather poor and the discussion is at a 5th grade level. Sigh.

    1. Agree and it sucks. THIS topic is dense enough to cover several good articles, yet the few inaccurate information is diluted into babble like:
      “So where exactly does open-loop end and closed-loop begin? The line seems clear for some systems, but muddy for others.”
      and
      “or the most part, they do what you expect them to do. Light goes on, light goes off. ”
      … whose role is just to FILL UP the page and pay the “author”, not to bring any informational value.

      HaD has just become a crappy proxy. Most original articles are superficial and inaccurate, and the rest is lifehack youtube channel level copy-pasted with the errors and some more.
      Ratio is 4/5 entertainement/clickbait vs 1/5 honest/informative articles.

      1. I’m studying computer engineering and I’m at the sophomore level, but I hadn’t a better idea of a control system until this article. Despite the presumed inaccuracies of the article, I found it helpful by making denser reading accessible. e.g. Wikipedia’s Control System article using a boiler in a central heating system on a timer for an open-control-loop example and one that’s on a thermostat for a closed-control-loop example. That’s certainly a fine example if you’ve seen a boiler operate on a timer, and seen one operate on a thermostat; but if you hadn’t, it’s a bad example to me and I missed out on any nuances in the example. But a light switch? Or a garage door opener? As a person *deeply experienced in light switch usage* and mashing the garage door opener until it stopped working, HECK YEAH I UNDERSTOOD THAT ARTICLE and why I like reading it better than something *absolutely* “correct!”

  6. @Kristina, if your garage door opener doesn’t automatically reverse the door upon encountering resistance, for safety’s sake you need to fix it. On most home models, there is a potentiometer that lets you adjust the “downward force”. (This is separate from the control that lets you adjust the travel distance.) To adjust, you place a sacrificial test object on the floor beneath the door (a piece of 2×4 dimension lumber is suggested), then adjust the downward force knob until the door reliably reverses when it strikes the object. Further, I would then suggest placing a small corrugated cardboard box in the same position, and ensure the closing door reverses before it crushes the box. Please see your garage door opener’s operating manual for complete instructions; or call a qualified service professional.

    1. Open-loop is a system that is given a set of outputs from the user and maintains that output using the feedback as input to make adjustments to the control system. A closed-loop uses just the feedback from the output to make its adjustments without input from the user. Also known as man-in-the-loop and man-on-the-loop respectively.

  7. “A standard light switch is a simple type of control system. Flip it back and forth and the light is either on or off with no in between. Too bright? Too bad. There is no way to account for light intensity preference, use duration, energy output, or anything else.”

    That’s not true. If you have fast fingers you could pulse-width-modulate the light intensity.

  8. “A device in the vehicle strobes a specific pattern at the receiver module on the light post, and the light changes as soon as possible.”

    Coudn’t find an Instructable for doing this. Anyone know of a construction article? (he says with an evil grin)

  9. “Take cruise control for example. Here is a system that’s better at its job than humans are. It will maintain the set speed until you hit the brakes or run out of gas.”

    You forgot running into a bridge abutment as an end case.

  10. “So where exactly does open-loop end and closed-loop begin? The line seems clear for some systems, but muddy for others. How much feedback is enough to qualify? Add just about anything to a light switch and it seems safe to say that you took it from open- to closed-loop.”

    wat

    “Add just about anything to a light switch and it seems safe to say that you took it from open- to closed-loop.””

    Why write this article without a single mention of control loop math? That’s why it’s a “mystery.”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s