Commit Graph

850 Commits

Author SHA1 Message Date
Jonathan Challinger 22517422f9 AP_Motors: add option to disable motor PWM output while disarmed 2016-11-21 10:49:21 +09:00
Peter Barker 06b616f761 AP_Motors: add missing parameter metadata 2016-10-27 09:15:03 -07: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
Leonard Hall bead957a78 AP_MotorsMulticopter: limit hover throttle 2016-10-15 11:27:53 +09:00
Andrew Tridgell 7cd7f03d56 AP_Motors: fixed use of trim on heli servos
this was broken by the servo range 0 to 1 changes
2016-10-13 09:34:48 +11:00
Lucas De Marchi ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
Leonard Hall 0a56d69d54 AP_MotorsMulticopter: Use same throttle value used by motors 2016-10-10 16:40:08 +09:00
Randy Mackay b63666d188 AP_Motors: increase MOT_THST_HOVER parameter description range
No functional change
2016-09-07 15:28:49 +09:00
Randy Mackay 4858afae6c AP_Motors: param description update that MOT_SPIN_MIN should be higher than MOT_SPIN_ARM 2016-09-03 11:12:31 +09:00
Andrew Tridgell e9e3a3f491 AP_Motors: added get_pwm_type() 2016-08-29 15:52:21 +10:00
Andrew Tridgell 270fa95a8d AP_Morors: scale colyaw to match previous behaviour
this was missed in the motor scaling changes. Thanks to Rob for
noticing this.
2016-08-10 07:58:06 +10:00
Randy Mackay ad697243b3 AP_MotorsMulticopter: initialise some members
This resolves some Covarity warnings at the cost of a small amount of flash
2016-08-08 13:31:30 +09:00
Andrew Tridgell 66c4995c9d AP_Motors: added get_desired_spool_state() 2016-08-04 09:43:40 -07:00
Andrew Tridgell 11975223dd AP_Motors: added H_RSC_POWER_NEGC and H_RSC_SLEWRATE
this gives more control over throttle for petrol
helis. H_RSC_POWER_NEGC allows for a asymmetric V-curve, which allows
for less power being put into the head when landing or when sitting on
the ground. That can lead to significantly less vibration and chance
of ground oscillation. A heli not being flown with aerobatics does not
need to use high throttle at negative collective pitch.

The H_RSC_SLEWRATE allows for a maximum throttle slew rate to be
set. Some petrol motors can cut if the throttle is moved too
quickly. We had this happen at a height of 6m when switching from
ALT_HOLD to STABILIZE mode. It also lowers the chance of the blades
skewing in their holders with the sudden change of power when the heli
is disarmed. In general it is a bad idea to do instantaneous large
movements of a IC engine throttle.
2016-07-03 18:29:05 +10:00
Andrew Tridgell bc7488e2f2 AP_Motors: fixed typos 2016-07-01 15:35:29 +10:00
Leonard Hall fe68fe65e2 AP_Motors: Single and Coax fix flap gains 2016-07-01 12:45:14 +09:00
Leonard Hall ba2382c409 AP_MotorsCoax: Fix servo 3 and 4 feed through sign 2016-06-20 09:45:17 +09:00
Andrew Tridgell 7a9b4c7572 AP_Motors: fixed motor load calculation
scale to 1.0 for max collective
2016-06-19 13:50:04 +10:00
Randy Mackay e185bab775 AP_MotorsMulticopter: add HOVER_LEARN option to learn but not save 2016-06-18 11:55:49 +09:00
Randy Mackay 23f8227e36 AP_Motors: bug fix to save params on disarm
Previously was saving during arming  as well as disarming.
Thanks to OXINARF for finding this!
2016-06-18 11:55:49 +09:00
Randy Mackay a2ffd9ec7d AP_MotorsMulticopter: fix comment for get_throttle_limit function 2016-06-18 11:55:49 +09:00
Randy Mackay a1b573ed0a AP_Motors: rename throttle_ave_max to throttle_avg_max 2016-06-18 11:55:49 +09:00
Randy Mackay ef106e4b0f AP_Motors: spool_mode moved out of flags struction
No functional change
2016-06-18 11:55:49 +09:00
Leonard Hall 8fff32bde3 AP_MotorsSingle: fix stability patch use of throttle_hover 2016-06-18 11:55:49 +09:00
Leonard Hall e0f9fc8e40 AP_MotorsSingle: rename rpy_scale, thrust_min_rpy variables
No functional change
2016-06-18 11:55:49 +09:00
Leonard Hall da05902805 AP_MotorsCoax: fix stability patch use of throttle_hover 2016-06-18 11:55:49 +09:00
Leonard Hall 9bc866e771 AP_MotorsCoax: rename rpy_scale internal variable
No functional change
2016-06-18 11:55:49 +09:00
Leonard Hall 8bdb906b2b AP_MotorsCoax: fixes negative thrust 2016-06-18 11:55:49 +09:00
Randy Mackay 71d1818103 AP_MotorsMulticopter: minor comment update 2016-06-18 11:55:49 +09:00
Randy Mackay 818965fa57 AP_MotorsMulticopter: output_to_motors and output_logic become protected 2016-06-18 11:55:49 +09:00
Leonard Hall 02881b59ff AP_MotorsMulti: float constants 2016-06-18 11:55:49 +09:00
Randy Mackay 79a73a5c2f AP_Motors: fix example sketch
No need to set throttle_mix nor throttle_min
2016-06-18 11:55:49 +09:00
Leonard Hall bee6c29b89 AP_MotorsMulticopter: current limit keeps battery from sagging below BAT_VOLT_MIN 2016-06-18 11:55:49 +09:00
Leonard Hall be25ac4acf AP_MotorsMulticopter: Add current limit time constant variable 2016-06-18 11:55:49 +09:00
Leonard Hall 7e0e0ca874 AP_MotorsMulticopter: battery voltage compensation improvements 2016-06-18 11:55:49 +09:00
Leonard Hall 0ee7b00b0b AP_MotorsMulticopter: rename _thrust_curve_min to spin_min 2016-06-18 11:55:49 +09:00
Leonard Hall 142a67bb6d AP_MotorsMulticopter: minor comment change 2016-06-18 11:55:49 +09:00
Leonard Hall 5cace33ca5 AP_MotorsMulticopter: SPIN_MIN replaces min_throttle 2016-06-18 11:55:49 +09:00
Leonard Hall 2c811364d3 AP_MotorsMulticopter: SPIN_ARM param replaces SPIN_ARMED 2016-06-18 11:55:49 +09:00
Leonard Hall 488f90b39d AP_Motors: add calc_spin_up_to_pwm to reduce repeated code 2016-06-18 11:55:49 +09:00
Randy Mackay 25778a24e2 AP_MotorsMulticopter: add HOVER_LEARN param 2016-06-18 11:55:49 +09:00
Leonard Hall 4f0db2bc36 AP_Motors: learned THST_HOVER replace THR_MID
This holds the estimated thrust required for the vehicle to hover
expressed as a number from 0 to 1.  0 will be equivalent to outputting
SPIN_MIN (which is a number from 0~1 but in the full output range) and 1 is equivalent to SPIN_MAX (also 0~1 but in the full output range)
2016-06-18 11:55:49 +09:00
Leonard Hall 5a8fc6283e AP_Motors: replace throttle_rpy_mix with throttle_avg
AC_AttitudeControl now calculates throttle vs attitude control
prioritisation and simply provides overall maximum throttle (aka
throttle_avg) to the motors library
2016-06-18 11:55:49 +09:00
Andrew Tridgell 255bda9f9c AP_Motors: allow setting of loop rate
this allows for SCHED_LOOP_RATE in copter
2016-06-17 15:01:18 +10:00
Leonard Hall b3fcab8044 AP_Motors: minor comment fix 2016-06-09 09:49:00 +09:00
Andrew Tridgell f58d837026 AP_Motors: fixed heli RSC output range and float conversion
adds H_RSC_PWM_MIN, H_RSC_PWM_MAX and H_RSC_PWM_REV
2016-06-04 18:33:36 +10:00
Leonard Hall a16018f9fe AP_Motors: Missed Single fix 2016-05-31 12:44:17 +10:00
Leonard Hall d67f83559c AP_Motors: Single and Coax Fixes 2016-05-29 16:12:29 +10:00
Randy Mackay 72b86a3f99 AP_Motors: remove unused stabilizing flag
Also initialise some members to resolve converity warnings
2016-05-28 15:45:29 +09:00
Andrew Tridgell a2ed8fb313 AP_Motors: prevent negative thrust
this prevents a sqrt of a negative number
2016-05-26 17:09:11 +10:00
Andrew Tridgell 6855899cbf AP_Motors: fixed servo constructor for coax 2016-05-26 16:41:16 +10:00
Andrew Tridgell 4e5e301c4e AP_Motors: fixed servo constructor for heli 2016-05-26 16:41:06 +10:00
Andrew Tridgell f9fb098222 AP_Motors: fixed channel output for SingleCopter 2016-05-26 16:26:43 +10:00
Andrew Tridgell 65eb9ceb32 AP_Motors: expose min/max pwm 2016-05-26 14:33:57 +10:00
Andrew Tridgell a44b0e0011 AP_Motors: don't setup oneshot for a zero output mask 2016-05-26 12:18:49 +10:00
Fredrik Hedberg 75d5c87788 AP_Motors: Fix setpoint bug with 0~1 conversion in AP_MotorsHeli 2016-05-25 09:27:40 +09:00
Randy Mackay 8d1f50e78f AP_Motors: rename get_pwm_min to get_pwm_output_min 2016-05-24 10:00:25 +09:00
Randy Mackay 0c225cf498 AP_MotorsMulticopter: fix typo in comments 2016-05-24 10:00:25 +09:00
Randy Mackay ff93524ba4 AP_Motors: rename MOT_THST_MAX to MOT_SPIN_MAX
Also renamed:
MOT_THST_BAT_MIN,MAX to MOT_BAT_VOLT_MIN,MAX
MOT_CURR_MAX to MOT_BAT_CURR_MAX
2016-05-24 10:00:25 +09:00
Randy Mackay f1cbdbe914 AP_Motors: update some comments 2016-05-24 10:00:25 +09:00
Randy Mackay 49b14b3cb6 AP_Motors: add PWM_MIN, MAX
These parameters allow the motor PWM output range to be different from receiver's throttle input range
Also renamed throttle_pass_through to set_throttle_passthrough_for_esc_calibration and change the method's input to the 0 to 1 range instead of direct PWM value
2016-05-24 10:00:25 +09:00
Ricardo de Almeida Gonzaga 2802775e7d AP_Motors: Fix typos 2016-05-13 19:20:06 -03:00
Andrew Tridgell 60b3625950 AP_Motors: added hook for vehicle based thrust compensation
allow vehicle code to compensate for thrust effectiveness changes due
to properties outside the scope of AP_Motors. This allows for
compensation in tiltrotors and tiltwings.
2016-05-11 05:55:23 +10:00
Andrew Tridgell 37d6b5fdaf AP_Motors: added output_motor_mask()
this will be used for tiltrotors in forward flight
2016-05-11 05:55:23 +10:00
dgrat 41661f815f AP_Math: Replace the pythagorous* functions with a variadic template
The new function can deal with a variable number of function parameters.
Additionally, I renamed the functions to norm(), because this is the
standard name used in several other projects.
2016-05-10 11:41:26 -03:00
skyscraper de5130fa13 AP_Motors: RC_Channel refactor
More fixing up of RC_Channel change access to
data members to functions
2016-05-10 16:21:16 +10:00
skyscraper daec4ea10e AP_Motors: Fix up after RC_Channels refactor
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:15 +10:00
Randy Mackay e41f798ba1 AP_Motors: remove unused set_stabilizing 2016-05-07 10:08:36 +09:00
Andrew Tridgell ff96085bd3 AP_Motors: allow arbitrary motor mapping with tricopters 2016-04-28 22:36:41 +10:00
Randy Mackay 7af9892bd1 AP_MotorsMatrix: make const a float
resolves compiler warning
2016-04-23 23:06:25 -07:00
Randy Mackay 72a7f674ec AP_Motors: protect against out-of-bounds memory access
resolves a compiler warning
2016-04-23 21:06:18 +10:00
Andrew Tridgell fd7c87e629 AP_Motors: allow enabling oneshot on a subset of motors 2016-04-22 13:24:04 +10:00
Andrew Tridgell f2c63e24c5 AP_Motors: allow tricopter motor 7 to be moved to any output 2016-04-22 08:32:03 +10:00
Andrew Tridgell 6df4d11d3f AP_Motors: ensure OneShot125 is within 125 to 250usec 2016-04-16 18:52:12 +10:00
Andrew Tridgell fe2065cd72 AP_Motors: rename MOT_PWM_MODE to MOT_PWM_TYPE
Randy prefers TYPE
2016-04-14 08:05:07 +10:00
Andrew Tridgell f54bcc6c7f AP_Motors: added oneshot support via MOT_PWM_MODE
MOT_PWM_MODE=0 is normal
MOT_PWM_MODE=1 is oneshot
MOT_PWM_MODE=2 is oneshot125
2016-04-14 08:05:05 +10:00
Randy Mackay 8d77bdec15 AP_MotorsMulti: minor comment fix 2016-04-14 05:45:24 +09:00
Randy Mackay f6eabfdab2 AP_MotorsMulticopter: formatting fixes 2016-04-01 11:59:30 +09:00
Randy Mackay 6807b961e2 AP_MotorsMulticopter: protect against div-by-zero if MOT_SPIN_ARMED is zero 2016-04-01 11:59:30 +09:00
Randy Mackay b39798ad90 AP_Motors: remove unused DESIRED_SPIN_MIN_THROTTLE 2016-04-01 11:59:30 +09:00
Randy Mackay dc86e1472c AP_MotorsTri: protect against div-by-zero if MOT_YAW_SV_ANGLE param was set to 90 2016-04-01 11:59:30 +09:00
Randy Mackay 9b5b6f3779 AP_MotorsHeli: constrain filtered throttle
This is required because we have removed the constraint on the throttle input.  This also insures that there is no lag caused by the filtered throttle straying far outside the 0 to 1 range
2016-04-01 11:59:30 +09:00
Randy Mackay b4a61e6ccf AP_Motors: remove constrain on throttle input
This constraint is redundant because we already constrain the filtered throttle
2016-04-01 11:59:30 +09:00
Leonard Hall fce426409e AP_MotorsTri: fix stab patch 2016-04-01 11:59:30 +09:00
Randy Mackay 49562c5ca3 AP_MotorsMulticopter: reduce num bits used for spool-up-down-mode 2016-04-01 11:59:30 +09:00
Randy Mackay 3ee88fd8c7 AP_MotorsCoax: remove output_min
This is now implemented by parent AP_MotorsMulticopter
2016-04-01 11:59:30 +09:00
Randy Mackay 8566a61660 AP_MotorsSingle: remove output_min
This is now implemented by parent AP_MotorsMulticopter
2016-04-01 11:59:30 +09:00
Randy Mackay 8621774040 AP_MotorsTri: remove output_min
This is now implemented by parent AP_MotorsMulticopter
2016-04-01 11:59:30 +09:00
Randy Mackay f4d94806e5 AP_MotorsMatrix: remove output_min
This is now implemented by parent AP_MotorsMulticopter
2016-04-01 11:59:30 +09:00
Randy Mackay b4b33db79b AP_MotorsMulticopter: promote output_min from Matrix class 2016-04-01 11:59:30 +09:00
Randy Mackay 2e8acf1f74 AP_MotorsHeli: calculate_scalars made protected
No functional change
2016-04-01 11:59:30 +09:00
Randy Mackay bc1b8f415a AP_Motors: example sketch output limit flags 2016-04-01 11:59:30 +09:00
Randy Mackay c9055ccdb1 AP_Motors: example sketch tests Single and Coax 2016-04-01 11:59:30 +09:00
Randy Mackay 41c55ffbe7 AP_MotorsTri: use YAW_SV_REV to reverse yaw output 2016-04-01 11:59:30 +09:00
Leonard Hall 13d727c2c6 AP_MotorsTri: add YAW_SV_ANGLE parameter to capture yaw servo lean angle max 2016-04-01 11:59:30 +09:00
Randy Mackay c939cc1551 AP_MotorsTri: clarify YAW_SV parameter descriptions and comments 2016-04-01 11:59:30 +09:00
Leonard Hall 267513d864 AP_MotorsTri: fixes to output_armed_stabilizing
Also minor comment fixes
2016-04-01 11:59:30 +09:00
Leonard Hall 250a444e57 AP_MotorsCoax: fixes to stab patch
Fix throttle_lower flag
Also some formatting changes
2016-04-01 11:59:30 +09:00
Randy Mackay 20565580ed AP_MotorsCoax: remove disabling of output ch7 2016-04-01 11:59:30 +09:00
Randy Mackay 63fefae7cf AP_MotorsCoax: use calc_pwm_output_1ot1 instead of local calc_pivot_radio_output 2016-04-01 11:59:30 +09:00
Leonard Hall 840e60c930 AP_MotorsSingle: fixes to stab patch
Fixes throttle_lower flag
Also some formatting changes
2016-04-01 11:59:30 +09:00
Randy Mackay af9b18329c AP_MotorsSingle: use calc_pwm_output_1to1 instead of local calc_pivot_radio_output 2016-04-01 11:59:30 +09:00
Randy Mackay c4b88aafef AP_MotorsHeli: swash and tail servo objects moved into class 2016-04-01 11:59:30 +09:00
Randy Mackay 4f1e62d551 AP_MotorsHeli: remove reset_radio_passthrough 2016-04-01 11:59:30 +09:00
Randy Mackay b5593431bf AP_MotorsHeli_Single: replace collective_mid_pwm with collective_mid_pct 2016-04-01 11:59:30 +09:00
Randy Mackay 9790245bf1 AP_MotorsHeli: replace collective_mid_pwm with collective_mid_pct 2016-04-01 11:59:30 +09:00
Randy Mackay a39bbc5421 AP_MotorsHeli: servo_test in range -1 to 1 2016-04-01 11:59:30 +09:00
Randy Mackay a42706bdcc AP_Motors: remove unused example sketch to test timing
This test was only important on the slower AVR boards
2016-04-01 11:59:30 +09:00
Randy Mackay a3450b712c AP_Motors: fix example sketch 2016-04-01 11:59:30 +09:00
Leonard Hall 753b72b28c AP_MotorsY6: call normalise_rpy_factors in motor setup 2016-04-01 11:59:30 +09:00
Leonard Hall 13ab3ecfea AP_MotorsQuad: call normalise_rpy_factors in motor setup 2016-04-01 11:59:30 +09:00
Leonard Hall 7ac4fc5569 AP_MotorsOctaQuad: call normalise_rpy_factors in motor setup 2016-04-01 11:59:30 +09:00
Leonard Hall e182c10625 AP_MotorsOcta: call noramlise_rpy_factors in motor setup 2016-04-01 11:59:30 +09:00
Leonard Hall 733b89cf3c AP_MotorsHexa: call noramlise_rpy_factors in motor setup 2016-04-01 11:59:30 +09:00
Leonard Hall 8f8eb7e214 AP_MotorsMatrix: add normalise_rpy_factors 2016-04-01 11:59:30 +09:00
Randy Mackay e7ba5ae451 AP_MotorsMulticopter: fix get_hover_throttle_as_high_end_pct 2016-04-01 11:59:30 +09:00
Randy Mackay 4514e8d100 AP_MotorsHeli: remove slow_start 2016-04-01 11:59:30 +09:00
Randy Mackay c41a5dc3bd AP_MotorsMulticopter: remove slow_start
This has been replaced with the spool logic feature
2016-04-01 11:59:30 +09:00
Randy Mackay b436dde60c AP_Motors: remove slow_start
This has been replaced with the spool logic feature
2016-04-01 11:59:30 +09:00
Randy Mackay e863f0b9c0 AP_MotorsHeli: use AP_Motors set_radio_passthrough in 0 to 1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 68a6408a23 AP_MotorsMulticopter: remove set_radio_passthrough
This has been moved up to the AP_Motors class
2016-04-01 11:59:30 +09:00
Randy Mackay 5ba3a6c536 AP_Motors: add set_radio_passthrough 2016-04-01 11:59:30 +09:00
Randy Mackay fe4733121d AP_MotorsHeli_Single: ext_gyro_gain in 0 to 1 range 2016-04-01 11:59:30 +09:00
Randy Mackay e1e4e37c92 AP_MotorsHeli_Single: use RSC class's get_idle_output function
No functional change
2016-04-01 11:59:30 +09:00
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