Model Preparation
Moving your model from desktop simulation to real-time simulation is an iterative process that can require extensive model reconfiguration. You can configure your plant model and create an HDL-compatible version of it for HDL code generation.
To configure your plant model for HDL code generation, use the hdlsetup
function. The hdlsetup
function sets your model
configuration parameters to default values recommended for code generation. You can model
the Simscape™ converters for hardware-in-the-loop (HIL) simulations by using either
Simscape switches or dynamic switches based on the complexity of your network topology.
You choose a solver type (Backward Euler, Trapezoidal Rule, or Partitioning) based on the
type of blocks in your model. If you have linear and switched linear blocks in your model,
choose the Backward Euler solver type. If you have nonlinear blocks in your model, choose
the Partitioning solver type. For more information, see Solver Configuration (Simscape).
Functions
sschdl.generateOptimizedModel | Replace Simscape switches and converter blocks with dynamic switches optimized for FPGA deployment (Since R2024a) |
sschdl.updateRuntimeParameters | Generate updated tunable parameter data file for Simscape model (Since R2024a) |
hdlsetup | Set up model parameters for HDL code generation |
Topics
- 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.
- Real-Time Code Generation and Deployment Process (Simscape)
Follow the hardware-in-the-loop (HIL) simulation workflow to deploy a Simscape model to your real-time target machine using Simulink® Coder™ and Simulink Real-Time™.
- 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.