Monday, 30 June 2014

ecalc



Disclaimer: I have been at the drone business about two months (since Christmas). I have noticed that there is a lack of How-To's, unlike other RC forums. How-To guides are nice when you want to do a simple search and get results with having to weed through pages and pages of discussions. I hope to keep blogging my progress to help other noobs.

Setting up my first drone, I did a search for "motor and prop efficiency" and came up with a couple references to eCalc. It is an online calculator that calculates flight times for all sorts of flying drones. I will use the example of my latest build, a Bixler 1.1. eCalc can be pretty overwhelming at first, but it becomes a breeze with some practice.  Note: eCalc is now commercialized, but there is a free version with limited options, and a one year subscription costs just $5, well worth it.
First, you need to plug in your motor cooling, field elevation, and ambient temperature. Notice that when you put int the ESC, you need to put in the surge or burst rating:


Now, put in your battery information. If you cannot find your particular battery, find a close match in C-rating and capacity and allow the program to populate the rest of the fields for you. Then, go back to the drop down and select CUSTOM. In my example, I chose a 2100 mAh battery, but went back and changed it to 2200 for more precise flight times:


Next, choose your motor, or one from the drop-down that matches pole count and can size (diameter and can length.) Allow the program to populate the rest of the fields for you and then go back and change the fields with information from the manufacturer's website. In my example, I had to change power (watts) and weight:


Next, select a prop and press CALCULATE. You want to experiment with motor and prop combinations that do not give you the red warning letters:

After first writing this post, I encountered a problem. I couldn't find a prop in the size I was looking for! Make sure you can easily acquire the prop you generate results for.
After making some changes, the most efficient prop for this motor is a 6 x 3E from APC. Notice the flight times offer you a range, depending on your flying style:


I just flew this particular combination yesterday, and the "most efficient" isn't always the best. In my case, the plane flew on the cusp of stalling with very little reserve thrust. It would literally stand still in ~20 MPH winds! I changed out for a 6 x 4E prop which gives much more power while sacrificing very little in flight times:


I can attest that the accuracy is dead-on with eCalc. At 10-11 minutes of flight time, my battery is at 50%. I hope this helps someone out on their journey!
If you don't have a computerized charger to confirm the amount of capacity, another good indicator is to measure the open circuit voltage (no load voltage) of the pack or individual cells right after a flight/drive with a digital volt meter or other similar digital voltage measuring device. An 80% discharged LiPo cell, will give an approximate open circuit voltage of about 3.72 to 3.74 volts. A 3S LiPo pack therefore would show about 11.2 volts after a flight when it's about 80% discharged, a 6S pack would be in the 22.4 volt region. The longer you wait after the flight/drive, the less accurate this voltage method of determining an 80% percent discharge works because as the pack rests after the flight, the resting open circuit voltage recovers slightly, perhaps up to 3.76 volts or so. Remember, states of charge in any battery are based on capacity, not voltage for the simple reason voltage drop in a battery is non-linear.

Lipo basics

Lipos (lithium polymer batteries aka li-poly) are the most popular power source for electric RC these days. They offer phenomenal energy storage/weight ratios and current output capabilities compared to older types of batteries. They are so good in fact that they are revolutionizing RC as we know it. But they can be a very finicky battery type and are often a very misunderstood one.
Lipo terminology and concepts

lithium polymer battery
Lithium polymer is one of many lithium based battery types available in the world. It is different than lithium ion, lithium ferrite and the one-use AA/AAA lithium cells. This type of battery differs from the other lithium types in several ways including very high energy density, very high discharge and charge rates, and very high volatility. The batteries themselves are a stacked type and come in flat cells that typically have a nominal voltage of 3.7V, and a full charge voltage of 4.2V.

mAh
mAh stands for milli-Amp-hour (1/1000th of an Ah) and denotes the capacity of a lipo. This is the standard method for stating capacity of all battery types. The Ah rating of a battery refers to how many amps a battery can output for 1 hour before it is depleted. For example a 2200mAh pack can output 2.2A for 1 hour.

Pack configuration (examples 3s1p, 2s2p)
This refers to the number of series and parallel cells that make up a pack. "s" refers to number of series cells and "p" refers to the number of parallel cells. For example a 3s1p pack is made up of 3 cells in series. A 2s2p pack is is made up of 2 sets of 2 parallel cells in series for a total of 4 cells. Raising "s" in a pack raises its voltage and raising "p" in a pack raises its capacity.

