Showing posts with label Quadcopter. Show all posts
Showing posts with label Quadcopter. Show all posts

Thursday, June 23, 2016

Flying a Quadcopter with the Wii Remote and Arduino (6): Using the Wii Remote as a Transmitter

⚠️ Warning

The method described here is an example of combining individual technologies.

The Wii Remote's sensors were not designed for RC use. The craft can become uncontrollable and fly off in unexpected directions or crash.

Flight regulations aside, careless flying is extremely dangerous. Please exercise extreme caution.



Progress on this series has been painfully slow, and in the meantime drone regulations have been introduced — leaving me wondering where you'd even fly this thing anymore. But let's press on anyway.

Last time, I covered implementing safety features in Arduino.

This time, I'll finish the remaining Arduino code to enable full Wii Remote control.


Check on Amazon The Wii Remote used here is a standard one with MotionPlus.

I originally wanted to use the Classic Controller for analog input, but I couldn't get Arduino to recognize it.

The Nunchuk is recognized, but it kept disconnecting during use, making it unusable.


Check on Amazon There's a PS3 controller library for Arduino, so a PS3 DUALSHOCK 3 might give you better control than the Wii Remote — though this code wouldn't work as-is.


Sunday, October 4, 2015

Flying a Quadcopter with the Wii Remote and Arduino (5): Safety Features

⚠️ Warning

The method described here is purely an example of combining individual technologies.

Do not fly this in areas with people or buildings nearby.

The Wii Remote's sensors were not designed for RC use. The craft can become uncontrollable and fly off in unexpected directions or crash.

Careless flying is extremely dangerous. Please exercise extreme caution.




In the previous post, I covered how to send input from Arduino to MultiWii.

This time, I'll use the Wii Remote as a transmitter and Arduino as a receiver, then connect it all to MultiWii.



…or rather, I'd like to — but jumping straight to that without safety measures would be a disaster. So first, let's add safety features.



Wii Remote + Arduino connection


Check on Amazon This is exactly the same as the earlier "RC car with Wii Remote + Arduino + LEGO" series.

See the relevant past posts:





Safety feature #1: Overview


Wednesday, August 26, 2015

Flying a Quadcopter with the Wii Remote and Arduino (4): Using Arduino as a Receiver

⚠️ Warning

I do not recommend flying a drone built with the method described here anywhere near people or buildings.

The Wii Remote's sensors were never designed for RC use. The craft can become uncontrollable, veer off course, or crash unexpectedly.

Take all necessary safety precautions.

…or better yet, don't actually fly it.




In the previous post I got everything roughly assembled, but MultiWii and Arduino were both empty — so let's fill them in.

How to use MultiWii as a flight controller is well covered on other sites, so I'll start with the Arduino side first.



What the Arduino does in this build


MultiWii is used as the flight controller, handling the quadcopter's attitude (orientation) control.

Normally, a radio transmitter (TX) sends signals that the receiver (RX) picks up, and those control signals feed into MultiWii.



…but in this build we're using a Wii Remote instead of a transmitter, so there's no standard receiver that can talk directly to MultiWii.

The solution: run the Arduino UNO as a Wii Remote receiver.



MultiWii input channels


Saturday, May 30, 2015

Flying a Quadcopter with the Wii Remote and Arduino (3): Assembly

【Warning】
I strongly advise against flying this in any area where people or buildings are nearby.
The Wii Remote's sensors were not designed for RC use.
Loss of control, flyaways, and crashes are real risks.
Take full safety precautions before attempting anything like this.


I got sidetracked by a personal 3D printing obsession, but let's get back to the Wii Remote multicopter.
In the previous parts I covered all the materials.

On to assembly. The basic quadcopter build is well-documented elsewhere, so I'll keep this brief.

Assembly


Starting with these parts:
Quadcopter components laid out

Assemble the frame:
Assembled quadcopter frame

Solder the ESCs to the battery leads.
Some frames have a carbon fibre power distribution board with pads you solder directly to.
ESCs soldered to power board
Check on Amazon
If your frame doesn't have a built-in power distribution board, a dedicated ESC distribution board like this is handy.

I soldered directly, but adding banana connectors in the middle for easy disconnection would have been the smarter move.

Mount everything on the frame along with the MultiWii.
In the photo the ESCs are on top of the frame, but mounting them underneath apparently makes for a more stable build if the wiring allows.
Frame with ESCs and MultiWii mounted

Normally you'd connect a standard RC receiver to the MultiWii at this point. Here, we replace the receiver with an Arduino UNO + USB Host Shield + Bluetooth dongle stack.
Arduino UNO with USB Host Shield mounted on quadcopter frame

