-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] control_allocator: Actuator Effectiveness with generalized configuration parameters (combined MC, VTOL, simple fixed wing support, custom torque, etc) #18558
Conversation
a791474
to
7e224d6
Compare
This looks good. For the metadata & UI to work, I see 2 things:
It could look like this:
|
Thanks @bkueng, the first quick thing I wanted to align on was parameter naming to try and minimize the number of generated parameters. Things like position and even axis will be reusable in other places, any objection to updating AcutatorEffectivenessMulticopter to use the same parameters?
|
I don't see any problem, as long as we don't use the same params for different actuator types in a single mixer config (the param indexing would not work that way). Let me bring my current WIP upstream so we can better coordinate and reduce the amount of conflicts: #18563 |
Sounds good to me. |
No it's just a dumb split, and that's why manually entering the per axis torque is also an option. This is simply intended as a crutch to get us off the old mixers, and didn't seem any worse than most of the current elevon and v-tail usage I've seen. If/when these actuator functions need more parameterized configuration we'll probably need a slightly different approach to prevent a parameter explosion (every possible option for every possible actuator). |
101: Elevator | ||
102: Rudder | ||
103: Throttle | ||
104: Elevon (+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe left and right elevon would be better?
Here's a slight variation that just occurred to me. Instead of the overly simplistic actuator functions being a scale factor, what if they were more like training wheels for editing the effectiveness directly? Selecting a particular function could unlock of appropriate torque parameters and enforce conservative constraints to keep it sane. Examples
Perhaps later we could have a control allocation parameter for something like normalized or unit mode. This way we'd preserve more context for interactive and semi automated preflight checks. Users would adjust the direction of the physical output (PWM, UAVCAN, etc), rather than the potential double negative. Semi-automated preflight check routine
|
I like it because it involves fewer parameters and also helps more advanced users. |
Just for my understanding. Regarding non-linear deflections of servos for fixed wing I like to add. |
At the moment I'm talking about implementing/enforcing it within PX4, but ultimately the GUI will need to be in sync some how. I'm imagining the full table of actuators and torque (roll/pitch/yaw), if "Right aileron" was selected for one of the actuators then the pitch and yaw cells would either be grayed out or forced to zero or something. You would also only be allowed to set the roll torque magnitude in the right direction. Ideally the GUI could directly enforce these constraints, and internally PX4 would enforce it as a backup (or editing airframes directly). Shorter term the GUI allowing you to set a cell, then PX4 immediately updating it (zero or constrained) might also be good enough as a start.
I was wondering about that, but ultimately for the default or generic airframes we carry I think it's much more accessible or self explanatory as the rotor geometry. I actually considered doing both, but it seemed a bit wasteful. The base ActuatorEffectiveness is nothing more than the full torque and thrust parameters per actuator, then there are specializations like multirotor or right aileron that help you generate those entries. All that is to say, I don't know what the best overall solution is, but I'm flexible and committed to finding something that's workable for both the GUI and standalone airframe parameters. |
In this particular context it's about capturing the high level function from an actuator effectiveness perspective. Ailerons are split left and right because the roll torque is opposite. In the split elevator case a separate left and right elevator would be the same, but split elevons would be different. Note you can add multiple actuators that are the same "function". If one of those actuators dies it can be removed from the effectiveness matrix, the mix would be recomputed (pseduo inverse), and the new mix would account for using only the remaining actuator. We'll need to come back to this later to think about the case of redundant actuators on the same control surface vs split control surfaces.
If this is primarily for implementing "expo" for the pilot then it should be handled on the input side (PX4 manual control setpoint in different modes). Somewhat related for ESCs we currently have an optional thrust curve parameter (THR_MDL_FAC) to linearize. This idea can be expanded for other outputs if needed. It sounds like we might want to expand that concept not just for ESCs (handling it differently for different motors), but also control surfaces. |
The effect of progessive function like expo and "degressive" function depend mainly on the characteristic of the airplane. therefor I vote it is best to put it at the end (just in front to the actuator). |
Thanks @jstrebel, we can definitely add that. If you have any specific details please start capturing them in a new issue. We can think about how to parameterize the adjustment per physical output. I also wonder if it might be interesting to be able to optionally carry a full calibration for a control surface so you know the deflection angle? |
This would be most useful for the Flaps. But makes als sense for the elevon and ailerons. |
Elevon (aka taileron) is combined roll + pitch mixing like on a flying wing. |
We might as well throw canards on the list while we're at it. |
Yes good point. Same thing as elevator, except with inverted sign. Will prevent fatal inversion during pre-flight check when the user is requested to check that the elevator/canard control surface deflects up and down. |
It comes from CA_AIRFRAME.
My intention was to put this on the control allocator, so that saturation can be handled correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've started playing around with dynamic control allocation for FW. Got it to fly in SITL without a lot of pain, I so far like the how the configuration is done (even without the nice UI).
Next up is doing the same with a standard VTOL.
|
||
case 103: { | ||
// 103: Throttle, scaled (CA_ACTn_SC) X thrust | ||
_effectiveness(4, n) = getScaleParameter(n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_effectiveness(4, n) = getScaleParameter(n); | |
_effectiveness(3, n) = getScaleParameter(n); |
|
||
float scale = 1.f; | ||
|
||
if (param_get(param_handle, &scale) != PX4_OK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intent here exactly? Shouldn't it set the scale to 0 in case of !PX4_OK, and otherwise to whatever the param resulted in?
We can close this now. Thanks everyone. |
Currently in PX4 we have a legacy output mixing system (.mix files and airframe environment variables) and a wonderful new fully configurable output configuration system tied in with the control allocator. The new system is approaching feature parity for multicopter, but we're still firmly stuck in the old legacy mixer world for FW and VTOL. This pull request is an attempt to bridge that gap, reproducing the vast majority of what people actually use with SimplerMixer.
This pull request introduces a new ActuatorEffectiveness that provides more options for how each actuator is configured. Currently includes...
Questions