Skip to content
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

New pwm subsystem supporting centralized pwm resource coordination #3

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

rolandash
Copy link
Collaborator

New features introduces by this new pwm subsystem:

  1. Real support of 8 main + 8 aux channels on a single FMU chip.
  2. Global pwm resource manifest and allocation through board's timer_config.c.
  3. Centralized pwm resource (timers/channels) management and coordination.
  4. New model for all pwm devices. Added abstraction layer of PWM groups. Each pwm device is one or more groups, other than previous pwm port based operations. FMU is one type of PWM devices.
  5. Runtime, flexible pwm channels allocation thus pwm devices can use arbitrary idle channels, rather than hard coded on fixed channels.
  6. Unified MindPX and new MindRacer hardware into one firmware target.
    MindPX: 8 Main + 8 AUX
    New MindRacer: 8 Main + 5 AUX

@rolandash
Copy link
Collaborator Author

rolandash commented Sep 17, 2018

New PWM subsystem design

new_pwm_design
)

@rolandash
Copy link
Collaborator Author

rolandash commented Sep 17, 2018

PwmGroups base class
PwmGroups is the base class for all pwm devices in the system, derived from CDev.
PwmGroups maintains the global map of all allocated pwm timers and channels, and detects conflicts between different pwm device usage.

Static PWM devices
Derived from PwmGroups.
FMU, ECU, fixed rgb pwm led, are all static pwm devices. These devices have fixed hardware pwm pins wiring, and timers/channels needed are predefined in board config file, and can not be changed during run time.

Floating PWM devices
Derived from PwmGroups.
These devices can be connected to any free pwm channels to work, as their working channels can be defined during runtime, through UI (GCS).
For example, camera trigger previously were assigned to working on AUX channels. In this new pwm subsystem, camera trigger is a floating pwm device. It can also be connected to free Main channels, as long as pwm rate matching.
This flexibility improves the efficiency of pwm channel usage greatly, as on some airframes when aux channels are occupied, then if still free channels on Main available then camera trigger can still be used.

PWM heaters, or external PWM LEDs, can all be driven as floating type devices like this way.

ECU (Engine Control Unit)
ECU is a component newly introduced, to resolve the problem that support both Main and AUX channels simultaneously in a single flight control chip. The concept of ECU is bit different from FMU(traditionally), as ECU has no intention to manage like RC inputs or safety button, but rather a simple direct PWM channel drive component.
When ECU is presented and enabled, it will drive Main channels, and left AUX channels handled by FMU.

@rolandash
Copy link
Collaborator Author

rolandash commented Sep 17, 2018

The document in this PR is a resort of the content in previous PR #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant