Actuator Parameters
Internal Control Loop of Motor Driver

Current Limit and Current Limit Margin
You can understand current limit and current limit margin as:
"Target current limit" + "protective redundancy margin"
Together, they define the safe operating range of the current controller.
📌 Basic Concepts
Current Limit
👉 The maximum current that the controller is allowed to output under normal operation
Current Limit Margin
👉 A reserved "buffer space" for the controller to handle transient fluctuations / control errors
Actual Hard Limit (Absolute Upper Bound)
current_lim + current_lim_margin
👉 Exceeding this limit will trigger protection (e.g., error / current limit violation)
Block Diagram (Logical Structure)

🧩 Detailed Explanation
1️⃣ Role of current_lim (Soft Limit)
In the control loop (FOC):
Iq_cmd = clamp(Iq_target, -current_lim, +current_lim)
👉 The Iq setpoint is constrained within ±current_lim
2️⃣ Role of current_lim_margin
Used to detect whether the "actual measured current" is abnormal
Possible sources of error: - ADC error - PWM delay - Back EMF - Dynamic disturbances
👉 Therefore, short-term exceeding of current_lim is allowed
3️⃣ Protection Trigger Condition
|Iq_measured| > current_lim + current_lim_margin
👉 This will trigger:
ERROR_CURRENT_LIMIT_VIOLATION
📊 Example
Assume:
- current_lim = 40 A
- current_lim_margin = 8 A
| Range | Meaning |
|---|---|
| 0 ~ 40A | Normal operation |
| 40 ~ 48A | Transient allowed (margin zone) |
| >48A | ❌ Protection triggered |
⚠️ Engineering Significance
current_lim determines
👉 Maximum motor output torque
Torque ∝ Iq
current_lim_margin determines
👉 System stability / robustness
- Too small: prone to false protection triggers
- Too large: may cause overcurrent damage to MOSFETs or motor
🧠 Summary
- current_lim → "desired maximum current"
- current_lim_margin → "allowed transient overshoot range"
🚀 Engineering Recommendations
Applicable for:
- High dynamic motion (jumping / locomotion)
- Strong nonlinear control (RL control)
Recommended configuration:
- Set margin to 20% ~ 30%
- Combine with:
- Bus current limit
- Temperature protection
- Torque limiter