motulator_bearingless.model
===========================

.. py:module:: motulator_bearingless.model

.. autoapi-nested-parse::

   Continuous-time models for six-phase bearingless synchronous machine drives.

   The symmetrical six-phase winding is described by means of the vector-space
   decomposition: the two-pole plane (`h = 1`) and the four-pole plane (`h = 2`) are
   represented by peak-valued complex space vectors. The machine model is expressed in
   rotor coordinates, where the plane `h` rotates at the electrical angular speed
   `h*w_M`. The magnetic model is a gradient of a magnetic energy function, which allows
   representing magnetic saturation and rotor eccentricity in a consistent manner
   [#Das2026]_. Uppercase `M` denotes mechanical quantities, as in motulator. The rotor
   displacement `q_M` and the radial force `f_M` are complex numbers, whose real and
   imaginary parts correspond to the i and j axes. The mechanical system models and the
   simulation class of motulator and the converter model of motulator_multiphase are
   re-exported for convenience.

   .. rubric:: References

   .. [#Das2026] Das, Martin, Kontodinas, Hinkkanen, "Direct force control of six-phase
      bearingless synchronous machines," Proc. ICEM, 2026,
      https://doi.org/10.1109/ICEM68283.2026.11757980

   ..
       !! processed by numpydoc !!


Classes
-------

.. autoapisummary::

   motulator_bearingless.model.BearinglessDrive
   motulator_bearingless.model.BearinglessDriveSensors
   motulator_bearingless.model.BearinglessSynchronousMachine
   motulator_bearingless.model.BearinglessSynchronousMachinePars
   motulator_bearingless.model.ExternalRotorPosition
   motulator_bearingless.model.RadialMechanics
   motulator_bearingless.model.SaturatedBearinglessSynchronousMachinePars
   motulator_bearingless.model.SpatialSaturatedBearinglessSynchronousMachinePars


Module Contents
---------------

.. py:class:: BearinglessDrive(machine, mechanics, radial, converter, sensors = None)

   Bases: :py:obj:`motulator.common.model.Model`\ [\ :py:obj:`motulator_multiphase.model.MultiThreePhaseConverter`\ ]


   
   Continuous-time system model of a six-phase bearingless machine drive.

   :param machine: Machine model.
   :type machine: BearinglessSynchronousMachine
   :param mechanics: Rotational mechanics.
   :type mechanics: MechanicalSystem | TwoMassMechanicalSystem | ExternalRotorSpeed
   :param radial: Radial mechanics.
   :type radial: ExternalRotorPosition | RadialMechanics
   :param converter: Converter model with two three-phase sets.
   :type converter: MultiThreePhaseConverter
   :param sensors: Sensors, see `BearinglessDriveSensors`, defaults to ideal phase-current, DC-bus
                   voltage, and displacement sensors. Sensored control also needs the speed and
                   position sensors.
   :type sensors: BearinglessDriveSensors, optional















   ..
       !! processed by numpydoc !!

.. py:class:: BearinglessDriveSensors

   Bases: :py:obj:`motulator.drive.model.DriveSensors`


   
   Sensors of a bearingless drive, ideal by default, see `Sensor`.

   :param i_c: Phase-current sensors of the two sets, `[[i_1, i_2], [i_3, i_4], [i_5, i_6]]`.
               Their conversion defaults to `complex2abc`. They cannot have a bandwidth.
   :type i_c: Sensor, optional
   :param u_dc: DC-bus voltage sensor.
   :type u_dc: Sensor, optional
   :param w_M: Rotor speed sensor (mechanical rad/s), defaults to None, i.e., no sensor.
   :type w_M: Sensor, optional
   :param theta_M: Rotor position sensor (mechanical rad), defaults to None, i.e., no sensor. The
                   sensored control uses the speed and position sensors. The position sensor cannot
                   have a bandwidth, since the angle is wrapped.
   :type theta_M: Sensor, optional
   :param q_M: Rotor displacement sensor (m) in stator coordinates.
   :type q_M: Sensor, optional















   ..
       !! processed by numpydoc !!

.. py:class:: BearinglessSynchronousMachine(par)

   Bases: :py:obj:`motulator.common.model.Subsystem`


   
   Six-phase bearingless synchronous machine model.

   The model is internally represented in rotor coordinates. The interfaces are in
   stator coordinates: the voltages and currents as the space vectors of the two
   three-phase sets, the displacement and the force as complex numbers. The first set
   consists of the phases 1, 3, 5 and the second set of the phases 2, 4, 6. The
   magnetic model is selected via the parameters: linear magnetics with
   :class:`BearinglessSynchronousMachinePars`, or magnetic saturation with
   :class:`SaturatedBearinglessSynchronousMachinePars` or, including spatial harmonics,
   :class:`SpatialSaturatedBearinglessSynchronousMachinePars`.

   .. rubric:: Notes

   A radial force that is constant in stator coordinates results from the interaction
   of the four-pole field (rotating with the rotor) and a two-pole field having the
   same electrical angular frequency `2*w_M` in stator coordinates. Hence, the
   two-pole quantities rotate at `w_M` in rotor coordinates, while the displacement of
   a rotor held at a fixed position rotates at `-w_M`.

   :param par: Machine parameters.
   :type par: BaseBearinglessMachinePars















   ..
       !! processed by numpydoc !!

   .. py:method:: compute_outputs(state, q_M_ab = 0j)

      
      Compute output variables.
















      ..
          !! processed by numpydoc !!


   .. py:method:: create_time_series(t)

      
      Create time series from state list.
















      ..
          !! processed by numpydoc !!


   .. py:method:: rhs(t)

      
      Compute state derivatives.
















      ..
          !! processed by numpydoc !!


   .. py:method:: set_outputs(t)

      
      Set output variables.
















      ..
          !! processed by numpydoc !!


   .. py:method:: set_states(state_list, index)

      
      Set states, keeping the rotor angle within [-pi, pi).
















      ..
          !! processed by numpydoc !!


.. py:class:: BearinglessSynchronousMachinePars

   Bases: :py:obj:`BearinglessMagneticModel`


   
   Constant parameters of a six-phase bearingless synchronous machine.

   The four-pole rotor produces the torque with the four-pole field (`h = 2`) and
   the radial force with the two-pole field (`h = 1`). Linear magnetics are
   assumed. The flux linkages are `psi_s = L_s(q_M)*i_s`, where the inductance
   matrix depends linearly on the rotor displacement via the radial force constants::

       L_s = [[L_1*I, L_21.T], [L_21, diag(L_d, L_q)]]
       L_21 = [[m_d*q_i, -m_d*q_j], [m_q*q_j, m_q*q_i]]

   The corresponding radial force is `f_M = 1.5*i_s.T*(dL_s/dq_M)*i_s`, i.e.::

       f_i = 3*(m_d*i_2d*i_1d + m_q*i_2q*i_1q)
       f_j = 3*(m_q*i_2q*i_1d - m_d*i_2d*i_1q)

   :param R_s: Stator resistance (Ω).
   :type R_s: float
   :param L_1: Inductance (H) of the two-pole plane, isotropic for the four-pole rotor.
   :type L_1: float
   :param L_d: d-axis inductance (H) of the four-pole plane.
   :type L_d: float
   :param L_q: q-axis inductance (H) of the four-pole plane.
   :type L_q: float
   :param m_d: d-axis radial force constant (H/m).
   :type m_d: float
   :param m_q: q-axis radial force constant (H/m).
   :type m_q: float

   .. rubric:: Notes

   The negative stiffness (unbalanced magnetic pull proportional to the displacement)
   is a second-order effect of the displacement on the inductances, which is not
   included in this linear model.















   ..
       !! processed by numpydoc !!

   .. py:method:: df_dq(i_s1, i_s2, q_M)

      
      Force sensitivity `d f_M/d q_M` at constant flux, shape (..., 2, 2).
















      ..
          !! processed by numpydoc !!


   .. py:method:: di_dq(i_s1, i_s2, q_M)

      
      Current sensitivity `d i_s/d q_M` at constant flux, shape (..., 4, 2).
















      ..
          !! processed by numpydoc !!


   .. py:method:: f_M(i_s1, i_s2, q_M)

      
      Radial force (N) as a function of currents (A) and displacement (m).
















      ..
          !! processed by numpydoc !!


   .. py:method:: i_s(psi_s1, psi_s2, q_M, exp_j_theta_M = None)

      
      Currents (A) and radial force (N) from flux linkages (Vs).
















      ..
          !! processed by numpydoc !!


   .. py:method:: incr_ind_mat(i_s1, i_s2, q_M)

      
      Incremental inductance matrix (H), shape (..., 4, 4).
















      ..
          !! processed by numpydoc !!


   .. py:method:: ind_mat(q_M)

      
      Inductance matrix (H), shape (..., 4, 4), at the displacement `q_M`.
















      ..
          !! processed by numpydoc !!


   .. py:method:: psi_s(i_s1, i_s2, q_M)

      
      Flux linkages (Vs) as functions of currents (A) and displacement (m).
















      ..
          !! processed by numpydoc !!


.. py:class:: ExternalRotorPosition

   Bases: :py:obj:`motulator.common.model.Subsystem`


   
   Rotor held at an externally given radial position.

   This corresponds to a rotor supported by active magnetic bearings or by mechanical
   bearings, in which case the radial force of the machine has no effect on the
   position. The displacement is constant or a function of time, defaulting to a
   centric rotor.















   ..
       !! processed by numpydoc !!

   .. py:method:: create_time_series(t)

      
      Create time series.
















      ..
          !! processed by numpydoc !!


   .. py:method:: rhs(t)

      
      No states.
















      ..
          !! processed by numpydoc !!


   .. py:method:: set_external_displacement(q_M_ab)

      
      Set the rotor displacement (m), constant or a function of time.
















      ..
          !! processed by numpydoc !!


   .. py:method:: set_outputs(t)

      
      Set output variables.
















      ..
          !! processed by numpydoc !!


.. py:class:: RadialMechanics(m, c = 0.0)

   Bases: :py:obj:`motulator.common.model.Subsystem`


   
   Radial rigid-body dynamics of the rotor.

   The rotor is modeled as a point mass, which is acted upon by the electromagnetic
   radial force of the machine, an optional external force (e.g., gravity or
   unbalance), and an optional viscous damping. The tilting and axial motion are not
   modeled.

   :param m: Mass of the rotor (kg).
   :type m: float
   :param c: Viscous damping coefficient (N/(m/s)), defaults to 0.
   :type c: float, optional















   ..
       !! processed by numpydoc !!

   .. py:method:: create_time_series(t)

      
      Create time series.
















      ..
          !! processed by numpydoc !!


   .. py:method:: rhs(t)

      
      Compute state derivatives.
















      ..
          !! processed by numpydoc !!


   .. py:method:: set_external_force(f_ext_ab)

      
      Set the external radial force (N), constant or a function of time.
















      ..
          !! processed by numpydoc !!


   .. py:method:: set_outputs(t)

      
      Set output variables.
















      ..
          !! processed by numpydoc !!


.. py:class:: SaturatedBearinglessSynchronousMachinePars

   Bases: :py:obj:`BearinglessMagneticModel`


   
   Parameters of a saturated bearingless synchronous machine.

   The class corresponds to
   :class:`motulator.drive.model.SaturatedSynchronousMachinePars`. The saturation model
   is specified as a current map. Optionally, to be used only in control systems, a
   flux map can be provided.

   :param R_s: Stator resistance (Ω).
   :type R_s: float
   :param i_s_fcn: Currents (A) and radial force (N) as functions of the flux linkages (Vs) of the
                   two planes and the displacement (m), e.g.,
                   :class:`~motulator_bearingless.gradnet.CurrentMap`. Needed in the machine model.
   :type i_s_fcn: Callable[[Any, Any, Any], tuple[Any, Any, Any]], optional
   :param psi_s_fcn: Flux linkages (Vs) and radial force (N) as functions of the currents (A) of the
                     two planes and the displacement (m), with the Jacobian, e.g.,
                     :class:`~motulator_bearingless.gradnet.FluxMap`. Needed in the control systems.
   :type psi_s_fcn: FluxMapFcn, optional















   ..
       !! processed by numpydoc !!

   .. py:method:: df_dq(i_s1, i_s2, q_M)

      
      Force sensitivity `d f_M/d q_M` at constant flux, shape (..., 2, 2).
















      ..
          !! processed by numpydoc !!


   .. py:method:: di_dq(i_s1, i_s2, q_M)

      
      Current sensitivity `d i_s/d q_M` at constant flux, shape (..., 4, 2).
















      ..
          !! processed by numpydoc !!


   .. py:method:: f_M(i_s1, i_s2, q_M)

      
      Radial force (N) as a function of currents (A) and displacement (m).
















      ..
          !! processed by numpydoc !!


   .. py:method:: i_s(psi_s1, psi_s2, q_M, exp_j_theta_M = None)

      
      Currents (A) and radial force (N) from flux linkages (Vs).
















      ..
          !! processed by numpydoc !!


   .. py:method:: incr_ind_mat(i_s1, i_s2, q_M)

      
      Incremental inductance matrix (H), shape (..., 4, 4).
















      ..
          !! processed by numpydoc !!


   .. py:method:: linearized(i_s2)

      
      Constant parameters of the linear model at an operating point.

      The inductances of the four-pole plane are the secant inductances at the given
      current and those of the two-pole plane are the incremental inductances at a
      centric rotor without the two-pole current. The force constants are fitted to
      the sensitivity of the radial force to the two-pole current.

      :param i_s2: Current (A) of the four-pole plane in rotor coordinates. Its both components
                   must be nonzero.
      :type i_s2: complex

      :returns: Parameters of the linear model.
      :rtype: BearinglessSynchronousMachinePars















      ..
          !! processed by numpydoc !!


   .. py:method:: psi_s(i_s1, i_s2, q_M)

      
      Flux linkages (Vs) as functions of currents (A) and displacement (m).
















      ..
          !! processed by numpydoc !!


.. py:class:: SpatialSaturatedBearinglessSynchronousMachinePars

   Bases: :py:obj:`BaseBearinglessMachinePars`


   
   Parameters of a saturated bearingless synchronous machine with spatial harmonics.

   The class corresponds to
   :class:`motulator.drive.model.SpatialSaturatedSynchronousMachinePars`. This version
   is intended for the machine model, while the control methods do not support spatial
   harmonics.

   :param R_s: Stator resistance (Ω).
   :type R_s: float
   :param magnetic_map_fcn: Currents (A), radial force (N), and torque (Nm) as functions of the flux
                            linkages (Vs) of the two planes, the displacement (m), and the complex
                            exponential of the mechanical rotor angle, e.g.,
                            :class:`~motulator_bearingless.gradnet.CurrentMapWithHarmonics`.
   :type magnetic_map_fcn: Callable[[Any, Any, Any, Any], tuple[Any, Any, Any, Any]]















   ..
       !! processed by numpydoc !!

   .. py:method:: i_s(psi_s1, psi_s2, q_M, exp_j_theta_M = None)

      
      Currents (A) and radial force (N) from flux linkages (Vs).
















      ..
          !! processed by numpydoc !!


   .. py:method:: magnetic_map(psi_s1, psi_s2, q_M, exp_j_theta_M = None)

      
      Currents (A), radial force (N), and torque (Nm) from flux linkages (Vs).
















      ..
          !! processed by numpydoc !!


