Coding Project 6 / Inverter Modeling Study

Compare ideal, average, and switching inverter models in simulation. 在仿真中比较理想平均开关逆变器模型。

This project turns Lecture 6 into a concrete debugging exercise. You will run the SVPWM tutorial path, create or expose three inverter-model choices, then explain how the chosen model changes phase voltage, common-mode voltage, current ripple, and the apparent delay between command and realized voltage. 这个项目把 Lecture 6 变成一个具体的调试练习。你需要运行 SVPWM tutorial 这条线,建立或暴露三种逆变器模型选择,然后解释模型选择如何改变相电压、共模电压、电流纹波,以及指令电压与实际电压之间看起来的延迟。

Core script核心脚本
simulation/tutorials_ep6_svpwm.py
Deliverable提交物
PDF + modified script or patch
Models模型
ideal / average / switching
Optional bonus可选加分
dead-time error model

Build a small inverter-model comparison harness建立一个小型逆变器模型对比框架

Start from simulation/tutorials_ep6_svpwm.py or a copy of it. Your goal is to compare how the motor input changes when the inverter is represented at different levels of detail. simulation/tutorials_ep6_svpwm.py 或它的副本开始。你的目标是比较:当逆变器用不同详细程度表示时,电机输入会怎样改变。

Minimum implementation requirement最低实现要求 Your code must let the user select at least three modes: ideal voltage source, average inverter, and switching inverter. The selection can be a string, integer flag, or command-line argument. 你的代码必须至少能选择三种模式:理想电压源、平均逆变器、开关逆变器。选择方式可以是字符串、整数 flag 或命令行参数。

Three required inverter models三种必做逆变器模型

Mode A: ideal voltage source模式 A:理想电压源

Feed the commanded $\alpha\beta$ or phase voltage directly into the machine model after normal voltage limiting. This is the fast control-design baseline.在正常电压限幅之后,把控制器指令的 $\alpha\beta$ 或相电压直接送入电机模型。这是快速控制设计基线。

Mode B: average inverter模式 B:平均逆变器

Use duty ratios to compute $\bar u_{xG}=d_xV_{dc}$, then subtract the neutral potential to obtain $\bar u_{xn}$.用占空比计算 $\bar u_{xG}=d_xV_{dc}$,然后减去中性点电位得到 $\bar u_{xn}$。

Mode C: switching inverter模式 C:开关逆变器

Use actual switching states from the PWM carrier comparison and compute $u_{xG}=S_xV_{dc}$ at the machine integration time step.使用 PWM 载波比较得到的实际开关状态,并在电机积分步长上计算 $u_{xG}=S_xV_{dc}$。

Bonus: dead-time model加分:死区模型

Add a simple current-sign-dependent voltage error $\Delta u_x\approx-\operatorname{sgn}(i_x)t_{dead}V_{dc}/T_{pwm}$ and compare it with Mode B or Mode C.加入一个简单的电流方向相关电压误差 $\Delta u_x\approx-\operatorname{sgn}(i_x)t_{dead}V_{dc}/T_{pwm}$,并与模式 B 或 C 对比。

Signals your simulation must log仿真必须记录的信号

Signal group信号组 Required examples至少包含 Purpose用途
Command voltage指令电压 u_alpha*, u_beta* or u_a*, u_b*, u_c* Shows what the controller wanted.说明控制器想要什么。
Duty ratios占空比 T_a, T_b, T_c Connects SVPWM output to inverter model input.连接 SVPWM 输出与逆变器模型输入。
Terminal potentials端电位 u_aG, u_bG, u_cG, u_nG Separates bus-referenced voltages from winding voltages.区分母线参考电压与绕组电压。
Winding voltage and current绕组电压与电流 u_an, u_bn, i_a, i_b, i_c Shows what the machine dynamics actually receive.说明电机动态真正接收了什么。

Five required figures5 张必做图

F1

Model comparison overview模型对比总览

Overlay one representative voltage signal from the ideal, average, and switching modes over the same time window.在同一个时间窗口中叠加理想、平均、开关三种模式下的一个代表性电压信号。

F2

PWM-period zoomPWM 周期放大图

Zoom into several PWM periods and show switching terminal voltage plus its average value.放大几个 PWM 周期,展示开关端电压及其平均值。

F3

Common-mode voltage共模电压

Plot $u_{nG}$ or an explicitly defined common-mode voltage for the average and switching models.画出平均模型与开关模型下的 $u_{nG}$ 或你明确定义的共模电压。

F4

Current ripple comparison电流纹波对比

Compare current ripple between at least two models. Use the same operating point and the same axis scale.比较至少两种模型下的电流纹波。必须使用相同工况和相同坐标尺度。

F5

Error or delay visualization误差或延迟可视化

Plot commanded voltage minus realized average voltage, or show the time shift between command update and voltage realization.画出指令电压减去实际平均电压,或展示指令更新与电压实现之间的时间偏移。

Questions your report must answer报告必须回答的问题

Q1

For your chosen operating point, where do the ideal and average inverter models agree, and where do they disagree?在你选择的工况下,理想模型和平均逆变器模型在哪些地方一致?在哪些地方不一致?

Q2

Why does the switching model show information that is invisible in the average model?为什么开关模型能显示平均模型中不可见的信息?

Q3

How did you compute $u_{nG}$ and winding voltage from terminal potentials?你如何从端电位计算 $u_{nG}$ 和绕组电压?

Q4

What changes when you increase or decrease MACHINE_SIMULATIONs_PER_SAMPLING_PERIOD?增大或减小 MACHINE_SIMULATIONs_PER_SAMPLING_PERIOD 时,结果有什么变化?

Q5

Which model would you use for current-loop controller design, and which model would you use for PWM waveform debugging?你会用哪种模型做电流环控制器设计?又会用哪种模型调试 PWM 波形?

Q6

If you implemented the dead-time bonus, how does its voltage error depend on current direction?如果你实现了死区加分项,它的电压误差如何依赖电流方向?

Suggested submission structure建议提交结构

PDF outlinePDF 提纲

  1. State the base script and the operating point.说明基础脚本和所选工况。
  2. Define the three inverter models you implemented.定义你实现的三种逆变器模型。
  3. List logged signals and sign conventions.列出记录信号和符号约定。
  4. Show F1-F5 and answer Q1-Q6.展示 F1-F5,并回答 Q1-Q6。
  5. Conclude which model is appropriate for which engineering question.总结不同工程问题适合哪一级模型。

Checklist before export导出前检查

The model-selection flag is visible in your code.代码中能清楚看到模型选择 flag。
Every plotted voltage states whether it is bus-referenced or winding voltage.每条电压曲线都说明是母线参考电位还是绕组电压。
All comparisons use the same operating point.所有对比使用同一个工况。
Axes, units, legends, and time windows are readable.坐标轴、单位、图例和时间窗口清楚可读。
Your conclusion chooses models by purpose, not by which plot looks nicer.结论按用途选择模型,而不是按哪张图更好看。