Showing posts with label Receiver. Show all posts
Showing posts with label Receiver. Show all posts

17 January 2014

Receiver to Flight Controller

The flight controller is the brains of the quadcopter. It has sensors that determine the pitch, roll, yaw, altitude, and acceleration of the quadcopter. Mechanically fix the flight controller to the frame, tell the flight controller what level looks like based on how you mounted it to the frame, and tell it how your motors are arranged. (We will cover these things a bit later.) The flight controller senses if the quadcopter tips, and controls the motors to correct it and level out the quadcopter. Quite frankly, this is amazing. It takes a lot of the complication of flying out, and makes it stable and easy to fly.

In order to do this, the flight controller has to be hooked up to the receiver appropriately. There are six lines that matter for this:
1) Yaw
2) Throttle
3) Pitch
4) Roll
5) +5V
6) Ground

On the flight controller I bought, there is silk screen showing what to connect to where, but the silkscreen is wrong. The wrong labels are repeated on the hard case I bought. Pitch, Roll, and Throttle are wrong. Here is the wrong silkscreen on the flight controller board:


Here is the wrong silkscreen on the hard case.



It took me a long time to figure out that the silkscreen was wrong, as I completely trusted it. In the end, I was able to figure it out because when I tipped the quadcopter while it was turning the rotors on very low throttle, the wrong motors would cut out. The idea here is if you have it in a stabilize mode and you tip it so one rotor is up, that rotor should slow or stop because the unit is trying to level out. So experimentally, I determined the layout. Here's the actual layout for the board I have:

Remember, the silkscreen is wrong, so it should read, starting with the yellow wire:

Yaw
Throttle
Pitch
Roll
+5V
Ground




As you can see above (spelled out for the colorblind), wire colors I chose are:
Yaw--Yellow
Throttle--White
Pitch--Blue
Roll--Red
+5V--Orange
Ground--Brown





These wires plug in to the receiver. Based on the color scheme I chose, and the channels I have selected on the transmitter, here is how I have wired up the receiver-flight controller connection at the receiver side:













Bat Orange and Brown (Inside has nothing, Middle is Orange, Outside is Brown)
   6  White -- Throttle
   5  Nothing
   4  Yellow -- Yaw
   3  Nothing
   2  Blue -- Pitch
   1  Red -- Roll
Remember that the signal pins are the inside ones (the pins nearest the channel number label).

As I spent so much time debugging the Receiver to Flight controller, and thinking I had something wrong, I'm documenting the full interconnect. The sticks on my transmitter are set up like this:

  • Pitch (Blue), Channel 2, left stick forward and back
  • Yaw (Yellow), Channel 4, left stick left and right
  • Throttle (White), Channel 6, right stick forward and back
  • Roll (Red), Channel 1, right stick left and right

The next thing to hook up is the ESC's to the motor controls on the Flight Controller. There are four of them, and you have to get the right one in the right place (you could modify the firmware to change which one plugs in where, but it's a lot easier in my mind to simply plug the right one in to the right place). Again, you have to experimentally determine which one is which. I chose the "+" configuration, so here is what it turned out to be for me:

Note that as odd as it seems, according to the silkscreen there is no "4" slot.
Front 6
Back  2
Right 5
Left  3

Looking back at this blog post, it doesn't seem nearly as hard as it was in real life. The hardest part was that I kept thinking I did something wrong on the receiver end because of the problem with the silkscreen. Now that I know how it should go, wiring this up could be really fast and painless. :-)




04 January 2014

Receiver/Transmitter Pair

The Receiver/Transmitter Pair is a radio set consisting of a Receiver and a Transmitter. The Transmitter has sticks, knobs, and buttons that allow you to control your quadcopter from the ground. The Receiver receives the radio frequency (RF) signals, interprets them, and passes them on to the Flight Controller.

The number of channels on your receiver is indicative of how many independent things you will be able to control at once. Mine is a 6 channel RX/TX (Receiver/Transmitter). This should be more than sufficient for a quadcopter.

The Frequency is the actual RF signal that you are transmitting and receiving on. Mine is 2.4 GHz (sometimes written 2400 MHz, they are the same). This is the same band as a lot of  802.11B (WIFI) equipment.

Transmitter Picture

Transmitter, shown above.


Receiver and Bind Plug Picture

Receiver and Bind Plug shown above

The signal pin is the pin closest to the labels. The positive pin is in the middle, and the ground pin is on the outside. This was actually hard to figure out, as the documentation seems hard to find on the web.

Pairing

