Customize Mission Planner for Swarm UAV formation fly

- Install software
- Git
  http://msysgit.github.io/
  Full installer for official Git for Windows with the highest version
  Step 1: Open the Git Setup Wizard, as shown in Figure 1
Figure 1
  Step 2: GNU General Public License, as shown in Figure 2
Figure 2
  Setp 3: Select Destination Location, as shown in Figure 3
Figure 3
  Setp 4: Select Components, as shown in Figure 4
Figure 4
  Step 5: Select Start Menu Folder, as shown in Figure 5
Figure 5
  Step 6: Adjusting your PATH environment, as shown in Figure 6.
              Please read the warning message as return in red colour
Figure 6
  Step 7: Configuring the line ending conversions, as shown in Figure 7.
              If you are Windows user, Checkout Windows-style, commit Unix-style line endings is
              the recommended setting on windows
Figure 7
  Step 8: Installing Git on your computer, as shown in Figure 8
Figure 8
  Step 9: Completing the Git Setup Wizard, as shown in Figure 9
Figure 9
- TortuiseGit
  http://code.google.com/p/tortoisegit/wiki/Download
 
- Visual Studio
  http://www.visualstudio.com/downloads/download-visual-studio-vs
 
- DirectX Redist
  http://www.microsoft.com/en-us/download/details.aspx?id=35
 
- Microsoft .NET 4.0
  http://www.microsoft.com/en-us/download/details.aspx?id=17851
 
- Check out
- Create an empty folder anywhere
- In explorer left click and select "Git Clone"
  set URL https://github.com/diydrones/MissionPlanner
  ok
- Build
- Open ArdupilotMega.sln woth visial Studio for Windows desktop.
- Compile.

ACRO Mode

A
////////////////////////////////////////////////////////////////////////////////
//ArduCopter.pde
////////////////////////////////////////////////////////////////////////////////
void setup() 
{
    cliSerial = hal.console;

    // Load the default values of variables listed in var_info[]s
    AP_Param::setup_sketch_defaults();

    init_ardupilot();

    // initialise the main loop scheduler
    scheduler.init(&scheduler_tasks[0], sizeof(scheduler_tasks)/sizeof(scheduler_tasks[0]));
}