C
Every lipo has a "C" and it is simply the capacity of the lipo in Ah minus the "h". For example a 2200mAh lipo (cell count has no impact of "C") has a C = 2.2A. A 3300mAh pack has a C = 3.3A.

See The variable C and how it applies for more info.

Internal resistance
All electrical devices have resistance and batteries are no different. In the case of RC use lipos, the internal resistance (often referred to as IR) can be used to determine the quality and health of a pack. The lower the IR, the easier current flows from the pack. The easier current flows from the pack, the higher the voltage will be under load. Expect to see numbers from 2mohms for a large higher performance cell to 100+mohms for a weak older cell.

Resting voltage
This is a battery concept, not just a lipo concept. The resting voltage of a battery is the voltage when that battery is "resting" or not in use. For example if you have a lipo laying on the table and it has not been used in any way for a few minutes, it is considered to be resting. You can use the resting voltage to know if a lipo is charged, or to get a rough idea of the level of charge, and to monitor the balance of the pack.

Load voltage
This is also a battery concept, not just a lipo concept. The load voltage of a battery is the voltage of that battery under load or in use. This voltage is a function of the load and will change continuously as the load changes. The greater the load, the greater the voltage drop. Monitoring this voltage can tell you many things including the health of a pack or whether a pack is properly sized for the application.

Minimum voltage for lipos
Many battery types can be fully discharged with no problem. In fact some, like NiCds, need to be fully cycled to keep the cells healthy. But lipos are different. They have a minimum voltage requirement and if it is not followed, you can easily damage the packs. This voltage varies from pack to pack but for simplicity sake lets call it 3.0V. Now this is not a resting voltage but rather the voltage seen under load. Since this is not an easy thing to monitor it is recommended that certain precautionary measures are taken and that leads into the next item, the 80% Rule.

80% Rule
In an attempt to keep lipos healthy a general rule has evolved, the 80% Rule. In simple terms it means you should not discharge a lipo more that 80% of its rated capacity. This has nothing to do with volts but rather the mAh used during a flight.

See The 80% Rule for more info.

Heat
Many things can hurt lipos but heat is usually the culprit. In general the internal temperature of a lipo must stay below 140F. To be safe you should never read a temp higher than 130F on the surface of the lipo. Heat can come from either a hard discharge or form an external source like being left in a car during a hot summer day. The best rule of thumb is if a lipo is too warm to hold tightly in your hand, it is too hot.
Lipo use for safety and longevity
Brand new packs
New lipos ship in a "sleep" state. They have a chemical stabilizer in the cells that help them more easily handle shelf life, and are shipped at a storage voltage of approx 3.85V per cell. This stabilizer is lost when the packs are cycled, so it is important to let the packs remain asleep until they are needed.

Once a new pack is ready to be used, it needs to go through a "break in" process. Generally this means treating the new pack gingerly for the first few cycles, including charging it slowly (1C) and gently discharging it to 50% capacity for the first 5 flights. This does 2 things. First it makes sure the pack is in good condition and secondly it "loosens" up the pack for normal duty.

Note on break-in: I am seeing more and more forum posts about people trying to break in new packs on a charger. I recommend against this. Not only is it very time consuming but it is also wasteful. Instead charge a new pack at 1C and the go fly it. Take it easy and use the time to work on some basics like hovering in less comfortable orientations or slow, precise flying. Using a pack for break-in in this fashion gives you more flight time and gets you more useful cycles of the lipos. Just remember to take it easy.

Charging
Basically there are a bunch of DOs and DON'Ts for charging and here are a few

DO
  • find a well thought out place to charge. This includes both a location as well as what you charge on and near. Many people like to charge in something flameproof like a cash box or lipo sack.
  • make sure the charger and lipo(s) are in good working order. 
  • choose a charge rate that is safe for your lipo.
  • always double check your charger settings and connections before you start charging. Then check again once the charge cycle starts to make sure the charger is displaying the correct info.
  • have a plan if something were to go wrong. This plan should include unplugging the charger and placing the lipo somewhere safe, be it a metal trash can or outside on the driveway.
DON'T
  • leave the charger unattended. This does not mean you have to watch it every second but do not leave the area while it is charging.
  • charge on or near anything flammable. This includes things like carpet (both in house and in car), solvents and adhesives, and trash cans full of paper or saw dust.
