Commit Graph

826 Commits

Author SHA1 Message Date
Randy Mackay 2cdc5da226 AP_MotorsHeli_Single: rotor speed functions in 0 to 1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 68945df45d AP_MotorsHeli_Single: write_aux uses 0 to 1 range 2016-04-01 11:59:30 +09:00
Randy Mackay b3334c3ae5 AP_MotorsHeli: rotor speed function in 0 to 1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 832a226f13 AP_MotorsHeli_RSC: rotor speeds in 0 to 1 range
Also move recalc_scalers functionality into update_rotor_ramp and update_rotor_runup
2016-04-01 11:59:30 +09:00
Randy Mackay 4775843e3c AP_MotorsHeli_RSC: add get_idle_output accessor 2016-04-01 11:59:30 +09:00
Randy Mackay a63dba5b13 AP_MotorsHeli_Single: servo_test becomes protected 2016-04-01 11:59:30 +09:00
Randy Mackay cefd114964 AP_MotorsHeli_Single: remove unused accessors for tail_type, ext_gyro_gain, phase_angle 2016-04-01 11:59:30 +09:00
Randy Mackay f2fc39943e AP_MotorsHeli_Single: remove unused delta_phase_angle 2016-04-01 11:59:30 +09:00
Randy Mackay 381f538aca AP_HotorsHeli_Single: remove unused definition 2016-04-01 11:59:30 +09:00
Randy Mackay 27fed39671 AP_MotorsHeli_Single: remove roll_scalar, pitch_scalar 2016-04-01 11:59:30 +09:00
Randy Mackay 756236af35 AP_MotorsHeli: remove unused delta_phase_angle 2016-04-01 11:59:30 +09:00
Randy Mackay 16ac92be82 AP_MotorsHeli: remove unused definitions 2016-04-01 11:59:30 +09:00
Randy Mackay aeef6692cb AP_MotorsHeli: remove unused roll_scalar, pitch_scalar, collective_range 2016-04-01 11:59:30 +09:00
Randy Mackay 1a690772e1 AP_Motors: example sketch outputs headers 2016-04-01 11:59:30 +09:00
Randy Mackay 361b64f817 AP_Motors: example sketch uses AP_Motors set_desired_spool_state 2016-04-01 11:59:30 +09:00
Randy Mackay d4998089c8 AP_Motors: example sketch provides roll, pitch, yaw in -1 to +1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 93597d152f AP_Motors: example sketch can test helicopter 2016-04-01 11:59:30 +09:00
Randy Mackay 47873c1d34 AP_MotorsHeli: fix RSC_SETPOINT param description 2016-04-01 11:59:30 +09:00
Randy Mackay bcbe6b279e AP_MotorsHeli: explicitely set ServoControlModes enum
Non functional change but this enum is tied to a parameter value so the exact value is important
2016-04-01 11:59:30 +09:00
Randy Mackay 8febcedf4b AP_MotorsHeli: remove unnecessary static declaration 2016-04-01 11:59:30 +09:00
Randy Mackay f022e504b0 AP_MotorsHeli: remove unused get_collective_mid and out methods 2016-04-01 11:59:30 +09:00
Randy Mackay a18722a2fc AP_MotorsHeli: output_min uses new move_actuators in -1 to +1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 1197a439af AP_MotorsHeli: move_actuators to -1 to +1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 8057d2fc58 AP_MotorsMatrix: remove unnecessary virtual declarations 2016-04-01 11:59:30 +09:00
Randy Mackay 71866be652 AP_MotorsHeliSingle: move_yaw in -1 to +1 range 2016-04-01 11:59:30 +09:00
Randy Mackay f6120b801b AP_MotorsHeliSingle: move_actuators in -1 to +1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 61cf8e1698 AP_Motors: add calc_pwm_output_1to1 and 0to1
Convenience functions to convert from -1 to +1 input to pwm output
2016-04-01 11:59:30 +09:00
Randy Mackay 56f05e6a96 AP_Motors: add set_desired_spool_state 2016-04-01 11:59:30 +09:00
Randy Mackay 2716126e40 AP_MotorsMulticopter: use desired_spool from AP_Motors class 2016-04-01 11:59:30 +09:00
Randy Mackay 93d1f1969c AP_MotorsMulticopter: remove set_desired_spool_state
This is being moved to AP_Motors
2016-04-01 11:59:30 +09:00
Randy Mackay 4dd4d38b9b AP_MotorsMulticopter: fix output_to_motors definition 2016-04-01 11:59:30 +09:00
Randy Mackay 3ae9b606ff AP_Motors: remove unnecessary output_to_motors declaration
This is declared down in the AP_MotorsMulticopter
2016-04-01 11:59:30 +09:00
Randy Mackay f2ff9e34ad AP_Motors: remove output_armed_zero_throttle 2016-04-01 11:59:30 +09:00
Leonard Hall 879e12ba43 AP_MotorsHeli_Single: roll, pitch, yaw input in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 97f0b00e3e AP_MotorsHeli: roll, pitch, yaw input in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall b701c109cf AP_MotorsSingle: roll, pitch, yaw input in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 1a308c2eb8 AP_MotorsCoax: roll, pitch, yaw input in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 4d208fcd47 AP_MotorsTri: roll, pitch, yaw input in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 027284fba0 AP_MotorsMatrix: roll, pitch, yaw input in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall ae4e495698 AP_Motors: roll, pitch, yaw input in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 90b3d7ca39 AP_Motors: example sketch tests stab patch more thoroughly 2016-04-01 11:59:30 +09:00
Leonard Hall cef3f42df5 AP_Motors: fix example make.inc 2016-04-01 11:59:30 +09:00
Leonard Hall d2a1cdf906 MotorsHeli: replace throttle_control_input with throttle_in
throttle_control_input was 0 to 1000 range, throttle_in is 0 to 1
2016-04-01 11:59:30 +09:00
Leonard Hall f02e8f8e01 AP_MotorsHeli: remove output_armed_not_stabilizing 2016-04-01 11:59:30 +09:00
Leonard Hall 5cd4b78918 AP_MotorsSingle: remove reverse parameters
No longer necessary because we can use individual servo reverse params
2016-04-01 11:59:30 +09:00
Leonard Hall 6264159f4d AP_MotorsSingle: move servo objects into Single class 2016-04-01 11:59:30 +09:00
Leonard Hall 21d304b86d AP_MotorsSingle: output_to_motors implements spool logic 2016-04-01 11:59:30 +09:00
Leonard Hall 24a100e429 AP_MotorsSingle: stability patch uses 0 to 1 range 2016-04-01 11:59:30 +09:00
Leonard Hall cffdced838 AP_MotorsSingle: support 4 servo outputs 2016-04-01 11:59:30 +09:00
Leonard Hall f53d6e95e8 AP_MotorsSingle: rename _rev_roll to _roll_reverse
Also rename _rev_pitch to _pitch_reverse and _rev_yaw to _yaw_reverse
2016-04-01 11:59:30 +09:00
Leonard Hall 4db73d86af AP_MotorsSingle: remove output_disarmed 2016-04-01 11:59:30 +09:00
Leonard Hall 46ab198ebc AP_MotorsSingle: remove output_armed_not_stabilizing 2016-04-01 11:59:30 +09:00
Leonard Hall 40c18891cf AP_MotorsCoax: remove reverse parameters
No longer necessary because we can use individual servo reverse params
2016-04-01 11:59:30 +09:00
Leonard Hall 260006dcb3 AP_MotorsCoax: move servo objects into Coax class 2016-04-01 11:59:30 +09:00
Leonard Hall 110d41ee24 AP_MotorsCoax: fix SV_SPEED param description 2016-04-01 11:59:30 +09:00
Leonard Hall 8d8f52b22f AP_MotorsCoax: output_to_motors implements spool logic 2016-04-01 11:59:30 +09:00
Leonard Hall b85c20bb65 AP_MotorsCoax: stability patch in 0 to 1 range
Also removes setting of limits in stability patch
sets outputs for additional 2 servos
2016-04-01 11:59:30 +09:00
Leonard Hall 7df9b2eb8c AP_MotorsCoax: support 4 servo outputs 2016-04-01 11:59:30 +09:00
Leonard Hall 7d6c6b5556 AP_MotorsCoax: rename _rev_roll to _roll_reverse
Also rename _rev_pitch to _pitch_reverse and _rev_yaw to _yaw_reverse
2016-04-01 11:59:30 +09:00
Leonard Hall 5cb44901ff AP_MotorsCoax: remove output_disarmed 2016-04-01 11:59:30 +09:00
Leonard Hall 3df52aad5f AP_MotorsCoax: remove output_armed_not_stabilizing 2016-04-01 11:59:30 +09:00
Leonard Hall 45a16d6dad AP_MotorsTri: implement output_to_motors for spool logic 2016-04-01 11:59:30 +09:00
Leonard Hall d0a7579fa0 AP_MotorsTri: stability patch in 0 to 1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 80f77bc30b AP_MotorsTri: output_min does not set limits 2016-04-01 11:59:30 +09:00
Leonard Hall ba659be5cb AP_MotorsTri: rename _yaw_servo_reverse to _yaw_reverse 2016-04-01 11:59:30 +09:00
Leonard Hall 8c4d6d6fbe AP_MotorsTri: remove output_disarmed 2016-04-01 11:59:30 +09:00
Leonard Hall a2fdcfaf3f AP_MotorsTri: remove output_armed_not_stabilizing 2016-04-01 11:59:30 +09:00
Leonard Hall 397940a9a4 AP_MotorsMatrix: implement output_to_motors 2016-04-01 11:59:30 +09:00
Leonard Hall cdec8f3387 AP_MotorsMatrix: remove output_disarmed 2016-04-01 11:59:30 +09:00
Leonard Hall b965857229 AP_MotorsMatrix: remove output_armed_not_stabilizing 2016-04-01 11:59:30 +09:00
Leonard Hall d0c6d087a5 AP_MotorsMatrix: do not set limits in output_min 2016-04-01 11:59:30 +09:00
Leonard Hall 3fef60da45 AP_MotorsMatrix: stability patch in 0 to 1 range
Includes storing motor level thrusts to _thrust_rpyt_out
rename _throttle_thr_mix_desired to _throttle_rpy_mix_desired
rename _throttle_thr_mix to _throttle_rpy_mix
use get_hover_throttle_as_high_end_pct
use throttle_thrust_max updated by multicopter spool logic
do not set limits in stability patch
2016-04-01 11:59:30 +09:00
Leonard Hall 5841310ac7 AP_MotorsMulticopter: update_throttle_filter limits throttle to 0 to 1 2016-04-01 11:59:30 +09:00
Leonard Hall 420b90953c AP_MotorsMulticopter: throttle_radio_min, max to multicopter class
Moved in from Motors class, only ever used by multicopters
No functional change
2016-04-01 11:59:30 +09:00
Leonard Hall 2c9a02066d AP_MotorsMulticopter: remove unused functions and variables 2016-04-01 11:59:30 +09:00
Leonard Hall 290e657f61 AP_MotorsMulticopter: update_battery_resistance captures resting voltage while disarmed
Previously it could also capture this when the input throttle was zero
2016-04-01 11:59:30 +09:00
Leonard Hall bc42cb2a66 AP_MotorsMulticopter: update_battery_resistance uses get_throttle accessor 2016-04-01 11:59:30 +09:00
Leonard Hall 8228d9e72c AP_MotorsMulticopter: current_limit_max_throttle uses get_throttle accessor 2016-04-01 11:59:30 +09:00
Leonard Hall 3cbc15bb5b AP_MotorsMulticopter: add get_throttle_thrust_max accessor 2016-04-01 11:59:30 +09:00
Leonard Hall d7dc37bda0 AP_MotorsMulticopter: remove apply_thrust_curve_and_volt_scaling_pwm 2016-04-01 11:59:30 +09:00
Leonard Hall 06f25b669d AP_MotorsMulticopter: add roll, pitch, throttle and yaw pass through 2016-04-01 11:59:30 +09:00
Leonard Hall d7c27c949c AP_MotorsMulticopter: add spool_up_complete accessor function 2016-04-01 11:59:30 +09:00
Leonard Hall 983d2dc97a AP_MotorsMulticopter: update_throttle_filter does not set throttle_in
get_throttle method now used to access filtered throttle
2016-04-01 11:59:30 +09:00
Leonard Hall 3fc3858fbd AP_MotorsMulticopter: set_throttle_range calcs _min_throttle before use 2016-04-01 11:59:30 +09:00
Leonard Hall b26318c178 AP_MotorsMulticopter: output_logic implements spooling 2016-04-01 11:59:30 +09:00
Leonard Hall b7fe6aa16e AP_MotorsMulticopter: remove update_max_throttle 2016-04-01 11:59:30 +09:00
Leonard Hall be64c71065 AP_MotorsMulticopter: add get_current_limit_max_throttle
returns the current limited maximum throttle as a number between 0 ~ 1 in the range throttle_min to throttle_max
2016-04-01 11:59:30 +09:00
Leonard Hall 64ba45a683 AP_MotorsMulticopter: add spin_when_armed_low_end_pct
returns the spin-when-armed value as a number from 0 to 1 in the range 0 to throttle_min
2016-04-01 11:59:30 +09:00
Leonard Hall 49819d822f AP_MotorsMulticopter: add get_hover_throttle_as_high_end_pct
Returns hover throttle as a number from 0 to 1 in the range from throttle_min to throttle_max
2016-04-01 11:59:30 +09:00
Leonard Hall e625c105a4 AP_MotorsMulticopter: remove get_throttle_warn 2016-04-01 11:59:30 +09:00
Leonard Hall 3854f2eda7 AP_MotorsMulticopter: rename _throttle_thr_mix_desired to _throttle_rpy_mix_desired
No functional change
Also rename _throttle_thr_mix to _throttle_rpy_mix
2016-04-01 11:59:30 +09:00
Leonard Hall 65bbc23a08 AP_MotorsMulticopter: apply_thrust_curve_and_volt_scaling in 0 to 1 range
existing equivalent pwm function becomes apply_thrust_curve_and_volt_scaling_pwm
2016-04-01 11:59:30 +09:00
Leonard Hall cb39f8aab7 AP_MotorsMuticopter: calc_thrust_to_pwm converts thrust in 0 to 1 range to pwm
pwm output is always between throttle min and throttle max
2016-04-01 11:59:30 +09:00
Leonard Hall 80ddce103f AP_Motors: move set_throttle_filter_cutoff declaration
No functional change
2016-04-01 11:59:30 +09:00
Leonard Hall 649a8c461d AP_Motors: remove unused throttle_radio_min, max
Moved to AP_MotorsMulticopter
2016-04-01 11:59:30 +09:00
Leonard Hall e84011603c AP_Motors: remove unused throttle_pwm_scalar, rpy_pwm_scalar 2016-04-01 11:59:30 +09:00
Leonard Hall 8e1351e474 AP_Motors: init member to resolve compiler warning 2016-04-01 11:59:30 +09:00
Leonard Hall ed51c7a28d AP_Motors: replace throttle_control_input with throttle_in
throttle_control_input was 0 to 1000 range, throttle_in is 0 to 1
2016-04-01 11:59:30 +09:00
Leonard Hall c96b91efb6 AP_Motors: add output_to_motors 2016-04-01 11:59:30 +09:00
Leonard Hall ac579685df AP_Motors: remove output_armed_not_stabilizing 2016-04-01 11:59:30 +09:00
Leonard Hall 666a92ae2f AP_Motors: set_throttle accepts 0 to 1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 3c74b4cc69 Motors: add get_roll_thrust which returns roll input in range 0 to 1
Also added get_pitch_thrust, get_yaw_thrust
2016-04-01 11:59:30 +09:00
Peter Barker a66da7be00 AP_Motors: correct parameter documenation 2016-03-17 16:10:10 +11:00
Lucas De Marchi 7d9153feb8 AP_Motors: replace header guard with pragma once 2016-03-16 18:40:42 +11: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
Jonathan Challinger 9a09a86bb8 AP_Motors: add AP_MOTORS_DENSITY_COMP_DISABLED option 2016-01-27 09:18:09 +09:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Andrew Tridgell b187a0c6eb AP_Motors: added quadplane frame type
this puts the motors on outputs 5 to 8, to leave the first 4 for the
plane
2016-01-09 07:38:51 +11:00
Randy Mackay b742ee9cfb AP_Motors: fix example sketch 2016-01-08 18:36:47 +09:00
Randy Mackay 6c458b07cb MotorsHeli_RSC: resolve compiler warning re init order 2016-01-07 12:31:49 +09:00
Andrew Tridgell 7c9ee9363b AP_Motors: added rc_map_mask() function 2016-01-06 22:09:40 +11:00
Andrew Tridgell dfccf8f713 AP_Motors: also wrap set_freq and enable_ch for motor mapping 2016-01-06 22:09:40 +11:00
Andrew Tridgell 77af00c5e1 AP_Motors: allow arbitrary mapping of channels on multirotors
using RCn_FUNCTION with motor1, motor2 etc
2016-01-06 22:09:40 +11:00
Andrew Tridgell 1b682e3c8f AP_Motors: swash servos are output only 2016-01-05 06:41:51 +11:00
Andrew Tridgell d31ba2b380 AP_Motors: added rc_write function
this is intended to make remapping motors and rescaling output easier
2016-01-04 16:56:54 +11:00
Andrew Tridgell 79c90d37f6 AP_Motors: apply HELI_RSC output type if available 2016-01-04 16:14:09 +11:00
Andrew Tridgell e1f4814068 AP_Motors: only set output side of range for RSC 2016-01-04 11:23:38 +09:00
Jonathan Challinger b803907163 AP_Motors: fix example build 2015-12-29 10:46:35 -08:00
Lucas De Marchi 8d252955f5 AP_Motors: don't link unused AP_Curve library 2015-12-28 10:23:23 -02:00
Lucas De Marchi a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Don Gagne ed7cd8d3f4 AP_Motors: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Robert Lefebvre 3a13db9333 AP_MotorsHeli: Add more parameter checks. 2015-12-07 14:51:42 +09:00
Lucas De Marchi c9d1456a66 AP_Motors: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11: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
Andrew Tridgell 47b9f6598a AP_Motors: allow change to heli rotor speed controls while armed
this helps a lot with tuning for gas helis
2015-11-27 15:12:03 +09:00
Caio Marcelo de Oliveira Filho 513f4fe986 AP_Motors: example uses millis/micros/panic functions 2015-11-20 12:32:16 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Robert Lefebvre b89b0d7f9e AP_MotorsHeli_Single: Move Servo_Test static variables to be class members 2015-11-12 19:37:37 +09:00
Robert Lefebvre bb7f8c1999 AP_MotorsHeli: Create Servo Test functionality 2015-11-12 19:37:34 +09:00
Robert Lefebvre eeb544d098 AP_MotorsHeli: Create SV_MAN=5=Oscillate servo setup mode. 2015-11-12 19:37:33 +09:00
Robert Lefebvre 4443ca9602 AP_MotorsHeli: Yaw servo to move when using SV_MAN param for setup. 2015-11-12 19:37:32 +09:00
Robert Lefebvre c2dff8749e AP_MotorsHeli: Change SV_MAN=2=Center to output _col_mid_pwm instead of 0 collective 2015-11-12 19:37:31 +09:00
Fredrik Hedberg 212eb85ff2 AP_MotorsHeli: Add min and max collective to manual servo modes 2015-11-12 19:37:30 +09:00
Robert Lefebvre 22729e6927 AP_MotorsHeli: Change servo manual #defines into enum 2015-11-12 19:37:29 +09:00
Robert Lefebvre 750728fa1e AP_MotorsHeli_Single: Add motor enable aux output functionality 2015-11-12 19:37:28 +09:00
Fredrik Hedberg 5fd7fe3e53 AP_Motors: Add manual servo override to center swash-plate for set-up in AP_MotorsHeli. 2015-11-12 19:37:25 +09:00
Jolyon Saunders ca28a49fa6 AP_Motors: Circular swash-plate limits for AP_MotorsHeli 2015-11-12 19:37:24 +09:00
Lucas De Marchi ca4ae1c9e0 AP_Motors: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09: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
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Randy Mackay ca942f39dd AP_Motors_Heli: remove unused allow_arming check 2015-10-27 09:14:40 +09:00
Caio Marcelo de Oliveira Filho 417651b1dc AP_Motors: remove unnecessary board includes from examples 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Lucas De Marchi f43f6c53f7 AP_Motors: Group writes to motors
Surround calls to rcout->write() with rcout->cork() and rcout->push().
If the RCOutput implementation allows the writes are grouped and only
sent together to the underlying hardware.
2015-10-06 10:42:18 +11:00
Lucas De Marchi e938075581 AP_MotorsCoax: get rid of _motor_to_channel_map 2015-09-29 12:01:41 +09:00
Lucas De Marchi ec4ebfde83 AP_MotorsSingle: get rid of _motor_to_channel_map 2015-09-29 12:01:28 +09:00
Lucas De Marchi 537599c01b AP_MotorsTri: get rid of _motor_to_channel_map 2015-09-29 12:01:14 +09:00
Lucas De Marchi 1572c9d4f4 AP_MotorsMatrix: get rid of _motor_to_channel_map 2015-09-29 12:00:56 +09:00
Lucas De Marchi 43268b9822 AP_MotorsHeli: get rid of _motor_to_channel_map 2015-09-29 12:00:18 +09:00
Lucas De Marchi 7ea141b774 AP_Motors_Multi: get rid of _motor_to_channel_map 2015-09-29 11:59:48 +09:00
Lucas De Marchi d97d97dc54 AP_Motors: get rid of _motor_to_channel_map
This was only used for supporting APM1. The removal was mostly automatic
with:

    sed -i 's/pgm_read_byte(&_motor_to_channel_map\[\([^]]*\)\])/\1/g' libraries/AP_Motors/*.cpp
    sed -i 's/_motor_to_channel_map\[\([^]]*\)\]/\1/g' libraries/AP_Motors/*.cpp

And then remove references to MOTOR_TO_CHANNEL_MAP and
_motor_to_channel_map and make sure the variable used in shifts is
unsigned
2015-09-29 11:59:25 +09:00
Andrew Tridgell f22a1d3e6d AP_Motors: display message in heli parameter_check() 2015-09-25 12:30:34 +10:00
Andrew Tridgell 9da2b2b430 AP_Motors: added H_GYR_GAIN_ACRO 2015-09-25 12:30:33 +10:00
Randy Mackay 1024790633 MotorsMulti: add throttle_max accessor 2015-09-07 15:10:02 +09:00
Randy Mackay e3ff4ed9c4 MotorsHeli: integrate RotorControlState 2015-08-31 11:43:59 +09:00
Randy Mackay cb47311416 MotorsHeli_RSC: add RotorControlMode enum 2015-08-31 11:43:58 +09:00
Randy Mackay 72efc85ee8 MotorsHeli_RSC: RotorControlState enum 2015-08-31 11:43:57 +09:00
Robert Lefebvre bde43412d8 AP_MotorsHeli: Fix RSC Mode 3 2015-08-31 11:43:55 +09:00
Robert Lefebvre 38ccd6e04f AP_MotorsHeli_RSC: Fix tail_type control 2015-08-31 11:43:54 +09:00
Robert Lefebvre 535da1d79a AP_MotorsHeli_Single: DDVPT to use it's own ramp and runup times 2015-08-31 11:43:51 +09:00
Robert Lefebvre 28318c4116 AP_MotorsHeli: Move Output functions into parent class 2015-08-31 11:43:50 +09:00
Robert Lefebvre 84102c3e3f AP_MotorsHeli: Rework how servo setup is done. 2015-08-31 11:43:49 +09:00
Robert Lefebvre 345663f705 AP_MotorsHeli: Simplify servo init/reset 2015-08-31 11:43:48 +09:00
Robert Lefebvre b11600aebe AP_MotorsHeli: Move set_delta_phase_angle into _Single class 2015-08-31 11:43:47 +09:00
Robert Lefebvre 3756c6b3f3 AP_MotorsHeli: Create RSC Throttle Curve mode for controlling gas engines. 2015-08-31 11:43:45 +09:00
Robert Lefebvre f853979816 AP_MotorsHeli: run RSC Control function in Output Min function
Move Output_Min() function into Heli_Single class as it will eventually be overloaded by other helicopter class types.
2015-08-31 11:43:44 +09:00
Robert Lefebvre 315f0408ae AP_MotorsHeli: RSC controller to use speed ramp as simple float scalar 2015-08-31 11:27:52 +09:00
Robert Lefebvre 91c7663ca2 AP_MotorsHeli: Set range of new RSC Servo object. 2015-08-31 11:27:51 +09:00
Robert Lefebvre cefa0c28a6 AP_MotorsHeli: RSC Mode 0 no longer a valid mode 2015-08-31 11:27:48 +09:00
Robert Lefebvre 981c96d8bc AP_MotorsHeli: Add more parameter checks 2015-08-31 11:27:47 +09:00
Robert Lefebvre ed08e9d531 AP_MotorsHeli_RSC: Split out rotor speed estimate into it's own function 2015-08-31 11:27:46 +09:00
Robert Lefebvre 064cc63512 AP_MotorsHeli: Colyaw function to check if rotor speed control is above idle 2015-08-31 11:27:45 +09:00
Robert Lefebvre 77e4bf39aa AP_MotorsHeli: rework RSC output() function to implement idle speed function
Also, split out speed_ramp function
2015-08-31 11:27:44 +09:00
Robert Lefebvre c3e7eed299 AP_MotorsHeli_Single: Fix recalc_scalars function 2015-08-31 11:27:42 +09:00
Robert Lefebvre 214d60abb9 AP_MotorsHeli: Create RSC_IDLE param 2015-08-31 11:27:41 +09:00
Robert Lefebvre 27f8d6bcd5 AP_MotorsHeli: Change RSC output() function into a state machine. 2015-08-31 11:27:40 +09:00
Robert Lefebvre 10b0be9e75 AP_MotorsHeli: Fully detail tradheli output functions and move manual servo handling 2015-08-31 11:27:39 +09:00
Robert Lefebvre 7dda0f651a AP_MotorsHeli: Rename tradheli servo objects for clarity 2015-08-31 11:27:38 +09:00
Robert Lefebvre 457d939e77 AP_MotorsHeli: Update includes so that it builds 2015-08-31 11:27:37 +09:00
Fredrik Hedberg e6119cf51f AP_Motors: Fix param indices in AP_MotorsHeli. 2015-08-31 11:27:36 +09:00
Fredrik Hedberg 411947ea7c AP_Motors: Rename output_yaw to move_yaw in AP_MotorsHeli_Single. 2015-08-31 11:27:35 +09:00
Fredrik Hedberg 1e8be73a27 AP_Motors: Fix formatting in AP_MotorsHeli_RSC. 2015-08-31 11:27:34 +09:00
Fredrik Hedberg e6957df54a AP_Motors: Fix param range comment in AP_MotorsHeli. 2015-08-31 11:27:33 +09:00
Fredrik Hedberg 97e09fa9b0 AP_Motors: Move traditional helicopter controls into AP_MotorsHeli_Single.
Original commit by fhedberg, had to fix merge conflicts and now it appears I did the commit?
2015-08-31 11:27:31 +09:00
Fredrik Hedberg af69a20ba5 AP_Motors: Break out yaw output in AP_MotorsHeli. 2015-08-31 11:27:30 +09:00
Fredrik Hedberg feb32f40ed AP_Motors: Break out servo init and reset in AP_MotorsHeli. 2015-08-31 11:27:29 +09:00
Fredrik Hedberg ae9a16dc27 AP_Motors: Move rotor speed control into AP_MotorsHeli_RSC. 2015-08-31 11:27:28 +09:00
Fredrik Hedberg 1bb6b65ce0 AP_Motors: Use C++11 initializers in AP_MotorsHeli. 2015-08-31 11:27:27 +09:00
Leonard Hall c357cb8f84 Copter: increase default thrust expo to 0.65 2015-08-23 16:42:05 +09:00
Gustavo Jose de Sousa 1e619c6c59 AP_Motors: 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:38:19 +10:00
Randy Mackay f009c2ddb9 Motors_Multicopter: add MOT_THR_MIX_MAX parameter
Allows controlling the prioritisation of throttle vs attitude control
during active flight
2015-08-07 17:39:09 +09:00
Leonard Hall 1a583c5382 AP_Motors: calc_roll_pwm based on throttle pwm range 2015-08-03 14:12:49 +09:00
Randy Mackay 5032cf9fbc Copter: init multicopter flags
Resolves coverity warning

Also fixed indentation
2015-07-25 14:00:29 +09:00
Randy Mackay e31f2d26c4 MotorsMulticopter: move get_hover_throttle_as_pwm to protected
No functional change
2015-07-21 16:27:04 +09:00
Randy Mackay c7c6228b5d MotorsMulticopter: remove virtual from set_yaw_headroom 2015-07-21 16:27:01 +09:00
Randy Mackay 4843be49de AP_MotorsTri: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:48 +09:00
Randy Mackay f906934dfa AP_MotorsSingle: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:45 +09:00
Randy Mackay 112e934072 AP_MotorsMatrix: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:43 +09:00
Randy Mackay b1a4a6bf0a AP_Motors_Coax: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:40 +09:00
Randy Mackay 4d1dfd94f5 AP_MotorsMulticopter: multicopter features moved in from parent
Also rename from multirotor to multicopter
2015-07-21 16:25:37 +09:00
Randy Mackay 7355ac9cb8 AP_MotorsHeli: implement empty slow start method 2015-07-21 16:25:34 +09:00
Randy Mackay a3fab10ef4 AP_MotorsHeli: init roll_radio_passthrough 2015-07-21 16:25:31 +09:00
Randy Mackay c9dedbd3b2 AP_Motors: remove multicopter only features
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:28 +09:00
Robert Lefebvre abb6eba291 AP_MotorsHeli: Change allow_arming check to use _rotor_speed_estimate
In future, this will be used to check actual rotor speed (measured) if available, to prevent trying to arm with the rotor spinning.
2015-07-21 16:25:21 +09:00
Robert Lefebvre 9fcbc77ce0 AP_MotorsHeli: Create rotor_speed_above_critical accessor 2015-07-21 16:25:11 +09:00
Robert Lefebvre 992c9c75bb AP_MotorsHeli: Create parameter_check method. 2015-07-21 16:25:04 +09:00
Robert Lefebvre e2fe640e6c Copter: Clean up helicopter allow_arming() function 2015-07-21 16:24:58 +09:00
Robert Lefebvre 61d6c5aa1d AP_Motors: Creation of AP_Motors_Multirotor class 2015-07-21 16:24:38 +09:00
Randy Mackay 8225e58454 AP_Motors: throttle_min method in 0 to 1000 range
Previously the pwm range value was returned.  This value is only used by
the multicopter attitude controller's angle boost function.
2015-07-20 20:44:46 +09:00
Randy Mackay 6bf6442396 MotorsMatrix; protect against divide by zero
This should never happen but just to be safe
2015-07-20 20:44:43 +09:00
Randy Mackay fa60c3dce8 MotorsCoax: fix output_armed_stabilized min thr limit 2015-07-20 20:44:36 +09:00
Randy Mackay 8a308205ce MotorsSingle: fix output_armed_stabilized min thr limit 2015-07-20 20:44:32 +09:00
Randy Mackay bd9a605086 MotorsTri: fix output_armed_stabilized min thr limit
_min_throttle is in the pwm range but was being used as if in the 0 to
1000 range
2015-07-20 20:44:23 +09:00
Randy Mackay e53c46bd8f MotorsMatrix: fix output_armed_stabilized min thr limit
_min_throttle was being used as if it were in the 0 to 1000 range when
in fact it is in the pwm range.  This meant the lower limit was too low.
2015-07-20 20:44:14 +09:00
Robert Lefebvre e1902e2289 AP_MotorsHeli: Remove unused _dt variable. 2015-07-14 20:13:43 +09:00
Robert Lefebvre 11214b3414 AP_Motors: move constraints to set_throttle 2015-06-22 13:52:59 +09:00
Robert Lefebvre 0c92565d23 AP_MotorsHeli: add Critical Rotor Speed param, use to switch off runup_complete 2015-06-19 15:10:53 +09:00
Robert Lefebvre 3ad6700c5d AP_MotorsHeli: add getters for rotor speed 2015-06-19 15:10:51 +09:00
Robert Lefebvre 8b917b82ee AP_MotorsHeli: Simplify set_desired_rotor_speed function definition 2015-06-19 15:10:50 +09:00
Robert Lefebvre 79e8c8f7f7 AP_MotorsHeli: whitespace fixes 2015-06-19 15:10:47 +09:00
Randy Mackay 2849430341 AP_Motors: init flags
resolves coverity issue
2015-06-08 14:46:16 +09:00
Andrew Tridgell d746e8fa29 AP_Motors: mark examples as nobuild
waiting for fix from Rob
2015-06-01 17:27:33 +10:00
Andrew Tridgell 89baf2bdf1 AP_Motors: convert example from .pde to .cpp 2015-06-01 17:07:05 +10:00
Robert Lefebvre 1424b17a83 AP_Motors_Heli: Change default RSC_SETPOINT to 700 2015-05-29 17:46:25 +09:00
Robert Lefebvre d24664ccf9 AP_MotorsHeli: Semantic change. Motor Runup to Rotor Runup 2015-05-29 17:46:18 +09:00
Robert Lefebvre 65ca09600c AP_Motors: Heli eliminate _dt member and fix rsc_runup calculation 2015-05-29 17:46:09 +09:00
Randy Mackay d777166c6f AP_MotorsTri: revert tail servo to Ch7 2015-05-25 22:27:38 +09:00
Randy Mackay 1a1fa7ca4b AP_MotorsHeli: add comment to avoid param conflict 2015-05-25 22:13:49 +09:00
Randy Mackay 4c94a69e33 AP_MotorsCoax: resolve param conflict with TradHeli 2015-05-25 22:13:47 +09:00
Randy Mackay 78b49fb4c6 AP_MotorsSingle: resolve param conflict with TradHeli
Also rename servo reverse parameters to be consistent with tricopter
2015-05-25 22:13:45 +09:00
Randy Mackay 8dc7cf7fa8 AP_MotorsTri: YAW_SV_REV values -1 or +1
Also resolve parameter conflict with TradHeli
2015-05-25 22:13:43 +09:00
Randy Mackay 71e4bccecb AP_Motors: init members in constructor
Also add f to end of float constants
2015-05-25 22:13:41 +09:00
Robert Lefebvre b8181b6b90 AP_Motors: RCMAP fix
Remove all RC Input channels passed as reference into AP_Motors.  All input handling self-contained inside AP_Motors.
Rework Tricopter to use internal servo calcs.
2015-05-25 22:13:32 +09:00
Jonathan Challinger 28731d2bdc AP_Motors: add throttle filter input constraint from -100 to 1100 2015-05-22 16:12:27 +09:00
Robert Lefebvre 73bafa131e AP_MotorsHeli: Overload output()
To protect it from future interference from Multirotor code.
2015-05-22 09:38:23 +09:00
Robert Lefebvre d3ce68a8ca AP_MotorsHeli: Overload update_throttle_filter()
Do not reset filter to zero when disarmed to allow collective pitch servo movement.
2015-05-22 09:38:20 +09:00
Randy Mackay 3d9a6a69e2 MotorsHeli: COLYAW to float 2015-05-08 14:14:36 +09:00
Randy Mackay edfa206bb8 Motors_Heli: nest heli params 2015-05-08 14:14:35 +09:00
Randy Mackay 68b05a4ca2 AP_Motors: is_throttle_mix_min returns bol 2015-05-08 14:14:32 +09:00
Leonard Hall 0f894ac1a8 AP_Motors: Rename and move Throttle Mix / Comp 2015-05-08 14:14:17 +09:00
Andrew Tridgell 2e57c62ebb AP_Motors: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Randy Mackay b223e90ef6 AP_Motors: fix example sketches 2015-05-01 20:58:20 +09:00
Randy Mackay 0acc06d713 AP_Motors: minor comment for interlock 2015-05-01 14:30:45 +09:00
Robert Lefebvre 1a482de5e2 AP_MotorsHeli: Overload output_armed_zero_throttle 2015-05-01 14:30:25 +09:00
Robert Lefebvre 6bdace30d2 AP_Motors: Add throttle interlock functionality
AP_MotorsMatrix's output_armed_zero_throttle uses output_min default from base class
2015-05-01 14:30:24 +09:00
Jonathan Challinger 348001e786 AP_Motors: add get_throttle_warn function 2015-05-01 12:56:11 +09:00
Randy Mackay bae1722946 AP_Motors: get_compensation_gain gets div-by-zero check 2015-04-29 14:36:22 +09:00
Jonathan Challinger 41ae7207c7 AP_Motors: scale roll/pitch/yaw gain for air density 2015-04-29 14:36:15 +09:00
Jonathan Challinger e2ba351149 AP_Motors: refactor apply_thrust_curve_and_volt_scaling 2015-04-29 14:36:12 +09:00
Jonathan Challinger a07b322d31 AP_Motors: set_throttle takes a float 2015-04-24 16:30:45 +09:00
Tom Pittenger a5ffadf201 AP_Motors: fix compile warnings re float constants 2015-04-24 14:04:00 +09:00
Jonathan Challinger 4993fd4d71 AP_Motors: use new lowpass filter 2015-04-17 10:46:47 +09:00
Jonathan Challinger e80776f1f5 AP_Motors: remove MOT_THR_FILT parameter and add interface to configure filter 2015-04-16 21:00:01 +09:00
Jonathan Challinger 8e442675a7 AP_Motors: introduce set_stabilize(bool), specifies whether torque demands should be output 2015-04-16 20:59:40 +09:00
Jonathan Challinger bc2afb31dd AP_Motors: virtual not necessary in child class 2015-04-16 20:59:37 +09:00
Jonathan Challinger a2c69fe90d AP_Motors: add optional motor output throttle filter 2015-04-16 20:59:31 +09:00
Leonard Hall 88be3d67e7 AP_Motors: add get for throttle comp 2015-04-16 13:29:50 +09:00
Leonard Hall 791fbcf9b3 AP_Motors_Class: time constants of throttle comp 2015-04-16 13:29:46 +09:00
Andrzej Zaborowski 132cdc4916 Motors: Use _motor_to_channel_map in tricopter consistently.
In AP_MotorsTri.cpp the AP_MOTORS_MOT_1, _2 and _4 constants are
always mapped to actual output channels through _motor_to_channel_map
while the _CH_TRI_YAW is not, but there were a few inconsistencies
in this that could lead to things like PWM min and max values being
set on wrong channels.

It looks like all in all _motor_to_channel_map being in PROGMEM
probably doesn't help save memory and I'm not sure how useful it is
in the first place but regardless the usage should be consistent.
2015-04-09 11:43:22 +09:00
Jonathan Challinger 1828515b3b AP_Motors: bug fix to _batt_voltage_filt 2015-04-01 10:15:06 -07:00
Jonathan Challinger 89cdd02f58 AP_Motors: remove duplicate get_throttle function 2015-04-01 10:15:05 -07:00
Jonathan Challinger 0e53c0a892 AP_Motors: make output_armed() and output_disarmed() pure virtual 2015-04-01 10:14:38 -07:00
Randy Mackay 385b3744ea MotorTri: check servo_out above min_throttle 2015-03-16 14:49:38 +09:00
Randy Mackay f9e29a7f77 MotorSingle: check servo_out above min_throttle
We need to recalc radio_out or the motors could fall below min throttle
2015-03-16 14:49:37 +09:00
Randy Mackay 8de5d16f96 MotorCoax: check servo_out above min_throttle
We need to recalc radio_out or the motors could fall below min throttle
2015-03-16 14:49:35 +09:00
Leonard Hall 31a55b2bd6 MotorsMatrix: fix div by zero by ensuring throttle is above min 2015-03-16 14:49:31 +09:00
Randy Mackay 5e26450a6f AP_Motors: make THR_LOW_COMP a variable instead of param 2015-03-10 12:20:27 +09:00
Leonard Hall 007c96a3d8 AP_Motors: Low throttle compensation setters 2015-03-10 12:20:21 +09:00
Leonard Hall 6275ee0289 AP_Motors: Check for battery voltage reading fail 2015-03-10 12:20:19 +09:00
Leonard Hall 3ad9b1a06b AP_MotorsMatrix: remove incorrect throttle limit flag 2015-03-06 14:02:55 +09:00
Jonathan Challinger d148039f65 AP_Motors: stricter batt_voltage misconfiguration check 2015-03-06 14:02:49 +09:00
Leonard Hall 11a19803e0 Motors: add accessors for motor logging
accessor include get_roll, get_pitch, get_yaw, throttle input
2015-03-06 14:01:58 +09:00
Randy Mackay f5f7cd540f Motors: fix example sketches 2015-03-03 21:39:24 +09:00
Leonard Hall cf8c211c35 Motors: fix thrust curve and add constraint 2015-03-03 15:49:07 +09:00
Leonard Hall 3e960dfc3b Motors: add get_voltage_comp_gain
This clarifies that lift_max is the inverse of the battery voltage gain
compensation
2015-03-03 15:49:04 +09:00
Leonard Hall 997c6f0868 Motors: move battery resistance calcs to parent
Moving from MotorsMatrix to parent Motors class allows these to be used
from other frame types
Also initialise battery resistance
2015-03-03 15:49:02 +09:00
Randy Mackay 09d7cdbc23 Motors: batt_voltage_filt becomes filter object 2015-03-03 15:49:00 +09:00
Leonard Hall 529c6fed3a Motors: move over current throttle limiting to parent
Moving from MotorsMatrix to parent Motors class allows this to be used
from other frame types
2015-03-03 15:48:54 +09:00
Randy Mackay 812473fd9a MotorsMatrix: use get_hover_throttle_as_pwm 2015-03-03 15:48:52 +09:00
Randy Mackay 1a9d3125ef Motors: _hover_out to pct * 10 instead of pwm 2015-03-03 15:48:50 +09:00
Leonard Hall 6b7bdf64bd Motors: move batt voltage lift_max calcs to parent
Moving from MotorsMatrix to parent Motors class allows them to be used
by other frame types
Also added sanity check of batt_voltage_min
2015-03-03 15:48:48 +09:00
Randy Mackay c549b58eb7 MotorsMatrix: remove check of throttle_curve_enabled 2015-03-03 15:48:46 +09:00
Randy Mackay 5fb3de48ee MotorsTri, Single, Coax: use new thrust curve 2015-03-03 15:48:44 +09:00
Randy Mackay 2eaa4a8445 Motors: remove old throttle curve 2015-03-03 15:48:42 +09:00
Leonard Hall 751dbb7df7 Motors: move thrust curve and volt scaling to parent
Moving from MotorsMatrix to Motors allows it to be used from other frames
2015-03-03 15:48:41 +09:00
Randy Mackay 80b498f598 Motors: add loop_rate to test sketch 2015-03-03 15:48:39 +09:00
Randy Mackay 7ab76dbd0e Motors: add loop_rate to constructor for all frames 2015-03-03 15:48:34 +09:00
Randy Mackay 77d4b3a2ae Motors: add loop_rate to constructor 2015-03-03 15:48:32 +09:00
Leonard Hall ec9d7dd99e Motors: minor comment fixes 2015-03-03 15:48:30 +09:00
Leonard Hall 1d0ee68116 Motors: over current throttle limiting 2015-03-03 15:48:28 +09:00
Randy Mackay f6523c0997 Motors: Add THR_LOW_CMP to adjust low throttle inputs affect on attitude control 2015-03-03 15:48:21 +09:00
Leonard Hall 83e3e2fec2 Motors: thrust curve and voltage scaling for matrix supported frames 2015-03-03 15:48:19 +09:00
Leonard Hall 5b0bd49ff2 Motors: configurable yaw headroom for matrix frames 2015-03-03 15:48:15 +09:00
Randy Mackay 3550e52560 MotorsTri: add 80% throttle limit
This limit was moved from the main copter flight code to the motors
library in order that the throttle_upper flag could be set properly.
2015-02-02 22:31:06 +09:00
Randy Mackay 38702a7e23 Motors: fix example sketch 2015-01-28 17:15:45 +09:00
Robert Lefebvre a2958e2ffd AP_MotorsSingle: Fix parameter comments. 2014-11-08 10:18:03 +09:00
Randy Mackay 677f6cce7f AP_Motors: reduce slow-start increment for fast CPUs 2014-10-18 20:54:08 +09:00
Randy Mackay 6690aff305 AC_Motors: param description addition 2014-10-14 12:43:22 +09:00
Randy Mackay 793ed20534 CoaxCopter: set throttle upper and lower flags 2014-10-04 23:49:19 +09:00
Randy Mackay 57f6d0ff60 SingleCopter: set throttle upper and lower flags 2014-10-04 23:49:16 +09:00
Randy Mackay 85fb4b122a MotorsMatrix: _min_throttle interpreted as 0 ~ 1000 range for throttle_lower flag
Also trigger throttle_upper flag when throttle in reaches 1000
2014-10-04 23:49:14 +09:00
Randy Mackay 91e5201439 Tri: _min_throttle interpreted as 0~1000 range for throttle_lower flag
limit.throttle_lower flag becomes true when the throttle passed into the
motors lib (which is in the 0 ~ 1000 range) is below _min throttle.
This makes the interpretation of the THR_MIN parameter consistent
between the main code (which uses 0 ~ 1000 range) and the motors lib
(which previously used the RC3_MIN ~ RC3_MAX range).
The remaining problem however is that the output of the motors continues
to use THR_MIN as if it were a pwm.  I don't believe this is a dangerous
problem however.
2014-10-04 23:49:11 +09:00
Jason Short b57539a9ad AP_Motors: throttle_pass_through accepts pwm 2014-09-19 22:21:45 +09:00
NullVoxPopuli c672b3e324 Copter: Added support for V-Shaped and A-Shaped VTail Quadcopter frames
Signed-off-by: NullVoxPopuli <LPSego3+dev@gmail.com>
2014-08-18 14:31:01 +09:00
Randy Mackay 9b9f6cd47a AC_MotorsHeli: init member to resolve compiler warning 2014-08-14 11:27:33 +09:00
Andrew Tridgell 2e83555892 AP_Motors: fixed example build 2014-08-13 21:48:35 +10:00
Randy Mackay 5596001d39 AC_Motors: make get_throttle_out const 2014-08-04 21:04:09 +09:00
Randy Mackay b665ebd7a0 MotorsMatrix: implement get_motor_mask 2014-07-26 16:33:24 +09:00
Randy Mackay d73605ece8 MotorsCoax: implement get_motor_mask 2014-07-26 16:33:22 +09:00
Randy Mackay 72c3e9cc72 TradHeli: implement get_motor_mask 2014-07-26 16:33:20 +09:00
Randy Mackay 6d99524e56 MotorsSingle: implement get_motor_mask 2014-07-26 16:33:18 +09:00
Randy Mackay 6ae855c1cf MotorsTri: implement get_motor_mask 2014-07-26 16:33:16 +09:00
Randy Mackay 7749bfe82c Motors: add get_motor_mask method
This returns a bitmask of output channels that are used by the motors
library.  This allows removing the chance of a do-set-servo interfering
with a motor or control surface used to control the vehicle.
2014-07-26 16:33:14 +09:00
Andrew Tridgell d9f20c6785 AP_Motors: fixed example build 2014-07-25 17:54:51 +10:00
Randy Mackay 517732a34d AP_Motors: add get_throttle_out accessor 2014-07-18 11:39:27 +09:00
Andrew Tridgell e448168ba6 AP_Motors: fixed example build 2014-07-14 10:41:16 +10:00
bugobliterator e6f27c9fac AP_Motors_Time_test.pde: use hal.scheduler->micros instead of gettimeofday 2014-07-14 09:31:59 +10:00
bugobliterator fb7ca9bb3c AP_Motors:add AP_Motors_Time_test 2014-07-14 09:29:45 +10:00
Víctor Mayoral Vilches d43c1cc544 AP_Motors_test: Adapt to test bench available 2014-07-14 09:29:08 +10:00
Robert Lefebvre 92bdf24dba AP_MotorsHeli: Add To-Do. Swash setup hasn't seemed to work right for a while, this might be why. Confirm later. 2014-07-13 17:11:22 +09:00
Robert Lefebvre 789b1018fc AP_MotorsHeli: Change set_delta_phase_angle so that it forces recalculation of collective factors. 2014-07-08 20:18:39 +09:00
Robert Lefebvre fd542e99d8 AP_MotorsHeli: Create Delta Phase Angle variable and method to set. Will be used by CCComp code. 2014-07-08 20:18:34 +09:00
Robert Lefebvre 0680b88abd AP_MotorsHeli: Add main loop rate time variable and method. Change RSC increment calc to account for loop rate time. 2014-07-08 20:18:20 +09:00
Robert Lefebvre 979abb9fbd TradHeli: Cause DDVP Tail Motor to stop immediately when Ch8 is 0. 2014-07-08 20:18:02 +09:00
Randy Mackay 5cc26569fc AP_Motors: fix example sketch 2014-04-29 20:46:34 +09:00
Randy Mackay 2be99d7a92 TriCopter: output_test for individual motors
Based on original work by Nils Hogberg
2014-04-29 11:41:16 +09:00
Randy Mackay 07766e55f9 SingleCopter: output_test for individual motors
Based on original work by Nils Hogberg
2014-04-29 11:41:14 +09:00
Randy Mackay 3610cfe24c TradHeli: output_test for individual motors
Based on original work by Nils Hogberg
2014-04-29 11:41:13 +09:00
Randy Mackay 8f74f5b3b0 CoaxCopter: output_test for individual motors
Based on original work by Nils Hogberg
2014-04-29 11:41:12 +09:00
Randy Mackay d63d82ec17 MotorMatrix: output_test for individual motors
Based on original work by Nils Hogberg
2014-04-29 11:41:10 +09:00
Vizual54 11d02ea5d2 AP_Motors: output_test for individual motors
Modified and integrated by Randy Mackay
2014-04-29 11:36:58 +09:00
L. Preston Sego III 3ecdc4b741 Copter: Add support for V-Tail Quads 2014-04-14 14:54:02 +09:00
Randy Mackay b78e59ea30 AP_Motors: add stability patch test to example sketch 2014-04-09 21:21:29 +09:00
Jonathan Challinger 9959a44453 AP_Motors: properly constrain thr_adj_max 2014-04-07 14:14:32 +09:00
Andrew Tridgell efdb678e00 AP_Motors: fixed example build 2014-04-07 11:55:56 +10:00
Andrew Tridgell 866e32f059 AP_Motors: removed unused variable 2014-02-26 09:40:39 +11:00
Randy Mackay d761ddd4af AP_Motors: fix example sketch 2014-02-15 06:09:08 +11:00
Randy Mackay 8d6eb1eceb MotorsMatrix: motor_to_channel_map moved to progmem 2014-02-15 05:27:50 +11:00
Randy Mackay 134289af38 TradHeli: motor_to_channel_map moved to progmem 2014-02-15 05:27:50 +11:00
Randy Mackay 1bee56877c CoaxCopter: motor_to_channel_map moved to progmem 2014-02-15 05:27:50 +11:00
Randy Mackay 3fad8e3630 SingleCopter: motor_to_channel_map moved to progmem 2014-02-15 05:27:50 +11:00
Randy Mackay 0edf039155 AP_MotorsTri: motor_to_channel_map moved to progmem 2014-02-15 05:27:50 +11:00
Randy Mackay 96d433c63e AP_Motors: motor_to_channel_map moved to progmem 2014-02-15 05:27:50 +11:00
Randy Mackay 415e48de19 TriCopter: use refs for all RC_Channels 2014-02-15 05:27:49 +11:00