模型准备
将模型从桌面仿真转移到实时仿真是一个迭代过程,可能需要重新配置大量模型设置。您可以配置被控对象模型并针对 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 起) |
hdlsetup | Set model configuration parameters for HDL code generation |
主题
- Modeling Guidelines for Simscape Subsystem Replacement
Simscape modeling best practices for replacing Simscape subsystem with state-space algorithm.
- Simscape Language Support
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
Model your power electronic converter by using hardware-in-the-loop (HIL) simulation in a real-time target machine.
- Model Preparation Process (Simscape)
Follow the real-time model preparation workflow to make your Simscape model real-time capable.
- Fixed-Cost Simulation Process (Simscape)
Configure the solvers in your Simscape model for real-time simulation.
- 实时代码生成和部署过程 (Simscape)
按照硬件在环 (HIL) 仿真工作流,使用 Simulink® Coder™ 和 Simulink Real-Time™ 将 Simscape 模型部署到您的实时目标机。
- Replace Piecewise-Constant Resistor with Switched Linear Components
Convert a Simscape model with nonlinear component into a switched linear model.
- Generate HDL Code for Simscape Models by Using Trapezoidal Rule Solver
Generate HDL code for a Simscape model by using the Trapezoidal Rule solver and deploy it onto a Speedgoat® FPGA I/O module.
- Optimize Simscape Three-Phase PMSM Drive Model for Efficient HDL Code Generation and Synthesis
Optimize three-phase PMSM model from a Simscape model for HDL code generation and FPGA deployment.