Alien 560 Quadcopter Build - Part 3 - Transmitter setup

I wish I could tell you that setting up the transmitter was straightforward, but unfortunately, it wasn’t. I’ll do my best to describe what I did, although I’m not sure my process is 100% repeatable.

I have a Turnigy 9XR Pro transmitter with a FrSky JR module. It is a digital radio with lots of features: updateable firmware, model memory, custom sound files and so on.

The first thing I did was upgrading the firmware. That process is a bit different depending on whether you have a PC or Mac. Effectively it involves connecting the transmitter to the PC with a USB cable, firing up eepskye application, setting a few parameters and flashing a new firmware via the app. I found a useful cheatsheet for updating Turnigy 9XR firmware at Quadcopter Basics website. It is also worth to consult the official Turnigy 9XR Pro: Using the Eepskye Program manual.

All subsequent setup is performed on the transmitter itself via the series of the menus. Unfortunately, the structure of those menus changes depending on the firmware version. My version after the upgrade was V.3527-Mike. There’s a 9xr tutorials RCGroups forum thread to help you with the initial setup, besides John G provided a useful Turnigy 9XR APM Arducopter/Arduplane radio settings cheatsheet. Also don’t neglect to check the official 9XR Pro: First Steps with Ersky9x manual, but keep in mind that those may be outdated.

A long press on the left side 4-position switch gets you to the main menu.

9xr Pro Main menu

  • Go into Controls to change the channel order. Pixhawk requires the channels to be in AETR order: Aileron, Elevator, Throttle, Rudder. However, although that is a correct order for Mode 2 radio I have, the order may be different for Mode 1.

  • In Calibration section calibrate the radio’s controls.

  • Set current date and time in Date-Time section.

  • Exit returns you to the main screen.

A long press on the right side 4-position switch gets you to the main menu. Here you need to create a new entry for your model.

9xr Pro model select menu

Once you create a new model name, there are a few settings which need to be set up for it.

