Flux e-Machine Toolbox: Command Line

Introduction

The command line of Flux e-Machine Toolbox is a program called emtcli which allows to invoke certain features of Flux e-Machine Toolbox from a script.

To be able to use Flux e-Machine Toolbox by command line:
  • On Windows:
    • open a DOS window (Command prompt) at the same location of emtcli.bat, so:

      %INSTALLFLUX%\Flux\EMachineToolbox\Scripts\win

    • execute "emtcli.bat" in the command prompt
  • On Linux:
    • open a terminal at the same location of emtcli.sh, so:

      $INSTALLFLUX/Flux/EMachineToolbox/Scripts/lin

    • execute "emtcli.sh" in the terminal

Currently emtcli allows to run a performance map computation from an existing Flux e-Machine Toolbox component and / or to export the results of a previous performance test.

The different syntaxes

  • Running a performance map computation:
    emtcli --project <FeMT component path> --inputs <input file path>
  • Export results of an existing computation in txt format:

    emtcli --project <FeMT component path> --export <test name> <format> <output path>
  • Running a computation and export it at the end:

    emtcli --project <FeMT component path> --inputs <input file path> --export <test name> <format> <output path>

Options

  • --project: the path of the Flux e-Machine Toolbox coupling component from which the computation or the export must be run

  • --inputs: the path to the text file which contains the input parameters of the computation to run. This file must contain one parameter by line, each parameter being defined by: Name=Value.

    The supported parameters correspond to the input parameters displayed in the Flux e-Machine Toolbox application and are described below:

    TestName=<Name of the test to create to do a computation>
    PhaseCurrent=<corresponds to the RMS phase current maximal (A)>
    PhaseVoltage=<corresponds to the RMS phase voltage maximal (V)>
    CommandMode=MTPA or MTPV <corresponds to the command mode>
    ComputationMode=TM or MS_MONO_POS <corresponds to the computation mode>
    • TM: Solving is performed in Transient Magnetic. This mode allows to compute iron losses and magnet losses.
    • MS_MONO_POS: Solving is performed in Magneto Static for a single rotor position. This mode does not allow to compute iron losses nor magnet losses.
    MaxSpeed=<corresponds to the maximal speed (rpm)>
    InitialAngleComputation=USER or AUTO <corresponds to the definition of the initial angle>
    InitialAngle=<corresponds to the rotor intial angle (deg, to define only if InitialAngleComputation is fixed at AUTO>
    NbIdIq=<corresponds to the number of computations for Jd, Jq>
    NbSpeed=<corresponds to the number of computations for the speed>
    NbCompElectPeriod=<corresponds to the number of computations by electrical period>
    TorqueMode=ELECTROMAGNETIC or USEFUL <corresponds to the torque computation mode>
    • ELECTROMAGNETIC: computation of electromagnetic torque without taking into account iron losses. This is the mode used in all versions strictly prior to version 2023.1, and it can still be used in the following versions
    • USEFUL: computation of corrected torque, i.e. taking into account iron losses (=electromagnetic torque reduced by the torque loss due to iron losses) - default mode, with TM computation mode only, from version 2023.1 onwards
    X Factor= <corresponds to the multiplying coefficient to be applied to the iron losses to adjust the computed values to the measurements - with TM computation mode only (this value must be strictly positive)>
    DistributionEnabled=yes or no <corresponds to the distribution (local)>
    CoreNumber=1 <corresponds to the number of cores (Mumps)>
    NumericalMemory=2048 <corresponds to the numerical memory (MiB). 0 for dynamic memory. >
  • -–export: must be followed by exactly three arguments:
    • <test name>: The name of the test present in the coupling component, for which the results must be exported. The name will also be used to name the export directory in which the text files will be exported
    • <format>: The format of exported files. 4 formats are supported:
      • TXT (text files with all map values)
      • HTML (html file with export of all maps)
      • PDF (pdf file with export of all maps)
      • MAT (mat file with Lookup tables export for Altair PSIM or Twin Activate software, and oml file for viewing tables in Compose - with MS-mono-position computation mode only)
    • <output path>: The path of a directory in which the export directory will be created. If this path does not point to an existing directory the command line will try to create the missing directories

Example of use via the DOS console

It is necessary to have generated a FeMT coupling component from a Flux project and have the path to this component. For instance d:\Example emtcli\Example.FEMT. Here are the steps to use the command line via DOS:

  1. In a user working directory, create a new text file named « inputs.txt »


  2. Open the « inputs.txt » file in a text editor and enter wished values for input parameters of test to run:


  3. From a Windows Explorer, open a DOS window in the working directory
  4. In the DOS window, update the environment variable « Path » by adding the directory « Scripts\win » of EMachineToolbox to be able to run easily emtcli:
    > set PATH=%PATH%;C:\Program Files\Altair\2024.1\flux\Flux\EMachineToolbox\Scripts\win
  5. Then execute the command « emtcli » to run the test and export results:
     > emtcli --project Example.FEMT --inputs inputs.txt –export EMTCliExample TXT “D:\Example emtcli”