The modified hot glue gun, reassembled

Tired Of Burnt Fingers? Try PID Tuning The Hot Glue Gun

Hot glue guns are pretty simple beasts: there’s an on/off switch, a heating element, and a source of current, be it battery or wired. You turn it on, and the heater starts warming up; eventually you can start extruding the thermoplastic sticks we call “hot glue”. Since there’s no temperature control, the longer you run the gun, the warmer it gets until it is inevitably hotter than you actually want– either burning you or oozing thermoplastic out the tip. [Mellow_Labs] was sick of that after a marathon hot-glue session, and decided to improve on his hot glue gun with PID tuning in the video embedded below.

PID tuning is probably a familiar concept to most of you, particularly those who have 3D printers, where it’s used in exactly the same way [Mellow_Labs] puts it to work in the hot glue gun.  By varying the input (in this case the power to the heater) proportional both to the Parameter (in this case, temperature) as well as the Integral and Derivative of that value, you can have a much steadier control than more naive algorithms, like the simple “on/off” thermostat that leads to large temperature swings.

In this case [Mellow_Labs] is implementing the PID control using a thermistor that looks like it came from a 3D printer, and a MOSFET driven by an RP2040. Microcontroller gets its power via the hot glue gun’s battery fed through a buck converter. Since he has them, a small OLED screen displays temperature, which is set with a pair of push-buttons. Thus, one can set a temperature hot enough to melt the glue, but low enough to avoid oozing or third degree burns.

He does not share the code he’s running on the RP2040, but if you are inspired to replicate this project and don’t want to roll your own, there are plenty of example PID scripts out there, like the one in this lovely robot. No, PID isn’t reserved for thermostats– but if you are controlling heat, it’s not reserved for electric, either. Some intrepid soul put built a PID controller for a charcoal BBQ once. Continue reading “Tired Of Burnt Fingers? Try PID Tuning The Hot Glue Gun”

Robot Balances Ball On A Plate

Imagine trying to balance a heavy metal ball bearing on a cafeteria tray. It’s not the easiest thing in the world! In fact, it’s perhaps a task better automated, as [skulkami3000] demonstrates with this robotic build.

The heart of the build is a flat platform fitted with a resistive touchscreen panel on top. The panel is hooked up to a Teensy 4.0 microcontroller. When a heavy ball bearing is placed on the touch panel, the Teensy is thus able to accurately read its position. It then controls a pair of NEMA 17 stepper motors via TCM2208 drivers in order to tilt the panel in two axes in order to keep the ball in the centre of the panel. Thanks to its quick reactions and accurate sensing, it does a fine job of keeping the ball centred, even when the system is perturbed.

Projects like these are a great way to learn the basics of PID control. Understanding these concepts will serve you well in all sorts of engineering contexts, from controlling industrial processes to building capable quadcopter aircraft. Continue reading “Robot Balances Ball On A Plate”

Combining Gyro Stabilisation With Weight Shift Balancing

Gyroscopes are perfect to damper short impulses of external forces but will eventually succumb if a constant force, like gravity, is applied. Once the axis of rotation of the mass aligns with the axis of the external torque, it goes into the gimbal lock and loses the ability to compensate for the roll on that axis. [Hyperspace Pirate] tackled this challenge on a gyroscopically stabilized RC bike by shifting a weight around to help keep the bike upright.

[Hyperspace Pirate] had previously stabilized a little monorail train with a pair of control moment gyroscopes. They work by actively adjusting the tilt of gyroscopes with a servo to apply a stabilizing torque. On this bike, he decided to use the gyro as a passive roll damper, allowing it to rotate freely on the pitch axis. The bike will still fall over but at a much slower rate, and it buys time for a mass on the end of the servo-actuated arm to shift to the side. This provides a corrective torque and prevents gimbal lock.

[Hyperspace Pirate] does an excellent job of explaining the math and control theory behind the system. He implemented a PD-controller (PID without the integral) on an Arduino, which receives the roll angle (proportional) from the accelerometer on an MPU6050 MEMS sensor and the roll rate (Derivative) from a potentiometer that measures the gyro’s tilt angle. He could have just used the gyroscope output from the MPU6050, but we applaud him for using the actual gyro as a sensor.

Like [Hyperspace Pirate]’s other projects, aesthetics were not a consideration. Instead, he wants to experiment with the idea and learn a few things in the process, which we can support.

Continue reading “Combining Gyro Stabilisation With Weight Shift Balancing”

Vastly Improved Servo Control, Now Without Motor Surgery

Hobby servos are great, but they’re in many ways not ideal for robotic applications. The good news is that [Adam] brings the latest version of his ServoProject, providing off-the-shelf servos with industrial-type motion control to allow for much, much tighter motion tracking than one would otherwise be limited to.

Modifying a servo no longer requires opening the DC motor within.

