Hackaday readers don’t need an introduction to the Arduino. But in industrial control applications, programmable logic controllers or PLCs are far more common. These are small rugged devices that can do simple things like monitor switches and control actuators. Being ruggedized, they are typically reasonably expensive, especially compared to an Arduino. [Doug Reneker] decided to evaluate an Arduino versus a PLC in a relatively simple industrial-style application.
The application is a simple closed-loop control of flow generated by a pump. A sensor measures flow for the Arduino, which adjusts a control valve actuator to maintain the specified setpoint. The software uses proportional and integral control (the PI part of a PID loop).
[Derek Schulte] designed and sells a consumer 3D printer, and that gives him a lot of insight into what makes them tick. His printer, the New Matter MOD-t, is different from the 3D printer that you’re using now in a few different ways. Most interestingly, it uses closed-loop feedback and DC motors instead of steppers, and it uses a fairly beefy 32-bit ARM processor instead of the glorified Arduino Uno that’s running many printers out there.
The first of these choices meant that [Derek] had to write his own motor control and path planning software, and the second means that he has the processing to back it up. In his talk, he goes into real detail about how they ended up with the path planning system they did, and exactly how it works. If you’ve ever thought hard about how a physical printhead, with momentum, makes the infinitely sharp corners that it’s being told to in the G-code, this talk is for you. (Spoiler: it doesn’t break the laws of physics, and navigating through the curve involves math.)
If you’ve ever tried to tune a PID system, you have probably encountered equal parts overwhelming math and black magic folk wisdom. Or maybe you just let the autotune take over. If you really want to get some good intuition for motion control algorithms, PID included, nothing beats a little hands-on experimentation.
The basic setup is a potentiometer glued to a barbecue skewer with a mini-quadcopter motor and rotor on the end of it. A microcontroller reads the voltage and PWMs the propeller through a MOSFET. The goal is to have the pendulum hover stably in midair, controlled by whatever algorithms you can dream up on the controller. [Clovis]’ video demonstrates on-off and PID control of the fan. Adding a few more potentiometers (one for P, I, and D?) would make hands-on tweaking even more interactive.
In all, it’s a system that will only set you back a few bucks, but can teach you more than you’d learn in a month in college. Chances are good that you’re not going to have exactly the same brand of sardine can on hand that he did, but some improvisation is called for here.
If you don’t know why you’d like to master open-loop closed-loop control algorithms, here’s one of the best advertisements that we’ve seen in a long time. But you don’t have to start out with hand-wound hundred-dollar motors, or precisely machined bits. As [Clovis] demonstrates, you can make do with a busted quadcopter and whatever you find in your kitchen.
There’s hardly a day that passes without an Arduino project that spurs the usual salvo of comments. Half the commenters will complain that the project didn’t need an Arduino. The other half will insist that the project would be better served with a much larger computer ranging from an ARM CPU to a Cray.
[Will Moore] has been interested in BEAM robotics — robots with analog hardware instead of microcontollers. His latest project is a sophisticated line follower. You’ve probably seen “bang-bang” line followers that just use a photocell to turn the robot one way or the other. [Will’s] uses a hardware PID (proportional integral derivative) controller. You can see a video of the result below.
[Jason] learned a lot by successfully automating this meat smoker. This is just the first step in [Jason’s] smoker project. He decided to begin by hacking a cheaper charcoal-fed unit first, before setting his sights on building his own automatic pellet-fed smoker. With a charcoal smoker it’s all about managing the airflow to that hot bed of coals.
[Jason] started by making sure the bottom was sealed off from stray airflow, then he cut a hole into the charcoal pan and attached a length of steel pipe. The opposite end of the pipe has a fan. Inside the pipe there is a baffle separating the fan from the charcoal pan. The servo motor shown here controls that valve.
The pipe is how air is introduced into the smoker, with the fan and valve to control the flow rate. The more air, the higher the temperature. The hunk of pipe was left uncut and works fine but is much longer than needed; [Jason says] the pipe is perfectly cool to the touch only a foot and a half away from the smoker.
With the actuators in place he needed a feedback loop. A thermocouple installed into the lid of the smoker is monitored by an Arduino running a PID control loop. This predicts the temperature change and adjusts the baffle and fan to avoid overshooting the target temp. The last piece of hardware is a temperature probe inside the meat itself. With the regulation of the smoker’s temperature taken care of and the meat’s internal temperature being monitored, the learning (and cooking) process is well underway.
There are many, many smoker automation projects out there. Some smokers are home-made electric ones using flower pots, and some focus more on modifying off the shelf units. In a way, every PID controlled smoker is the same, yet they end up with different problems to solve during their creation. There is no better way to learn PID than putting it into practice, and this way to you get a tasty treat for your efforts.
The Brasilia Lady comes with a 300 ml brass boiler, a pump and four buttons for power, coffee, hot water and steam. A 3-way AC solenoid valve, wired directly to the buttons, selects one of the three functions, while a temperamental bimetal switch keeps the boiler roughly between almost there and way too hot.
To reduce the temperature swing, [Rhys] decided to add a PID control loop, and on the way, an OLED display, too. He designed a little shield for the Arduino Nano, that interfaces with the present hardware through solid state relays. Two thermocouples measure the temperature of the boiler and group head while a thermal cut-off fuse protects the machine from overheating in case of a malfunction.
Also, the Lady’s makeup received a complete overhaul, starting with a fresh powder coating. A sealed enclosure along with a polished top panel for the OLED display were machined from aluminum. [Rhys] also added an external water tank that is connected to the machine through shiny, custom lathed tube fittings. Before the water enters the boiler, it passes through a custom preheater, to avoid cold water from entering the boiler directly. Not only does the result look fantastic, it also offers a lot more control over the temperature and the amount of water extracted, resulting in a perfect brew every time. Enjoy [Rhys’s] video where he explains his build:
Your quad-copter is hovering nicely 100 feet north of you, its camera pointed exactly on target. The hover is doing so well all the RC transmitter controls are in the neutral position. The wind picks up a bit and now the ‘copter is 110 feet north. You adjust its position with your control stick but as you do the wind dies and you overshoot the correction. Another gust pushed it away from target in more than one direction as frustration passes your lips: ARGGGHH!! You promise yourself to get a new flight computer with position hold capability.
How do multicopters with smart controllers hold their position? They use a technique called Proportional – Integral – Derivative (PID) control. It’s a concept found in control systems of just about everything imaginable. To use PID your copter needs sensors that measure the current position and movement.
The typical sensors used for position control are a GPS receiver and an Inertial Management Measurement Unit (IMU) made up of an accelerometer, a gyroscope, and possibly a magnetometer (compass). Altitude control would require a barometer or some other means of measuring height above ground. Using sensor fusion techniques to combine the raw data, a computer can determine the position, movement, and altitude of the multicopter. But calculating corrections that will be just right, without over or undershooting the goal, is where PID comes into play. Continue reading “Flying with Proportional – Integral – Derivative Control”→