Example for a specific motor
Opened this issue · 1 comments
jrast commented
I found this cool project and tried to simulat a specific motor we have in use, it's this one:
https://www.faulhaber.com/de/produkte/serie/3242bx4/#37890
So quite a small / low-power motor compared to the other examples here. And I had some difficulties to map the parameters from the datasheet to the parameters required for simulation. I tried to adjust the parameters in the plot_vector_ctrl_pmsm_2kw.py
example but I don't think that those are correct:
# Rated Specs - Faulhaber 3242 042 BX4
# Rated voltage, current, frequency, power, and torque
nom = NominalValues(U=42, I=0.68, f=4520 / 60, P=45, tau=41.6e-3)
base = BaseValues.from_nominal(nom, n_p=2)
kE = 7.666 # mV/min^-1 --> mV*min
# Compute psi from kE, psi is in Wb
psi = kE / (60 * 1000)
J = 30 * 1e-7 # Inertia (kg*m^2)
Cv = 4.1e-4 # Viscous Friction (mNm/min^-1)
# Convert mNm/min^-1 to Nm/(rad/s)
Cv = Cv / 1000 / 60 * 2 * 3.14159
# Configure the system model.
mdl_par = SynchronousMachinePars(
n_p=2, # Number of Pole Pairse
R_s=11.7, # Resistance (Ohm)
L_d=719e-6, # Direct-axis inductance (H)
L_q=719e-6, # Quadrature-axis inductance (H)
psi_f=psi,
)
machine = model.SynchronousMachine(mdl_par)
mechanics = model.StiffMechanicalSystem(J=J, B_L=Cv)
converter = model.VoltageSourceConverter(u_dc=42)
mdl = model.Drive(converter, machine, mechanics)
# Configure the control system.
par = mdl_par # Assume accurate machine model parameter estimates
cfg = control.CurrentReferenceCfg(par, nom_w_m=base.w, max_i_s=1.5 * base.i)
ctrl = control.CurrentVectorControl(par, cfg, J=J, T_s=100e-6, sensorless=True)
# Set the speed reference and the external load torque.
# Speed reference in mechanical rad/s
ctrl.ref.w_m = lambda t: (t > 0.2) * .2 * base.w
# External load torque
mdl.mechanics.tau_L = lambda t: (t > 0.8) * 0.7 * nom.tau
# Simulate the system and plot results in per-unit values
start_time = time.time()
sim = model.Simulation(mdl, ctrl)
sim.simulate(t_stop=1.4)
stop_time = time.time()
print(f"Simulation time: {stop_time-start_time:.2f} s")
plot(sim)
The motor behaves strangely and does not reach the desired speed. Any ideas?
Can anyone provide a correct parametrization for this specific motor, maybe with some comments on how to map the parameters from the datasheet to the parameters required by motulator?