Wiring details come later — for now, just find a way to mount the stack on the frame.

Screwing it to the edge of the carbon board like in the photo works, but the cantilevered mount is prone to screws loosening from vibration in flight.

Check on Amazon
An alternative is to use nylon standoff screws to build a three-layer sandwich: MultiWii → Arduino UNO → USB Host Shield.

Nylon standoffs are surprisingly hard to find at hardware stores, and most metal standoffs are too heavy.

Also: if the quad lands inverted in a crash, the USB Host Shield's pin sockets can break.

However you mount the stack, the USB Host Shield is always the most vulnerable part. Consider it expendable before you start.


Next time: flashing the sketch to the MultiWii. Whenever I feel like it.

Thursday, April 30, 2015

Flying a Quadcopter with the Wii Remote and Arduino (2): More Materials

【Warning】
I strongly advise against flying this in any area where people or buildings are nearby.
The Wii Remote's sensors were not designed for RC use.
Loss of control, flyaways, and crashes are real risks.
Take full safety precautions before attempting anything like this.


Last time I covered the airframe components. Here's the rest of the materials list:
  • Quadcopter airframe (frame / electronics / drive system)
  • Propellers
  • Battery
  • Flight controller
  • Receiver
  • Transmitter
  • Miscellaneous extras


Propellers


Hobby craft propellers from a hardware store won't work — they won't generate enough lift. Use multicopter-specific propellers.

For the HJ450 frame from last time, 7–10 inch props work. Larger generates more lift but risks hitting adjacent props; smaller feels more controllable.

A quadcopter has two motors spinning in reverse, so you need a pair of counter-rotating propellers.

Pick up plastic propellers from RC-E-Tech — get counter-rotating pairs in two colours, and buy extras.

Two colours because it's hard to tell front from back mid-flight; colour-coding the front and rear props solves that.

Carbon fibre propellers are now available on Amazon, but don't start with those.
A homemade copter is inherently unstable, and trying to fly one with a Wii Remote means it's going to run away and crash repeatedly at first.
Carbon fibre is extremely strong, so if it hits you it's serious — potentially blinding.
I got hit in the leg once and the bruise was spectacular.

Plastic props are still dangerous, but at least they break on impact — which is marginally better.
And carbon fibre is expensive, so it would be a costly mistake anyway.

Battery

Check on Amazon
You'll use a LiPo (Lithium Ion Polymer) battery. A typical spec is 11.1V, 3S, 30C, 2200mAh — which is probably gibberish the first time you read it.

"11.1V" is the voltage. The voltage determines the power circuitry, so don't substitute a different voltage.

"3S" is the cell count — three LiPo cells in one pack. Each cell is about 3.7V, so 3S = 11.1V.

"30C" is the burst rate — the maximum discharge capability. For a 2200mAh / 30C battery:
2200 mAh × 0.001 × 30C = 66A maximum discharge.
Higher means faster charging and handling higher current loads.

"2200mAh" is the capacity — enough to discharge at 2.2A for one hour.

Bigger seems better — but as I mentioned with props, you're going to crash a lot at first.
A damaged LiPo battery can catch fire or explode; once damaged, it has to be discarded.
Start cheap and low-capacity for practice.

Check on Amazon
Charging LiPo batteries requires a balance charger — a special charger that keeps all cells at equal voltage.

With a 3S pack, even if the total voltage is 11.1V, one cell might be at 2.0V while the other two are over 3.7V — which shortens the life of the higher-voltage cells.
The balance charger prevents this by equalising all cells during charge and also includes a conditioning discharge function.

Hyperion is the recommended brand but they're expensive — I use a cheap iMax unit.

Flight Controller

Check on Amazon
The brain of the quadcopter. Use a Multiwii SE V3.0.
I'm using V2.5, but V3.0 has horizontal-facing pins which should make assembly easier — or so I'd assume, having never used it.
Note: "SE" vs non-SE have different features; get the "SE" version.

The name has "Wii" in it, but it does NOT receive Wii Remote signals.
The name comes from its origin: someone smart hacked apart a Wii Remote, took the accelerometer, attached it to an Arduino, and built a flight controller from it. Hence "MultiWii." Incredible what people come up with.

Since it's Arduino-compatible, you flash the flight controller firmware via the Arduino IDE.
Details on that in a later part.

Check on Amazon
The FTDI USB-serial module I've mentioned before.
Needed to connect the Multiwii SE V2.5 to a PC.
The V3.0 apparently has a USB connector built in, so it may not be needed for that version.

