- - 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.
Customize Mission Planner for Swarm UAV formation fly
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(); |
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(); |
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
};
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.
- 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());
} - 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 - But this time, I want introduce GPS library to you.
You can down the library at here: http://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: - 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:
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) |
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.
- There are a lot of GPS receivers in the market, we are using 3DR GPS MTK V2.0 now, as shown in Figure 1.
- Connect GPS receiver to the Arduino Mega 2560.
- 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());
}
} - 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
Figure 1: 3DR MTK V2.0
Figure 2: Arduino Mega 2560
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.
control, I/O, A/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
- 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.
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
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
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
Item | uC | Input Voltage | System Voltage | Clock Speed | Digital I/O | Analog Inputs | PWM | UART | Flash Space | Bootloader | Programming Interface |
---|---|---|---|---|---|---|---|---|---|---|---|
AT91SAM3X8E | 7-12V | 3.3V | 84MHz | 54* | 12 | 12 | 4 | 512Kb | Due | USB native | |
ATmega32U4 | 7-12V | 5V | 16MHz | 20* | 12 | 7 | 1 | 32Kb | Leonardo | USB native | |
ATmega328 | 7-12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | Optiboot | USB via ATMega16U2 | |
ATmega328 | 7-12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | Optiboot | USB via ATMega16U2 | |
ATmega328 | 7-15V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | Optiboot | USB via FTDI | |
Arduino Uno SMD
(retired) | ATmega328 | 7-12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | Optiboot | USB via ATMega8U2 |
Arduino Uno
(retired) | ATmega328 | 7-12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | Optiboot | USB via ATMega8U2 |
Arduino Duemilanove
(retired) | ATmega328 | 7-12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | USB via FTDI |
Arduino Bluetooth
(retired) | ATmega328 | 1.2-5.5V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | Bluetooth Serial |
ATmega328 | 3.35 -12V | 3.3V | 8MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | FTDI-Compatible Header | |
ATmega328 | 5 - 12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | FTDI-Compatible Header | |
Ethernet Pro
(retired) | ATmega328 | 7-12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | FTDI-Compatible Header |
ATmega2560 | 7-12V | 5V | 16MHz | 54 | 16 | 14 | 4 | 256Kb | STK500v2 | USB via ATMega16U2 | |
Arduino Mega 2560
(retired) | ATmega2560 | 7-12V | 5V | 16MHz | 54 | 16 | 14 | 4 | 256Kb | STK500v2 | USB via ATMega8U2 |
Arduino Mega
(retired) | ATmega1280 | 7-12V | 5V | 16MHz | 54 | 16 | 14 | 4 | 128Kb | STK500v2 | USB via FTDI |
ATmega2560 | 3.3-12V | 3.3V | 8MHz | 54 | 16 | 14 | 4 | 256Kb | STK500v2 | FTDI-Compatible Header | |
ATmega2560 | 5-12V | 5V | 16MHz | 54 | 16 | 14 | 4 | 256Kb | STK500v2 | FTDI-Compatible Header | |
Arduino Mini 04
(retired) | ATmega328 | 7-9V | 5V | 16MHz | 14 | 6 | 8 | 1 | 32Kb | AtmegaBOOT | Serial Header |
ATmega328 | 7-9V | 5V | 16MHz | 14 | 6 | 8 | 1 | 32Kb | AtmegaBOOT | Serial Header | |
ATmega328 | 3.35 -12V | 3.3V | 8MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | FTDI-Compatible Header | |
ATmega328 | 5 - 12V | 5V | 16MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | FTDI-Compatible Header | |
ATmega328P | 3.35 -12V | 3.3V | 8MHz | 14 | 8 | 6 | 1 | 32Kb | AtmegaBOOT | FTDI-Compatible Header or Wirelessly via XBee1 | |
ATmega2560 | 3.3-12V | 3.3V | 8MHz | 54 | 16 | 14 | 4 | 256Kb | STK500v2 | FTDI-Compatible Header | |
ATmega32U4 | 5 - 12V | 5V | 16MHz | 12 | 4 | 5 | 1 | 32Kb | DiskLoader | Native USB | |
ATmega32U4 | 3.35 - 12V | 3.3V | 8MHz | 12 | 4 | 5 | 1 | 32Kb | DiskLoader | Native USB | |
ATmega328 | 2.7-5.5V | 3.3V | 8MHz | 14 | 6 | 6 | 1 | 32Kb | AtmegaBOOT | FTDI-Compatible Header | |
ATmega328 | 2.7-5.5V | 3.3V | 8MHz | 9 | 4 | 5 | 02 | 32Kb | AtmegaBOOT | FTDI-Compatible Header |
More information visit:https://www.sparkfun.com/arduino_guide
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
Microcontroller | ATmega2560 |
Operating Voltage | 5V |
Input Voltage (recommended) | 7-12V |
Input Voltage (limits) | 6-20V |
Digital I/O Pins | 54 (of which 15 provide PWM output) |
Analog Input Pins | 16 |
DC Current per I/O Pin | 40 mA |
DC Current for 3.3V Pin | 50 mA |
Flash Memory | 256 KB of which 8 KB used by bootloader |
SRAM | 8 KB |
EEPROM | 4 KB |
Clock Speed | 16 MHz |
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
More information visit: http://arduino.cc/en/Main/arduinoBoardMega2560
Subscribe to:
Posts (Atom)