Discharging
There are really only 2 things to worry about when discharging lipos, minimum voltage under load and heat. Everything else is a function of these 2 things including max continuous amps, max burst amps, flight time, and so on. The best practice is to follow the 80% Rule and to watch for excessive heat after a flight.

Storage
This topic is hotly debated by many but it seems most believe that you should 1) store lipos in a cool dry place and 2) at roughly 50% capacity.
  1. The cool dry place can be anywhere from your garage to your fridge. In any case they should be stored in a fireproof container for safety. Many use ammo cans, cash boxes or lipo sacks. Just make sure they are safe and don't get crushed or poked while in storage.
  2. While in storage the packs should be at roughly 50% capacity or 3.85V per cell. The exact level is not overly important, they should be somewhere between empty and full. Many people simply leave the packs in the same state they are after a flight (roughly at 20% capacity if using the 80% rule). Others use their chargers to partially charge their packs with their chargers "Storage Charge/Discharge" mode.
Important: When transporting lipos you need to make sure they stay cool and away from harm. Many times it is easy to place them in a container in a car but left in there on a hot summer day can damage them.

Disposing of lipos
It is a fact that all batteries will die someday and lipos are no different. In fact it often happens prematurely with lipos because they are damaged. Once you have a lipo that is either no longer useful or can no longer be trusted, you need to properly dispose of it. The good news is that it is not difficult to dispose of lipos because they are non-toxic. They just need fully discharged and then they can go into the trashcan. Another option is to give the lipo to a battery recycler if you have one in your area.

See the Making lipos safe and dealing with problems for more info.

Play around with parameters, again

arming_check = enabled
circle_radius = 700 cm
circle_rate = 30 deg/s

fence_alt_max = 70m

land_speed = 70 cm/s
pilot_velz_max = 300 cm/s

rtl_loit_time = 2500 ms

thr_min = 100


MOT_SPIN_ARM:
at 82: occationally trigger motor 2 to rotate.
at 84: running at gentle speed, giving 1188

THR_MIN :
at 105: give minimum pwm of 1190, when armed
0.105*817+1104=1190


give a limit using the formula (value / 1000) + 817 + 1104(or minimum throttle pwm)

Range of THR_MAX  and THR_MIN tested: 817



1st Stitching


A Byte of Python

python + opencv + VSC++

python - Windows x86 MSI installer
scipy - scipy-0.14.0-win32-superpack-python3.4
numpy - numpy-1.8.1-win32-superpack-python3.4


Installing OpenCV 2.4 on Windows 7 (Visual Studio 2010 / Visual C++, 64 bit)

Week10 30/06 evening flight

A quick check of throttle value, ~40% to maintain hover. need more data to verify

altitude maintaining is not great, need improvement
it is like 45% of the full throttle, on the rc out channels, to maintain hover

all test done using 10 inch propeller

Friday, 27 June 2014

RTL Mode

In return to launch (RTL) mode, the copter navigates from its current position to hover above the home position. The behavior of RTL mode can be controlled by several adjustable parameters. This page describes how to use and customize RTL mode.

Overview

When RTL mode is selected, the copter will return to the home location. The copter will first rise to RTL_ALT before returning home or maintain the current altitude if the current altitude is higher than RTL_ALT.  The default value for RTL_ALT is 15m.
RTL
RTL is a GPS-dependent move, so it is essential that GPS lock is acquired before attempting to use this mode. Before arming, ensure that the APM’s blue LED is solid and not blinking. For a GPS without compass, the LED will be solid blue when GPS lock is acquired. For the GPS+Compass module, the LED will be blinking blue when GPS is locked.
RTL will command the copter to return to the home position, meaning that it will return to the location where it was armed. Therefore, the home position is always supposed to be your copter’s actual GPS takeoff location, unobstructed and away from people. For APM:Copter if you get GPS lock and then ARM your copter, the home position is the location the copter was in when it was armed. This means if you execute an RTL in APM:Copter, it will return to the location where it was armed.
Warning: In RTL mode the flight controller uses a barometer which measures air pressure as the primary means for determining altitude (“Pressure Altitude”) and if the air pressure is changing in your flight area, the copter will follow the air pressure change rather than actual altitude (unless you are within 20 feet of the ground and have SONAR installed and enabled).

