How to Set the Sample Time for Power Converter
- Click Simulation (Upper Site)> Model Configuration Parameter>Solver>Solver Option=Variable Step> Additional Options: Max step size= 1e-6
- 1e-6 is the standard. The minimum “Max step size” is:
Max Step Size <= 1 / Switching Frequency / Sample In A Period - Sample in a period is recommended at 30. Higher value give better results but require high computing power.
How to Set the Sample Time for Controller
- Group all the controller into a subsystem.
- Right click subsystem
- Block Parameter (Subsystem)
- Mark “Treat as atomic unit”
- Set the sample time to your desired instead of -1
There will be error since the block inside the subsystem used sample time 0 (simulation sample time). It need to be set to -1 (inherited).