Commit Graph

42 Commits

Author SHA1 Message Date
Randy Mackay 0052dcc8f8 AC_PID: update pid_info when integrator set 2019-10-18 11:15:25 +09:00
Leonard Hall ab0bdc9fe6 AC_PID: upgrade to PID object 2019-07-25 17:38:15 +09:00
Leonard Hall 8c6a24450a AC_PID: Fix D term initialisation 2018-09-15 11:00:29 +10:00
Randy Mackay 4e8155f4e5 AC_PID: allow non-zero ff gain default 2018-01-05 13:33:21 +09:00
Andrew Tridgell b97bf5d15e AC_PID: added feed-forward to AC_PID 2017-02-18 17:26:43 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Randy Mackay 227e4f86d7 AC_PID: fix parameter description 2016-04-01 11:59:30 +09:00
Randy Mackay 920425567c AC_PID: shorten FILT_HZ to FILT 2016-04-01 11:59:30 +09:00
dgrat 5148e41c1a AP_Math: Cleaned macro definitions
Moved Definitions into a separate header. Replaced PI with M_PI and
removed the M_PI_*_F macros.
2016-02-27 02:51:33 -03:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Gustavo Jose de Sousa 286d084d83 AC_PID: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:41 +10:00
Robert Lefebvre 967071ca62 AC_PID: Integrate PID Logging functionality. 2015-05-27 14:28:44 +10:00
Tom Pittenger 9d74f57ed3 AP_PID: replace fabs() with fabsf() 2015-05-09 09:57:26 +10:00
Andrew Tridgell 33555b7f12 AC_PID: revert AP_Math class change 2015-05-05 13:27:05 +10:00
Tom Pittenger 01180d52c4 AP_PID: compiler warnings: apply is_zero(float) 2015-05-05 13:26:51 +10:00
Randy Mackay 67b0c6f5c4 AC_PID: replace is_equal with is_zero 2015-04-28 16:22:08 +09:00
dgrat 303cfd683a AC_PID: replace floating point '==' with is_equal
Also add div-by-zero check to fix calc_filt_alpha

Also get_i and get_shrink_i do not need to set values to zero in Vector2f
constructor because this is already done.
2015-04-28 16:21:46 +09:00
Jonathan Challinger 6ea91d012e AC_PID: calculate filt_alpha every time the filter is run 2015-04-14 16:19:02 +09:00
Randy Mackay a095a8c3a1 AC_PID: more protection against NaN and Inf 2015-04-09 20:19:55 +09:00
Leonard Hall ae77c18a19 AC_PID: Protect against NaN and INF 2015-04-09 18:30:12 +09:00
Randy Mackay 12724e9556 AC_PID: remove include of stdio.h 2015-03-11 20:40:05 +09:00
Randy Mackay c10b0b34ca AC_PID: replace set_filt_hz method with filt_hz
Thanks to Jonathan Challinger for spotting this bug
Also add sanity check to filt_hz
2015-03-11 17:28:20 +09:00
Leonard Hall 517448e536 AC_PID: add input filtering and restructure 2015-03-06 14:01:52 +09:00
Robert Lefebvre b35ec4339e AC_PID: Add method to set the D-term Filter Rate from main code. 2014-05-29 17:39:10 +09:00
Robert Lefebvre f1c3f2a3d1 AC_PID: Remove get_leaky_i function which is now found in AC_HELI_PID. 2014-05-29 17:39:08 +09:00
Randy Mackay fbc5af2705 AC_PID: results returned as float 2014-02-15 06:09:08 +11:00
Andrew Tridgell 8c25a504c3 AC_PID: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
James Bielman 4fa7bb1486 Add AVR compatibility header for missing math.h definitions.
- Define float versions of math functions to the double versions
  on AVR (eg. #define sinf sin).
- These macros appear to be missing in older versions of avr-libs.
- Include AP_Math.h rather than math.h to get these definitions.
2013-01-16 13:52:17 +11:00
Andrew Tridgell 2294acc652 AC_PID: fixed build on ARM 2013-01-02 22:09:02 +11:00
rmackay9 24317e721b AC_PID, AP_AHRS: added descriptions to some parameters 2012-12-10 22:28:39 +09:00
Andrew Tridgell 5e7ca5b0f8 AC_PID: suppress the derivative immediately after reset
use _last_derivative == NAN to flag that the derivative is invalid
2012-11-27 18:45:49 +11:00
Andrew Tridgell eac1ad49d6 AC_PID: save 8 bytes per AC_PID object
we don't need the _derivative or _output variables
2012-11-27 18:06:22 +11:00
Robert Lefebvre 1d12b781a0 AC_PID: Create Leaky Integrator Function. 2012-11-26 21:01:20 -05:00
uncrustify fc9f1a8216 uncrustify libraries/AC_PID/AC_PID.cpp 2012-08-21 18:59:13 -07:00
Andrew Tridgell 5e8fe8d93e AP_Param: update PID libraries for new constructor syntax 2012-08-08 12:11:57 +10:00
rmackay9 24a471ff8f AC_PID - added more paranoid checking that imax is positive in constructor, operator() and load_gains methods 2012-03-20 11:51:15 +09:00
Jason Short 24ce02c6a4 made I term return in same pattern as D term 2012-02-16 22:09:22 -08:00
Andrew Tridgell 9c5a5473ab added indexes to group info structures 2012-02-13 16:22:52 +11:00
Andrew Tridgell 452749149f convert AC_PID library to AP_Param 2012-02-13 16:22:52 +11:00
Andrew Tridgell f9eed9bd9e fixed missing return in D value 2012-02-13 16:22:52 +11:00
Jason Short af79eb273f Added D term to APM_PI - need to refactor this as a parent class and two child classes to save code space, remove dupes 2012-01-28 21:21:43 -08:00