Commit Graph

69 Commits

Author SHA1 Message Date
Andrew Tridgell 184420355d PID: fixed example build 2014-08-13 22:12:24 +10:00
Kevin Hester c2184cb8e4 PID: fixup line endings 2014-04-15 15:57:56 +09:00
Andrew Tridgell 37ad9e3f82 PID: fixed example build 2013-09-24 11:57:21 +10:00
Andrew Tridgell 6862791d66 PID: fixed indent-tabs-mode 2013-05-30 09:50:37 +10:00
Andrew Tridgell ba83950fc4 libraries: replace constrain() with constrain_float()
this makes the type much more obvious. Thanks to Tobias for the
suggestion.
2013-05-02 10:25:40 +10:00
Andrew Tridgell 6123ea2dac PID: added get_pid_4500()
this is a version of get_pid() that returns an int16_t constrained to
-4500 to 4500. This will prevent overflow errors for large PID gains
in ArduPlane and Rover
2013-04-01 22:17:04 +11:00
Andrew Tridgell fe964fcda0 PID: change to float input/output
this makes the PID library a bit more flexible for smaller range
numbers. Note that this library is used on ArduPlane and Rover, not
Copter
2013-02-09 20:36:26 +11:00
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell 62bfded26c PID: fixed example build 2012-12-20 14:52:36 +11:00
Pat Hickey eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00
Andrew Tridgell 7d27e420ae AP_HAL: remove unnecessary Arduino.h includes 2012-12-20 14:52:30 +11:00
Andrew Tridgell 306d53b4ae PID: updates for new AP_Param API 2012-12-20 14:51:39 +11:00
Pat Hickey 39d14c8a93 PID: ported to AP_HAL 2012-12-20 14:51:31 +11:00
Pat Hickey 3f1d9d7f69 AP_Param: #include <AP_Param.h> fixups for libraries & sketches
* I mostly went through with grep and added an #include <AP_Param.h> below
  every #include <AP_Common.h>. Not all of these example sketches might
  strictly need AP_Param.
2012-12-20 14:51:19 +11:00
Andrew Tridgell 816fe9d35a PID: use NAN to flag a D reset
this saves a byte per PID for a flag, and gives us a safe way to
reset_I() without causing a spike in D
2012-11-27 18:41:31 +11:00
Andrew Tridgell f6fce1e238 PID: don't reset _last_error on reset_I()
resetting _last_error when you have a non-zero D term causes the D
contribution to the next call to be massively amplified. This can
cause crazy behaviour on auto takeoff in ArduPlane if you have a
non-zero D term for the roll or picth controllers

Thanks to Chris Miser for providing the tlog that allowed this bug to
be found.
2012-11-27 13:35:09 +11:00
Andrew Tridgell d13d117e61 APM: removed reset_I() and instead auto-reset integrator in PID library
this prevents us resetting key integrators on waypoint change, while
still preventing old integrators being used when a PID starts to be
used again
2012-08-28 20:18:23 +10:00
uncrustify 13e0dd2c70 uncrustify libraries/PID/PID.h 2012-08-21 19:04:31 -07:00
uncrustify 330c6c07e3 uncrustify libraries/PID/PID.cpp 2012-08-21 19:04:31 -07:00
uncrustify 84816966ec uncrustify libraries/PID/examples/pid/pid.pde 2012-08-21 19:04:31 -07:00
Andrew Tridgell 5e8fe8d93e AP_Param: update PID libraries for new constructor syntax 2012-08-08 12:11:57 +10:00
Andrew Tridgell f6d7d1bc59 APM: changed PID library to do automatic deltat calculation
this fixes a problem with the HDNG2RLL PID, which was using the wrong
time base and prevents similar bugs from happening in the future
2012-07-06 19:59:18 +10:00
Andrew Tridgell 23ed5c2cee fixed imax load/save in PID 2012-02-13 16:22:53 +11:00
Andrew Tridgell 150a67c262 fixed PID initialisation 2012-02-13 16:22:53 +11:00
Andrew Tridgell 9c5a5473ab added indexes to group info structures 2012-02-13 16:22:52 +11:00
Andrew Tridgell f760b3c717 restore _fCut that was lost in AP_Param development 2012-02-13 16:22:51 +11:00
Andrew Tridgell bf4a77da81 convert libraries to new typesafe macros 2012-02-13 16:22:51 +11:00
Andrew Tridgell e5a0074312 modify the PID library for AP_Param 2012-02-13 16:22:51 +11:00
Andrew Tridgell 9c1e257826 fixed example in PID library 2012-01-23 08:47:46 +11:00
James Goppert 0c7c508541 Optional recursion added. 2011-09-30 17:17:51 -04:00
James Goppert 5489b84f8e Improvements to cmake. 2011-09-29 21:23:26 -04:00
James Goppert d887a28b91 Added ArduBoat/ ArduRover/ and APO library. 2011-09-29 14:12:15 -04:00
unknown a4e001bbcf Adding CMake support 2011-09-14 15:44:55 +02:00
jasonshort 4ec8805216 Reverted to older PID. Restored the older filter, and removed PI command. I am no longer using PID for the quad and have switched to PIPI loops which perform much better. The D term in this class is not that great.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3241 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-09-04 17:47:07 +00:00
jasonshort d192ceb8f8 upped D filter to 6
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3096 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-08-14 05:44:29 +00:00
tridge60@gmail.com 5c68a04c5d PID: fixed an uninitialised variable
we did not initialise derivative to zero

git-svn-id: https://arducopter.googlecode.com/svn/trunk@3082 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-08-13 04:46:21 +00:00
jasonshort 915a564b8f Changed the PID derivative filter to a moving average with 4 samples. Having great luck with it and High kD when using noisy sensors.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2957 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-29 21:52:37 +00:00
tridge60@gmail.com cf68e31729 fixed warnings in PID.h
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2560 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-06-15 12:25:00 +00:00
jasonshort 5a22080484 I am Adding A "PI" loop to the mix. This is a need for AC2. We can optimize the internals later, but I basically duped the get_PID and removed the D term internals.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2338 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-16 16:05:49 +00:00
james.goppert@gmail.com c1b6032e7f Eclipse makefile support for examples.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1860 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-04-09 19:38:12 +00:00
tridge60@gmail.com 860998d337 implemented typesafe PSTR()
This makes PSTR() type safe by using a 1 byte wrapper
structure. Attempts to use the wrong varient of a print function will
generate a compilation error.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1797 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-03-21 07:25:48 +00:00
jasonshort 240a3a2f2a quick.fix
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1688 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-19 21:01:32 +00:00
DrZiplok@gmail.com 944825772d Use AP_Var to store PID scaling values.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1652 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-14 04:45:31 +00:00
jasonshort c9227dbcaf fixed a scaling bug in imax
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1553 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-24 02:07:25 +00:00
mich146@hotmail.com 0328f926b5 Reinstate Float loading and saving
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1507 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-17 22:57:48 +00:00
jasonshort 55667fd905 removed EEPROMB references
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1315 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-28 18:42:56 +00:00
james.goppert 6c10842562 Fixed PID error for low pass filter.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1295 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-27 05:59:49 +00:00
jasonshort 68eec6805a update use EEPROM class, new scaled input for RC_Channel
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1264 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-26 01:17:04 +00:00
jasonshort f64fab442d added ability to get the integrator for debugging
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1117 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-13 04:05:55 +00:00