10ecffce01
These changes reduce height variation in turns and improve robustness. the specific changes are: 1) Linked roll and pitch integrator protection to the final output value so that if final output is on upper limit, the integrator is prevented from increasing and vice-versa. This improves wind-up protection. 2) Modified rate feedback in roll and pitch controllers to use body rates rather than Euler or earth rates. 3) Changed the roll to pitch compensation to use measured roll angle and estimated airspeed to calculate the component of turn rate (assuming a level coordinated turn) around the pitch axis. This a mathematically correct calculation and will work over a range of bank angles and aircraft with minimal (if any) tuning required. 4) The integrator in the roll and pitch loop is clamped when the estimated speed is below the minimum FBW speed 5) The noise filter in the pitch and roll loop has been changed to use a FOH discretisation. This gives improved noise rejection and less phase loss when compared to the previous filter that used a ZOH or equivalent discretisation. This has been flown on the rascal in the SITL and on a X-8 with limited flight testing. Initial results have been encouraging with reduced height variation in turns. Compare to standard PIDS, the revised pitch and roll controllers allow the use of rate feedback (effectively the same as the old D term) without beating the servos to death. The bank angle compensation in the pitch loop works effectively over a much larger range of bank angles and requires minimal tuning compared to the old calculation. YAW CONTROLLER Currently testing the a 3-loop acceleration autopilot topology for the yaw loop with feed forward yaw rate for turn compensation. This 3-loop topology is commonly used in tactical skid to to turn missiles and is easy to tune. The following block diagram shows the general signal flow Note that the acceleration measurement has to pass through an integrator before it gets to the actuator. This is a important feature as it eliminates problems of high frequency noise and potential coupling with structural modes associated with direct feedback of measured acceleration to actuator. The high pass filter has been inserted to compensate for airspeed and bank angle measurement errors which will cause steady state errors in the calculation of the turn yaw rate. The yaw controller flies SITL well, but hasn't been flight tested yet. It can be configured either as a simple yaw damper, or the acceleration and integral term can be turned on to allow feedback control of lateral acceleration/sideslip. TO DO: Need to reduce number of tuning parameters and provide consistent naming Need to provide guidance on tuning these loops with definitions for all the gain terms. Need to check signs and units into and out of lateral loops. DESIGN DECISIONS PENDING: 1) Can we remove the noise filters? Provided the mpu6k noise filter is running they are of limited benefit given the 25Hz Nyquist frequency 2) If we do remove them and rely on the mpu6k noise filter, what is the apprporiate default cutoff frequency for plane use. 20Hz is probably OK for most setups, but some noisy/high vibration setups would require as low as 10Hz 3) The inverted flight logic looks like a crash waiting to happen. It's problematic to test and even if implemented correctly would still crash a plane with poor inverted flight capability. We should either implement it properly and fully tested or delete it. |
||
---|---|---|
APMrover2 | ||
ArduCopter | ||
ArduPlane | ||
FollowMe | ||
libraries | ||
mk | ||
Tools | ||
.gitignore | ||
.project | ||
COPYING.txt | ||
Doxyfile.in | ||
README.md | ||
reformat.sh | ||
uncrustify_cpp.cfg | ||
uncrustify_headers.cfg | ||
Vagrantfile |
ArduPilot Project
You can find lots of development information at the ArduPilot development site
Getting the source
You can either download the source using the "ZIP" button at the top of the github page, or you can make a clone using git:
git clone git://github.com/diydrones/ardupilot.git
Prerequisites
Ubuntu Linux
The following packages are required to build ardupilot for the
APM1/APM2 (Arduino) platform in Ubuntu: gawk make git arduino-core g++
To build ardupilot for the PX4 platform, you'll first need to install the PX4 toolchain and download the PX4 source code. See the PX4 toolchain installation page.
The easiest way to install all these prerequisites is to run the
ardupilot/Tools/scripts/install-prereqs-ubuntu.sh
script, which will
install all the required packages and download all the required
software.
Building using the Arduino IDE
ArduPilot is no longer compatible with the standard Arduino distribution. You need to use a patched Arduino IDE to build ArduPilot.
Do not try to use the Arduino IDE to build in Linux--you should follow the instructions in the "Building using make" section.
-
The patched ArduPilot Arduino IDE is available for Mac and Windows from the downloads page.
-
Unpack and launch the ArduPilot Arduino IDE. In the preferences menu, set your sketchbook location to your downloaded or cloned
ardupilot
directory. -
In the ArduPilot Arduino IDE, select your ArduPilot type (APM1 or APM2) from the ArduPilot menu (in the top menubar).
-
Restart the ArduPilot Arduino IDE. You should now be able to build ArduPlane or ArduCopter from source.
-
Remember that, after changing ArduPilot type (APM1 or APM2) in the IDE, you'll need to close and restart the IDE before continuing.
Building using make
-
Before you build the project for the first time, you'll need to run
make configure
from a sketch directory (i.e. ArduPlane, ArduCopter, etc...). This will create aconfig.mk
file at the top level of the repository. You can set some defaults inconfig.mk
-
In the sketch directory, type
make
to build for APM2. Alternatively,make apm1
will build for the APM1 andmake px4
will build for the PX4. The binaries will generated in/tmp/<i>sketchname</i>.build
. -
Type
make upload
to upload. You may need to set the correct default serial port in yourconfig.mk
.
Development using VirtualBox
ardupilot has a standardized Linux virtual machine (VM) setup script that uses the free VirtualBox virtualization software. You can use it to create a standard, reproducible development environment in just a few minutes in Linux, OS X, or Windows.
-
Download VirtualBox for your Mac, Windows or Linux machine.
-
In the
ardupilot
directory, runvagrant up
from the command line. This will create a new Ubuntu Linux VM. -
Run
vagrant ssh -c "ardupilot/Tools/scripts/install-prereqs-ubuntu.sh -y"
. This will install all the prerequisites for doing ardupilot development.
You can now run vagrant ssh
to log in to the development
environment. The ~/ardupilot
directory in the VM is actually the
ardupilot
directory in your host operating system--changes in either
directory show up in the other.
Once you've followed the instructions above, here's how you would build ArduCopter for PX4 in the development environment:
$ vagrant ssh
# cd ardupilot/Arducopter
# make configure
Now edit ardupilot/config.mk
so it has the following line:
PX4_ROOT = ~/PX4-Firmware
Back at the terminal:
# cd ~/PX4-Firmware
# make configure_px4fmu
# make px4
User Technical Support
ArduPilot users should use the DIYDrones.com forums for technical support.
Development Team
The ArduPilot project is open source and maintained by a team of volunteers.
To contribute, you can send a pull request on Github. You can also join the development discussion on Google Groups. Note that the Google Groups mailing lists are NOT for user tech support, and are moderated for new users to prevent off-topic discussion.