ArduPilot / ArduPilot/ardupilot
Move Heli Quad from Heli Build to MultiRotor Build?
- Dominant language
- C++
- Stars
- 15.9k
- Forks
- 21.4k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 119
Description
Starting this conversation as an Issue, in an attempt to capture the history behind the decision.
Currently been working on AP_MotorsHeli rework (see here: #23691). During this work the question has come up: Do we keep Heli-quad in the heli build or do we move it to the multirotor build.
It is an area of the code that has become stale/not commonly used. For example, the most prominent use case that we are aware of is a large heli-quad style aircraft (central drive with collective for thrust torque control), but this is running the multi-rotor code not the heli code.
The multi-rotor code has far better motor mixing and output saturation handling than heli-quad currently does. Given that the physics of most heli-quads will fly very similarly to fixed pitch multi-rotor’s it seems appropriate to actually bring heli-quad style setups into the multi-rotor builds. It should mostly mean a change to the wiki to help users to setup. For example using MOT_PWM_MIN _MAX range may not be appropriate any more as users will want access to SERVO*_MIN _MAX on each corner to set the correct blade angles.
Basically we have two ways of setting up a heli-quad in ArduPilot and neither have the full suite of options available to them. We basically have two options:
**1) Bring Heli-Quad under the multi-rotor build:**
_To make this fully featured, this would require:_
- Exposing the rotor speed control (governer) to the multi-rotor build.
- Updating the wiki with new guidance on how to setup
_Advantages of doing this:_
- Heli-quad takes advantage of all of the control saturation and motor mixing of the multi-rotor build.
- Reduction of code base with the multi-rotor code getting far more use, it is easier to maintain that one code path without it going stale.
_Disadvantages of doing this:_
- This is essentially a breaking change for current users of heli-quad with the heli-build. There is a reasonable chance that all of the attitude/rate gains are still valid, so we may be able to handle this case with conversion (if it is needed at all!). Some experimenting required here.
**2) Keep Heli-Quad under the heli build:**
_To make this fully featured, this would require:_
- Bringing across all of the motor-mixer and saturation handling from multi-rotor to heli
_Advantages of doing this:_
- The swashplate setup method remains the same.
- It will definately not be a breaking change.
_Disadvantages of doing this:_
- Have not implimented yet but I am concerned that either we have a lot of code duplication to bring across the motor mixing etc to heli-quad or it may make the motors code somewhat convoluted as we may need to start peppering if build == heli throughout (not sure, just a feeling)
- Harder to maintain, due to its rare useage.
Personal opinion: I would like to bring heli-quad into the multi-rotor build. Suffer any breaking changes now and ultimately get an easier to maintain block of code.
Contributor guide
Assessment
This issue has not been assessed yet.