Using a Powertrain system example, this video demonstrates the lookup table optimization capability that enables you to compress the lookup tables in your design to reduce the RAM memory usage. You can approximate a function or an existing block with an optimal lookup table.
设计最佳查找表涉及各种选择:固定点或浮点数据,表的大小,均匀间隔的数据或不均匀间距以及其他算法设置,例如插值方法。所有这些决定都是使用查找表优化器自动化的。
We explore the tradeoff between system behavior and efficient design as measured by the amount of memory reduced.
大家好。我是Mathworks产品营销经理Ram Cherukuri,在此视频中,我们将探索如何优化设计中的查找表,以便使用动力总成控制示例模型将目标ECU上的RAM使用最小化。
首先,什么是查找表优化?
It’s a feature that allows you to optimize the data types and the various parameters of a lookup table, such as the number of breakpoints, their spacing, etc., to give you an optimal lookup table within a user-specified tolerance.
您可以利用此功能在设计中压缩查找表以最大程度地减少RAM足迹,并且还可以使用它来用它来替换复杂的功能或子系统使用查找表,以实现更快的运行时性能。
Please refer to the documentation link and the other videos linked below to know more about how to use this feature in detail.
You have both the command line API and a UI-based app to use this feature.
我们将使用来自动力总成模块式参考示例的传统压缩点火引擎模型,并且该模型具有大约31个查找表。
这是压缩引擎的Simul金宝appink模型,我们可以在面罩下进行探索该子系统的组件。我们将使用此脚本在此示例中贯穿步骤。首先,我们将估算此模型中31个LUTS的总内存足迹。
现在,让我们在此处选择一个查找表进行快速测试,让我们以相对较大的容忍度在输出方面运行优化。我们选择了约25%的绝对耐受性和5%的相对公差。在这里,您可以看到生成的查找表与原始表相比。
The compressed output for this particular LUT gave us a 96% reduction in memory as it uses 8-bit fixed-point data types for the table data while leaving the interface data types in double.
我们尝试了各种耐受性选择,这是一个图表,显示了记忆降低和公差价值之间的权衡。
And as you can see, even with a very strict tolerance, you can save 50% in RAM memory.
我们的脚本执行类似的练习,但是在模型中所有的LUTS,当您在此处运行脚本时,您会生成一个类似的图表,即使具有最严格的公差值,也显示了80%的降低。
这显然强调了如何实现高效设计,尤其是当您从模型中的校准任务中拥有大量查找表时。
One last neat trick before we end the video. You can achieve lossless compression with no change in numerical behavior by choosing the second simulation in the optimization run, yet get more than 50% reduction in memory footprint as highlighted in the graph here.
请参阅视频下面链接的文件交换条目,以在您自己的模型上尝试此示例脚本。
You can also select a web site from the following list:
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。