Download Chenxi Lei
Transcript
If you specify the stop time equal or higher than ―0.01‖s, then every time the C++ shared library is called, it will have the effect as when the Simulink model executes more than two runs. This will mean that for CACC, at the beginning of each run, the C++ shared library would use the same value for preceding vehicle’s acceleration (one input of the controller). Thus every time the C++ shared library is called, the value for preceding vehicle’s acceleration for all the runs after the first run will be out-dated. In our experiments, we would like to evaluate the performance of CACC controller used in ideal communication circumstances, where the controller can always get ―fresh‖ and up to date input every time it runs. So in each SUMO timestep, we specify that the CACC controller runs once by calling the C++ shared library once. In this way we can timely assign the fresh (and up to date) value of preceding vehicle’s acceleration to the CACC controller. Therefore, we have to specify the value of stop time less than one sampling timestep. For other parameters, we just use the default values. 1.3.4 Other Considerations After that, one can convert the whole Simulink model by selecting ―tools->Real-Time Workshop-> Build Model‖. It is important to note that we encountered several problems during the process of converting the original Simulink model provided by TNO, into the C++ source code. In the original Simulink model provided by TNO, two stateflow (charts) are used, which could not be converted. One stateflow (chart) is used in the ―fault detection, isolation&recovery‖ module in the RT system, the other is used in the ―from HMI‖ module, see Appendix B. The following error message was generated during the conversion process: ―To build RTW with Stateflow blocks requires a valid Stateflow Coder license‖. It’s still not clear whether a real license is needed or it might only be a bug. A similar problem occurred when we tried to convert the Kalman filters. Therefore, we have just taken the pure ACC and CACC controllers from the RT control system and the ―G_a‖ module that is used to revise the value generated by the ACC and CACC controllers from the ―vehicle‖ module. Due to the converting problems with the Kalman filters, we were not able to use the ―single target tracking‖ or ―multiple target tracking‖ functions incorporated in the ―target-tracking‖ block. This is because these functions are using the Kalman filters. The only ―target-tracking‖ function that we could use is the ―direct measurement‖ function. All details about the original Simulink model can be found in Section 1, Appendix B, and the modified Simulink model used in the experiments performed in this assignment can be found in Section 2, Appendix B. Finally, we were able to generate the C++ code of the modified Simulink model, which does not include fault detection and host tracking functions. Note, before one converts the model, the parameters of the model can be loaded by running the parameters file. The original parameter file is named ―caccrt_p.m‖ which was used together with the original Simulink model named ―caccrt.mdl‖. The modified parameter file is named ―testpartofcacc_p.m‖ used for modified Simulink models for controllers which supplied by this appendix. Note that the CACC controller models’ names start with ―trysome‖ while the ACC controller models’ names start with ―accwithout‖. 4