-
Notifications
You must be signed in to change notification settings - Fork 2
Simulate Performance Profile
Identifying the optimal operating conditions and performance limits of a motor is critical for designing efficient and reliable robotic systems. This guide details how to analyze and simulate efficiency, torque-speed curves, and thermal bounds within the mjlab environment.
Identifying the "Maximum Efficiency" point is critical for optimizing battery life in mobile robotics—it defines the operating range where the motor is most effective.
To determine this, load-dependent Copper Losses (
The following parameters are used for analysis based on the Maxon 48V spec:
-
Nominal Voltage (
$V$ ):$48\text{ V}$ -
Terminal Resistance (
$R$ ):$0.994\ \Omega$ -
No-load Current (
$I_0$ ):$0.15\text{ A}$ (150 mA) -
Stall Current (
$I_s$ ):$V / R = 48 / 0.994 \approx 48.3\text{ A}$
Current at Maximum Efficiency (
For the Maxon specimen:
If a MuJoCo simulation indicates a motor is drawing an average of 2.69 Amps, the system is operating at peak efficiency.
-
Operation at 20A: Energy is lost to heat (
$I^2R$ ), leading to rapid thermal accumulation. - Operation at 0.2A: Energy is lost to internal friction and windage. The load is insufficient to justify the baseline parasitic draw of the motor.
The maximum achievable efficiency at the
At this peak, the motor converts approximately 89% of electrical power into mechanical work, while the remaining 11% is dissipated as heat.
Since the torque-current relationship is linear, the torque at max efficiency can be approximated:
| Metric | Value | Simulation Implication |
|---|---|---|
| Current for Max Eff | The gear ratio should ideally be sized so "cruising" current is near this value. | |
| Max Efficiency | Expect |
|
| Torque at Max Eff | Loads significantly higher than this indicate a "High Heat" operating zone. |
The following Python script generates a full performance profile for a motor. It calculates current, input power, mechanical output power, and efficiency across the operating range—from no-load to stall conditions.
def simulate_motor_performance(V, R, Kt, I0):
"""
Calculates motor performance metrics across its operating range.
V : Voltage (V)
R : Terminal Resistance (Ohm)
Kt : Torque Constant (Nm/A)
I0 : No-load Current (A)
"""
# 1. Fundamental Limits
I_stall = V / R
tau_stall = Kt * (I_stall - I0)
# 2. Peak Efficiency Calculation
I_max_eff = (I_stall * I0)**0.5
tau_max_eff = Kt * (I_max_eff - I0)
eta_max = (1 - (I0 / I_stall)**0.5)**2 * 100
print(f"--- Motor Simulation Results ({V}V) ---")
print(f"Stall Current: {I_stall:.2f} A")
print(f"Stall Torque: {tau_stall:.3f} Nm")
print(f"Max Efficiency: {eta_max:.1f}%")
print(f"Current @ Max Eff: {I_max_eff:.2f} A")
print(f"Torque @ Max Eff: {tau_max_eff:.3f} Nm")
print("-" * 40)
print(f"{'Torque (Nm)':<15} | {'Current (A)':<12} | {'Efficiency (%)':<15}")
print("-" * 40)
# 3. Generate a range of torques from 0 to Stall
steps = 10
for i in range(steps + 1):
tau = (tau_stall / steps) * i
I = (tau / Kt) + I0
# Power Calculations
P_in = V * I
P_out = tau * ( (V - I * R) / Kt ) # Torque * Angular Velocity
# Efficiency (handle division by zero at start)
eff = (P_out / P_in * 100) if P_in > 0 else 0
if eff < 0: eff = 0 # Efficiency is 0 at stall
print(f"{tau:<15.3f} | {I:<12.2f} | {eff:<15.1f}")
# --- MAXON EC-i 40 SPECIFICATIONS ---
# Kt = 91 mNm/A -> 0.091 Nm/A
simulate_motor_performance(V=48, R=0.994, Kt=0.091, I0=0.15)Running the script with the "gold standard" specimen data yields the following profile:
--- Motor Simulation Results (48V) ---
Stall Current: 48.29 A
Stall Torque: 4.381 Nm
Max Efficiency: 89.2%
Current @ Max Eff: 2.69 A
Torque @ Max Eff: 0.231 Nm
----------------------------------------
Torque (Nm) | Current (A) | Efficiency (%)
----------------------------------------
0.000 | 0.15 | 0.0
0.438 | 4.96 | 87.0
0.876 | 9.78 | 78.5
1.314 | 14.59 | 69.1
1.752 | 19.41 | 59.4
2.190 | 24.22 | 49.5
2.628 | 29.03 | 39.7
3.067 | 33.85 | 29.8
3.505 | 38.66 | 19.9
3.943 | 43.48 | 9.9
4.381 | 48.29 | 0.0
-
Current Column: Serves as a validation check for the MuJoCo /
mjlablogged current. If the simulated current aligns with these torque values, the$K_t$ and$R$ parameters are correctly configured. - Efficiency Column: Note the observed peak at lower-mid torque ranges followed by a rapid decline. If a simulation consistently operates in higher torque bands, energy depletion will exceed estimates based on simple average power calculations.
-
Edge-Case Dynamics:
- At 0 Nm: Efficiency is 0% as input power is consumed entirely by internal friction and windage (No-load current).
-
At Stall Torque: Efficiency is 0% due to zero mechanical work (
$W = F \times d$ ); 100% of input power is dissipated as resistive heat ($I^2R$ ).