Droning On: PID Controllers and Bullet Connectors

droning-on-hill Not all drones are multirotors – Posing in our title photo are Maynard Hill and Cyrus Abdollahi. Maynard’s plane, TAM5 aka The Spirit of Butts Farm, is the smallest aircraft to make a transatlantic flight (YouTube link). Retracing the path of Alcock and Brown from Newfoundland to Ireland, the 6 pound (dry weight) model made the trip in just under 39 hours. All this happened in 2003, and was the cap on a lifetime of achievements for Hill. These are the types of pursuits that will be banned in the USA if the FAA restrictions go into effect.

Flight Controllers

Quite a few of you thought the Naze32 was left out of last column’s flight controller roundup. I hear you loud and clear! I’ll add the Naze to the controllers which will be tested on The Hackaday Testbed. The hard part is finding the darn things! I currently have an Acro Naze32 on its way to Droning On HQ.  If I can find a full version, I’ll add that.

PID Controllers Deep Dive

I’ve gotten a few questions on Proportional Integral Derivative (PID) controllers, so it is worth diving in a bit deeper to explain what a PID controller is. PID controllers are often found in process controls managing parameters like temperature, humidity, or product flow rate. The algorithm was initially designed in the late 1800’s as a method of controlling the helm of large naval ships. In fixed wing drones, PID keeps the plane’s wings level and on course. In multicopters, PID loops control heading, but they also provide the stable flight which allows the quadcopter to fly in the first place. A full explanation of PID loops would be beyond the scope of a single article, but let’s try a 10,000 foot explanation.

pidP: This is the “Present” parameter. P Has the most influence on the behavior of the aircraft.  If the wind blows your quadcopter from level flight into a 30 degree right bank, P is the term which will immediately take action to level the quad out. If the P value is too high, The quadcopter will overshoot level flight and start banking the other way. In fact, way too high a P value can cause a quadcopter to shake as it oscillates or “hunts” for level. Too Low a P value? the quadcopter will be very slow to react, and may never quite reach level flight again.

I: This the “Past” parameter. The I term dampens the overshoot and oscillations of the P term, and avoids the tendency of P to settle above or below the set point. Just like with P, too high an I term can lead to oscillation.

D: This is the “Future” parameter, and has the smallest impact on the behavior of the aircraft. In fact, some flight controllers leave it out entirely.  If P and I are approaching a set point too quickly, overshoot is likely to occur. D slows things down before the overshoot happens.

So why do multicopter pilots dread PID tuning?  Quite simply, it’s a tedious process. Couple a new pilot and an unproven aircraft with un-tuned PID values, and you have a recipe for frustration – and broken propellers. Things get even more complex when you consider the fact that there are at least 3 sets of PID variables to be tuned – Pitch, Roll, and Yaw. Some flight controllers now support multiple PID values depending on the style of flight. Want your plane or multicopter to fly around like a hotrod? You need a totally different set of PID values than a docile trainer craft. Rolf Bakke (KapteinKUK himself) made a video illustrating how multicopters behave when tuning PID values. You can easily see how a quad can go from “drunk” to “angry bee” with just a few value tweaks. All this is coming together with The Hackaday Testbed, which will help me in posting a few PID tuning videos of my own.

Hackaday Testbed Update

As for the testbed itself, it’s nearly complete! You can follow the progress on my Hackaday Projects Page. Most of the assembly has been relatively straightforward.   though of course there are always a few snags. It seems I always forget something when ordering up parts for coils-bada build. In this case it was 2.5mm banana plugs and motor mounting screws.

The Hobbyking motors attach to the frame with 3mm screws. The problem is that there really is no way to know how long the screws should be until you have the motors, mounting plates and drone frame on hand. I have a bunch of 3mm screws of various lengths, and thankfully there were enough screws of the correct length to mount the motors. Murphy is always at my side, as I accidentally grabbed a screw that was 1mm too long and, you guessed it, screwed right into the windings of the motor. Doh! Thankfully I had spares.

bullet-solderBullet connectors can be a real pain to solder. There are some jigs out there which help, but I’ve always found myself going back to the old “helping hands” alligator clips. Bullets tend to use lower gauge wire than we’re used to with regular electronics. 14, 12, even 8 gauge wires are used on R/C aircraft. A low power soldering iron with a surface mount tip just won’t cut it. Those irons just doesn’t have the thermal mass to get the connectors up to soldering temperature. This is one of those places where a decent 40 watt or better Weller iron (yes, the kind that plugs right in the wall) can be a godsend. I’m using an Metcal iron here, with a wide flat tip.

bullet-solder-2Bare bullet connectors and alligator clips can also create a problem – the metal clips create even more thermal mass. Years back an old-timer showed me a trick to handle this. Slip a piece of silicone R/C plane fuel tubing on the bullet, and then clip the helping hands onto the tube. The tube will act as insulation between the bullet and the clip. Silicone can easily withstand the temperatures of soldering. I’ve also used the silicone tube on the jaws themselves – though eventually the jaws will cut the soft tubing.

That’s about it for this edition Droning on! Until next time, keep ‘em flying!

