Skip to content

Simulate Performance Profile

priamai edited this page Mar 25, 2026 · 1 revision

Simulating Motor Performance Profiles

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.


1. Identifying Maximum Efficiency

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 ($I^2R$, which increase with torque) must be balanced against No-load Losses ($V \cdot I_0$, which are constant "penalties" associated with spinning).

1.1 Case Study: Maxon EC-i 40 (488607)

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}$

1.2 The Mathematical Shortcut

Current at Maximum Efficiency ($I_{max_eff}$) occurs when load-dependent copper losses approximately equal constant no-load losses:

$$I_{max_eff} = \sqrt{I_{stall} \cdot I_{no_load}}$$

For the Maxon specimen: $$I_{max_eff} = \sqrt{48.3 \cdot 0.15} \approx \sqrt{7.245} \approx \mathbf{2.69\text{ A}}$$


1.3 Simulation Analysis

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.

1.4 Calculating Peak Efficiency ($\eta_{max}$)

The maximum achievable efficiency at the $2.69\text{ A}$ operating point is calculated as:

$$\eta_{max} = \left( 1 - \sqrt{\frac{I_0}{I_s}} \right)^2$$

$$\eta_{max} = \left( 1 - \sqrt{\frac{0.15}{48.3}} \right)^2 \approx (1 - 0.0557)^2 \approx (0.944)^2 \approx \mathbf{89.2%}$$

At this peak, the motor converts approximately 89% of electrical power into mechanical work, while the remaining 11% is dissipated as heat.


1.5 Torque at Maximum Efficiency

Since the torque-current relationship is linear, the torque at max efficiency can be approximated:

$$\tau_{max_eff} \approx K_t \cdot (I_{max_eff} - I_0)$$ $$\tau_{max_eff} \approx 91\text{ mNm/A} \cdot (2.69\text{ A} - 0.15\text{ A}) \approx \mathbf{231\text{ mNm}}$$


1.6 Summary for Simulation Tuning

Metric Value Simulation Implication
Current for Max Eff $2.69\text{ A}$ The gear ratio should ideally be sized so "cruising" current is near this value.
Max Efficiency $89.2%$ Expect $11%$ of battery power to dissipate as heat at this point.
Torque at Max Eff $231\text{ mNm}$ Loads significantly higher than this indicate a "High Heat" operating zone.

2. Generating a Performance Profile Script

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.

2.1 The Profiling Script

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)

2.2 Generated Output Table (Maxon EC-i 40)

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            

2.3 Application to Simulation Analysis

  1. Current Column: Serves as a validation check for the MuJoCo / mjlab logged current. If the simulated current aligns with these torque values, the $K_t$ and $R$ parameters are correctly configured.
  2. 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.
  3. 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$).