Options (User Adjustable Parameters)

  • RTL_ALT: The minimum altitude the copter will move to before returning to launch.
    • Set to zero to return at the current altitude.
    • The return altitude can be set from 1 to 8000 centimeters.
    • The default return altitude Default is 15 meters (1500)
  • RTL_ALT_FINAL: The altitude the copter will move to at the final stage of “Returning to Launch” or after completing a Mission.
    • Set to zero to automatically land the copter.
    • The final return altitude may be adjusted from 0 to 1000 centimeters.
  • RTL_LOIT_TIME: Time in milliseconds to loiter above the “Home” position before beginning final descent.
    • The “Loiter” time may be adjusted from 0 to 60,000 milliseconds.
  • WP_YAW_BEHAVIOR: Sets how the autopilot controls the “Yaw” during Missions and RTL.
    • 0 = Never change Yaw.
    • 1 = Face Next Waypoint including facing home during RTL.
    • 2 = Face Next Waypoint except for RTL (i.e. during RTL vehicle will remain pointed at it’s last heading)
  • LAND_SPEED: The descent speed for the final stage of landing in centimeters per second.
    • The landing speed is adjustable from 20 to 200 centimeters per second.

Notes

  • Other navigation settings also have an influence over RTL mode:
    • WPNAV_ACCEL
    • WPNAV_LOITER_SPEED
    • WPNAV_SPEED_DN
    • WPNAV_SPEED_UP
  • To use RTL, GPS lock needs to be achieved (Blue GPS LED and Blue APM LED on solid not blinking) before arming and takeoff to establish the home or launch position.
  • Note on the UBLOX GPS module the LED is off while acguiring satellites and on blinking when satellites have been acquired.
  • Landing and re-arming the copter will reset home, which is a great feature for flying at airfields.
  • If you get lock for the first time while flying, your home will be set at the location of lock.
  • If you set the ALT_HOLD_RTL to a number at other than 0 it will go to and maintain that altitude while returning.
  • RTL uses the waypoint_speed to determine how fast it travels.
  • Once the copter arrives at the home location the copter will enter Loiter mode, timeout (AUTO_LAND), then land.
  • To prevent auto-landing, simply change modes with the control switch to clear the landing timer and resume normal flight.
  • The throttle stick controls the altitude while returning or loitering above home and not the motors directly.

DATA - event logging 【EV rows】

#define DATA_MAVLINK_FLOAT              1
#define DATA_MAVLINK_INT32              2
#define DATA_MAVLINK_INT16              3
#define DATA_MAVLINK_INT8               4
#define DATA_AP_STATE                   7
#define DATA_INIT_SIMPLE_BEARING        9
#define DATA_ARMED                      10
#define DATA_DISARMED                   11
#define DATA_AUTO_ARMED                 15
#define DATA_TAKEOFF                    16
#define DATA_LAND_COMPLETE              18
#define DATA_NOT_LANDED                 28
#define DATA_LOST_GPS                   19
#define DATA_BEGIN_FLIP                 21
#define DATA_END_FLIP                   22
#define DATA_EXIT_FLIP                  23
#define DATA_SET_HOME                   25
#define DATA_SET_SIMPLE_ON              26
#define DATA_SET_SIMPLE_OFF             27
#define DATA_SET_SUPERSIMPLE_ON         29
#define DATA_AUTOTUNE_INITIALISED       30
#define DATA_AUTOTUNE_OFF               31
#define DATA_AUTOTUNE_RESTART           32
#define DATA_AUTOTUNE_COMPLETE          33
#define DATA_AUTOTUNE_ABANDONED         34
#define DATA_AUTOTUNE_REACHED_LIMIT     35
#define DATA_AUTOTUNE_TESTING           36
#define DATA_AUTOTUNE_SAVEDGAINS        37
#define DATA_SAVE_TRIM                  38
#define DATA_SAVEWP_ADD_WP              39
#define DATA_SAVEWP_CLEAR_MISSION_RTL   40
#define DATA_FENCE_ENABLE               41
#define DATA_FENCE_DISABLE              42
#define DATA_ACRO_TRAINER_DISABLED      43
#define DATA_ACRO_TRAINER_LEVELING      44
#define DATA_ACRO_TRAINER_LIMITED       45
#define DATA_EPM_ON                     46
#define DATA_EPM_OFF                    47
#define DATA_EPM_NEUTRAL                48

How to do one-button 3D mapping with the new DroidPlanner

