Usage#

After Installation, the package is used in the same manner as motulator: a continuous-time system model, a discrete-time control system, and a simulation object are created, see the usage of motulator. The package is organized like motulator.drive:

from motulator_multiphase import control, model, utils

Quick Start#

A sensorless flux-vector-controlled dual-three-phase IPMSM drive, whose sets are displaced by 30°:

from math import pi

import motulator.drive.control.sm as sm_control
from motulator_multiphase import control, model, utils

# System model: the parameters describe one three-phase set, when both sets carry
# equal currents, and L_ls is the leakage inductance not coupled to the other set
par = model.SynchronousMachinePars(n_p=3, R_s=3.6, L_d=0.036, L_q=0.051, psi_f=0.545)
machine = model.MultiThreePhaseMachine(par, L_ls=0.005, n_sets=2)
converter = model.MultiThreePhaseConverter(u_dc=540, n_sets=2)
mdl = model.MultiThreePhaseDrive(machine, model.MechanicalSystem(J=0.03), converter)

# Control system: the flux-vector controller of motulator for the CM, parametrized
# with the parallel-connected equivalent machine, and a current controller for the DM
est_par = utils.to_parallel(par, 2)
cfg = sm_control.FluxVectorControllerCfg(i_s_max=18, sensorless=True)
vector_ctrl = sm_control.FluxVectorController(est_par, cfg)
dm_ctrl = control.DifferentialModeController(L_ls=0.005, n_sets=2)
speed_ctrl = sm_control.SpeedController(J=0.03, alpha_s=2 * pi * 4)
ctrl = control.MultiThreePhaseControlSystem(vector_ctrl, dm_ctrl, speed_ctrl)

# Speed reference, load torque, and current sharing (75% in the first set at the end)
ctrl.set_speed_ref(lambda t: (t > 0.2) * 150)
mdl.mechanics.set_external_load_torque(lambda t: (t > 0.8) * 28)
ctrl.set_current_sharing(lambda t: [1.5, 0.5] if t > 1.2 else [1.0, 1.0])

res = model.Simulation(mdl, ctrl).simulate(t_stop=1.6)
utils.plot(res)  # CM quantities, the current being the sum of the set currents
utils.plot_sets(res)  # Set currents and DM currents

The sets are displaced by 60°/n by default (30° for a dual-three-phase machine); other arrangements are given with theta_sets. Complete examples are in the example gallery.

Machine Parameters#

The machine parameters, such as motulator.drive.model.SynchronousMachinePars, describe one three-phase set, when all sets carry equal currents. Hence, the parameters of a three-phase machine can be used for each set. The leakage inductance L_ls of a set, which is not coupled to the other sets, is needed in addition, see System Model. The controllers of motulator are parametrized with the equivalent machine, whose sets are connected in parallel, given by motulator_multiphase.utils.to_parallel(). This function also scales the magnetic models of saturated machines, e.g., GradNet flux maps.

Simulation Results#

The simulation results are organized as in motulator, see the usage of motulator. In addition, the following signals are available:

  • res.mdl.machine.i_c_ab and res.mdl.converter.u_c_ab are the currents and voltages of the sets in their own coordinates, with the shape (n_sets, N).

  • res.mdl.machine.i_dm_ab and res.mdl.machine.psi_dm_ab are the DM currents and flux linkages in stationary coordinates, with the shape (n_sets - 1, N).

  • res.mdl.machine.i_s_ab, res.mdl.machine.psi_s_ab, and res.mdl.machine.u_s_ab are the current, flux linkage, and voltage of the parallel-connected equivalent machine. Hence, the current is the sum of the set currents. These signals allow using the plotting functions of three-phase drives, such as motulator.drive.utils.plot().

  • res.ctrl.dm contains the DM signals, see motulator_multiphase.control.DifferentialModeSignals, with the shape (N, n_sets - 1). They are in the same coordinates as the other signals of the vector controller, e.g., in the estimated rotor flux coordinates for induction machines.

The function motulator_multiphase.utils.plot_sets() plots the current magnitudes of the sets and the DM currents with their references.

Scope#

  • Identical sets, any number n ≥ 1; a drive with one set equals the three-phase drive of motulator.

  • The saturated machine models and GradNet flux maps of motulator can be used for the CM, see utils.to_parallel.

  • Each DM is a resistive-inductive circuit of the stator resistance and the leakage inductance of a set; it is not saturated and produces no torque.

  • Gate blocking (standby control) is not supported.