mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Control allocation: make heli rpm control an optional build flag disabled by default
to save flash. The rpm capture dirver is also disabled on default releases
This commit is contained in:
parent
8ecb76aba2
commit
e01fef755a
@ -10,3 +10,10 @@ menuconfig USER_CONTROL_ALLOCATOR
|
||||
depends on BOARD_PROTECTED && MODULES_CONTROL_ALLOCATOR
|
||||
---help---
|
||||
Put control_allocator in userspace memory
|
||||
|
||||
menuconfig CONTROL_ALLOCATOR_RPM_CONTROL
|
||||
bool "Include RPM control for Helicopter rotor"
|
||||
default n
|
||||
depends on MODULES_CONTROL_ALLOCATOR
|
||||
---help---
|
||||
Add support for controlling the helicopter main rotor rpm
|
||||
|
||||
@ -135,11 +135,15 @@ void ActuatorEffectivenessHelicopter::updateSetpoint(const matrix::Vector<float,
|
||||
_saturation_flags = {};
|
||||
|
||||
const float spoolup_progress = throttleSpoolupProgress();
|
||||
float rpm_control_output = 0;
|
||||
#if CONTROL_ALLOCATOR_RPM_CONTROL
|
||||
_rpm_control.setSpoolupProgress(spoolup_progress);
|
||||
rpm_control_output = _rpm_control.getActuatorCorrection();
|
||||
#endif // CONTROL_ALLOCATOR_RPM_CONTROL
|
||||
|
||||
// throttle/collective pitch curve
|
||||
const float throttle = (math::interpolateN(-control_sp(ControlAxis::THRUST_Z),
|
||||
_geometry.throttle_curve) + _rpm_control.getActuatorCorrection()) * spoolup_progress;
|
||||
const float throttle = (math::interpolateN(-control_sp(ControlAxis::THRUST_Z), _geometry.throttle_curve)
|
||||
+ rpm_control_output) * spoolup_progress;
|
||||
const float collective_pitch = math::interpolateN(-control_sp(ControlAxis::THRUST_Z), _geometry.pitch_curve);
|
||||
|
||||
// actuator mapping
|
||||
|
||||
@ -134,5 +134,7 @@ private:
|
||||
|
||||
const ActuatorType _tail_actuator_type;
|
||||
|
||||
RpmControl _rpm_control{this};
|
||||
#if CONTROL_ALLOCATOR_RPM_CONTROL
|
||||
RpmControl _rpm_control {this};
|
||||
#endif // CONTROL_ALLOCATOR_RPM_CONTROL
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user