Usage#
After Installation, the package is used in the same manner as motulator: a continuous-time system model and a discrete-time control system are connected in a simulation object, see the usage of motulator. The modules are imported as
from motulator_bearingless import control, model, utils
import motulator_bearingless.gradnet as gn
Quick Start#
A sensorless direct-force-controlled 2.6-kW bearingless SyRM drive, whose rotor is held at a fixed radial position by external bearings:
from math import pi
from motulator_bearingless import control, model, utils
# System model: L_1 is the two-pole inductance, and m_d and m_q are the radial force
# constants of the d and q axes
par = model.BearinglessSynchronousMachinePars(
R_s=0.215, L_1=0.03, L_d=0.03, L_q=0.01, m_d=10.0, m_q=0.2
)
machine = model.BearinglessSynchronousMachine(par)
w_M_rated = 2 * pi * 1700 / 60
k = 14.5 / w_M_rated**2 # Quadratic load torque, 14.5 Nm (rated) at the rated speed
mechanics = model.MechanicalSystem(J=0.05, B_L=lambda w_M: k * abs(w_M))
radial = model.ExternalRotorPosition() # Fixed radial position
converter = model.MultiThreePhaseConverter(u_dc=540) # Two sets by default
mdl = model.BearinglessDrive(machine, mechanics, radial, converter)
# Control system: the direct force controller and the speed controller
cfg = control.DirectForceControllerCfg(i_s_max=25, psi_s_min=0.3, sensorless=True)
force_ctrl = control.DirectForceController(par, cfg)
speed_ctrl = control.SpeedController(J=0.05, alpha_s=2 * pi * 4)
ctrl = control.DirectForceControlSystem(force_ctrl, speed_ctrl)
# Speed and force references
ctrl.set_speed_ref(lambda t: min(max(t - 0.2, 0) / 0.6, 1) * w_M_rated)
ctrl.set_force_ref(lambda t: (t > 0.4) * 100 + 1j * (t > 0.6) * 150)
res = model.Simulation(mdl, ctrl).simulate(t_stop=1.2)
utils.plot(res)
The gradient-network maps replace the constant parameters in the same manner as in motulator:
import motulator_bearingless.gradnet as gn
models = "examples/trained_models/"
current_map = gn.CurrentMapWithHarmonics(
gn.load_gradnet(models + "bsyrm_fem_curr_map_harm_softmax_d128.npz")
)
par = model.SpatialSaturatedBearinglessSynchronousMachinePars(0.215, current_map)
machine = model.BearinglessSynchronousMachine(par)
flux_map = gn.FluxMap(gn.load_gradnet(models + "bsyrm_fem_flux_map_softmax_d128.npz"))
est_par = control.SaturatedBearinglessSynchronousMachinePars(0.215, psi_s_fcn=flux_map)
force_ctrl = control.DirectForceController(est_par, cfg)
Complete examples, including current-based force control, levitation control, and the magnetic maps, are in the example gallery.
Correspondence to motulator#
The classes correspond to those of motulator as follows.
The mechanical system models, the sensors, the simulation class, and the vector controllers of motulator are used as such, and they are re-exported by the modules of this package. The four-pole plane is described as an equivalent three-phase machine by motulator_bearingless.utils.fourpole_pars(), using motulator_multiphase.utils.to_parallel(), so that also the tools of motulator for that machine are available, e.g., motulator.drive.utils.MachineCharacteristics and the control-loci plots.
Simulation Results#
The simulation results are organized as in motulator. In addition to the signals of the mechanical system and the converter, the most relevant signals are:
res.mdl.machine.i_c_abandres.mdl.converter.u_c_abare the currents and voltages of the two three-phase sets in their own coordinates.res.mdl.machine.i_s1_abandres.mdl.machine.i_s2_abare the currents of the two-pole and four-pole planes in stator coordinates, andres.mdl.machine.psi_s1_dqandres.mdl.machine.psi_s2_dqthe flux linkages in rotor coordinates.res.mdl.machine.f_M_ab,res.mdl.machine.q_M_ab, andres.mdl.machine.tau_Mare the radial force, the rotor displacement, and the torque.res.ctrl.refandres.ctrl.fbkcontain the references and the feedback signals of the control system.
The function motulator_bearingless.utils.plot() plots the main signals.
Scope#
Symmetrical six-phase machines with two identical three-phase sets, without zero-sequence currents.
The radial motion of the rotor is modeled as a point mass, or the rotor is held at a given radial position. The tilting and axial motion are not modeled.
The constant machine parameters of the examples are illustrative.
The trained networks describe a 2.6-kW bearingless synchronous reluctance machine, based on a finite-element model that has not been validated against measurements.
The control methods do not use the spatial harmonics.