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

  • seems to test out fine on my arduino nano. btw, if you dont want to cut your cable just yet, male 2mm pitch headers seems to fit the original cable and maybe female headers would fit into the sensor head itself. also, in a pinch, breadboard jumper wires will fit into the cable's female header to test out the sensor
  • I am interested on how the alititude is controlled by the elevator. Can I switch back to throttle if necesary (pre flight). The engine I would imagine is responsible for speed. This would be cool for trying some complex acrobatics or some high angle dives for a picture and then get out of there that you just can't get with the controls reversed.
  • 3D Robotics
    More thinking on how to allow the XY sensor to be be placed diagonally as per this diagram: perhaps it's a simple as using some if-then statements. The truth table for the four directions in diagonal mode is this ("+" = voltage higher than netural position; "-" = lower):

    -- X Y
    Right + _
    Left - +
    Forward + +
    Back - -

    Rather than find some fancy matrix math that can handle that, perhaps this is best turned into a "Case" logic tree?
  • Thanks for answer. I want to use the ardupilot like a recovery sistem if the rc link is lost (RTL). I fly Fpv, and this is a fantastic board to do this. If the plane is making a turn with ailerons, a bit of rudder and elevator, and the rclink is down, the ardupilot dont make the corrections just from the neutral position, this can cause dont success recovery. In V1 the Copilot force the plane to stable flight, I dont know in the V2.
  • Thanks I will try to get the up to date equipment.

    regards
    Sirk
  • 3D Robotics
    Ah, so you're not using the ArduPilot code, either. That stabilization code was pre-alpha, which we shared only so people could see what direction we were taking; it's too early to support that. We'll be posting a release version in a week or so. To support you I'll need you to be using the current ArduPilot board and released ArduPilot code. It's too hard if you're using home-built hardware and buggy demo code.
  • This method is from the stabilisation code that you all developed:

    void pulse_servos(int roll, int pitch) {
    pulse_servo_1(90 - (pitch + roll));
    pulse_servo_2(90 + (pitch + roll));
    }
  • 3D Robotics
    Woah--you're not using the commercial ArduPilot board? I have no idea what pins we've changed since that early board, which we never released. It's really hard to support people who aren't using our current hardware.

    In your code, where is the pulse_servos subroutine? We don't have one called that.
  • Hello

    I am using servo1.attach(9) and servo2.attach(10) but the problem may be wiring as the response is quite irregular. I tried the register code that you all wrote as well but the effect on my board is the same. In fact at the moment with the segment below and the code that sets up the servo registers I still cannot get the servos to respond though the light blinks and Done is printed. My wiring involves attaching servos to out1 and out2 on the board layout shown.

    int max16_roll = 2100;
    int min16_roll = 1000;
    int max16_pitch = 2100;
    int min16_pitch = 1000;
    int roll = 0;
    int pitch = 0;
    int ledPin = 13;

    void setup() {
    Serial.begin(9600);
    pinMode(ledPin, OUTPUT);
    pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);
    Init_servo();
    }
    void loop() {
    flashLights();
    testServos();
    Serial.print("Done");
    delay(1000);
    }
    void testServos() {
    for(int i = 0; i <= 45; i++) {
    roll = i; pitch = i;
    pulse_servos(roll, pitch);
    }
    }
    void flashLights() {
    digitalWrite(ledPin, HIGH);
    delay(1000);
    digitalWrite(ledPin, LOW);
    delay(1000);
    }


    Do you have any idea what I am missing.

    Thanks
    Sirk
  • 3D Robotics
    Are you using Attach to link the servo to the correct pins?

    In the ArduPilot code we don't use servo.write. Too inefficient. We use registers instead,
This reply was deleted.