Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

mixing: expand on mixing and output group #856

Merged
merged 4 commits into from
Aug 23, 2019

Conversation

hamishwillee
Copy link
Collaborator

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)

@hamishwillee hamishwillee requested a review from bkueng August 22, 2019 03:21
> **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.
Copy link
Collaborator Author

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?

Copy link
Member

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.

Copy link
Collaborator Author

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"

Copy link
Member

@bkueng bkueng left a 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.

en/concept/mixing.md Outdated Show resolved Hide resolved
en/concept/mixing.md Outdated Show resolved Hide resolved
en/concept/mixing.md Outdated Show resolved Hide resolved
> **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.
Copy link
Member

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.

@hamishwillee
Copy link
Collaborator Author

hamishwillee commented Aug 23, 2019

Another mystery solved.

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.

@bkueng bkueng merged commit 2ed62e0 into master Aug 23, 2019
@bkueng bkueng deleted the hamishwillee_mixing_output_group branch August 23, 2019 07:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants