DC Motor
ContinuousDCMotor 模块对机电直流(DC)电机对象进行建模。它描述电枢电路(电阻 、电感 、反电动势 )与转子力学平衡(转动惯量 、粘性摩擦 、负载转矩 )之间的动态相互作用。模块提供统一的模型阶次选择,适用于教学与工业仿真:
- 一阶(仅机械):忽略电感(),电枢电流按代数关系瞬时计算,转速呈指数收敛。
- 二阶(转速与电流)[标准]:完整的机电耦合,包含电气和机械时间常数。
- 三阶(位置、转速与电流):在机电模型上增加转子角位置()积分,用于伺服定位和运动控制。
模块分别输出转子角速度()、电枢电流()、电磁转矩()和角位置(),并对退化参数内置除零保护。
视频教程
数学模型
永磁直流电机的电枢电路遵循基尔霍夫电压定律,转子轴遵循牛顿-欧拉转动动力学:
电枢电路
反电动势与轴角速度成正比:
整理得电流导数:
转子力学平衡
电磁转矩与电枢电流成正比:
整理得角加速度:
转子位置动态
稳态解析解
稳态时(,),电机精确收敛到:
在国际单位制下,转矩常数与反电动势常数数值相等()。当 或 dynamicsMode 设为 firstOrder 时,电气时间常数消失(),系统平滑过渡到精确的指数型机械响应。
输入与输出
| Direction | ID | Label | 类型 | Status |
|---|---|---|---|---|
| → In | voltage |
Voltage (Va) | number | Optional |
| → In | loadTorque |
Load Torque (TL) | number | Optional |
| → In | p |
+ | number | Optional |
| → In | n |
- | number | Optional |
| → In | flange_a |
Shaft | number | Optional |
| → In | flange_b |
Case | number | Optional |
| → In | H |
H | number | Optional |
| ← Out | speed |
Speed (ω) | number | Output |
| ← Out | current |
Current (ia) | number | Output |
| ← Out | torque |
Torque (Te) | number | Output |
| ← Out | position |
Position (θ) | number | Output |
参数
| 参数 | Label | 类型 | 默认值 | 描述 |
|---|---|---|---|---|
preset |
Motor Preset | select | custom |
Select a pre-calibrated physical motor model or configure custom parameters |
dynamicsMode |
Model Dynamics | select | secondOrder |
Select dynamical model order and complexity |
resistance |
Resistance (R) | number | 1 |
Armature winding resistance [Ω] |
inductance |
Inductance (L) | number | 0.5 |
Armature winding inductance [H] |
torqueConstant |
Torque Constant (Kt) | number | 0.1 |
Motor torque constant [N·m/A] |
backEmfConstant |
Back-EMF Constant (Ke) | number | 0.1 |
Back-EMF constant [V/(rad/s)] |
inertia |
Rotor Inertia (J) | number | 0.02 |
Rotor moment of inertia [kg·m²] |
damping |
Viscous Friction (b) | number | 0.05 |
Viscous damping coefficient [N·m·s/rad] |
brushDrop |
Brush Voltage Drop (Vbrush) | number | 0 |
Total contact voltage drop across carbon brushes [V]. Sets effective voltage to 0 when |Va| <= Vbrush. |
currentLimit |
Current Limit (Imax) | number | 0 |
Armature peak current limit [A]. Clamps armature current to ±Imax. 0 = unlimited. |
coulombFriction |
Coulomb Friction / Stiction (Tc) | number | 0 |
Breakaway Coulomb friction torque opposing motion [N·m]. Prevents rotation until net torque exceeds Tc. |
initialSpeed |
Initial Speed (ω0) | number | 0 |
Initial angular velocity at t=0 [rad/s] |
initialCurrent |
Initial Current (ia0) | number | 0 |
Initial armature current at t=0 [A] |
initialPosition |
Initial Position (θ0) | number | 0 |
Initial rotor position at t=0 [rad] |
coggingTorque |
Cogging Torque (Tcog) | number | 0 |
Peak reluctance cogging torque amplitude due to stator slotting [N·m]. 0 = neglected. |
coggingSlots |
Cogging Slots / Poles | number | 12 |
Number of cogging torque periods per mechanical revolution. |
使用示例
示例 1:转速阶跃响应与负载抑制
一台 12 V 永磁直流电机从静止空载加速,在 时突加 的负载转矩。使用默认参数(),开环电机平稳加速到稳态转速 (),电枢电流为 。负载接入后,转速降至 ,电流升至 。
示例 2:闭环 PID 位置控制
将 thirdOrder 模式的 DCMotor 模块与 PIDController 相连进行角位置调节。用方波设定值()减去位置输出 position()后送入控制器。将 PID 参数整定为 ,可在 内实现快速、临界阻尼且无超调的定位。
说明与最佳实践
- 数值稳定性与步长:默认参数给出条件良好的时间常数(,),在默认步长 和四阶龙格-库塔积分下稳定。
- 代数一阶回退:当 时不再除以 ,而是直接计算平衡电流 ,避免显式求解器常见的刚性不稳定。
- 端口灵活:
loadTorque输入未连接时默认为零,便于只用一个输入做转速实验。
常见工程问题解答 (FAQ)
Q: Why does my DC Motor simulation oscillate or become unstable with very small inductance L?
When the electrical time constant is significantly smaller than the simulation step size (), the differential equation for armature current becomes numerically stiff. If you wish to neglect inductance without changing the simulation step size, select 1st Order in the dynamicsMode dropdown or set . The block will automatically switch to an exact algebraic calculation of armature current , guaranteeing numerical stability.
相关模块
- PIDController/docs.md" class="bw-link">PIDController
- SecondOrderSystem/docs.md" class="bw-link">SecondOrderSystem
- StateSpace/docs.md" class="bw-link">StateSpace
- TransferFunction/docs.md" class="bw-link">TransferFunction