added ChannelConfig message for configuration of multi-actuator setups - #80
added ChannelConfig message for configuration of multi-actuator setups#80alexcekay wants to merge 1 commit into
Conversation
|
This is great, definitely needed. Can you provided a concrete example? We'd want to make sure this lands in AM32 at the same time. |
|
@dakejahl for sure. SetupA concrete example for a large fixed-wing with a couple of meters wing-span. Node configurationThe user needs to assign an actuator ID to each PX4 CAN Node. This can be done via a parameter or for example HW switches. As an example:
In addition the user has to set a parameter that states that this CAN Node should listen to Flight-controller configurationOn the flight-controller each output function can be assigned a
LogicThe flight-controller uses its parameters to build the correct
In this case the message is: The PX4 Nodes can use this information to see which Mapping two different functions to exactly the same |
a44e063 to
8411852
Compare
|
Dosn't this just move the conplexity from the nodes on to the main flight controller? Is that exactly the oposite of what we should be trying to do? Why not just change the param on the node? Its is posible that the PX4 actuator config makes this more apealing. I dont think it would add anything for AP. |
|
basically yes, this is mostly a configuration topic. In complex systems with a lot of nodes that are produced in mass it's easier to have the configuration centralized. With this and HW DIP switches on the nodes to set the actuator ID one can have an assembly line that does not require to ever connect to one of the nodes and change its configuration. If later the config should be changed it's only required to map differently on the flight controller. Connecting to the nodes individually to change params does not allow producing systems in a quick and easy to repeat manner for non-technical users. The way presented here is repeatable and easy to use, thus avoids an error-prone manual process. Setting params from the flight-controller is also hard as it requires knowing the NodeID and probing for the correct actuator ID to set the correct indexes a node should listen to. For smaller/hobby users or other projects it's of course possible to simply not use/implement this message. |
|
In production settings why not just bake the config into the firmware so you flash once and are done? Again, its possible that this is easy in AP but not in PX4. |
|
Hi @tridge, @peterbarker would also love to hear your opinion regarding this topic. |
Certainly I think such a generic message should be evaluated for adding into a common namespace rather than into a new one. I don't think moving between namespaces is a thing in DroneCAN-land. I'll have a think |
Hang on, back up. That seems pretty dire. Mr Hall was assuming that this would be a simple parameter-set (done via DroneCAN), not an entirely different different SKU requirement! If I'm thinking right then end to-end on ArduPilot:
I think what this message proposal would do would add a message that AP_Periph could use to set the So a few issues:
|
|
Hi @peterbarker, thanks for the feedback.
To clarify: that line was in answer to the suggestion of baking config into firmware at build time, not a description of the current proposal.
Yes exactly, it allows centrally setting which node handles which actuator on which of its outputs.
This is true, to clarify: when changing params on the node (in ArduPilot's case AP_Periph) you can already get exactly what you'd gain from this message. But that's exactly the piece The actual pain point is for systems at scale, we're talking about thousands of drones produced per day. It's a one-time setup, but done thousands of times, and that causes hours of work that can be completely avoided. For a lot of other params you can set the same value to every node, that's not the problem here. The problem is specifically that different nodes need different values depending on their physical position. The proposal here sidesteps that by being broadcast. Every node sees it, and matches against an actuator_id it already knows about itself (e.g. via a HW DIP switch or another out-of-band method). It's a config-distribution mechanism, not a new remap mechanism. The message is of course not needed when someone builds a couple of drones, the existing systems are enough for that. This message is entirely optional.
Agreed, I'll add this to the message description. The persistence lives on the flight controller. The way I currently have it implemented in a PX4 branch:
|
|
I still think this is madness. It would require a actuator ID and actuator channel to be configured on the flight controller. For ArduPilot this would be 64 new parameters. There are several other ways to streamline complex configurations.
|
Here are the measurements from the reference implementation I created for PX4: The entire feature (not just params) costs 0.12% of FLASH on a standard F7/H7 flight controller. In PX4 its 30 params rather than 64, but even in this case the param part is mostly: So even if you double this it's still marginal FLASH usage. The cost for persistence is of course way lower as this param FLASH cost contains all the metadata and so on. The persistence cost (actual stored param values) is a fraction of that since the FLASH diff above includes parameter metadata and the default value table including strings, which is not needed for the actual persistence. The params also integrate directly into QGC's actuator configuration tab as shown in a screenshot above. Users can see and change the full mapping in one place, no need to work with raw parameter values. Regarding your points:
This requires different firmware builds per physical position, we discussed this above in detail.
This means the integrator now needs to own a fork of the node firmware (assuming the node he wants to use even is open-source).
|
Its not the flash cost of the parameters I care about. Its the parameters themselves, it is more parameters to download every time you connect to the vehicle. Its more parameters to track and manage through configuration and updates. I don't think the custom firmware or python script is really a genuine issue, one would hope that the companies making thousands of vehicles per day would be able to manage a small script. You could even make the python script look exactly like the QGC interface you propose (or get it into QGC directly). Just is would have to reach in and set parameters on the nodes not on the flight controller.
This approach relies on using dynamic node allocation. That means when the vehicle has a node reporting that it is unhealthy you have no idea where on the vehicle it is to replace it. You would have search through all the nodes manualy. I just don't think this config message is actually solving a genuine problem. It doesn't add anything that a GCS or config script can't already do. |
6764c13 to
853b56f
Compare
|
I think both sides made enough arguments in this thread to see the direction this is heading. Let's be honest we have very different perspectives on the problem space this message addresses and could continue discussing here indefinitely and would not reach a common understanding. For me it looks like you guys don't face this kind of problem with similar constrains so there is no need for you to have it solved. This leads to different trade-offs being chosen, which in your case end up with preferring to not implement anything new. For us it's an easy choice: 30 (or 64) params don't matter at all when on most systems more than 1000 are already downloaded. It gets you a transparent centrally managed system that solves all of the discussed problems with a simple DSDL message and minimal code changes in PX4. The use cases and design rationale are documented in this PR and anyone is free to evaluate. For anyone interested I can provide the reference implementation in PX4 for the FC and the Node it's small and we use it on our systems already. I think all of the participants who until now voiced their opinions in this PR will not be able to agree on basically anything regarding this PR. Thus we'll just continue using this in our vendor namespace, I'll leave this PR open for others who face similar problems in the future. |

Context
This started off as a specific feature needed by our company but I think others could also benefit from it.
The current
ArrayCommandsetup works great for simple setups or in case one can assign individual actuator IDs to each servo. It already gets harder to use when one has a general CAN to PWM board with multiple output channels in which case a mapping on each node is needed.In bigger setups that are produced at scale all of this does not scale well as changing the setup requires connecting to individual servos or individual CAN to PWM boards. To deploy such setups it is easier to set up all nodes once and only change the configuration on the flight controller.
Solution
A new message
ChannelConfigis introduced which originates from the flight controller and is received by servos / CAN to PWM boards. In it, the flight controller can specify which actuator (using its ID) should handle a Command on which of its channels. All of it is 0-based. For example when ArrayCommand contains two commands, it could specify that actuator 0 should handle Command 0 on its channel 0 and actuator 1 should handle Command 1 on its channel 3.This scales well to more complex setups where one has CAN to PWM boards in each wing and tail of a larger fixed-wing. After assigning actuator IDs to each of the nodes, one can dynamically change which node handles what on which channel.
Compatibility
This message is optional. If the flight controller does not send it or an actuator does not react to it, the current behavior stays unchanged. The idea is that the nodes have a parameter that controls whether they react to this message and only process it when enabled. When enabled, they have to wait for one
ChannelConfigbefore processingArrayCommand. The frequency ofChannelConfigcan be very low as it should not change frequently (or at all) after startup.