void loop()
{
    // wait for an INS sample
    if (!ins.wait_for_sample(1000)) {
        Log_Write_Error(ERROR_SUBSYSTEM_MAIN, ERROR_CODE_MAIN_INS_DELAY);
        return;
    }
    uint32_t timer = micros();

    // check loop time
    perf_info_check_loop_time(timer - fast_loopTimer);

    // used by PI Loops
    G_Dt                    = (float)(timer - fast_loopTimer) / 1000000.f;
    fast_loopTimer          = timer;

    // for mainloop failure monitoring
    mainLoop_count++;

    // Execute the fast loop
    // ---------------------
    fast_loop();
B
// Main loop - 100hz
static void fast_loop()
{

    // IMU DCM Algorithm
    // --------------------
    read_AHRS();
C
static void read_AHRS(void)
{
    // Perform IMU calculations and get attitude info
    //-----------------------------------------------
#if HIL_MODE != HIL_MODE_DISABLED
    // update hil before ahrs update
    gcs_check_input();
#endif
    ahrs.update();
}
    // run low level rate controllers that only require IMU data attitude_control.rate_controller_run(); // write out the servo PWM values // ------------------------------ set_servos_4(); // Inertial Nav // -------------------- read_inertia(); // run the attitude controllers update_flight_mode();
D
// update_flight_mode - calls the appropriate attitude controllers based on flight mode
// called at 100hz or more
static void update_flight_mode()
{
    switch (control_mode) {
        case ACRO:
            #if FRAME_CONFIG == HELI_FRAME
                heli_acro_run();
            #else
                acro_run();
            #endif
            break;

        case STABILIZE:
            #if FRAME_CONFIG == HELI_FRAME
                heli_stabilize_run();
            #else
                stabilize_run();
            #endif
            break;

        case ALT_HOLD:
            althold_run();
            break;

        case AUTO:
            auto_run();
            break;

        case CIRCLE:
            circle_run();
            break;

        case LOITER:
            loiter_run();
            break;

        case GUIDED:
            guided_run();
            break;

        case LAND:
            land_run();
            break;

        case RTL:
            rtl_run();
            break;

        case OF_LOITER:
            ofloiter_run();
            break;

        case DRIFT:
            drift_run();
            break;

        case SPORT:
            sport_run();
            break;

        case FLIP:
            flip_run();
            break;

#if AUTOTUNE_ENABLED == ENABLED
        case AUTOTUNE:
            autotune_run();
            break;
#endif

#if HYBRID_ENABLED == ENABLED
        case HYBRID:
            hybrid_run();
            break;
#endif
    }
}
// optical flow // -------------------- #if OPTFLOW == ENABLED if(g.optflow_enabled) { update_optical_flow(); } #endif // OPTFLOW == ENABLED }
// tell the scheduler one tick has passed scheduler.tick(); // run all the tasks that are due to run. Note that we only // have to call this once per loop, as the tasks are scheduled // in multiples of the main loop tick. So if they don't run on // the first call to the scheduler they won't run on a later // call until scheduler.tick() is called again uint32_t time_available = (timer + MAIN_LOOP_MICROS) - micros(); scheduler.run(time_available); }
E
////////////////////////////////////////////////////////////////////////////////
//control_acro.pde - init and run calls for acro flight mode
////////////////////////////////////////////////////////////////////////////////
// acro_init - initialise acro controller
static bool acro_init(bool ignore_checks)
{
    // always successfully enter acro
    return true;
}

// acro_run - runs the acro controller
// should be called at 100hz or more
static void acro_run()
{
    float target_roll, target_pitch, target_yaw;
    int16_t pilot_throttle_scaled;

    // if motors not running reset angle targets
    if(!motors.armed() || g.rc_3.control_in <= 0) {
        attitude_control.relax_bf_rate_controller();
F
// relax_bf_rate_controller - ensure body-frame rate controller has zero errors to relax rate controller output
void AC_AttitudeControl::relax_bf_rate_controller()
{
    // ensure zero error in body frame rate controllers
    const Vector3f& gyro = _ins.get_gyro();
    _rate_bf_target = gyro * AC_ATTITUDE_CONTROL_DEGX100;
}
attitude_control.set_yaw_target_to_current_heading();
G
// set_yaw_target_to_current_heading - sets yaw target to current heading
void set_yaw_target_to_current_heading()
{ _angle_ef_target.z = _ahrs.yaw_sensor; }
attitude_control.set_throttle_out(0, false);
H
 // set_throttle_out - to be called by upper throttle controllers when they wish to provide throttle output directly to motors
 // provide 0 to cut motors
void AC_AttitudeControl::set_throttle_out(int16_t throttle_out, bool apply_angle_boost)
{
    if (apply_angle_boost) {
        _motors.set_throttle(get_angle_boost(throttle_out));
    }else{
        _motors.set_throttle(throttle_out);
        // clear angle_boost for logging purposes
        _angle_boost = 0;
    }

    // update compass with throttle value
    // To-Do: find another method to grab the throttle out and feed to the compass.  Could be done completely outside this class
    //compass.set_throttle((float)g.rc_3.servo_out/1000.0f);
}
return;
} // convert the input to the desired body frame rate get_pilot_desired_angle_rates(g.rc_1.control_in, g.rc_2.control_in, g.rc_4.control_in, target_roll, target_pitch, target_yaw); // get pilot's desired throttle pilot_throttle_scaled = get_pilot_desired_throttle(g.rc_3.control_in);
I
static int16_t get_pilot_desired_throttle(int16_t throttle_control)
{
    int16_t throttle_out;

    // exit immediately in the simple cases
    if( throttle_control == 0 || g.throttle_mid == 500) {
        return throttle_control;
    }

    // ensure reasonable throttle values
    throttle_control = constrain_int16(throttle_control,0,1000);
    g.throttle_mid = constrain_int16(g.throttle_mid,300,700);

    // check throttle is above, below or in the deadband
    if (throttle_control < THROTTLE_IN_MIDDLE) {
        // below the deadband
        throttle_out = g.throttle_min + ((float)(throttle_control-g.throttle_min))*((float)(g.throttle_mid - g.throttle_min))/((float)(500-g.throttle_min));
    }else if(throttle_control > THROTTLE_IN_MIDDLE) {
        // above the deadband
        throttle_out = g.throttle_mid + ((float)(throttle_control-500))*(float)(1000-g.throttle_mid)/500.0f;
    }else{
        // must be in the deadband
        throttle_out = g.throttle_mid;
    }

    return throttle_out;
}
// run attitude controller attitude_control.rate_bf_roll_pitch_yaw(target_roll, target_pitch, target_yaw); // output pilot's throttle without angle boost attitude_control.set_throttle_out(pilot_throttle_scaled, false);
K
// set_throttle_out - to be called by upper throttle controllers when they wish to provide throttle output directly to motors
 // provide 0 to cut motors
void AC_AttitudeControl::set_throttle_out(int16_t throttle_out, bool apply_angle_boost)
{
    if (apply_angle_boost) {
        _motors.set_throttle(get_angle_boost(throttle_out));
    }else{
        _motors.set_throttle(throttle_out);
        // clear angle_boost for logging purposes
        _angle_boost = 0;
    }

    // update compass with throttle value
    // To-Do: find another method to grab the throttle out and feed to the compass.  Could be done completely outside this class
    //compass.set_throttle((float)g.rc_3.servo_out/1000.0f);
}
} // get_pilot_desired_angle_rates - transform pilot's roll pitch and yaw input into a desired lean angle rates // returns desired angle rates in centi-degrees-per-second static void get_pilot_desired_angle_rates(int16_t roll_in, int16_t pitch_in, int16_t yaw_in, float &roll_out, float &pitch_out, float &yaw_out) { // Calculate trainer mode earth frame rate command for roll float rate_limit; Vector3f rate_ef_level, rate_bf_level, rate_bf_request; // calculate rate requests rate_bf_request.x = roll_in * g.acro_rp_p; rate_bf_request.y = pitch_in * g.acro_rp_p; rate_bf_request.z = yaw_in * g.acro_yaw_p; // calculate earth frame rate corrections to pull the copter back to level while in ACRO mode if (g.acro_trainer != ACRO_TRAINER_DISABLED) { // Calculate trainer mode earth frame rate command for roll int32_t roll_angle = wrap_180_cd(ahrs.roll_sensor); rate_ef_level.x = -constrain_int32(roll_angle, -ACRO_LEVEL_MAX_ANGLE, ACRO_LEVEL_MAX_ANGLE) * g.acro_balance_roll; // Calculate trainer mode earth frame rate command for pitch int32_t pitch_angle = wrap_180_cd(ahrs.pitch_sensor); rate_ef_level.y = -constrain_int32(pitch_angle, -ACRO_LEVEL_MAX_ANGLE, ACRO_LEVEL_MAX_ANGLE) * g.acro_balance_pitch; // Calculate trainer mode earth frame rate command for yaw rate_ef_level.z = 0; // Calculate angle limiting earth frame rate commands if (g.acro_trainer == ACRO_TRAINER_LIMITED) { if (roll_angle > aparm.angle_max){ rate_ef_level.x -= g.acro_rp_p*(roll_angle-aparm.angle_max); }else if (roll_angle < -aparm.angle_max) { rate_ef_level.x -= g.acro_rp_p*(roll_angle+aparm.angle_max); } if (pitch_angle > aparm.angle_max){ rate_ef_level.y -= g.acro_rp_p*(pitch_angle-aparm.angle_max); }else if (pitch_angle < -aparm.angle_max) { rate_ef_level.y -= g.acro_rp_p*(pitch_angle+aparm.angle_max); } } // convert earth-frame level rates to body-frame level rates attitude_control.frame_conversion_ef_to_bf(rate_ef_level, rate_bf_level); // combine earth frame rate corrections with rate requests if (g.acro_trainer == ACRO_TRAINER_LIMITED) { rate_bf_request.x += rate_bf_level.x; rate_bf_request.y += rate_bf_level.y; rate_bf_request.z += rate_bf_level.z; }else{ acro_level_mix = constrain_float(1-max(max(abs(roll_in), abs(pitch_in)), abs(yaw_in))/4500.0, 0, 1)*ahrs.cos_pitch(); // Scale leveling rates by stick input rate_bf_level = rate_bf_level*acro_level_mix; // Calculate rate limit to prevent change of rate through inverted rate_limit = fabs(fabs(rate_bf_request.x)-fabs(rate_bf_level.x)); rate_bf_request.x += rate_bf_level.x; rate_bf_request.x = constrain_float(rate_bf_request.x, -rate_limit, rate_limit); // Calculate rate limit to prevent change of rate through inverted rate_limit = fabs(fabs(rate_bf_request.y)-fabs(rate_bf_level.y)); rate_bf_request.y += rate_bf_level.y; rate_bf_request.y = constrain_float(rate_bf_request.y, -rate_limit, rate_limit); // Calculate rate limit to prevent change of rate through inverted rate_limit = fabs(fabs(rate_bf_request.z)-fabs(rate_bf_level.z)); rate_bf_request.z += rate_bf_level.z; rate_bf_request.z = constrain_float(rate_bf_request.z, -rate_limit, rate_limit); } } // hand back rate request roll_out = rate_bf_request.x; pitch_out = rate_bf_request.y; yaw_out = rate_bf_request.z; }

ArduPilot Radio Control Mapping

Channel 1 = Roll
Channel 2 = Pitch
Channel 3 = Throttle
Channel 4 = Yaw

const AP_Param::GroupInfo RCMapper::var_info[] PROGMEM = {
AP_GROUPINFO("ROLL", 0, RCMapper, _ch_roll, 1),
AP_GROUPINFO("PITCH", 1, RCMapper, _ch_pitch, 2),
AP_GROUPINFO("THROTTLE", 2, RCMapper, _ch_throttle, 3),
AP_GROUPINFO("YAW", 3, RCMapper, _ch_yaw, 4),
AP_GROUPEND
};

Send location information to other Arduino

Previous, I was interpreted the GPS information, now I want send my location to other Arduino board. So that, every Arduino board can be sharing the location information. This is for anti-collision purpose.

  1. At the second Arduino board, up load the code to it.
    void setup()
    {
      Serial.begin(38400);
      Serial.flush();
     }
    void loop()
    {
      if(Serial.available())
        Serial.write(Serial.read());
    }
  2. Now, you can open the COM port, the result will be same as previously.
    $GPGGA,003121.200,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7E
    $GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
    $GPRMC,003121.200,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*6F
    $GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
    $GPGGA,003121.400,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*78
    $GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
    $GPRMC,003121.400,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*69
    $GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
    $GPGGA,003121.600,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7A
    $GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
    $GPGSV,3,1,11,22,73,029,14,18,51,120,18,31,48,306,39,50,42,091,*7C
    $GPGSV,3,2,11,25,33,050,28,14,24,011,29,21,22,164,,16,14,205,*7D
    $GPGSV,3,3,11,29,11,117,,27,04,224,,193,,,*4B
    $GPRMC,003121.600,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*6B
    $GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
  3. But this time, I want introduce GPS library to you.
    You can down the library at herehttp://arduiniana.org/libraries/tinygpsplus/

    The good thing about this library is, you just need to call the function it have, and it will automatic display result to you, cool right!
    Here is complete list:
  4. gps.location.lat() // Latitude in degrees (double)
    gps.location.lng() // Longitude in degrees (double)
    gps.location.rawLat().negative ? "-" : "+"
    gps.location.rawLat().deg // Raw latitude in whole degrees
    gps.location.rawLat().billionths // ... and billionths (u16/u32)
    gps.location.rawLng().negative ? "-" : "+"
    gps.location.rawLng().deg // Raw longitude in whole degrees
    gps.location.rawLng().billionths // ... and billionths (u16/u32)
    gps.date.value() // Raw date in DDMMYY format (u32)
    gps.date.year() // Year (2000+) (u16)
    gps.date.month( // Month (1-12) (u8)
    gps.date.day()) // Day (1-31) (u8)
    gps.time.value() // Raw time in HHMMSSCC format (u32)
    gps.time.hour() // Hour (0-23) (u8)
    gps.time.minute() // Minute (0-59) (u8)
    gps.time.second() // Second (0-59) (u8)
    gps.time.centisecond() // 100ths of a second (0-99) (u8)
    gps.speed.value() // Raw speed in 100ths of a knot (i32)
    gps.speed.knots() // Speed in knots (double)
    gps.speed.mph() // Speed in miles per hour (double)
    gps.speed.mps() // Speed in meters per second (double)
    gps.speed.kmph() // Speed in kilometers per hour (double)
    gps.course.value() // Raw course in 100ths of a degree (i32)
    gps.course.deg() // Course in degrees (double)
    gps.altitude.value() // Raw altitude in centimeters (i32)
    gps.altitude.meters() // Altitude in meters (double)
    gps.altitude.miles() // Altitude in miles (double)
    gps.altitude.kilometers() // Altitude in kilometers (double)
    gps.altitude.feet() // Altitude in feet (double)
    gps.satellites.value() // Number of satellites in use (u32)
    gps.hdop.value() // Horizontal Dim. of Precision (100ths-i32)

  5. GPS library usage
    Let's say you want to display your location, you would simply create a TinyGPS++ instance as shown in below:

    #include <TinyGPS++.h>
    TinyGPSPlus gps;

    Repeatedly feed it characters from your GPS receiver:

    while (Serial.available()>0)
      gps.encode(Serial.read());

    Then display the desired information:

    if(gps.location.isUpdated())
    {
      Serial.print("Latitude: ");
      Serial.println(gps.location.lat());
      Serial.print("Longitude: ");
      Serial.println(gps.location.lng());
    }

    The result as shown below:

Global Positioning System

The Global Positioning System (GPS) is a space-based statellite navigation system that provides location and time information on all weather conditions. It maintained by the US government and is freely accessible to anyone with a GPS receiver.

Here, we don't discuss its background, we want to know how to interpret the satellite positioning data.
  1. There are a lot of GPS receivers in the market, we are using 3DR GPS MTK V2.0 now, as shown in Figure 1.

  2. Figure 1: 3DR MTK V2.0

  3. Connect GPS receiver to the Arduino Mega 2560.

  4. Figure 2: Arduino Mega 2560

  5. Next, wrie code to Arduino Mega 2560, the code very simple.

    void setup()
    {
      Serial.begin(38400);
      Serial1.begin(38400);
      Serial.flush();
      Serial1.flush();
    }
    void loop()
    {
      if(Serial1.available())
      {
        Serial.write(Serial1.read());
      }
    }
  6. Open the COM port used by Arduino Mega 2560, you will see the received data from the GPS.

    $GPGGA,003121.200,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7E
    $GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
    $GPRMC,003121.200,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*6F
    $GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
    $GPGGA,003121.400,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*78
    $GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
    $GPRMC,003121.400,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*69
    $GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
    $GPGGA,003121.600,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7A
    $GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
    $GPGSV,3,1,11,22,73,029,14,18,51,120,18,31,48,306,39,50,42,091,*7C
    $GPGSV,3,2,11,25,33,050,28,14,24,011,29,21,22,164,,16,14,205,*7D
    $GPGSV,3,3,11,29,11,117,,27,04,224,,193,,,*4B
    $GPRMC,003121.600,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*6B
    $GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39

    This is a part of GPS data, it looks terrible. Starting, you may feel very afraid, confused, don't know how to read it. But in fact, you can refer to the following web site, it explains the meaning of each of the data represented in detail.
    http://aprs.gids.nl/nmea/

    These data have been repeat and repeat, but what I need is the location, I want to know where I am, so we need to read $GPGGA this sentence.

    $GPGGA,003121.200,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7E
  7. Name
    Example data
    Description
    Sentence Identifier
    $GPGGA
    Global Positioning System Fix Data
    Time
    003121.200
    00:31:21:200
    Latitude
    0120.4690, N
    01° 20.4690' N or 01° 20' 28" 140''' N
    Longitude
    10341.9579, E
    103° 41.9579' E or 103° 41' 57" 474''' E
    Fix Quality:
    - 0 = Invalid
    - 1 = GPS fix
    - 2 = DGPS fix
    1
    Data is from a GPS fix
    Number of Satellites
    4
    4 Satellites are in view
    Horizontal Dilution of Precision (HDOP)
    2.63
    Relative accuracy of horizontal position
    Altitude
    -45.2, M
    -45.2 meters above mean sea level
    Height of geoid above WGS84 ellipsoid
    3.2, M
    3.2 meters
    Time since last DGPS update
    blank
    No last updateZ
    DGPS reference station id
    blank
    No station id
    Checksum
    *7E
    Used by program to check for transmission errors
    From the above table, know that I am at 01° 20' 28" 140 North and 103° 41' 57" 474 East.
    Next, you can enter the location return by GPS receiver into the Google map: 1°20'28.140'' 103°41'57.474'' , it show that there is my home.

Week Six - Program XBee & PPT

What is XBee

XBee is the brand name form Digi international for a family factor compatible radio modules. The first XBee radio were introduced under the MaxStream brand in 2005 and were based on the 802.15.4-2003 standard designed for point-to-point star communications at over-the-air baud rates of 250 kbits/s.


The XBee radios can all be used with the minimum four number of connections – power (3.3 V), ground, data in and data out (UART), with other recommended lines being Reset and Sleep.
 controlI/OA/D and indicator lines built in. A version of the XBees called the programmable XBee has an additional onboard processor for user’s code. The programmable XBee and a new surface mount (SMT) version of the XBee radios were both introduced in 2010.
As of February 2013, the XBee radio family consists of[7]
  • XBee 802.15.4 – The initial point-to-point topology or star topology module running the IEEE 802.15.4 protocol
  • XBee-PRO 802.15.4 – A higher power, longer range version of the XBee 802.15.4
  • XBee DigiMesh 2.4 – A 2.4 GHz XBee module which uses DigiMesh, a sleeping mesh networking protocol developed by Digi International
  • XBee-PRO DigiMesh 2.4 – A higher power, longer range version of the XBee DigiMesh 2.4
  • XBee ZB – An XBee module that incorporates the ZigBee PRO mesh networking protocol
  • XBee-PRO ZB – A higher power, longer range version of the XB
    ee ZB
  • XBee ZB SMT – A surface mount XBee running the ZigBee protocol
  • XBee-PRO ZB SMT – A higher power, longer range version of the XBee ZB SMT
  • XBee SE – An XBee ZB module that incorporates the security cluster for the ZigBee Smart Energy public profile
  • XBee-PRO SE – A higher power, longer range version of the XBee SE
  • XBee-PRO 900HP - A 900 MHz XBee-PRO module with up to 28 mile range with high-gain antenna, which supports DigiMesh networking protocol
  • XBee-PRO 900 (Legacy) – A 900 MHz proprietary point-to-point and star topology module, not recommended for new design
  • XBee-PRO XSC (S3B) – A 900 MHz module compatible over the air with the Digi 9XStream radios
  • XBee-PRO DigiMesh 900 (Legacy) – A 900 MHz module which uses DigiMesh, not recommended for new design (see XBee-PRO 900HP for new designs)
  • XBee-PRO 868 – An 868 MHz 500 mW long-range module which supports proprietary point-to-point and star, for use in Europe
  • XBee 865/868LP - An 868 MHz XBee module which uses DigiMesh, available in Surface Mount form-factor (also configurable to 865 MHz for use in India)




After study for XB we decided to use XBee pro S2 
it has a bigger communication range.

As well as it is able to have a network communication not just point-to-point communication.







This is XBee explorer. We have to mount XBee on top of it in order to connect it to computer.




This is XBee shield. If we need to connect XBee to Audrunio for programming, we have to mount XBee on top if XBee shield and mount XBee shield on top of Audrunio.





We use X-CTU to configure XBee 







Our 1st test for XBee....
However, was not very successful 
We accidentally connected the XBee in reverse direction ...opps... 
it caused XBee connection error . Sadly, we broke the antenna on the XBee but it was still working fine...O.0   




Week Five - Familiarizing with APM

APM Autopilot suite


Hardware - The embedded systems and peripheral sensors that 3DRobotics designs, manufactures, and sells. Think of hardware as the brain, eyes, ears, ect. Almost any mobile machine can be transformed into a robot, by integrating a small hardware package into it.



 Firmware - The "skill set" code running on the hardware which configures it for the kind of vehicle you've put it in. You choose the firmware and mission: plane, copter, rover...






Software - Your interface to the hardware. Initial set-up, configuration, and testing. Mission-planning/operation, and post-mission analysis.
Point-and-click intuitive interaction with your hardware, or advanced custom scripting for niche mission profiles. Options are everything APM.


 Those are mission planners. The one at lift is the new version AMP planner 2.0 






Testing



APM and GPS we got those from last year FYP group. 



Testing for the APM and GPS we got those from last year FYP group. 
However, the APM is no longer functioning.
The GPS works fine. 










This is the new Autopilot we purchased.










We connect APM with RC receiver 

How to connect: 


First test with UAV motors: 

 Result(fail):APM keep showing "DISARMED"; motors cannot move.
At indoor GPS cannot detect our location.

How we solve the problem: 

At first we thought the APM was spoiled so we send it back for repair. However, the technician for Sgbotics told us that it works fine. Next day we gone to Sgbotics's warehouse to solve the problem. After went back we change a larger voltage battery and we did a calibration for joystick.

Result(solved):   





Week Three - Familiarizing with Arduino

What is an Arduino 

Arduino is an open-source electronics prototyping platform based on flexible, easy-to use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. or more simply, you load on some code and it can read sensors, perform actions based on inputs from buttons, control motors, and accept shield to further expend it's capabilities. 

Different type of Arduino


ItemuCInput VoltageSystem VoltageClock SpeedDigital I/OAnalog InputsPWMUARTFlash SpaceBootloaderProgramming Interface
[Due]
AT91SAM3X8E7-12V3.3V84MHz54*12124512KbDueUSB native
[Leo]
ATmega32U47-12V5V16MHz20*127132KbLeonardoUSB native
[UnoR3]
ATmega3287-12V5V16MHz1466132KbOptibootUSB via ATMega16U2
[UnoR3SMD]
ATmega3287-12V5V16MHz1466132KbOptibootUSB via ATMega16U2
[RedBoard]
ATmega3287-15V5V16MHz1466132KbOptibootUSB via FTDI
[UnoSMD]
Arduino Uno SMD
(retired)
ATmega3287-12V5V16MHz1466132KbOptibootUSB via ATMega8U2
[Arduino Uno]
Arduino Uno
(retired)
ATmega3287-12V5V16MHz1466132KbOptibootUSB via ATMega8U2
[Duemilinove]
ATmega3287-12V5V16MHz1466132KbAtmegaBOOTUSB via FTDI
[Bluetooth]
ATmega3281.2-5.5V5V16MHz1466132KbAtmegaBOOTBluetooth Serial
[Pro 3V]
ATmega3283.35 -12V3.3V8MHz1466132KbAtmegaBOOTFTDI-Compatible Header
[Pro 5V]
ATmega3285 - 12V5V16MHz1466132KbAtmegaBOOTFTDI-Compatible Header
[Ethernet]
Ethernet Pro
(retired)
ATmega3287-12V5V16MHz1466132KbAtmegaBOOTFTDI-Compatible Header
[2560R3]
ATmega25607-12V5V16MHz5416144256KbSTK500v2USB via ATMega16U2
[2560]
ATmega25607-12V5V16MHz5416144256KbSTK500v2USB via ATMega8U2
[Mega]
Arduino Mega
(retired)
ATmega12807-12V5V16MHz5416144128KbSTK500v2USB via FTDI
[MegaPro3]
ATmega25603.3-12V3.3V8MHz5416144256KbSTK500v2FTDI-Compatible Header
[MegaPro5]
ATmega25605-12V5V16MHz5416144256KbSTK500v2FTDI-Compatible Header
[Mini04]
Arduino Mini 04
(retired)
ATmega3287-9V5V16MHz1468132KbAtmegaBOOTSerial Header
[Mini05]
ATmega3287-9V5V16MHz1468132KbAtmegaBOOTSerial Header
[ProMini3]
ATmega3283.35 -12V3.3V8MHz1466132KbAtmegaBOOTFTDI-Compatible Header
[ProMini5]
ATmega3285 - 12V5V16MHz1466132KbAtmegaBOOTFTDI-Compatible Header
[Fio]
ATmega328P3.35 -12V3.3V8MHz1486132KbAtmegaBOOTFTDI-Compatible Header or Wirelessly via XBee1
[MegaProMini]
ATmega25603.3-12V3.3V8MHz5416144256KbSTK500v2FTDI-Compatible Header
[ProMicro5]
ATmega32U45 - 12V5V16MHz1245132KbDiskLoaderNative USB
[ProMicro3]
ATmega32U43.35 - 12V3.3V8MHz1245132KbDiskLoaderNative USB
[LilyMain]
ATmega3282.7-5.5V3.3V8MHz1466132KbAtmegaBOOTFTDI-Compatible Header
[LilySimp]





ATmega3282.7-5.5V3.3V8MHz9450232KbAtmegaBOOTFTDI-Compatible Header
All Arduino boards have one thing in common: they are programmed through the Arduino IDE. This is the software that allows you to write and upload code. Beyond that, there can be a lot of differences. The number of inputs and outputs (how many sensors, LEDs, and buttons you can use on a single board), speed, operating voltage, and form factor are just a few of the variables. 




Study for Arduino



This is the book we used

After the research we had done we decided to use Arduino Mega 2560. 












Arduino Mega 2560




Summary


MicrocontrollerATmega2560
Operating Voltage5V
Input Voltage (recommended)7-12V
Input Voltage (limits)6-20V
Digital I/O Pins54 (of which 15 provide PWM output)
Analog Input Pins16
DC Current per I/O Pin40 mA
DC Current for 3.3V Pin50 mA
Flash Memory256 KB of which 8 KB used by bootloader
SRAM8 KB
EEPROM4 KB
Clock Speed16 MHz
The Arduino Mega 2560 is a microcontroller boaed based on the ATmega2560(datasheet). It has 54 digital input/output pins (of which 15 can be used as PWM outputs),16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with USB cable or power it with a AC-to-DC adapter or battery to get started. The Mega is compatible with most shield designed for Arduino Duemilanove or Diecimila. 

A Mega 2560 is an updated to the Arduino Mega, which is replaces. The Mega 2560 differs from all preceding boards in that it does not use the FTDI USB-to-derial driver chip. Instead, it features the ATmega16U2 (ATmega8U2 in the revision 1 and 2 boards )programmed as USB-to-serial converter




This the software we use to program Arduino