When you first get your RX/TX hardware, you need to "pair" them. This associates them with each other very similar to what you do with a Bluetooth headset and phone. The hardware will come with a "Bind Plug" which is just a loopback cable that plugs in to the receiver to tell it to switch to Bind mode.

While individual hardware makers may have slightly different steps, this is what worked for me, and should be fairly applicable to the general case.

To Pair the Receiver/Transmitter

0) Start with no power applied anywhere
1) Plug the Bind Plug in to the "BATT" terminal. 
2) Power up the receiver with 5 volts using any of the + and - terminals. You should see a blinking red light on the the receiver, indicating that it hasn't got signal from anywhere.
3) While holding down the "Bind Range Test" button on the transmitter, switch the transmitter power on. The light should go green on the transmitter, and solid red on the receiver. They are now Paired (or "Bound" if you like).
4) Turn off all power and remove the Bind Plug.

If you need more information, this video  helped me figure out how to bind my transmitter to my receiver. It is not the greatest video ever, but it was helpful to me. I didn't know that the orange wire to my ESC was the signal wire, which he mentions.

Now that your transmitter is talking to your receiver, it's time to see what channel is what. If you have a servo or two, you can just plug them in to the different channels and map it out by trying the sticks and seeing which one is associated with which channel. Of course, you need to power the receiver with 5 volts applied to the "BATT" terminals.

If you don't have servos, there are more sophisticated things you can do. There is software that connects to the transmitter and allows you to see which channel is controlled by what stick/knob. The software also allows you to adjust which channel is where, how much the output varies when you push the sticks, and a lot of other things.

Item number 11 on my parts list is"#FS-L001/9043, Hobby King 2.4Ghz 6Ch Tx USB Cable". This cable hooks from the back of my transmitter to a USB port. I plugged it in to my PC and installed some driver software for it. 

Configuration

One of my biggest complaints about Hobby King is the software on their web site is all USER SUPPLIED. Anybody could upload malware/virus/spyware/whatever. This is very unsettling. I recommend using this software inside a disposable Virtual Machine so that you don't risk your main machine.

On HobbyKing's web site there are four separate transmitter/receiver pairs that are ALMOST the same thing, but not quite, and of course different software has been uploaded for the different varieties. My particular controller is the 9042 Mode 1 (Mode 1 means the throttle stick is on the right--this page has some wonderful pictures of the modes), but the software that finally worked for me was from the 9042 Mode 2 page. 

The parts I found from HobbyKing are at:
Go down to the purple "Files" tab to see the files you need. Again, these are uncontrolled, user-supplied files, so be careful. They could be wrong or worse.

From this page, I ended up installing: 
  • Virtual COM Port driver "CP210x_VCP_Windows"
  • "Digital Radio software"
  • "T6install" which installed a tool called "T6Config"
I needed the VCP software because it turns the USB into a virtual serial port, allowing the transmitter to talk straight across it to the software. It will create a virtual serial port that you hook the software to. In my case it was COM3.

Both "Digital Radio Software" and "T6Config" worked, but I found the "Digital Radio Software" to be much nicer. I was able to see which channel was what, swap channels around like I wanted, and calibrate settings. Of course I only did this after wasting a lot of time by trying to jump ahead and getting nowhere. It turns out my transmitter came from the factory with a reversed throttle channel. This means that when I pushed up, it went down and vice-versa.  Since I didn't know much yet, it took me a long while to figure out why my ESC's would not arm. This was why, and will be covered in more detail in a future post.

You can also use Mission Planner to figure out which channel does what, but you have to have things much more put together to do that, and it kind of obviates the need for mapping out the channels if your hardware is already hooked up right. But it is a good sanity check, and I will show this in a future post.

Stick Ranges and Calibration

You can calibrate the min and max range of the sticks using the software above. You don't need to do that right know, but know that you can and that we will very likely come back to it later.

RX/TX Range

Before flying, I highly recommend checking out how far your receiver/transmitter pair can be from each other and consistently talk to each other. Do this on the ground. Kelly and I did not do this for the first flight test, and I think this might have been the cause of the crash (we have determined it was not the battery).

To do this, get a servo, a battery, a buddy, and a cell phone. Have the buddy move the appropriate transmitter knob and see if your servo responds. Keep moving farther away from the transmitter until it stops working. Document this and be careful to fly inside this range. Remember to consider altitude when figuring out safe ranges. You can set up failsafes and geofences, but more on that later. Much later actually.

One last thing: Here is a thread that talks more about the type of transmitter I have.