The PID control system in a typical hobby servo is very good at two things: moving to a new position quickly, and holding that position. This system is not very good at smooth motion, which is desirable in robotics along with more precise motion tracking.

[Adam] has been working on replacing the PID control with a more capable cascade-based control scheme, which can even compensate for gearbox backlash by virtue of monitoring the output shaft and motor position separately. What’s really new in this latest version is that there is no longer any need to perform surgery on the DC motor when retrofitting a servo; the necessary sensing is now done externally. Check out the build instructions for details.

The video (embedded just below) briefly shows how a modified servo can perform compared to a stock one, and gives a good look at the modifications involved. There’s still careful assembly needed, but unlike the previous version there is no longer any need to actually open up and modify the DC motor, which is a great step forward.

Continue reading “Vastly Improved Servo Control, Now Without Motor Surgery”

A Deep Dive Into Quadcopter Controls

In the old days, building a quadcopter or drone required a lot of hacking together of various components from the motors to the batteries and even the control software. Not so much anymore, with quadcopters of all sizes ready to go literally out-of-the-box. While this has resulted in a number of knock-on effects such as FAA regulations for drone pilots, it’s also let us disconnect a little bit from the more interesting control systems these unique aircraft have. A group at Cornell wanted to take a closer look into the control systems for drones and built this one-dimensional quadcopter to experiment with.

The drone is only capable of flying in one dimension to allow the project to more easily fit into the four-week schedule of the class, so it’s restricted to travel along a vertical rod (which also improves the safety of the lab).  The drone knows its current position using an on-board IMU and can be commanded to move to a different position, but it first has to calculate the movements it needs to make as well as making use of a PID control system to make its movements as smooth as possible. The movements are translated into commands to the individual propellers which get their power from a circuit designed from scratch for this build.

All of the components of the project were built specifically for this drone, including the drone platform itself which was 3D printed to hold the microcontroller, motors, and accommodate the rod that allows it to travel up and down. There were some challenges such as having to move the microcontroller off of the platform and boosting the current-handling capacity of the power supply to the motors. Controlling quadcopters, even in just one dimension, is a complex topic when building everything from the ground up, but this guide goes some more of the details of PID controllers and how they help quadcopters maintain their position.

Continue reading “A Deep Dive Into Quadcopter Controls”

Building Reaction Wheels With Python And LEGO

Reaction wheels are useful things, typically used by satellites to keep themselves oriented the right way up in space. Turning the reaction wheel creates an equal and opposite torque in the spacecraft, allowing it to point and rotate itself accurately. The same technique also works here on Earth, and [Brick Experiment Channel] decided to build one out of LEGO to control an inverted pendulum.

The initial design using a small LEGO wheel on an inverted pendulum was only able to work reliably over a 4-degree angle from the vertical. Upgrading the wheel to a larger, heavier one enabled the wheel to instead work over a 28-degree range instead.

A MPU9250 inertial measurement unit was pressed into service for control of the reaction wheel, fitted to the base of the pendulum and read by a Raspberry Pi. The Pi takes accelerometer and gyroscope readings, and then controls the motor on the pendulum with a PID controller to keep the inverted pendulum upright.

The video goes into a great deal of detail on what it takes to make the pendulum run smoothly. From changes to the control coefficients to measuring the motor’s back EMF, [Brick Experiment Channel] demonstrates everything required to make the pendulum robust to outside perturbances.

The inverted pendulum is a great way to learn about control theory, as we’ve seen time and again.

Continue reading “Building Reaction Wheels With Python And LEGO”

Sonic The Self-Balancing Robot: Face-Plants And The Challenges Of Sensor Integration

Watching a child learn to run is a joyous, but sometimes painful experience. It seems the same is true for [James Bruton]’s impressive Sonic the Self-Balancing robot, even with bendable knees and force sensitive legs.

We covered the mechanical side of the project recently, and now [James] has added the electronics to turn it into a truly impressive working robot (videos after the break). Getting it to this point was not without challenges, but fortunately he is sharing the experience with us, wipe-outs and all. The knees of this robot are actuated using a pair of motors with ball screws, which are not back drivable. This means that external sensors are needed to allow the motors to actively respond to inputs, which in this case are load cells in the legs and an MPU6050 IMU for balancing. The main control board is a Teensy 3.6, with an NRF24 module providing remote control.

[James] wanted the robot to be able to lean into turns and handle uneven surfaces (small ramps) without tipping or falling over. The leaning part was fairly simple (for him), but the sensor integration for uneven surfaces turned out to be a real challenge, and required multiple iterations to get working. The first approach was to move the robot in the direction of the tipping motion to absorb it, and then return to level. However, this could cause it to tip over slightly larger ramps. When trying to keep the robot level while going over a ramp with one leg, it would go into wild side-to-side oscillations as it drops back to level ground. This was corrected by using the load cells to dampen the motion.

Continue reading “Sonic The Self-Balancing Robot: Face-Plants And The Challenges Of Sensor Integration”