-
Notifications
You must be signed in to change notification settings - Fork 480
mixing: expand on mixing and output group #856
Conversation
> **Note** This approach is needed because the physical bus used for MAIN outputs is not always the same; it depends on whether or not the flight controller has an IO Board (see [PX4 Reference Flight Controller Design > Main/IO Function Breakdown](../hardware/reference_design.md#mainio-function-breakdown)) or uses UAVCAN for motor control. | ||
The startup scripts load the mixer into the appropirate driver device for the board: `/dev/pwm_output0` (IO driver) or `/dev/pwm_output1` (FMU driver), `/dev/uavcan/esc` (uavcan driver). | ||
|
||
Since there are multiple control groups (like flight controls, payload, etc.) and multiple output groups (busses), one control group can send commands to multiple output groups. |
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.
@bkueng So my inference in this paragraph and the preceding one, is that a mixer can be loaded into multiple drivers.
YOu can choose to use UAVCAN or not for motor control. My assumption is that the scripts load the mixer into both drivers. If you don't use UAVCAN the mixer code will still happily be trying to mix, but without any ESCs attached there will be no outputs for it to control - is that correct?
Also, UAVCAN have way more than 8 outputs but a mixer only defines 8, and from what I can see in the startup script, only MAIN mixer gets loaded into UAVCAN driver. So assuming a QUAD with 4 motors gets loaded, does this mean that you can only use UAVCAN for 4 more outputs? Does my question make sense?
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.
@bkueng So my inference in this paragraph and the preceding one, is that a mixer can be loaded into multiple drivers.
Yes. But this sentence also applies to the case where you define the same control group in aux and main mixer files (for example).
If you don't use UAVCAN the mixer code will still happily be trying to mix, but without any ESCs attached there will be no outputs for it to control - is that correct?
If you have UAVCAN enabled, the main mixer will not be loaded to the IO driver, so you don't have the main pins. It's probably done for simplicity, but technically it would easily be possible. Then you would have the same signal on UAVCAN as on the main pins.
Also, UAVCAN have way more than 8 outputs but a mixer only defines 8, and from what I can see in the startup script, only MAIN mixer gets loaded into UAVCAN driver
I think a mixer file can go up to 16 outputs, not quite sure. But essentially yes, either 8 or 16 is the limit.
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.
Thanks. Would be good to know which. But not sure how to capture this here, so lets see if the question ever comes up again "for real"
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.
Thanks @hamishwillee. Another mystery solved.
> **Note** This approach is needed because the physical bus used for MAIN outputs is not always the same; it depends on whether or not the flight controller has an IO Board (see [PX4 Reference Flight Controller Design > Main/IO Function Breakdown](../hardware/reference_design.md#mainio-function-breakdown)) or uses UAVCAN for motor control. | ||
The startup scripts load the mixer into the appropirate driver device for the board: `/dev/pwm_output0` (IO driver) or `/dev/pwm_output1` (FMU driver), `/dev/uavcan/esc` (uavcan driver). | ||
|
||
Since there are multiple control groups (like flight controls, payload, etc.) and multiple output groups (busses), one control group can send commands to multiple output groups. |
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.
@bkueng So my inference in this paragraph and the preceding one, is that a mixer can be loaded into multiple drivers.
Yes. But this sentence also applies to the case where you define the same control group in aux and main mixer files (for example).
If you don't use UAVCAN the mixer code will still happily be trying to mix, but without any ESCs attached there will be no outputs for it to control - is that correct?
If you have UAVCAN enabled, the main mixer will not be loaded to the IO driver, so you don't have the main pins. It's probably done for simplicity, but technically it would easily be possible. Then you would have the same signal on UAVCAN as on the main pins.
Also, UAVCAN have way more than 8 outputs but a mixer only defines 8, and from what I can see in the startup script, only MAIN mixer gets loaded into UAVCAN driver
I think a mixer file can go up to 16 outputs, not quite sure. But essentially yes, either 8 or 16 is the limit.
Co-Authored-By: Beat Küng <[email protected]>
Co-Authored-By: Beat Küng <[email protected]>
A lot of effort, for possibly a small set of interested users. However it does satisfy me to know how this works :-) I reworded slightly to capture the mapping of device abstraction through device driver. Can you give it a quick recheck ... feel free to merge if it seems OK. |
This better explains how output groups are mapped to physical bus, and hence how the magic of "MAIN" and "AUX" going to different physical but on different Pixhawk boards works. IT follows on from discussion here: #852 (comment)