Skip to content

Commit

Permalink
AP_Motors: Support for Assisted Autorotation
Browse files Browse the repository at this point in the history
retrieve collective hover setting
get governor rpm setpoint
  • Loading branch information
Ferruccio1984 authored and bnsgeyer committed Dec 23, 2023
1 parent 36aaa23 commit 45e9b61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libraries/AP_Motors/AP_MotorsHeli.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class AP_MotorsHeli : public AP_Motors {
// get_rsc_setpoint - gets contents of _rsc_setpoint parameter (0~1)
float get_rsc_setpoint() const { return _main_rotor._rsc_setpoint.get() * 0.01f; }

//return governor rpm setpoint
float get_rpm_setpoint() const {return _main_rotor.get_governor_setpoint();}

// arot_man_enabled - gets contents of manual_autorotation_enabled parameter
bool arot_man_enabled() const { return (_main_rotor._rsc_arot_man_enable.get() == 1) ? true : false; }

Expand Down Expand Up @@ -145,6 +148,13 @@ class AP_MotorsHeli : public AP_Motors {
//return zero lift collective position
float get_coll_mid() const { return _collective_zero_thrust_pct; }

//return collective hover
float get_coll_hover() const { return _collective_hover; }

float get_coll_max_pitch() const { return _collective_max_deg;}

float get_coll_min_pitch() const { return _collective_min_deg;}

// enum for heli optional features
enum class HeliOption {
USE_LEAKY_I = (1<<0), // 1
Expand Down Expand Up @@ -275,6 +285,7 @@ class AP_MotorsHeli : public AP_Motors {
// internal variables
float _collective_zero_thrust_pct; // collective zero thrutst parameter value converted to 0 ~ 1 range
float _collective_land_min_pct; // collective land min parameter value converted to 0 ~ 1 range
float _collective_hover_rad;
uint8_t _servo_test_cycle_counter = 0; // number of test cycles left to run after bootup

motor_frame_type _frame_type;
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_Motors/AP_MotorsHeli_RSC.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class AP_MotorsHeli_RSC {
// functions for autothrottle, throttle curve, governor, idle speed, output to servo
void set_governor_output(float governor_output) {_governor_output = governor_output; }
float get_governor_output() const { return _governor_output; }
float get_governor_setpoint() const { return _governor_rpm; }
void governor_reset();
float get_control_output() const { return _control_output; }
void set_idle_output(float idle_output) { _idle_output.set(idle_output); }
Expand Down

0 comments on commit 45e9b61

Please sign in to comment.