First of all, Enter Protocol section to set up your module and receiver options:

  • In my case, the protocol needs to be set to PXX which FrSky uses.
  • RxNum is 1 which is the number of the paired receiver in that model.
  • Type is D16 - the receiver is configured for 16 channels (check your receiver manual, for FrSky X8R I use it is a default configuration with no jumpers shortened.
  • Finally, pressing Bind puts the transmitter module into bind mode. Follow your receiver manual to bind the transmitter to the receiver. For X8R it involves just pressing a Bind button on the receiver once the transmitter is in bind mode.

Setting up flight modes

Pixhawk has quite a few flight modes. If you want to switch flight modes in-flight, a radio transmitter usually has a 3-way switch you can use (some radios have a 6-way switch). Turnigy 9XR has a 3-way switch, but I wanted to do something more advanced than just being able to choose between 3 modes. I got an idea from Mike Perillo’s blog post. My setup allows me to switch between 5 modes in the following way:

  • ELE D/R switch on the left is mapped to RTL (Return-to-Launch) mode. If it is turned on, it overrides all the other mode settings. It is an emergency feature aimed to return the aircraft to the launch site with a single switch flip.
  • AIL D/R switch on the right is mapped to Auto mode and overrides other mode settings except for RTL switch.
  • The 3-way switch is mapped to Stabilize, Alt Hold, and Loiter, but only if RTL or Auto are not enabled.

9xr Pro switches

The way I did that was with the combination of logical switches and mixer configuration. An important thing to understand is that the flight channels are mapped to the values on Channel 5 according to the configuration you define in Mission Planner or QGroundCtrl (more on that later). So all you need to do is to map different flight modes to values evenly spread across -100 … +100 range on channel 5. That involves a few steps:

Enter Model SetupL.Switches menu. Logical switches can have On and Off values just like real switches, but they are defined by logical formulas rather than positions of the handles on the transmitter. Set up logical switches like this:

9xr Pro logical switches menu

This effectively corresponds to the following formulas:

  • L1 = ELE OR AIL. Logical switch L1 is enabled if either ELE D/R or AIL D/R switch is on. In other words, if L1 is off when neither RTL nor Auto mode is engaged.

  • L2 = (NOT L1) AND ID-UP, L3 = (NOT L1) AND ID-CENTRE, L3 = (NOT L1) AND ID-DOWN. That means that L2 - L4 switches will only take effect if L1 is off, i.e. when neither RTL nor Auto mode is engaged. Logical switches L2 - L4 will be responsible for Stabilize, Alt Hold, and Loiter modes respectively depending on the position of the 3-wat switch (up, centre, or down).

  • L5 = (NOT ELE) AND AIL. Logical switch L5 is responsible for Auto mode and will only be enabled when ELE D/R switch is off and AIL D/R switch is on.

Next set up flight modes in Modes menu.

9xr Pro flight modes menu

You can see that Flight Mode 1 - Return is triggered by ELE D/R switch, while 4 other modes: Stabil, Alt Ho(ld), Loiter, and Auto are triggered by logical switches L2 to L5 respectively.

And finally, enter Mixer menu. These are probably the most complex settings in the entire transmitter, and I’m going to cover just enough of it to set up the flight modes the way we want.

9xr Pro mixer menu

You can see that channels 1 to 4 are mapped 100% to Aileron, Elevator, Throttle, Rudder (remember I told you about AERT channel order?), while channel 5 is different. It is configured to trigger the discrete values depending on the values of the switches we have previously set up. All the CH5 submixes are identical except for Offset and Switch values.

9xr Pro edit mix menu

  • 1st: has Weight: 33, Offset: -100, and Switch: ELE
  • 2nd: Weight: 33, Offset: -77, and Switch: L2
  • 3rd: Weight: 33, Offset: -50, and Switch: L3
  • 4th: Weight: 33, Offset: -20, and Switch: L4
  • 5rd: Weight: 33, Offset: 27, and Switch: L5

Submixes 2-5 have Replace multiplier. The above setup means that switches ELE, L2, L3, L4 and L5 are mapped to values -100, -77, -50, -20, 27 on channel 5 axis, which works nicely to switch between the first 5 channels configured in the ground station software (I’ll cover that later). I chose those values empirically by tweaking them until that worked.

That concludes the transmitter setup. Next, to the Pixhawk software setup and configuration.

To be continued…

Alien 560 Quadcopter Build - Part 2 - Assembly

Unlike a conventional helicopter, a multirotor aircraft contains very few moving parts: no gears, no swash plates, no contrarotating propellers. It only has motors directly driving propellers, and that’s it. So there was no complex mechanics to assemble. The frame was probably the most complicated bit. The Alien 560 frame consists of a couple of dozen carbon fibre plates which need to be screwed together by a hundred or so tiny screws.

The assembly instruction was not included in the kit, but it can be downloaded from here. In the end, it is not much complex than a large Meccano set. I found that placing a magnetic mat or tray under the frame during the assembly reduces the chances of losing those little screws. I also put a medium-strength thread lock on the screws which are prone to loosening from vibration, such as motor mounts. I held off attaching the upper deck (the frame’s lid) for now; that would wait till all the cables are in place.

The next step was to assemble the power system. The Pixhawk comes with a power module which sits between the battery and the rest of the electrical parts and provides power to the flight controller. A power distribution harness plugs into the other side of the power module and distributes the power to the 4 ESCs (electronic speed controllers). The Alien frame has compartments in the landing gear’s “legs” for mounting ESCs - that position provides optimal cooling during flight. Because the power harness’s wires were too short to reach the ESC bays, I had to make the extender leads out of 16AWG wires and bullet connectors. The ESCs then feed power to the motors positioned at the ends of the foldable “arms” (more extension power leads were necessary here). I insulated all the electrical connection points with shrink-wraps to avoid short circuits. The power fed to each motor can reach 10A, so you definitely don’t want that to happen.

quadcopter frame with assembled electrics

quadcopter frame with assembled electrics

That was it for the power circuits. The next step was to assemble the signal chains.

First, the receiver. I used an FRSky X8R receiver. It is a good idea to pair your receiver to the transmitter before installing it. The included FRSky manual describes the steps to do that, and there are plenty of videos on Youtube showing the process.

FRSky X8R receiver has two diversity antennas, and it chooses the one with the strongest signal during the operation. FRSky recommends putting the antennas apart at 90 degrees angle to each other. I made an antenna mount out of a piece of plastic, drilled the hole in the frame and mounted the antennas so that they pointed downwards. Then mounted the receiver on the lower deck attached by a piece of a double-sided sticky tape.

receiver mount on the bottom plate

I can’t stress enough that an utmost care must be taken while working with carbon fibre. Carbon fibre dust is extremely harmful. Therefore any drilling or sanding carbon fibre must be carried out in a well-ventilated area, and a respirator with N95 safety rating must be worn.{.text-danger}

There are multiple ways to plug a receiver into Pixhawk. The serial SBus interface both Pixhawk and FRSky support is the easiest option. It allows connecting the receiver to the flight controller via a single cable rather than one for each channel. This page describes how to make the connection.

The GPS receiver has to be mounted on the top of the aircraft away from any sources of interference such as battery and motors. And because Neo-M8N GPS module I used also had a compass in it, it had to be oriented the right way forward. The best way to mount a GPS module on a quadcopter is to lift it above the deck on a mast. But the Alien frame had an elevated GPS mount plate which I decided to use. By design, it would be sitting at the far back of the aircraft, like a scorpion’s tail, but because my GPS cable was short, I moved it closer to the centre and rotated 180 degrees.

The next step was to connect the GPS and the telemetry. And that was where Pixhawk Lite played a joke on me. The wiring of all the Pixhawk modules is spelt out in the Adrupilot Wiki. If you buy all the electronic components such as GSP, telemetry, and OSD in a package then connecting them together should be as easy as plugging the appropriate wires. But Pixhawk Lite’s designers committed a few mistakes when laying out the controller’s connectors. Therefore some of the signal leads had to be rewired. These are the bits which had to be changed (extracted from the rcgroups forum’s thread mentioned above and Banggood comments:

  • GPS Cable Changes Required: The 5V and GND wires are reversed. The RX and TX lines of the GPS are connected to the telemetry lines etc. So they need to be directly moved by two pins towards the new 5V line.

  • Telemetry Cable Changes Required: The 5V and GND wires are also reversed. The RX and TX also need to be swapped, but the lines stay in their current pins.

  • Although the wiring of the power connector is compatible with the included power module, the standard Pixhawk’s power module cannot be used because of the wiring changes.

After carefully rewiring the connectors I was finally able to plug the modules together.

I wanted to mount the telemetry transmitter with its antenna facing down for a better signal. But the problem was that telemetry antenna was huge compared to the rest of the components. Its size was dictated by the frequency is used, which was 915 Mhz - the frequency allowed in Australia. That made the antenna as large as a one of a Wi-Fi router. I decided to place the telemetry receiver at the back on the upper deck with its antenna strapped to one of the rear landing gear. That would keep it secure and out of reach of the spinning propellers. The antenna’s weight at the back will also counteract the weight of a camera in front should I decide to install one later.

telemetry antenna mounted at the back of the quadcopter

Pixhawk has an external reset button which I glued to the upper deck with a drop of hot glue.

The last thing to install was the flight controller itself. As prescribed by the Pixhawk’s designers, it should be mounted at the centre of an aircraft on an anti-vibration pad. High-frequency vibrations produced by spinning motors interfere with the Pixhawk’s built-in gyroscopes jeopardising the flight stability. There are many different ways to dampen the vibration. A genuine 3DR Pixhawk, for example, comes with a few pieces of a 3M double-sided foam. Also, copter builders through experimentation discovered a few more efficient ways. I decided to go with an anti-vibration mount consisting of two plates with rubber bushings in between which was similar to the highly recommended 3D printed mount. I fastened the dampening mount to the upper deck with a couple of screws and attached the Pixhawk Lite to it with a servo tape.

Now was the time to secure the top upper deck to the rest of the frame with the remaining screws from the frame kit and to plug all the signal cables into the flight controller: GPS, compass, telemetry, receiver and ESCs. The four ESCs are plugged into Pixhawk’s servo channels 1 - 4 strictly according to the aircraft’s configuration. An important note is that although Pixhawk servo connectors have +5V pin, Pixhawk doesn’t provide +5V power to the servo rail. Considering that in our build the Pixhawk is powered from its power module rather than a servo rail (that configuration is also possible), it makes sense to disconnect +5V (red) wire from the ESC connectors before plugging them in. That is because +5V from the power module may not have the exact same potential as +5V from the ESCs, and that can create a harmful voltage differential.

pixhawk mounted on the top plate

Finally, I had everything installed and plugged in. The next step would be to set up the software.

Alien 560 from the front

To be continued…

Alien 560 Quadcopter Build - Part 1 - Parts

When I was at school, I was an electronics geek. I was spending days in a library looking for schematics of AM radios and circuits of blinking lights and beeping sounds, and then long evenings in an electronics club trying to solder them together. Unfortunately, none of the stuff I built ever worked properly: radios received only static, lights blinked out of order, and beepers screaked. But most of all I was obsessed with remote control models.

I had a book about remote control models my dad gave to me. It was a 300-pages manual describing in details how to build a remote-controlled ship, a glider, and a car, complete with blueprints and full schematics and circuit designs of the transmitter and the receiver. It was all analogue like almost everything in the 80s, and the transmitter required some precisely machined metal parts for control handles. I drooled over that book for years but sadly I clearly understood that I had zero chances of assembling a radio and a working model.

Many years passed, but my yearning for remote control models remained. And finally, when I moved to Australia I decided that I had waited long enough. I bought my first hobby-grade remote controlled car, then another one, and before I knew I had a few.

Rack full of R/C cars

Those cars are a lot of fun to play with, and they are quite reliable. The oldest one I own is eight years old and still going strong. It had to repair it after some accidents, but it was nothing major.

About a year ago one of my friends talked me into attempting to assemble a quadcopter. He has built a few quad- and hexacopters himself and, as you can imagine, he knew quite a lot about them. The way he talked about copters sounded intriguing, and I' ve got hooked up.

Rather than buying a ready to fly quadcopter off the shelf, I decided to build one myself from scratch to make it more interesting. With the help of my friend I have put together a list of the necessary components which looked like this:

Category Item
Frame HobbyKing® Alien 560 Folding Quad-Copter Carbon Fiber Version (Kit)
Flight Controller + GPS / Compass + OSD + Telemetry Pixhawk PX4 2.4.6 32bit Flight Controller Led NEO-M8N GPS PPM OSD 3DR 915Mhz 433Mhz
Flight Controller Anti-vibration mount Anti-vibration-Plate-Pixhawk-APM-2-5-2-6-2-8-Shock-Absorber-RC-Flight-Control-WS
Motors (x4) Turnigy Multistar 4220-880Kv 16Pole Multi-Rotor Outrunner
ESC (x4) Afro ESC 30Amp Multi-rotor Motor Speed Controller (SimonK Firmware)
Propellers (x2) Quanum Carbon Fiber T-Style Propeller 11x5.5 (CW/CCW) (2pcs)
Propeller Balancer Carbon Fiber Propeller Balancer Maglev 4-axis Rack
Transmitter (w/o module) Turnigy 9XR PRO Radio Transmitter Mode 2 (without module)
Transmitter module & Receiver combo FrSky XJT 2.4Ghz Combo Pack for JR w/ Telemetry Module & X8R 8/16Ch S.BUS ACCST Telemetry Receiver
Transmitter Battery Turnigy 9XR Safety Protected 11.1v (3s) 2200mAh 1.5C Transmitter Pack
Batteries ZIPPY Compact 5800mAh 3S 25C Lipo Pack
Battery Strap Turnigy Battery Strap 330mm
Power distribution harness Multistar XT60 to 4 x 3.5mm with JST Plug Quadcopter Distribution Harness
Power wires (2m each color) Turnigy High Quality 16AWG Silicone Wire: red, blue, black
Power Connectors (x2) PolyMax 3.5mm Gold Connectors 10 PAIRS (20PC)
Servo Extension Leads 15cm Servo Lead Extention (JR) 26AWG (10pcs/bag)
Servo Leads 10CM Male to Male Servo Lead (JR) 26AWG (10pcs/set)
Heat Shrinks A bunch of various heat shrinks
Cable Ties 75PCS Assorted heavy duty black nylon cable tie
Mounting Tape Servo Tape (Clear) 25mm x 1m

I chose Alien 560 frame because my friend has already built a quadcopter based on it, so I hoped to leverage his experience. It is a carbon fiber frame allowing installation of up to 12'' propellers. It also has foldable “arms” which are very convenient: it doesn’t take much storage space folded while unfolding it before a flight takes just a few seconds.

The choice of a flight controller was a key one. A flight controller is a brain which controls all the functions of an aircraft. There are quite a few to choose from on the market. Some, like CC3D and Naze32 are designed for drone racing while others, like Naza-M are tailored for aerial photography. I chose to base my quadcopter on a Pixhawk. Pixhawk itself is an open source hardware project. Because its schematics is available to anyone who cares, quite a few companies make them. 3DR is the “official” manufacturer; they use their controllers in their highly acclaimed 3DR Solo drones. But there is also no shortage of various Chinese manufacturers producing Pixhawk clones in all shapes and sizes, most of them costing half or less of the 3DR’s. Most of them use reference design and look identical to each other, but some are quite different. Regardless, they all should all be compatible and work just as well.

I ordered a package containing not just the flight controller itself, but also all the necessary accessories: a power module, GPS, Compass, a telemetry module and an OSD (on-screen display). Unfortunately, Banggood mixed something up and sent me a different package. While technically also a Pixhawk, that wasn’t the one I ordered. A quick search on the internet revealed that Pixhawk Lite I received had weird wiring issues. I complained to Banggood, explained their mistake, and they agreed to exchange the wrong controller for the right one. I sent the package back and received a new one in a couple of weeks. When I opened it I discovered that it contained the same Pixhawk Lite as the previous one they sent me. Obviously, there was something wrong with their inventory management system. At that point, I decided to give up since I saw no rational way of getting the right controller out of them. After all, there were people who had successfully built copters on it, and I figured I could do that too. Luckily for me, Banggood agreed to refund the price difference.

To be continued…

Introduction to iOS Music Production Brown Bag

Music band with iPad

I work at Odecee. It is a technology consultancy company with a difference. They understand that people are their main and only asset, so they tend to hire smart IT professionals, pay them well, and give them cool toys.

Every week they run brown bags in their office. A “brown bag” means a lunchtime presentation where attendants are supposed to bring their lunches (in brown paper bags, hence “brown bag”). Yet, Odecee also provides catering for those events.

We have monthly sessions on web development, DevOps, mobile development, and “kitchen sink” (tech topics which don’t fit into any other category). However, employees are invited to speak on any other topics they are passionate about, whatever drives them, makes them tick.

I myself recently took an opportunity to present a brown bag on the basics of iOS music production. The reason I wanted to talk about music to a technical audience is because engineers often see the world through a lens of their technical skills. They like no one can benefit from a creative freedom music gives them. For engineers music, especially electronic music, is a perfect creative media. It is technical but, at the same time, it is unstructured. It obeys laws of physics but musicians don’t need to rely on formulas to create.

I hold a view that everyone can be a musician. Making music should be fun, the tools should be easily available and easy to use. Unfortunately, it is often perceived as something highly complex and expensive, only accessible to a few chosen ones. That point of view is reinforced by a current state of desktop music production tools. But fortunately for us, Apple delivered yet another mobile revolution and this one passed mostly unnoticed by the general public - the revolution in mobile music production. As with many other areas, iPhones and iPads made music making what it should be - easy, fun and accessible.

Here are the slides of the presentation.

My goal with this presentation is, quite simply, change the world, one man at a time: if after that even one person picked up a music instrument, whether a real one or one in an iOS app, and made a tune then my job here is done.

You can listen to some of my music on my Soundcloud account. Track Cold Space / Sparkling Nebula listed there was almost entirely made on iPad in Nanostudio, only the final mixing was done on a desktop.

Road Ahead

It’s been nearly a year since I wrote that post: A new chapter. During that time I did a bit of traveling, spent a fair amount of time slacking off at the beach (you can’t resist that during summer time in Australia), but most of all I was studying. I was keen to deliver on my resolution to pick up lasting fundamental skills.

Road Ahead sign

As I already had an experience with online education and found it as good, if not better, than in-person training, I went for online courses again. There is no shortage of opportunities for online learning for anyone who wants to pick up new skills, especially in technology: Coursera, Pluralsight, Udemy, Lynda.com, just to name a few, provide lots on online courses covering a wide variety of technologies. Most of them are very affordable or even free. I listened to a few lectures on Coursera.org before, however I never took them seriously. And just when I was deciding what to learn next, an email arrived into my mailbox advertising a brand new Full Stack Web Development Specialization. In Coursera’s lingo, a specialization is a sequence of related courses which progress you to a particular goal, in this case – becoming a full stack developer, i.e. a developer who is capable of creating both back-end and front-end sides of a software solution, in this instance in JavaScript. That specialization was advertised to include the following courses:

and an optional capstone project, where students could apply the newly acquired skills to build a real-world software product.

Although I already knew some of these topics, I decided to enroll for that specialization anyway. After all, reiterating the fundamentals never hurts. A part of my resolution was to acquire fundamental skills which do not depend on a single vendor. And the web is as fundamental as they get. The web is everywhere, it has become the application platform, and web frontend has become the front-end. I agree with Atwood’s Law, stating that “any application that can be written in JavaScript will eventually be written in JavaScript”. Over the years I’ve watched the meteoric rise of JavaScript from the sidelines wishing I could make a career turn and concentrate on that brave new world. Well, now I had a chance.

Before I’ve got stuck in the Oracle swamp, I used to build UI applications. That was what I did well and enjoyed doing. At those old times, UI meant C++ with MFC, Delphi, Visual Basic, or some similar old tools no one can recall now. And since I decided to take a career turn, I wanted to get back to UI. But since UI now universally means web applications, I had to become an expert in web development. I took a plunge and enrolled for the Coursera’s specialization.

The next few months were intense. At first I thought I could learn at a leisurely pace at Coursera, and if I’m bored I’ll pick up some other courses to do at the same time. But instead, I found that Coursera’s stuff was full-on. I had to watch the lectures, read a lot of supplementary materials, do assignments and turn them in each week. And because I wanted to obtain an in-depth understanding of how everything worked, I was studying nearly full time. Then I had to verify other people’s assignments – Coursera has a peer-to-peer assessment model, where each student has to grade assignments of 3 other students each week. That is clever, and I found that I learned as much from other student’s fork as from my own study.

In the middle of the second course I was doing, Coursera suddenly changed its business model. It used to be all free for everyone. Now anyone who wanted to get assessed and graded had to pay. I still could watch all the lectures for free, but my assignments wouldn’t be graded and I wouldn’t get the course completion certificate. After some consideration I chose to pay – it wasn’t that much anyway.

To cut a long story short, that was quite a ride. Now when it is all behind me, I wholeheartedly recommend that specialization to anyone willing to learn about web development. You may take all of its courses to learn everything you need to know to become front-end or back-end web developer, or pick individual courses to suit your learning needs. Either way, it is an excellent value for your time and your money.

In a few days after I finished the last course and updated my resume, I had a new job as a front-end web developer. It is a new direction for me, a new road ahead. I like it, I think I’ll stay on it for a while.