UserVehicle_RTW
===============
In this example a simple vehicle model was implemented in Simulink.
Relevant files and places to look at
------------------------------------
.
|-- Data
| |-- TestRun
| | `-- Examples
| | `-- BasicFunctions
| | `-- Simulink
| | `-- Hockenheim_UserVehicle_RTW
| `-- Vehicle
| `-- Examples
| `-- UserVehicle_RTW
`-- src
|-- Makefile
|-- README-UserVehicle_RTW.txt
|-- tire_lin.c
|-- tire_lin.mexa64 (Linux) OR .mexw64 (MS Windows)
|-- User.c
|-- UserVehicle_RTW.mdl
`-- UserVehicle_RTW_CarMaker_rtw
|-- UserVehicle_RTW_wrap.c
`-- UserVehicle_RTW_wrap.h
o src/UserVehicle_RTW.mdl
The Simulink model itself.
o src/tire_lin.c
src/tire_lin.mexa64 (Linux) OR .mexw64 (MS Windows)
An S-function of a simple, linear tire model used in UserVehicle_RTW.mdl
plus a ready-to-use, precompiled mex-binary of the S-function. In case
you want to compile the S-function yourself please see the instructions
in the comments at the top of the source file.
o src/UserVehicle_RTW_CarMaker_rtw/UserVehicle_RTW_wrap.h
src/UserVehicle_RTW_CarMaker_rtw/UserVehicle_RTW_wrap.c
The wrapper source code.
o src/User.c
#include of the wrapper header file.
Registration of the UserVehicle_RTW model in function User_Register().
The corresponding statements are added automatically by the RTW build process.
o src/Makefile
libUserVehicle_RTW_$(ARCH).a is added to the list of files that make up the
CarMaker executable.
The corresponding statements are added automatically by the RTW build process.
o Data/Vehicle/Examples/UserVehicle_RTW
The vehicle data set for the vehicle model. In the vehicle data editor see
also the "Additional Parameters" on the "Misc." tab.
o Data/TestRun/Examples/BasicFunctions/Simulink/Hockenheim_UserVehicle_RTW
A copy of the Hockenheim testrun which uses the UserVehicle_RTW
vehicle data set.
Almost all places where modifications were made to existing files can be
found by doing a textual search for "UserVehicle_RTW".
Implementation details
----------------------
o The model is connected to CarMaker by "registering" it, i.e. adding it to
the list of available vehicle models. Registering is done in the model
wrapper's central interface function UserVehicle_RTW_Register(), which is
called from User_Register() in src/User.c. Once it is registered, the
UserVehicle_RTW module can be activated with the right FileIdent entry in
the vehicle's configuration file. CarMaker then automatically calls the
functions of our vehicle model using the function pointers in the
tModelClassDescr struct.
o The instance pointer of the Simulink model is returned as the function
value of the UserVehicle_RTW_New() function. It is automatically passed via
the MP argument, when any of the other functions are called by CarMaker,
hence no local instance pointer variable is needed.
o Since CarMaker communicates with our vehicle model mainly via the module's
Calc() function and the parameters passed to it, the connection between the
Simulink model and CarMaker is implemented accordingly. The toplevel diagram
of the Simulink model contains only Inport and Outport blocks. In the
generated C code their counterpart can be found in the model's ExternalInputs
and ExternalOutputs structs. As a consequence, the UserVehicle_RTW_Calc()
function in UserVehicle_RTW_wrap.c consists mainly of statements shuffling
data between the function's IF interface parameter and the model.
NeilSwift
- 粉丝: 128
- 资源: 3
最新资源
- (源代码+论文+PPT模板+数据库)云端守护者宠物诊所【java毕业设计】.zip
- (源代码+论文+PPT模板+数据库)云端宠诊所系统【java毕业设计】.zip
- springboot030甘肃非物质文化网站的设计与开发.zip
- (源代码+论文+PPT模板+数据库)智慧之选宠物诊所【java毕业设计】.zip
- (源代码+论文+PPT模板+数据库)智兽医疗小精灵【java毕业设计】.zip
- (源代码+论文+PPT模板+数据库)智宠医疗乐享服务【java毕业设计】.zip
- MATLAB代码:基于共享储能电站的工业用户日前优化经济调度 关键词:共享储能 储能电站 容量优化配置 充放电优化 日前优化调度 参考文档:《基于共享储能电站的工业用户日前优化经济调度》完全复现
- (源代码+论文+PPT模板+数据库)智悦宠诊所系统【java毕业设计】.zip
- (源代码+论文+PPT模板+数据库)专业守护之星诊所【java毕业设计】.zip
- (源代码+论文+PPT模板+数据库)智悦兽医平台【java毕业设计】.zip
- springboot035学科竞赛管理.zip
- springboot033小徐影城管理系统.zip
- springboot034在线商城系统设计与开发-代码.zip
- MATLAB程序设计:微电网调度优化 通过两个案例学习cplex求解 解决微电网优化调度问题 案例一:机组组合优化(优化各常规发电机组启停问题以及出力 满足系统负荷要求 以达到成本最优) [三个
- springboot036海滨体育馆管理系统的设计与实现.zip
- springboot038基于SpringBoot的网上租赁系统设计与实现.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0