Title photo credit Cyrus Abdollahi.

Goliath: One Drone to Rule Them All

goliath

We see quadcopter projects all the time here on Hackaday, so it takes something special to get our attention. [Peter McCloud] has done just that with Goliath, a gas powered quadcopter he’s entered in The Hackaday Prize. By gas, we don’t mean a little glow fuel buzzer, We’re talking about a 30 horsepower V-twin lawnmower engine running good old-fashioned gasoline.

Multicopters powered by a single power source present a unique set of problems. Quadcopter propellers need to rotate in opposite directions to avoid the entire craft spinning due to torque action. With individual electric motors that’s as easy as swapping a couple of wires. Not so with a single rotating engine. [Peter] has accomplished this feat with a clever arrangement of single and double-sided belts.

Control is another issue. Generally, central powered multicopters use collective pitch, similar to a helicopter control system. [Peter] has decided to go with high-efficiency fixed pitch blades and a vane system for directional control. Much like hovercraft use vanes to steer, Goliath will use vanes to affect its attitude and yaw.

goliathPropThe propellers are works of art in their own right. [Peter] modeled the propellers in CAD using the principles of blade element theory, then used a Shopbot style CNC to carve them out of pink insulation foam. Styrofoam alone won’t withstand the 60 lbs each propeller will be supporting, so [Peter] plans to laminate the props in composite cloth. This is the similar to the way many full-scale helicopter rotor blades are assembled.

Goliath’s frame is constructed of Dexion style slotted steel angles, and we have to admit, at 240 lbs with engine, it seems like it’s going to be a heavy beast. Big enough to ride at least. Who knows… if the judges like it [Peter] may ride Goliath all the way to space!

 

 


SpaceWrencherThe project featured in this post is an entry in The Hackaday Prize. Build something awesome and win a trip to space or hundreds of other prizes.

A Quadcopter from Scratch

Quadcopter

