Skip to content

Introduce signal node object to abstract connections with control devices#181

Merged
pelesh merged 6 commits intodevelopfrom
slaven/signal_node_dev
Jul 18, 2025
Merged

Introduce signal node object to abstract connections with control devices#181
pelesh merged 6 commits intodevelopfrom
slaven/signal_node_dev

Conversation

@pelesh
Copy link
Copy Markdown
Collaborator

@pelesh pelesh commented Jul 14, 2025

Description

This is a draft for implementation of signal node (bus) object.

Closes #154

@superwhiskers

Proposed changes

In this implementation signal node does not own any variable or residual. The SignalNode class implements methods to set, initialize and read signal:

  1. void set(ScalarT* p_signal) method stores the pointer to a component model variable that will be shared with other components as a (control) signal. Only component that owns that variable can invoke the set function.
  2. void init(ScalarT signal) writes value of signal to the memory location pointed by the pointer stored in the SignalNode instance. Both, the component sending and the component receiving signal can initialize the signal.
  3. ScalarT read() is a const method that reads the value pointed by the pointer stored in the SignalNode instance.

Note: When initializing the system, generators need to be initialized before governors because mechanical power sent to a generator by the governor is initialized by the generator rather than the governor.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.

Further comments

  • Current implementation keeps the old interface where generator has pointer directly to the governor and vice versa.
  • Still TODO: Create method to select which variable to connect to the signal bus.

@pelesh pelesh self-assigned this Jul 14, 2025
@pelesh pelesh added enhancement New feature or request question Further information is requested new model labels Jul 14, 2025
@pelesh
Copy link
Copy Markdown
Collaborator Author

pelesh commented Jul 15, 2025

Some additional comments on ideas behind the proposal in this PR:

  • Components that are source of signals own signal variables. I think this is helpful because:
    • The number of component internal variables is always the same no matter what is the connectivity.
    • Internal variables including signal variables can be stored in a contiguous array to simplify implementing compile-time automatic differentiation.
  • Signal node stores address and/or index of the variable shared as a signal. The signal node has minimal functionality and its purpose is to abstract away the source of signal from component receiving the signal.
  • Components that receive signal get the address/index of the signal variable so they can use it directly in its residual/Jacobian equations or make a local copy of the signal variable.

Copy link
Copy Markdown
Collaborator

@lukelowry lukelowry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I prefer this approach to #173 , but we still need to make the signals definable via data structure soon. Up to @pelesh if we do that in this PR or as next task.

Comment thread src/Model/PhasorDynamics/SynchronousMachine/GENROUwS/Genrou.hpp
Comment thread tests/UnitTests/PhasorDynamics/GovernorTgov1Tests.hpp
Comment thread src/Model/PhasorDynamics/SignalNode/SignalNode.hpp
@pelesh pelesh force-pushed the slaven/signal_node_dev branch from 31e075a to 4d9955d Compare July 15, 2025 22:16
@pelesh pelesh force-pushed the slaven/signal_node_dev branch from 4d9955d to 6cc26f8 Compare July 17, 2025 18:28
@pelesh pelesh marked this pull request as ready for review July 17, 2025 23:26
@pelesh pelesh force-pushed the slaven/signal_node_dev branch from fa3a42d to 1fe2b67 Compare July 18, 2025 02:32
Copy link
Copy Markdown
Collaborator

@lukelowry lukelowry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks well. I prefer this over the initial PR for SignalBus #173

I believe merging this will allow me to submit PR for the exciter model in my feature branch. Hope we can get this approved asap!

@pelesh pelesh merged commit ccacdc7 into develop Jul 18, 2025
4 checks passed
@pelesh pelesh deleted the slaven/signal_node_dev branch July 24, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new model question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add signal bus model to phasor dynamics family

3 participants