Commit Graph

1309 Commits

Author SHA1 Message Date
jphelirc 2d094da38e added relay control to CH6
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2943 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-26 03:37:41 +00:00
tridge60@gmail.com 586acf4342 fixed quad PWM clipping
this adopts the simpler approach suggested by Jason.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2936 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-22 21:25:59 +00:00
mich146@hotmail.com 7210d6decb fix float issues - crosstrack & target alt
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2935 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-21 23:36:22 +00:00
rmackay9@yahoo.com f5d17f756a ACM - partial integration of optical flow sensor
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2934 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-21 23:14:53 +00:00
tridge60@gmail.com e80ed6d687 quad: fixed the clipping of PWM outputs
when we clip a motor output we need to decrease the opposite motor by
the same amount, otherwise we lose the ability to control the quad
when the servo outputs are extreme

Found using the quad HIL test. Thanks to Jani for testing this on a
real quad!

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2929 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-20 00:33:04 +00:00
rmackay9@yahoo.com 09256e12da DataFlash library - changed to use standard arduino SPI library
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2928 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-19 23:00:18 +00:00
tridge60@gmail.com 6e179db689 HIL: fixed build with HIL and logging
thanks to Jani for noticing this

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2925 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-19 10:51:07 +00:00
tridge60@gmail.com efae9dddd5 HIL: we only need 50Hz attitude for HIL
putting it in the fastest loop clogged up mavlink too much

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2923 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-19 09:49:57 +00:00
rmackay9@yahoo.com 3d641a3b45 AP_OpticalFlow - fixes to position calculations (lat was reversed and would calculate position even with surface quality was very low)
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2913 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-18 21:51:27 +00:00
jasonshort c79ff4f583 doubled Slew rate limiter to 2 m/s max @ 10 hz.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2912 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-18 18:18:47 +00:00
tridge60@gmail.com 98980d6f61 HIL: fixed altitude calculation
ACM uses a zero home altitude, so we need an offset when using GPS for
altitude

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2910 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-18 12:44:02 +00:00
tridge60@gmail.com 60bf2182e4 GPS-HIL: set new_data on setHIL()
this fixes navigation for ACM in HIL

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2909 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-18 12:42:36 +00:00
jasonshort b3e629cfbf 2.0.37
Added rate of change limit for noisy Sonars.
converted to static functions - Tridge
New Throttle PIDs from Jack

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2904 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 19:14:23 +00:00
jasonshort e07c0aab7a 2.0.37
Added rate of change limit for noisy Sonars.
converted to static functions - Tridge


git-svn-id: https://arducopter.googlecode.com/svn/trunk@2902 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 19:08:29 +00:00
jasonshort d04d32c40c 2.0.37
Added rate of change limit for noisy Sonars.
converted to static functions - Tridge


git-svn-id: https://arducopter.googlecode.com/svn/trunk@2901 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 19:08:17 +00:00
jasonshort a1733ee901 Added a slew rate limit
reworked filter, same results, just wanted to get rid of modulus.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2900 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 19:05:18 +00:00
tridge60@gmail.com 6b0c938176 CLI: make it possible to completely disable the CLI
set CLI_ENABLED to DISABLED for no CLI. This saves a lot of memory

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2895 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:34:05 +00:00
tridge60@gmail.com e6d9a6921a HIL: don't access dcm functions in HIL mode
the dcm is not valid in HIL_MODE_ATTITUDE

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2894 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:33:53 +00:00
tridge60@gmail.com 863e77677e HIL: enable reception of GPS and ATTITUDE via MAVLink
this allows us to get GPS position and ATTITUDE in HIL_MODE_ATTITUDE

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2893 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:33:42 +00:00
tridge60@gmail.com 93a8deac7d HIL: send location information
we don't send MSG_LOCATION in HIL mode during GPS updates, as we don't
call the GPS update routines, so we need to send MSG_LOCATION as part
of the Position stream

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2892 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:33:33 +00:00
tridge60@gmail.com aff9e9a831 HIL: when in HIL_MODE_ATTITUDE, we get altitude from gps setHIL
we need to skip the barometer and sonar calls

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2891 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:33:17 +00:00
tridge60@gmail.com eb2a6403e0 don't force config in default APM_Config.h
defaults for these are already in config.h, but protected with #ifndef
wrappers. The #ifndef wrappers are useful to allow users to have
makefile targets for different configs, so you can (for example), do
"make heli" with a local makefile

This makes it easier for developers to ensure that all configs build
correctly

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2890 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:33:09 +00:00
tridge60@gmail.com df6a1b51f3 make a lot more functions and variables static
this saves about 1k of code space through better compiler optimisation

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2889 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:32:00 +00:00
tridge60@gmail.com 0b1262a685 make main variables and functions static
this makes most of the variables and functions in the main
ArduCopterMega.pde code static, which allows the compiler to optimise
better, and exposes unused variables as compiler warnings

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2888 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:31:46 +00:00
tridge60@gmail.com f9105a056e logging: moved the default log_bitmask calculation to compile time
this saves a little bit of code by moving the calculation of the
default log bitmask to compile time from runtime

(merge from APM)

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2887 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:31:17 +00:00
tridge60@gmail.com 8a7466d1a2 make it possible to completely disable logging
set LOGGING_ENABLED  to DISABLED to disable all logging. This saves
about 10k of flash when disabled.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2886 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:31:07 +00:00
tridge60@gmail.com fdf090b471 allow flight modes to be setup over MAVLink
this adopts the same method of setting up flight modes over MAVLink as
APM now has

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2885 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:30:53 +00:00
tridge60@gmail.com 855b88852e fixed a bunch of compiler warnings
mostly signed/unsigned warnings

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2884 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 10:30:21 +00:00
mich146@hotmail.com 8aad21fcc8 add level command via mavlink, and fix fall through
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2877 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-17 00:14:50 +00:00
jasonshort b6db64f9be 2.0.36
Added Yaw control when descending in Alt hold
lowered kP & kD for Alt hold a tad
Adjusted RTL behavior to do speed control up to 4m to home, then go into Loiter
Fixed issue with AUTO not getting proper input.
Added Limit to high side of motors

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2874 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-16 23:08:07 +00:00
jasonshort df26281296 2.0.36
Added Yaw control when descending in Alt hold
lowered kP & kD for Alt hold a tad
Adjusted RTL behavior to do speed control up to 4m to home, then go into Loiter
Fixed issue with AUTO not getting proper input.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2873 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-16 22:32:54 +00:00
jasonshort af8afecbb8 2.0.36
Added Yaw control when descending in Alt hold
lowered kP & kD for Alt hold a tad
Adjusted RTL behavior to do speed control up to 4m to home, then go into Loiter


git-svn-id: https://arducopter.googlecode.com/svn/trunk@2872 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-16 22:12:52 +00:00
jasonshort 05c058148b tweaked WP speed so long distances wont blow up equation.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2871 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-16 22:02:47 +00:00
jasonshort 59023505f9 Added in limit for alt hold to prevent I term run up.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2870 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-16 21:53:47 +00:00
jphelirc 24abae3c6d ESC setup notes
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2847 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-14 02:52:08 +00:00
jasonshort f46647d8b8 minor cosmetics
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2846 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-14 02:01:51 +00:00
tridge60@gmail.com 48f010f80c compass: fixed a compiler warning
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2844 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-13 09:10:24 +00:00
tridge60@gmail.com a9278b6fcd build: added EXTRAFLAGS to make rules
this allows you to create a local makefile like this:

 include Makefile

 hil:
	make -f Makefile EXTRAFLAGS="-DHIL_MODE=HIL_MODE_ATTITUDE -DSERIAL3_BAUD=115200"

and then use 'make hil'

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2843 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-13 09:07:09 +00:00
jasonshort b7b0212506 Cleaned up or reverse code.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2842 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-13 05:54:40 +00:00
jasonshort 100e3bac60 2.0.35
Added camera reversing parameters in AP_Var
Added RTL Throttle Hold set/check
Added dynamic speed control to slow down as you reach waypoints and RTL Home
upped Yaw Dead zone slightly.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2841 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-12 20:04:15 +00:00
jasonshort bdcd0e2e37 Added Scaling to yaw response on Auto, RTL, and Guided modes
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2837 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-11 00:54:00 +00:00
jasonshort 35bf288abd New PIDs - I rewrote the control laws from scratch to add a PI Rate function. The end result should fly nearly identically to the current version. The nice detail is that we can use NG PID values for easy transition!
Before: ->  After
Stabilize P –> Stabilize P (Use NG values, or 8.3 x the older AC2 value)
Stabilize I –> Stabilize I (Stays same value)
Stabilize D –> Rate P (Stays same value)
–> Rate I (new)
 
Added a new value – an I term for rate. The old stabilization routines did not use this term. Please refer to the config.h file to read more about the new PIDs.
Added framework for using DCM corrected Accelerometer rates. Code is commented out for now.
Added set home at Arming.
Crosstrack is now a full PID loop, rather than just a P gain for more control. 
Throttle now slews when switching out of Alt hold or Auto modes for less jarring transitions
Sonar and Baro PIDs are now combined into a throttle PID Yaw control is completely re-written.
Added Octa_Quad support - Max



git-svn-id: https://arducopter.googlecode.com/svn/trunk@2836 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-11 00:47:08 +00:00
tridge60@gmail.com 165643c307 fixed 5843 detection code
we were looking for the wrong regA value

Thanks to Chris for the debugging help! (and happy birthday!)

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2828 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-09 22:27:15 +00:00
tridge60@gmail.com 7b803a9e1a compass: added error checking on I2C transactions
this adds error checking to all operations on the compass, to ensure
that we don't accept invalid data

This also fixes the calibration values for the 5883L to match the
recommended values in the spec

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2815 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-09 12:10:00 +00:00
tridge60@gmail.com 488a2805f7 mavlink: fixed a signed/unsigned warning
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2814 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-09 12:09:50 +00:00
jasonshort a16b00b5bf Added heavily filtered Accelerometer values for experimentation.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2779 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-08 03:58:19 +00:00
jasonshort 5e163c6052 added ki_Yaw private variable and accessors.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2778 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-08 03:57:12 +00:00
jasonshort 0d31d9be10 Added a limit to the atan function to calc the heading. Just trying to avoid, bad values screwing up the DCM. - Jason
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2777 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-08 03:56:04 +00:00
jasonshort 38cf90ae58 AC 2.0.33 Beta
Slighted tuned down D term in Loiter PIDs after testing, tuned up P slightly
fixed alt hold bug cause when gaining 3D lock in alt hold.
Mavlink now reports correct throttle scaling value in mavlink


git-svn-id: https://arducopter.googlecode.com/svn/trunk@2746 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-04 06:40:37 +00:00
jasonshort 659b520912 AC 2.0.33 Beta
Slighted tuned down D term in Loiter PIDs after testing, tuned up P slightly
fixed alt hold bug cause when gaining 3D lock in alt hold.
Mavlink now reports correct throttle scaling value in mavlink


git-svn-id: https://arducopter.googlecode.com/svn/trunk@2745 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-04 06:37:29 +00:00