3D Robotics

Getting ready for ArduPilot 2.0

ArduPilot 2.0 uses the same hardware as ArduPilot 1.0 but new software to do both the navigation and stabilization functions itself, with no need for a FMA Co-Pilot (although we still use the FMA XY sensor). Here's how to directly connect the FMA sensor to ArduPilot. [Note if you're buying the FMA XY sensor by itself, you'll need to order a cable, too. Also, note that the sensors come from FMA with a thin film (usually red) over the thermopile lenses. You have to remove the film before using them.] Cut one of the cables that comes with the FMA sensor in half and pull the four wires apart for about two inches. Strip their ends by about a quarter of an inch. Slip on heat shrink tubing. If you have some red tubing, put it on the second wire in from the side of the cable with the red strip, to mark the positive power cable (yes, that's confusing. V+ isn't the wire with the red strip--it's the wire next to it!). Now solder each pair of wires to a two-pin male machine pin header, and shrink the tubing around them. (See photo above). Now, solder on one two-hole female machine pin header to the ArduPilot board in the VCC and GND holes, and another one in holes Analog 0 and 1, as shown in the diagram below. You can see the FMA sensor pin-out details here. Finally, solder a regular two-pin header on the ArduPilot's D6 and D7 holes. This is to place a jumper on when you're doing IR calibration the first time on the ground.

Note that in this version of ArduPilot, we do altitude control with the elevator, not the throttle, so plug in your servos as shown in the diagram below:

You can test your sensor by downloading and running this simple test program. Just load it on ArduPilot (make sure the board is powered and the GPS is not connected). With the FTDI cable connected, click on the serial monitor icon in Arduino and make sure the speed is set for 9600. The program will prompt you to tilt the sensor in certain directions and then strike any key and hit return when you're ready to take the X and Y sensor readings. Remember that sensor readings inside and near heat sources (like your hand) are nothing like the real thing outside. But it's still a good way to confirm that your sensor is working right. Note that when you mount the sensor on your aircraft, the wire should be coming out towards the tail, as shown in the picture of an EasyStar configuration below (you don't need to put it on a pod like that--any position that has a relatively unubstructed view of all four sides is fine). The "P"s on the sensor should be facing forwards and towards the rear, with the one next to the FMA logo in front.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Hello

    I am new to ardupilot and just wanted to ask a quick question about servo control. I have tried as a start using software control for servos via the code below with the mux pin set high for testing. However the servos do not seem to respond regularly or reliably. Is there any reason someone can tell me why this does not work?

    if(input_servo == 0) {
    for(int i = 0; i <= 180; i++) {
    servo.write(i);
    delay(50);
    servoVal1 = servo.read();
    Serial.print(servoVal1);
    Serial.print(" ");
    }
    }

    Thanks
    Sirk
  • 3D Robotics
    Telmo: Reading the current servo positions at autopilot start is the way we record the trim positions of the plane. If you use constant positions, the plane will be out of trim and it will be harder to stabilize. Why do you want the fixed values?
  • Hi, Im very interested in the v.2. Im just in test of v.1. In this version its posible that the Ardupilot takes the neutral servo position from a fixed value? I think is beter solution and more than the actual (neutral at activation stik position). Thans a lot
  • We use matrix
    | +1 +1 |
    | -1 +1 |
    we could use constant cos(45) instead of +-1 for 45 degrees rotation, which is 0.707, but this doesn't affect result if it's 45 degrees.
  • 3D Robotics
    I'll try that. Somehow there's this voice from my distant engineering classes telling me that we should actually be using matrix math and taking a cross-product, but I'd love to find that your simple addition and subtraction works instead.
  • I realize that we even don't need to divide the sum by 2, because we anyway get sensor values in unknown range (dependent on weather). Raw sensor values need to be calibrated and brought to usable range (maybe -1 ... +1). So you can save some code bytes by omitting "/2".
  • Chris: I don't mean adding raw analog values (0-1023 range), but signed with center (zero) at 512.
    This would be:
    x_read= analogRead(X_pin) - 512;
    y_read= analogRead(Y_pin) - 512;
    y_real= (y_read - x_read)/2;
    x_real= (y_read + x_read)/2;

    I just tested, this works for me on real sensor. FMA copilot must do same thing because it supports diagonally mounted sensor.

    I suggest that you include such possibility in your ArduPilot code, possibly in #ifdef / #endif block so that users can optionally enable this.
  • 3D Robotics
    Michal: that's not working for me. Here's asketchfile that demos that. (You can use your hand to simulate the heat signature of the earth on the "down" side in each direction).

    I get data like this:

    (baseline: x=455, y= 38)

    x y
    L: 380 27
    R: 500 26
    F: 408 150
    B: 464 8

    You would expect the four directions to occupy the four quadrants of an XY plot with the baseline at the center. But the last one (Back) doesn't.
  • Moderator
    Chris: Ok, that makes scense. How about editing comments that we leave? B4 we could edit them for a few minutes after the post, is that gone for good?
  • On the subject -
    Why not a 3-sensor board. Its cheaper, uses one more analog pin, and the math is - well, just math.
This reply was deleted.