CarMaker Stuck in Preparation Phase with Vehicle Control Plugin
Question
When using the template for a Vehicle Control Plugin created via Simulink block "Create Plug-in Model", CarMaker gets stuck in the preparation phase. This happens for instance with an empty model or one that does not write to existing CM Dict variables. The build process and the registration are successful, the model appears in the Model Manager and the library is visible in the Compile Info.
What is going wrong?
Solution
The reason for the behavior lies in the structure of the CarMaker main cycle. As you can see in the Programmer's Guide chapter 1.6 "The main cycle explained", different modules with the included models are calculated sequentially in one cycle.
In order to start the simulation, the vehicle must first be set to a certain state. This is done by the "Vehicle Operator". This VhclOp is located in the DrivMan block and must be able to communicate with the PTControl Operation State Machine in the Vehicle block. After all, the vehicle is to be set to a certain state. Imagine it like this: If you want to drive off with a car, you have to get in, start the engine, etc...
The Vehicle Control Module sits between the DrivMan and the Vehicle Block. This means that for the above communication the signals have to be passed on. If no Vehicle Control model is selected in the Vehicle Data Set, the signals are forwarded from the DM Block (thus they also get the new name VC.< UAQ >). By implication you have to ensure the forwarding of the signals, if you want to use a Vehicle Control plugin. Otherwise the connection will be interrupted and the vehicle will never reach the correct state during the preparation phase. Of course you also have the possibility to provide your own Vehicle Operator Signals in your Vehicle Control plugin without passing the DrivMan signals.
So the solution is simple: Just forward all signals you don't want to manipulate and recompile the model.
Please have a look at the interface variables of each model class to get an idea which signals have to be provided as output of a user defined model (Reference Manual > e.g. Steering Interface > Interface for the evaluation function).
- Date: 26.04.2021
- Product: CarMaker
- Version: 12.0
- Component: Model Integration
- Language: English
Tags
Vehicle ControlUser models