From the series:改善您的赛车发展
Spend more time on algorithm development and less time manually producing code. With the click of a button, you can bring algorithms to C/C++ code and hardware with code generation. Christoph Hahn and Application Engineer Andreas Uschold, both of MathWorks, walk through the basics of code generation and the tools available to simplify and speed up the process.
Code generation tools are a great alternative to manual coding, which is time consuming and error prone. There is a benefit to having the entire process in one tool chain where, for example, an electrical Formula Student team developing vehicle dynamics controllers, such as torque vectoring, can bring it to its CPU as quickly as possible.
Andreas描绘了使用Design V的代码生成的典型行业工作流程,这是许多汽车公司使用的设计工作流程。在simulink中查看这个金宝app®,显示的示例是一个典型的闭环控制系统,带有控制器和您要控制的硬件。要从系统中生成代码,您只需按MATLAB中的按钮®和Simulink and get C/C++ code. The generated code complies with the ANSI ISO C standard and is as readable as good manual generated C code.
Having the code does not mean it is running on the hardware so Andreas then gives an overview of hardware support packages and their benefits. Hardware support packages are available for different hardware platforms and enable you to embed and deploy your code.
最终,基于模型的设计有助于尽早检测错误并加快开发过程。这是代码生成的一个很好的概述,我们将在以后的情节中更详细地介绍各个步骤。
Below are links to software and hardware products and services mentioned in the episode:
Two episodes of the MATLAB and Simulink student lounge are closely connected to that topic. In thefirst video在循环(PIL)测试中进行了更详细的解释second videoa top of the world electric Formula Student team explains their approach to code generation and testing.
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
您还可以从以下列表中选择一个网站:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.