How to do one-button 3D mapping with the new DroidPlanner

DroidPlanner has just been updated with an incredible feature that comes very close to "one-button 3D mapping" with ArduCopter. Here's a quick tutorial on how to use it to create a mission that autonomously takes off, circles a building taking pictures of it and lands, capturing all the imagery you need to stitch together a 3D model like the above. This model was taken with a 3DR Iris and GoPro camera in just one circle and stitched together with Autodesk Memento/ReCap.
(Don't forget you can now do this via Bluetooth with your Android phone or tablet, in addition to the usual 3DR long-distance radios.)
Steps
1) In the Edit screen, hold down the trash can icon, which will clear any previous mission you had and auto-create the first waypoint, which is an auto-takeoff. Then tap the Add Waypoint button (the top one with the "+") and tap the center of the structure you want to 3D-map:
2) Tap on that new waypoint and in the drop-down menu, select "Circle". This will tell the copter to do a single circle at the default altitude (20m) and the default radius (10m), with the nose of the copter and camera always facing into the center of the circle. If that's what you want, you're done!
3) (Optional) If you want it do to do multiple circles at the same altitude, change the "Orbits" number in the menu below. If you want it to do multiple circles at different altitudes (to give the stitching software a range of views), tap on Advanced and change the Steps number to the number of circles you want, with the Altitude Step being how much higher each circle should be over the one before:
4) At that point, you can either launch the mission and when it's done it will loiter, waiting for you to manually land, or you can add more more waypoint to autoland (triangle waypoint icon below). If you're done, don't forget to press Send Mission to send it to the copter!
5) If you want the copter to circle and a larger or smaller radius, select Parameters 
In the Parameters list, scroll down to CIRCLE_RADIUS and change it whatever value you'd like. (Note that in the screenshot below there's an error: the units are in centimeters, not meters. So 2000 is 2000cm or 20m. That will be fixed in the next push)
When you're done changing that, remember to Write the parameters to the copter:
6) Now that you've finished the mission, set your onboard camera to take a picture once per second in stop-motion or "intervelometer" mode (I use a GoPro Black with my Iris, which works great, but you can use any camera that has this mode). Don't forget to start the camera!
7) Now switch your copter to Auto mode and nudge the throttle up a bit. The copter will take off, fly to the structure, circle it at the altitude and number of times you selected, and automatically return and land at your feet! Mission accomplished!  
Some safety notes:
  • Watch out for trees and other obstacles! Make sure your first circle is above any trees or other things that might be in the path of the circle
  • Make sure your radius is at least twice the distance from the center to the edge of the structure. You want to have at least ten meters clearance from the structure at all times
  • If you're doing an autolanding, make sure you've got plenty of room for the landing and no obstructions on the route home. If you can't ensure that, do the landing manually.
  • Don't plan any mission where your view of the copter will be obscured. You must be able to take over manual control if it looks like your mission will take the copter into harm's way
