Severson-Group / eMach

Open Source Machine Modeling and Optimization Framework. X Mach Speed.
https://emach.readthedocs.io
BSD 3-Clause "New" or "Revised" License
18 stars 3 forks source link

Inductance analyzer needs to be restructured #296

Open dmnewman3 opened 11 months ago

dmnewman3 commented 11 months ago

Inductance analyzer should be restructured to the following two analyzers:

The flux linkage analyzer should take a JMAG FEA-drawn machine as the problem and analyze it to result in flux linkage

The inductance/saliency analyzer should effectively post-process the flux linkage data to result in Ld, Lq, and saliency ratio.

dmnewman3 commented 11 months ago

@npetersen2 @elsevers @Anvar-Khamitov @wchan29 @noguchi-takahiro

Please respond with your thoughts here. I'd like to get a plan in place before any action is started to address this issue.

npetersen2 commented 11 months ago

@dmnewman3 I am also building an analyzer to do this inductance calculations for my project... it is working using FEMM for my buried PM rotor design using 6-phase multi-phase winding.

It seems like we should be able to use the same analyzer for both our needs.. But that means it will need to be more general... not sure if it is really worth it at this point.

dmnewman3 commented 10 months ago

@npetersen2 That is good to know, I have things split up and the only thing I am getting caught up on is avoiding hard-coding the 3 phases. Are you hard coding the 6 phases into yours or are you doing it another way?

npetersen2 commented 10 months ago

Yeah the phase number is tricky... One possible way is as follows: The user specifies three things:

  1. num_of_phases
  2. list of terminal circuit names ph1, ph2, ph3 etc.
  3. Transform which converts phase vector into alpha-beta-zero vector

These are general and apply to 3 phase, 6 phase, etc.

Then, the flux linkage analyzer excites each phase in the list, gets the flux linkages, and returns the vector. The inductance analyzer uses the transform to convert to alpha-beta form and gives inductance matrix. It can also post process the alpha-beta inductance matrix into DQ values, etc.

Anvar-Khamitov commented 10 months ago

Yeah, I think this looks good. The user could specify key-value parameters in the form of a dictionary. Including phase names, the following may be the inputs:

The analyzer can then open the file, create a new study, set speed and simulation settings, excite one terminal at a time, and extract flux linkages.

dmnewman3 commented 6 months ago

@npetersen2 @Anvar-Khamitov @elsevers I am putting the finishing touches on this and will require a review shortly. I ended up only being able to make this for a 3-phase machine, as adding additional phases proved too complicated. Please speak up if you strongly object to this, if not I will be asking for a review shortly.

elsevers commented 6 months ago

Hmm. It would be very nice if this could work for an arbitrary number of phases. I see Nathan outlines a plan for this above -- I am not sure where this is at as a trade-off between complexity and usefulness.

dmnewman3 commented 6 months ago

Hmm. It would be very nice if this could work for an arbitrary number of phases. I see Nathan outlines a plan for this above -- I am not sure where this is at as a trade-off between complexity and usefulness.

@elsevers I don't think the complexity outweighs the usefulness. I think if this is ever needed for another machine type (6-phase, bearingless, etc.) it can be adapted and included by someone who needs it. The basics are very easy to understand, but the implementation for more complex machines is beyond my capacity.

elsevers commented 6 months ago

Hmm. It would be very nice if this could work for an arbitrary number of phases. I see Nathan outlines a plan for this above -- I am not sure where this is at as a trade-off between complexity and usefulness.

@elsevers I don't think the complexity outweighs the usefulness. I think if this is ever needed for another machine type (6-phase, bearingless, etc.) it can be adapted and included by someone who needs it. The basics are very easy to understand, but the implementation for more complex machines is beyond my capacity.

The beauty of the approach @npetersen2 is proposing is that you don't need to be an expert in high phase machine types. You just need to structure your analyzer so that you allow the user to specify the Clarke transform that is used to go to $\alpha-\beta$

dmnewman3 commented 6 months ago

@elsevers I am going to upload what I have and we can maybe have a discussion with the group. This PR is only intended to restructure what is already in eMach, not necessarily to change the way any of its physical calculations are done. I have a lot to get done and I can't fit redoing this in. If @npetersen2 wants to change any of what I have, we can make this a feature branch instead of a user branch, which I am happy to do.

dmnewman3 commented 6 months ago

@elsevers Re: a conversation I had with @npetersen2 last week, my plan for the (2) analyzers is now as follows:

  1. Flux Linkage Analyzer:

    • Inputs: a. machine (including no. and name of phases) b. operating point (standard for FEA analyzers)
    • Outputs: a. csv files b. peak current c. rotor angle
  2. Inductance Analyzer

    • Inputs: a. csv files b. peak current c. rotor angle d. Clarke transformation matrix
    • Outputs: a. alpha-beta inductances b. d-q inductances

@elsevers Please confirm this is a setup you are comfortable with. @npetersen2 Please include if I am missing anything, but I believe this is what we had decided on.

elsevers commented 3 months ago

Per 5/31 call:

Key points:

  1. Analyzer does not need to know what the FEA tool is ---> no knowledge of JMAG is needed
  2. Analyzer does not need to know what the machine type is
  3. Analyzer does need to know the total number of phases.

Psuedo code for flux linkage analyzer

Flux linkage analyzer should be able to call these functions in the problem class

# code called by analyzer.analyze()
prob.delete_all_op()

# 1. Create all operating points! One per phase + 0 current case
while m < phaseNum + 1
    op(m) = prob.newOperatingPoint()
    while i < phaseNum
        if i = m
          prob.SetPhaseCurrent(op(m), i, 1)
        else
           prob.SetPhaseCurrent(op(m), i, 0)
      end
end

# 2. Run analyses
Run()

# 3. Extract results
while m < phaseNum       
     while i < phaseNum
          flux_link(m,i) = prob.GetFluxLinkage(op(m),i)
     end
end
elsevers commented 3 months ago

Information the user needs to provide the JMAG flux linkage problem class initializer

  1. user provides a JMAG tool object that is pointing to an open JMAG project that is all set up and ready to solve
    1. This means that the phases are connected to each current source directly, so that we can have only one current on at a time.
    2. Standardize a naming convention of the phases and their current sources
  2. User provides a list of the phase names, from this list of phase names, the problem class will determine:
    1. the phase current source names.
    2. how many phases there are
  3. What solve type to use (options should be all available JMAG solvers, including: 2d transient, 2d static, 3d transient, 3d static)