ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Compound excitation DC machines and examples

Open m-kormann opened this issue 2 years ago • 10 comments

Component models to implement compound excitation already existed and just had to be combined in the right way.

To allow modeling of a self-exciting DC generator, additionally I introduced saturation in the AirGapDC model.

It has to be discussed if the stray induction also needs a saturation model.

Summary by CodeRabbit

  • New Features
    • Introduced simulation models for compound excited DC machines that integrate both electrical and thermal dynamics.
    • Added a quasi‐static variant for scenarios where fast electrical transients are not required.
    • Provided an example generator setup to demonstrate compound excitation in power generation.
    • Enhanced configuration options with a new parameter record for streamlined machine customization.

m-kormann avatar Mar 31 '23 12:03 m-kormann

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 31 '23 12:03 CLAassistant

I dislike the idea of introducing special effects (like saturation) into these models. If we do so, we should introduce saturation, deep bar effect, .... what else? in all machine models. To be honest, I don't have enough time neither to implement that nor to review that all. And remember, you'll have to provide at least one meaningful test case (that tries to detect all flaws ;-) We expect users that need such features to copy the corresponding models out of the MSL and adapt them to their needs.

AHaumer avatar Apr 27 '23 16:04 AHaumer

I dislike the idea of introducing special effects (like saturation) into these models. If we do so, we should introduce saturation, deep bar effect, .... what else? in all machine models. To be honest, I don't have enough time neither to implement that nor to review that all. And remember, you'll have to provide at least one meaningful test case (that tries to detect all flaws ;-) We expect users that need such features to copy the corresponding models out of the MSL and adapt them to their needs.

I can understand the dislike of special effects in such models; and instead of adding more special effects in an existing it would to me make more sense to demonstrate how such effects can be added in example-models (either by adding separate components in the example, or by having more advanced models with those effects (ideally built by composition of existing components, and possibly some new ones, since that would also indicate that the existing models can be re-used).

Some reasons are that:

  • For understanding and education it helps to have a simple model without anything extra. (Tools can of course remove unnecessary equations when presenting it, but it is still a hurdle.)
  • In some uses (like HILS) the extra equations may cause unnecessary problems.

HansOlsson avatar Apr 28 '23 05:04 HansOlsson

Saturation was implemented to showcase the benefit of a compound-excited machine: Self-Excitation up to nominal voltage and keeping it constant under load. I was impressed myself that adding one simple effect such a behaviour can be modeled. But I agree with you. Once you start introducing a simple effect, where to stop going into details?

Basically saturation was just introduced by modifying the airgap model. So I will remove the saturation part from the MSL MR and adapt the example to work without self-excitation. Then a user could still implement saturation by replacing the airgap model.

m-kormann avatar Apr 28 '23 07:04 m-kormann

@m-kormann to be honest, I understand your intention and the application. You see I've prepared the possibility of having a compound machine but I didn't have the time to implement it. DC machines have lost siginificance the past decades, but they're useful for education. So I'd suggest two possibilities:

  1. Implement saturation in a 100% backwards compatible way and provide several additional example utilizing that, e.g. self-excitation of a parallel excited generator and self-excitation of a series excited machine for braking. Might be a lot of work and should be extended to quasi-static DC-machines.
  2. Implement the compound machine (transient and quasi-static). Implement an example using that machine. If desired, implement saturated air-gap in Examples.Utilities.

AHaumer avatar Apr 28 '23 15:04 AHaumer

@AHaumer Yes, DC machines have lost significance, but also in my opinion they are of high value for educational reasons. Using a compound DC machine as excitation machine I managed to model a synchronous generator keeping the output voltage nearly constant for different loads without the need of any controller.

So let's divide this topic into three parts and only implement the first one in this MR:

  1. Implement the compound machine transient and quasi-static
  2. Implement a saturated air-gap in Examples.Utilities
  3. Implement saturation for all other DC machines for different applications

The quasi-static machine already was implemented and now I added it to the example.

m-kormann avatar May 09 '23 13:05 m-kormann

I made some attempts to model DC machiens with saturation some time ago, see Magnetic_DCMachines.

@m-kormann So one additional option still ist to create a separate public library with saturation models. On my opinion, there is no need to have saturation models in the MSL. Considering this option, you are very free to implement as many options as you like.

christiankral avatar May 10 '23 14:05 christiankral

@christiankral This is a very good hint! I also had the thought to implement DC machines within Modelica.Magnetic.FundamentalWave, which I see you already have done. When I find time, I will implement the Compound Excited machine in your library.

Still I think the unsaturated Compound DC machine should go to MSL because half the path was already gone before.

m-kormann avatar May 11 '23 13:05 m-kormann

@m-kormann please send me a personal mail. I'd like to exhange ideas privately: https://www.oth-regensburg.de/personen/detailansicht/anton-haa-haumer Additionally I have a small library with specical machine implementations (including saturaton) we could develop together with your ideas maybe for inclusion in MSL.

AHaumer avatar May 26 '23 09:05 AHaumer

Walkthrough

This update introduces a new Modelica model named DC_CompoundExcited in both the basic and quasi-static DC machine packages, complete with detailed parameters for electrical and thermal dynamics. A new simulation example, DCCE_Generator, is added to demonstrate its operation. Additionally, a new parameter record (DcCompoundExcitedData) is provided to encapsulate excitation characteristics. Package order files in the affected directories are updated to include these new components.

Changes

File(s) Change Summary
Modelica/Electrical/Machines/BasicMachines/DCMachines/DC_CompoundExcited.mo Added new model DC_CompoundExcited with electrical and thermal parameters, components, and annotations.
Modelica/Electrical/Machines/BasicMachines/QuasiStaticDCMachines/DC_CompoundExcited.mo Added new quasi-static model DC_CompoundExcited (with quasiStatic=true and an extended icon).
Modelica/Electrical/Machines/Examples/DCMachines/DCCE_Generator.mo Added new example model DCCE_Generator demonstrating power generation with compound excitation.
Modelica/Electrical/Machines/{BasicMachines/DCMachines, BasicMachines/QuasiStaticDCMachines, Examples/DCMachines}/package.order Updated package order files to include new entries (DC_CompoundExcited and DCCE_Generator).
Modelica/Electrical/Machines/Utilities/ParameterRecords/DcCompoundExcitedData.mo Added new record DcCompoundExcitedData extending parameter data for compound excitation.
Modelica/Electrical/Machines/Utilities/ParameterRecords/package.order Updated package order to add the new DcCompoundExcitedData entry.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Gen as DCCE_Generator
    participant DC as DC_CompoundExcited
    participant Data as DcCompoundExcitedData

    User->>Gen: Start simulation
    Gen->>DC: Instantiate compound excited model(s)
    DC->>Data: Request excitation parameters
    Data-->>DC: Supply parameter data
    DC->>Gen: Return simulation outputs

Poem

Hoppin' through the code with delight,
I found new models shining bright.
DC currents dance in compound flow,
Data records whisper soft and low.
With each new change, I skip and play—
A bunny’s cheer for a brighter day!
🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Apr 09 '25 17:04 coderabbitai[bot]