Commit Graph

118 Commits

Author SHA1 Message Date
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
Ricardo de Almeida Gonzaga 2802775e7d AP_Motors: Fix typos 2016-05-13 19:20:06 -03: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 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 4f1e62d551 AP_MotorsHeli: remove reset_radio_passthrough 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 e863f0b9c0 AP_MotorsHeli: use AP_Motors set_radio_passthrough in 0 to 1 range 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 a18722a2fc AP_MotorsHeli: output_min uses new move_actuators 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 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
Andrew Tridgell 1b682e3c8f AP_Motors: swash servos are output only 2016-01-05 06:41:51 +11: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
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
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 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
Andrew Tridgell f22a1d3e6d AP_Motors: display message in heli parameter_check() 2015-09-25 12:30:34 +10:00
Randy Mackay e3ff4ed9c4 MotorsHeli: integrate RotorControlState 2015-08-31 11:43:59 +09:00
Robert Lefebvre bde43412d8 AP_MotorsHeli: Fix RSC Mode 3 2015-08-31 11:43:55 +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 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 214d60abb9 AP_MotorsHeli: Create RSC_IDLE param 2015-08-31 11:27:41 +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
Fredrik Hedberg e6119cf51f AP_Motors: Fix param indices in AP_MotorsHeli. 2015-08-31 11:27:36 +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
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
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 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
Robert Lefebvre 11214b3414 AP_Motors: move constraints to set_throttle 2015-06-22 13:52:59 +09:00