Stitching
Once you've finished the mission and acquired the imagery, you'll need to use stitching software or a cloud service to turn it into a 3D model. Autodesk offers some good free choices for that:
  • 123D Catch. Quick and dirty. This won't make the best model, but it's easy, works most of the time, and has a good web viewer so you can share the 3D model with anyone.  Mac, Windows or Web
  • ReCap 360: This offers better renders, but it can be hard to get it to reliably generate a model. Web
  • Memento: This is beta software, but it works great for me and is my go-to tool for high-quality renders and a very easy-to-use interface.  You have to join the Autodesk Labs program to use it (that's free and open to all), but it's well worth it for this gem. The only downside is that it's Windows-only so if you're a Mac user like me you have to dual-boot or run Windows in a VM
Coming soon...
In the next version of DroidPlanner, the interface to change the altitude, radius of the circle and the number and step-distance of each orbit will be improved to a simple "point and drag" feature, which is very intuitive. Basically, you'll just point at the structure you want to 3D map, drag the circle so it's well outside the structure, drag a slider for the altitude and press go. One-button mapping!

Thursday, 26 June 2014

26/06 Flight

Default PID, reaction time

the XY plane vibration on the crash flight
 
Improved XY plane vibration

old Z axis vibration

Improved Z axis vibration


Wednesday, 25 June 2014

NumPy vs. SciPy vs. other packages

What is the difference between NumPy and SciPy?

In an ideal world, NumPy would contain nothing but the array data type and the most basic operations: indexing, sorting, reshaping, basic elementwise functions, et cetera. All numerical code would reside in SciPy. However, one of NumPy’s important goals is compatibility, so NumPy tries to retain all features supported by either of its predecessors. Thus NumPy contains some linear algebra functions, even though these more properly belong in SciPy. In any case, SciPy contains more fully-featured versions of the linear algebra modules, as well as many other numerical algorithms. If you are doing scientific computing with python, you should probably install both NumPy and SciPy. Most new features belong in SciPy rather than NumPy.

How do I make plots using NumPy/SciPy?

Plotting functionality is beyond the scope of NumPy and SciPy, which focus on numerical objects and algorithms. Several packages exist that integrate closely with NumPy to produce high quality plots, such as the immensely popular Matplotlib and the extensible, modular toolkit Chaco.

How do I make 3D plots/visualizations using NumPy/SciPy?

Like 2D plotting, 3D graphics is beyond the scope of NumPy and SciPy, but just as in the 2D case, packages exist that integrate with NumPy. Matplotlib provides basic 3D plotting in the mplot3d subpackage, whereas Mayavi provides a wide range of high-quality 3D visualization features, utilizing the powerful VTK engine.

OpenCV Stitching example (Stitcher class, Panorama)

Eight Advantages of Python Over Matlab

Week09 25/06 Endurance Test

Total consumption is close to 3000mAh. I believe the power module tend to overstate the power used

voltage drop.

Improvement since the crash - Week 9&10


  • Lower the position of PDB as well as Pixhawk; Centre the Pixhawk
    - Make Pixhawk closer to the centre of rotation, for better motion measurement
    - Solder wires onto PDB, instead of sockets. Hence the wiring between PDB and ESCs are loosen, giving more flexible wiring arrangement.
  • Replace soft shock-absorbing foam to thinner double-sided tape
    - Avoid possible over-damping, which may create more low frequency oscilation
    - Make sure Pixhawk is not tilted under pressure / tension, such as wires, which can give erratic attitude infomation
  • Put GPS Mount on a more rigid mount
  • Made battery holder
    - Battery is slided into the holder, instead of hanging below. Decrease possibility of sudden shift of battery position.
  • Use nylon lock nuts, instead of cone
    - Reduce possibilities of loosen nuts over the propellers.
  • Glue the motor mount onto the arms
    - Prevent motor mount from sliding to sideways
  • Redesign of propeller guards
    - Give more protection from the side


Some features added
  • 5.8Ghz FPV system, with laptop as monitor
  • Servo box

Monday, 23 June 2014

Why doesn't the ball fall off the quad?

About -Centre of Gravity-

Conclusion from me:


  • The position of CG in the XY plane is important. It should be centered ideally, so the controller have a full and balanced control over the attitude
  • The position of CG along the Z axis does NOT affect much. Its position, together with the midpoint of the Propeller (say point M) will confine the position of the actual rotational center. 
  • The stability, which is our main concern, is mainly determined by the mass distribution of the whole UAV. if more mass is below, the UAV tend to level itself (when the UAV is not accelerating greatly).
  • However the stability is NOT a feature actually needed. Ideally the UAV should have natural stability, and hand over all the stabilizing task to PID control, as physical stabilizing and PID stabilizing is not compatible to each other, and may cause unpredictable oscillation (heard from somewhere).
  • Pixhawk should be placed somewhere between the plane of propellers and CG plane. This is where the centre of rotation lies





Autotune - info

First up Autotune is not something you have to do it is not a "requirement". It is something you can do to get the most out of your frame. However, the default parameters (or close to them) should be fine for most people.
For those people that want to get the most out of their frame, AutoTune makes it easy. Approximately 95% of people are successful when using AutoTune without any changes to their frame. However, if you do wish to use AutoTune then you do need to achieve a basic level of construction and rigidity of your setup.
This isn't possible when carrying a large camera gimbal on vibration mounts. In this case the camera should be removed and the copter tuned on it's own. This should result in a safe tune for the copter as additional weight is added even if it is able to move around.
The remainder of the reasons Autotune won't work all fit under the "you shouldn't be flying that" category or at least the "fly at your own risk" category. If your arms are too soft for the power of your motors (I have been guilty of that one), your CG is way out, or the vibration dampening on your APM is so soft it wobbles around in flight. Then sorry, you are on your own. The Autotune feature will detect that your frame isn't up to scratch and will tell you to go fix your problems or do the tuning yourself :)
An from a personal note, as a developer I am not trying to attract people that have never flown models before (others might be, but I am talking personally). I am not trying to attract people that want to fly a 5kg Parrot AR Drone because they got the little one and wanted to go outside without getting blown away by the slightest breeze.
I want to attract experienced pilots from DJI or OpenPilot because Arducopter control is THAT good (we are there or close and I still have a few polishing ideas left), because the control system design is based on a complete physics model of the multirotor, and Autotune generates the control gains that bring them to the edge of what the copter is capable of in a single 6 to 8 minute flight. I want to make sure that the copter is easy to set up (and that setup makes sense) for an experienced pilot. This in turn makes it relatively easy for a beginner to get up to speed and have a top performing machine.
For the pilot that doesn't want to keep the CG at least close to where it is supposed to be, or make sure that all the screws on the frame are tight, or straps a 2 kW system to a $20 flimsy plastic frame, then expects the Autopilot to make up the difference. Sorry, you will be disappointed. 
The IMU, RCOU and RCIN messages were disabled by the user. Pixhawk is capable of logging everything and has plenty of space.

Thursday, 19 June 2014

Tips on Tuning



Although there are many gains that can be tuned in APM:Copter to get optimal performance, the most critical is the Rate Roll and Pitch P values which convert the desired rotation rate into a motor output.  This alone will likely get it flying reasonably well at least in Stabilize mode.
Some general advice on how to tune this parameter:
  • Too high and the copter will oscillate quickly in roll and/or pitch
  • Too low and the copter will become sluggish
  • High powered copter should use a lower gain, under powered copters are a higher gain


Wednesday, 18 June 2014

Mission Planner Flight Data Screen


6-mode switch configuration - Week 9

Here is a working solution to mix 2 switch into channel 5, to achieve 6-position switch, for mode changing.






Monday, 16 June 2014

Crash Analysis - Week 9

We believe, there are many factors which contributed to the crash last week.

The reason of crash and reason of drifting from mission are different, based on the flight data collected.


Reason of drift from the planned mission:

As we can see, the UAV drifts far off during flight to the WP5. WP5 is a loiter_turn point. It should rotate at a radius of 3m specified in CIRCLE_RADIUS.


There is no indication of mechanical failure which causes any deviation from the navigation route. Below shows that for the entire auto-flight, the XY position is exactly what the controller demanded. Hence it is most probably a sotware glitch.

According to this,this and this, the LOITER_TURNS function is broken in version 3.1. 
"This change will go out with the first AC3.2 release candidate and I'll add it to the list of to-be-tested features."
"NB: The units are meters in AC 3.1 and will be centimeters in AC 3.2.  ***Mission Planner will report the units as cm for both versions of the code.

Remark: There is a strange phenomenon that the UAV doesn't actually hit within the radius (4 meter as in the particular flight) of the WPs. The distance of way-point switching can be as far as 10+ meters. The reason should be found in source code analysis (to-do)

WPNAV_ACCEL default 100



Reason of crash

Mechanical Failure:


  • We suspect that the front-left propeller had come loose during the latter part of the flight. In normal flight, the propeller is rotating clockwise, which creates a CCW torque to the UAV. However, when the propeller comes loose for some reason, there is not enough CCW torque for the craft. Hence the craft keep yawing CW. The
    Evidence:
    - The propeller and nut is not on the motor after crash.
    - The propeller was found 3 meters away from the site of crash.
    - The screws screwing the motor axis became loose, indicating abnormal vibration occurred.
    - The motor 3 and 4 rotate much faster than motor 1 and 2, indicating that the craft tend to correct from a continuous CW yawing. However, due to the loosen front-right (No. 3) propeller, the CCW torque is just not enough, and adversely affect the UAV's attitude.
graph showing that the UAV tending to yaw CCW continuously (but failed)

graph showing that there is no yaw stick being applied by pilot, when the UAV keep rotating CW

Further info - battery voltage dropped drastically, indicating that a sudden loss of lift, which in turn requires more power to maintain the UAV in the air.

Remarks: Initially we were suspecting that the auto-tune was the cause of the crash. However, it became less convincing after we realized that the online auto-tune result was in-line with ours. We were not getting abnormal tuning values.


Google Earth Generated FPV for the crashed flight