模型准备
将模型从桌面仿真转移到实时仿真是一个迭代过程,可能需要重新配置大量模型设置。您可以配置被控对象模型并针对 HDL 代码生成创建一个 HDL 兼容版本。
要为 HDL 代码生成配置被控对象模型,请使用 hdlsetup 函数。hdlsetup 函数将模型配置参数设置为针对代码生成推荐的默认值。您可以使用 Simscape™ 开关或基于网络拓扑复杂度的动态开关对硬件在环 (HIL) 仿真的 Simscape 转换器进行建模。根据模型中的模块类型选择求解器类型(后向欧拉、梯形法则或分割)。如果模型中有线性和开关式线性模块,请选择后向欧拉求解器类型。如果模型中有非线性模块,请选择分割求解器类型。有关详细信息,请参阅 Solver Configuration (Simscape)。
函数
sschdl.generateOptimizedModel | Replace Simscape switches and converter blocks with dynamic switches optimized for FPGA deployment (自 R2024a 起) |
sschdl.updateRuntimeParameters | Generate updated tunable parameter data file for Simscape model (自 R2024a 起) |
sschdl.tuneOptimizedModel | Tune parameter values for dynamic switches optimized for FPGA deployment (自 R2026a 起) |
hdlsetup | 设置用于 HDL 代码生成的模型配置参数 |
主题
- Modeling Guidelines for Simscape Subsystem Replacement
Simscape modeling best practices for replacing Simscape subsystem with state-space algorithm.
- Simscape Language Support for FPGA HIL Deployment
Simscape language support in Simscape Hardware-in-the-Loop Workflow.
- Estimate Achievable Target Frequency Without Running Synthesis
Estimate the optimal frequency that you want your Simscape models to achieve on FPGA without running synthesis.
- Modeling Techniques for Simscape Converters for FPGA HIL Deployment
Model your power electronic converter by using hardware-in-the-loop (HIL) simulation in a real-time target machine.
- Modeling Best Practices for FPGA HIL Deployment
Modeling guidelines and best practices for FPGA HIL deployment. (自 R2026a 起)
- 模型准备 (Simscape)
获取参考结果,性能优化
- Define Step Size and Number of Nonlinear Iterations for Simscape Real-Time Simulation (Simscape)
Determine the step size and number of nonlinear iterations for fixed-step, fixed-cost simulation.
- Increase Simulation Speed Using the Partitioning Solver (Simscape)
Improve performance by using the Simscape Partitioning solver to convert a large system of equations into several smaller systems of equations that are easier to solve.
- Replace Piecewise-Constant Resistor with Switched Linear Components
Convert a Simscape model with nonlinear component into a switched linear model.
- Simulate Large Time Steps Using Trapezoidal Rule Solver for Real-Time FPGA Deployment
Generate HDL code for a Simscape model by using the Trapezoidal Rule solver and deploy it onto a Speedgoat® FPGA I/O module.
- Generate Optimized Simscape Three-Phase PMSM Drive Model for Real-Time FPGA HIL Deployment
Optimize three-phase PMSM model from a Simscape model for HDL code generation and FPGA deployment.