Receiver

Finally — the Arduino UNO.
It receives the Wii Remote input via Bluetooth using a USB Host Shield and a Planex Bluetooth USB dongle, the same setup as the RC car build.
If you're using a SparkFun shield, a hardware mod is required — see the RC car post for details.

A normal RC build would use a commercial RC receiver here; since we want Wii Remote control, we're building a custom one with Arduino.

Bluetooth range is about 10 m — don't fly it out of range.

Check on Amazon (Arduino UNO) Check on Amazon (USB Host Shield) Check on Amazon (Bluetooth dongle)

Transmitter

A Wii Remote. Every household has a spare Wii Remote, right?
For reference, a proper RC transmitter runs ¥10,000 or more on its own.

Extras

Check on Amazon Of course you want aerial footage.
You'd love to mount a GoPro, but if you're going to do that, buy a proper DJI drone instead.

A regular compact camera is too heavy and destabilises the quad. It can work — I tried it — but it's marginal.

My recommendation: the Hoten X-Z-18. Terrible quality, but only 5g, and it records to micro SD.

The catch: it's designed for Walkera multirotors, has a proprietary connector that doesn't fit Arduino or Multiwii, and has no record button.
To trigger recording, you modify the cable to connect it, then send the correct pulse signal from Multiwii or Arduino.
I'll explain what signal to send in a future part.

Here's what it looks like. You'll get a sense of just how bad the quality is:



That's the full materials list.
Check on Amazon
To be honest, the parts alone cost more than buying several ready-made quads.
The path ahead is brutal.
Unless you're genuinely obsessed with building things, just give up now and buy something off the shelf.


More to come anyway.

Flying a Quadcopter with the Wii Remote and Arduino (1): Materials

【Warning】
I strongly advise against flying this in any area where people or buildings are nearby.
The Wii Remote's sensors were not designed for RC use.
Loss of control, flyaways, and crashes are real risks.
Take full safety precautions before attempting anything like this.


Quadcopters have been all over the news lately. I built one controlled by a Wii Remote.

My flying is rough and the tuning needs work, but here's what it looks like:



I checked that the area was clear before starting, but a crowd gathered while I was flying.
I had implemented an emergency drop command and a forced-landing mode (described later), but even so — the risk of a runaway made for a somewhat nerve-wracking situation.

Destroying the frame is one thing; injuring someone is entirely another.
Please be careful. Actually — don't replicate this.
(I know, if I say that I shouldn't be writing it up — but this is meant as a technical explanation…)

To build a quadcopter from scratch, you need at minimum:
  • Quadcopter airframe (frame / electronics / drive system)
  • Propellers
  • Battery
  • Flight controller
  • Receiver
  • Transmitter
  • Miscellaneous extras


Let me go through each.

Airframe (Frame / Electronics / Drive System)


"Airframe" covers a lot of individual parts. The main ones are:
  • Frame
  • Electronic speed controllers (ESCs)
  • Brushless motors

Matching frame size, weight, and motor output is fiddly — sourcing each part separately takes a while.

Frame
Check on Amazon
I bought a NEEWER HJ450 frame from Amazon.

In hindsight, a smaller motor-to-motor distance (i.e. a smaller frame) would be easier to manage.
I needed some extra lift for the custom receiver, so a mid-size frame worked, but you don't need to go this large.

The bigger the frame, the heavier the build — and the more dangerous. Smaller is better.

Electronic Speed Controllers (ESCs)

Check on Amazon
ESCs (also called BECs) translate the flight controller's signals into motor power.
I used four 20 A units. They look like mystery objects and are surprisingly expensive.

Brushless Motors
Check on Amazon
Not just any motor — the mini-4WD DC type won't cut it here.
Quadcopters use brushless motors for the precise speed control they need.

I used four A2208 KV1400 motors. Which motor you need depends on the frame weight and other factors — I'll be honest, I didn't fully understand the spec sheet.

Propeller adapters are included. They are extremely easy to lose, and almost impossible to replace — be warned.

Other Items

Check on Amazon
ESCs and motors are expensive — a lead that breaks mid-flight is heartbreaking. Using banana plugs for all electrical connections makes them detachable, which is a real quality-of-life improvement.

Cable ties from a 100-yen shop also come in very handy.



…That said, frame selection is tricky, and for the airframe specifically, buying a pre-matched assembly kit from a shop like RC-E-Tech is probably the safer choice.

Just covering the airframe has gotten long — more in the next part.