CAPITULO III: PROYECTO DE MODIFICATORIA DEL CÓDIGO DEL NIÑO Y DEL ADOLESCENTE RESPECTO DE LA JUSTICIA JUVENIL
5. PLANTEAMIENTO OPERACIONAL
Fig. 6-7. Variables in ControlDesk model.
The generated C code contains all variables in the Simulink/Stateflow model and it can now be loaded into the dSPACE ControlDesk experiment. After the C code is loaded into the DS1006 board on the dSPACE simulator, the variables are listed at the bottom of the window as shown in Fig. 6-7. The ControlDesk contains a wide range of instruments that can be selected such as buttons, sliders, data acquisition instruments, etc., as shown in the right of Fig. 6-8. The variables will then be linked with selected instruments. To assign variables, they are dragged from the variable browser onto the instrument and these steps are repeated for all variables in this experiment. Selected instruments can now be put in operation by switching to animation mode. Fig. 6-9 shows part of the layout which contains control signals.
Four knobs at the top of this diagram are used to control the input value which is modelled on the left of the state chart in the Simulink/Stateflow model as illustrated in Fig. 6-5 and Fig. 6-6. Grey rectangles in this diagram are “OnOffButton”s. They are utilized to represent the constant blocks in the Simulink model to generate control signals. The “RadioButton”s on the right of this diagram are used to switch between “ChassisView” and “CompassView”, “Low” transfer gear and “High” transfer gear respectively. All the output states are linked with “MultiStateLED”. Fig. 6-10 shows one of the output displays in comparison with Fig. 5-2 after the simulation is enabled.
Fig. 6-9. Layout of input signals in ControlDesk.
As shown in Fig. 6-10, blocks turn into a green colour to represent active states when corresponding buttons in Fig. 6-9 are clicked. For instance, the screen currently shows 4×4 information. The information on the left and central area of the display is available to the driver. The right area is currently in chassis view. The functions of the 4×4 Information System are thereby simulated and tested on a real-time basis. However, there is a difference between the ControlDesk model and the actual 4×4 Information System displayed in terms of user interface. Therefore, animation of the real-time simulation is enabled to obtain a better visualization.
6.4
Animation of the real-time simulation
Fig. 6-11. Display shows “Home” screen during real-time animation.
The animation of the user interface of the 4×4 Information System is realized by customizing appointed instruments that benefits from comprehensive configuration options for instrument properties such as size, position, fonts and colours. For instance, the background picture of “MultiStateLED” which shows the status of the states is changed according to its role in the system. As shown in Fig. 6-11, the home screen of the Driver Information System is displayed on the right side of this
layout. The buttons for generating control signals are located on the left side of this layout. During the real-time animation, the developer clicks on the button, the display on the right side of the layout switching to corresponding pictures represents the mode changes. For example, when the developer clicks on the “Audio Video” button, the right area shows the “Radio” screen as displayed in Fig. 6-12. The “4×4 Info” screen appears when the “4×4 Info” button is clicked. The “4×4 Info” screen as shown in Fig. 6-13 represents the 4×4 Information System that is modelled in detail.
Fig. 6-12. Display shows “Audio Video” during real-time animation.
Fig. 6-14. The real-time animation of 4×4 Information System interface. Fig. 6-14 illustrates the real-time animation of the 4×4 Information System. The top half of the window represents the 4×4 Information System display. It translates the design requirements into the visualized layout. Each block exhibits a type of information that can be viewed by the driver. The control blocks are integrated at the bottom of this layout. The sliders can be dragged to simulate different input values. The vehicle settings can be changed and driving modes can be switched by clicking buttons. This simulates the possible behaviour reactions of a driver when they face different driving situations. The buttons on the display can be clicked to simulate different situations without any interruption to the experiment. Most importantly, the change of pictures represents various modes or settings of the vehicle on the real-time basis. Thus, the robustness and the reliability of designed and developed functions are ensured.
6.5
Discussion
Given the complexity of the automotive SoS such as the 4×4 Information System presented in Chapter 3, the software function of this SoS has to be developed in consideration of the physical structure of the vehicle network, i.e., the large amount of real-time data is captured with a large number of interactions among the electronic systems on the vehicle and they have to be delivered and displayed correctly in order to enable the advanced functions of the 4×4 Information System. Thus, the real-time behaviour of the software is vital to the success of flawless software delivery for the automotive electronic SoS development. This chapter proposes a novel approach to verify the advanced function of automotive electronic SoS through real-time simulation and animation.
In this chapter, RTW produces the C code from the Simulink/Stateflow model for the real-time platform target to implement the real-time animation of the 4×4 Information System interface. Experience shows that dSPACE ControlDesk provides the features for the verification of advanced functions. Developing the function model in Simulink/Stateflow and then generating the code and transferring the model into dSPACE ControlDesk to perform real-time animation is a feasible and effective approach to the development of an automotive electronic SoS. This technique improves confidence in the function model built and generated code. Moreover, the real-time animation helps developers to become aware of the complexity of the SoS and allows engineers to realize the function interface and execute their concepts in the very early stages of the development. They are significant benefits that ensure the successful development of an automotive electronic SoS.