[AwesomeAwesomeness] wanted a low cost quadcopter, so he built one from scratch. Okay, not quite from scratch. [AA's] cookie mix came in the form of an Arduino Uno and some motors. He started with motors and propellers from a Hubsan X4 quadcopter. Once the power system was specified, [AA] designed a frame, arms, and motor pods in Solidworks. He printed his parts out and had a sweet quadcopter that just needed a brain.

Rather than buy a pre-made control board, [AA] started with an Arduino Uno.  An Arduino alone can’t source enough current to drive the Hubsan motors. To handle this, [AA] added a ULN2003A  Darlington transistor array. The 2003A did work, but [AA] had some glitching issues. We think FETs would do much better in this application, especially when running PWM.

On the control side of things, [AA] added an MPU-6050 Triple Axis Accelerometer and Gyro breakout from SparkFun. The 6050 has 3 gyros and 3 accelerometers in one package. Plenty for a quadcopter.

All this left was the coding. Multicopters generally use Proportional-Integral-Derivative (PID) control loops to maintain stability in the air. [AA] used the Arduino PID library for his quadcopter. He actually created two PID instances – one for pitch and one for roll.

[AA] doesn’t have any videos of his quadcopter in action yet, and we’re guessing this is due in part to weight. Lifting an Uno, a perfboard, and a frame is a tall task for those motors. Going with a one of the many tiny Arduino’s out there would help reduce weight. In addition, [AA] could use a gear system similar to what is used in the Syma X series quadcopters. Stick with it – you’re on the right track!

 

Quadcopter Built From Recycled Motherboards

A quadcopter built from a motherboard

[Eric] has figured out a great way to build quadcopters out of recycled computer motherboards. Multicopters come in all shapes and sizes these days. As we mentioned in the last issue of Droning On, they can be bought or built-in a multitude of materials as well. Drones have been built using materials as varied as wood, PVC pipe, carbon fiber, and aluminum.

One of the more common commercial materials is G10 fiberglass sheet. It’s stiff, strong, and relatively light. Printed circuit boards are generally made of FR-4 fiberglass, G10’s flame resistant cousin. It’s no wonder [Eric] had quadcopters in his eyes when he saw a pile of motherboards being thrown out at his university.

[Eric] used a heat gun and a lot of patience to get all the components off the motherboard. With a bit of care, most of the components can be saved for future hardware hacks. This is one step that’s best performed outside. Hot melting plastics, metals, and resin fumes aren’t the greatest things to inhale.

Computer motherboards being cut on a shopbotClean PCBs in hand, [Eric] headed to his local TechShop. He drew his dead cat style frame in SolidWorks and cut it out on a ShopBot. While a high-end CNC cutter is nice, it’s not absolutely necessary. The fiberglass sheets could be cut with a rotary tool or a jigsaw. No matter how you cut it, be sure to wear a mask rated for fiberglass resins and some protective clothing. Fiberglass plate is nasty stuff to cut.

Once the upper and lower frame plates were cut, [Eric] completed his quad frame with some square wooden stock for arms. The final quad is a great flier, and spare parts are easy to source. Nice work on the recycling, [Eric]!

[Read more...]

Droning On: The Anatomy of A Drone

 

drone3

These last few weeks I’ve been ordering parts for the Hackaday Testbed, a basic quadcopter to be used here at Hackaday. The top question I see when surfing multicopter forums is “What should I buy”. Which frame, motors,  props, speed controller, and batteries are best?  There aren’t easy answers to these questions with respect to larger quads (300mm or more) . There are a myriad of options, and dozens of vendors to choose from.

Advice was simple in the pre-internet days of R/C planes and helicopters: just head down to your local hobby shop, and see what lines they carry. Hook up with a local club and you’ll have some buddies to teach you to fly. This advice still holds true to a certain extent. Some hobby shops carry the DJI and Blade lines of multicopters. However, their flight control systems are closed source. If you really want to dig in and adjust parameters, you have to either buy a combo package with an open source flight control system, or buy every part separately. Unfortunately, very few local hobby shops can afford to stock individual parts at that level.

In the online world there are several “big” vendors. The classic names in the USA have always been Tower Hobbies and Horizon Hobby. Some new US-based companies are All e RC and ReadyMadeRC. Several Chinese companies, including HobbyKing and RcTimer, maintain warehouses in several parts of the world. I’m only listing a few of the big names here. If I’ve left out your favorite site, drop some info in the comments section.

The killer with many of these companies is supply. A popular component will often go out of stock with no hint as to when it will be available again. When it comes to single parts like batteries, it’s easy to just order a different size. But what about motors or speed controls? These components need to be matched on a multicopter. Changing one for a different model means changing all of them, so it pays to buy a spare or two when ordering! Click past the break for a breakdown of some multicopter parts.

[Read more...]

Free Falling Quadcopter Experiments End With Splat

quad-freefall

Don’t get too attached to the great picture up above, as the quad shooting it was in a death plunge when the frame was snapped. There’s just something tempting about free fall. Nearly every tri/quad/hex/multicopter pilot has the impulse to chop the throttle while flying around. Most quadcopters are fixed pitch, which means that as power drops, so does control authority. When power is cut, they fall like stones. A quick throttle chop usually results in a few feet of lost altitude and a quickened pulse for the pilot. Cut power for much longer than that, and things can get really interesting.  [RcTestFlight] decided to study free fall in depth, and modified a test bed quadcopter just for this purpose.

First, a bit of a primer on free-falling quadcopters and their power systems.  Quadcopters always have two motors spinning clockwise, and two spinning counterclockwise. This configuration counters torque and allows for yaw control. Most large quads these days use sensorless brushless motors, which can be finicky about startup conditions. Brushless controllers are generally programmed to kick a motor into spinning in the proper direction. If a motor is spinning in reverse at several hundred RPM, things can get interesting. There will often be several seconds of stuttering before the motor starts up, if it starts at all. The controller MOSFETS can even be destroyed in cases like this.

When a quadcopter loses power, the motors slow down and thrust drops off. The quad begins to drop. As the falling quadcopter picks up speed, the propellers begin to spin (windmill) due to the air rushing up from below. If the quadcopter started its fall in a normal attitude, all four of  the propellers will rotate reverse of its normal direction.  The now spinning props will actually act as something of an air brake, slowing the fall of the quad. This is similar to a falling maple seed, or autorotation in a helicopter.  The spinning blades will also act as gyroscopes, which will add some level of stabilization to the falling quadcopter. Don’t get us wrong – the quadcopter can still be unstable as it falls, generally bobbing and weaving through the air. None of this is a guarantee that the quad won’t tip over onto its back – which will reverse the entire process.  Through all of this bobbing, weaving, and falling the flight controller has been along for the ride. Most flight controllers we’ve worked with have not been programmed with free fall in mind, so there is no guarantee that they will come back on-line when the throttle is rolled on. Thankfully many controllers are open source, so testing and changes are only a matter of risking your quadcopter.

[Read more...]

A Collective Pitch Quadcopter

StingrayCY(1)

Quadcopters aren’t a new thing, but for all the advances in multi-rotor craft, they all still fall into the paradigm of, ‘stick a prop on a motor and repeat three more times. [Curtis Youngblood], one of the top RC heli pilots in the world, came up with a very cool drive system for a quad, requiring only one motor and granting each blade collective pitch that allows for absolutely insane acrobatic ability.

There’s only one motor inside the Stingray 500, as [Curtis] calls his new toy. It’s at the rear of this quad’s H-frame, attached to a shaft running down the spine with a pair of pulleys. All four rotors are driven by this spinning shaft.

Because [Curtis] is an acrobatic pilot, he needed a way to control his ‘copter in more than one direction. To do this, he added four servos on each arm of the quad, giving each rotor collective pitch, just like the tail rotor of a real helicopter. The result is a quadcopter that can fly upside-down with the greatest of ease, perform barrel rolls, and all the other maneuver a true 3D RC ‘copter can do.

The awesome guys at Flite Test had [Curtis] visit their hangar and had him do an awesome demo flight. You can check out that video below.

[Read more...]

Follow

Get every new post delivered to your Inbox.

Join 96,520 other followers