Skip to content

Conversation

@dmnewman3
Copy link
Contributor

@dmnewman3 dmnewman3 commented Apr 7, 2024

Issue

Closes #296

Summary

This PR does the following:

  • separates existing flux linkage and inductance analyzers
  • enables the use of more than 3-phase machines
  • provides the full alpha-beta and d-q reference frame inductances including cross-coupled inductances
  • separates the documentation and .rst files for each.

closes #296

@dmnewman3 dmnewman3 added documentation Improvements or additions to documentation enhancement New feature or request Machine Evaluation Related to the Machine Evaluation Framework labels Apr 7, 2024
@dmnewman3 dmnewman3 requested a review from wchan29 April 7, 2024 21:34
@dmnewman3 dmnewman3 self-assigned this Apr 7, 2024
wchan29
wchan29 previously approved these changes May 1, 2024
Copy link
Contributor

@wchan29 wchan29 left a comment

Choose a reason for hiding this comment

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

@dmnewman3 Here is my Level 1 review summary:

Does the code run without error and produce the expected result? Yes
Does the code comply with the code guidelines? Yes
Does the code documentation comply with the documentation guidelines? Yes
Is the writing, grammar, and syntax correct and clear? Yes
Is the changeset compliant with the eMach architecture? Yes
Does this review consider whether this physics are accurate? Not sure, but seems good.
Is PR approved to Level 2? Yes

@elsevers
Copy link
Contributor

@dmnewman3 -- thanks! I have asked @noguchi-takahiro to do a review on this. Once you get an approval from him, I'll go ahead and do a review as well.

- main mach_cad file
- tutorial 5 file
Copy link
Contributor

@noguchi-takahiro noguchi-takahiro left a comment

Choose a reason for hiding this comment

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

Thank you @dmnewman3. Your flux and inductance analyzer works well. I have super small request regarding the printing the rotor_angle. Please see the comment below and consider to update it.

Copy link
Contributor

@noguchi-takahiro noguchi-takahiro left a comment

Choose a reason for hiding this comment

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

Thank you @dmnewman3. It looks good to me.

Here is my Level 1 review summary:

Does the code run without error and produce the expected result? Yes
Does the code comply with the code guidelines? Yes
Does the code documentation comply with the documentation guidelines? Yes
Is the writing, grammar, and syntax correct and clear? Yes
Is the changeset compliant with the eMach architecture? Yes
Does this review consider whether this physics are accurate? Yes
Is PR approved to Level 2? Yes

@elsevers I approve this PR. Could you review this?

noguchi-takahiro and others added 2 commits May 28, 2024 00:39
- remove references to version 21.1
- remove extra stator id naming line
@elsevers elsevers mentioned this pull request May 30, 2024
Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

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

Partial review here. I am comparing the plan in issue #296 to the documentation I am reading for the flux linkage analyzer and think we aren't quite on the right track.

  1. Flux linkage analyzer input 1: instead of taking in a SynR machine object, instead take in a JMAG tool handle to a JMAG project that is open and already loaded with the machine and fully configured. It could be a SynR machine, or a PM machine, or something else entirely -- doesn't matter.
  2. Flux linkage analyzer input 2: total number of phases
  3. Flux linkage analyzer input 3: name of each phase
  4. Flux linkage analyzer input 4: list consisting of objects of our standard operating point class to calculate flux linkages at.

The analyzer then calculates the flux linkages for all phases at each operating point.

One thing I am not sure of: does our operating point class give us capability to specify each phase current individually?

Takahiro and I will discuss a bit more later today and revise this description.

@dmnewman3
Copy link
Contributor Author

Hi @noguchi-takahiro, I've updated the analyzers and incorporated @elsevers feedback. I think I've got it to a point where I can have you look over it. It have it to a point where everything is structured as Eric requested and it is fully functional with the example file I pushed to the repo. I've also updated the documentation quite a bit.

Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

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

Change requests for flux linkage analyzer and problem

  • problem: rename to Flux_Linkage_Problem to FluxLinkageJMAG_Problem
  • problem: Use the toolJmag = JMAG.JmagDesigner() instead of app and model
  • problem + analyzer: let's eliminate using CSV files to exchange information. Instead, we'll save flux linkage data to an object. In the problem class, see if you can prevent JMAG from storing the data onto the hard drive. Just retrieve it directly from JMAG via a function call.
  • problem: ratedcurrent should be renamed to rated_current
  • analyzer: should not be referring to JMAG specific information from the problem class. I.e., remove the analyzer using app or model.
  • problem: remove the requirement that a user needs to make the mesh prior to creating the problem. Our theory is that creating the mesh as a distinct step is unnecessary and that just calling the run function will take care of this. The model should be pre-configured with the appropriate mesh settings prior to creating the problem object.

@dmnewman3
Copy link
Contributor Author

Thanks for the feedback @elsevers and @noguchi-takahiro, I have made the changes requested:

  • renamed problem and analyzer to FluxLinkageJMAG_Problem and FluxLinkageJMAG_Analyzer
  • restructured to have toolJmag as the input instead of app and model
  • eliminated the need for csv files and restructured theInductanceProblem and InductanceAnalyzer accordingly
  • renamed ratedcurrent to rated_current
  • moved all specific JMAG references to problem class in flux linkage analyzer
  • removed the need to include the mesh in the initial FEA file

Please re-review and provide feedback as necessary.

Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

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

@dmnewman3, quick review on this caught a problem -- can you take a look?

@dmnewman3 dmnewman3 requested a review from elsevers June 12, 2024 21:54
Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

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

Thanks @dmnewman3. See my comment on revisions needed to implement the approach we outline in #296

- requirements of model in .rst file
- flux_linkage analyzer
- inductance analyzer
- example JMAG file
@dmnewman3 dmnewman3 requested a review from elsevers June 13, 2024 20:37
Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

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

Thanks @dmnewman3. I left you some items to work on as in-line annotations.

I think we should be including an abstract base class for that the flux linkage analyzer expects of the flux linkage problem class (abstract functions of delete_operating_points, new_operating_point, set_phase_current, and run_analyses) and then have your problem class implement that abstract base class. This approach is used extensively in other parts of the codebase. If you are familiar with how to do this, go ahead and try. Otherwise, please work on addressing the more concrete items I have identified.

@@ -0,0 +1,103 @@
import os
Copy link
Contributor

Choose a reason for hiding this comment

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

When I try to run this example file, I encounter this error:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @elsevers,

I have never seen this issue, but I have implemented a save command right after opening so hopefully that fixes your problem. I have created the file using JMAG21 so there should be no problem opening it in a more recent version. Please do let me know if this most-recent push fixes this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to @noguchi-takahiro and @dmnewman3, this appears to be a bug with JMAGv22. This error did not pop up when using JMAGv21 or JMAGv23.

- remove hard-coded references
- save file before executing
- redefine add_em_study and remove it as analyzer call
- rename and restructure del_op_pts, new_op_pt, run_all_cases
- add set_phase_currents
- set output as vector of phase currents
- update documentation
@dmnewman3 dmnewman3 requested a review from elsevers June 18, 2024 17:28
@dmnewman3
Copy link
Contributor Author

@elsevers I have implemented your feedback, but I don't understand how what we're doing now is not implementing the abstract base classes you are referring to. The pattern we are doing seem to be exactly how is laid out in the guidelines and how other analyzers are structured. I would like to prioritize getting this over the finish line and then if time allows we can improve upon it from there. Either that or maybe I have the wrong idea of what you're referring to.

Either way, I am ready for a new review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request Machine Evaluation Related to the Machine Evaluation Framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants