## 4 Results
### Gearshift Logic  
Considering gear shifting, the controlled object can be represented by the entire vehicle in a broader perspective or by the gearbox itself in a narrower perspective. In the case of a vehicle with a manual gearbox, the control system (driver) analyzes the output values Y and internal states X obtained using the revolution and velocity sensors, and based on the data obtained visually or acoustically and based on the request W, he/she performs gear shifting U.  
Figure 21: Primary gearshift map of the gearshift threshold values.  
Figure 22: Principle of operation of the gearshift map.  
In the case of a vehicle with an automatic gearbox, the function of the control system is taken over by the transmission control unit. The gear shifting itself, represented by the action command U, is controlled automatically based on the comparison of the required values W with the output values Y and internal state values X and is performed in the form of feedback control directly in the TCU. These values are obtained using a number of sensors measuring, for example, revolutions, speed, engine load, accelerator pedal position, etc.  
Figure 23 shows a simplified schematic of the IVECO LMV 4 \(\times\) 4 M65 gearshift. The input for the TCU is the driver's request for the vehicle speed, expressed by the accelerator pedal position W. It compares it with the value of the vehicle speed Y and with the internal state of the vehicle influenced by the engine revolutions, power, torque, currently applied gear, load, etc. Based on the comparison of the current and required state, it creates a command for the gearbox to engage a higher or lower gear or to maintain the current one.  
The given schematic is significantly simplified, as this process involves many other components, sensors, actuators and parameters, which were not included in this schematic. In a real vehicle, the TCU performs a number of other functions that are not essential for the purposes of this study.  
After the integration of the control map into the vehicle model, it is necessary to create a model of the gearshift logic itself, shown in Figure 24. To create the TCU logic model, the Stateflow module of the Matlab simulation environment was used, in which a state diagram was created. It consists of two simultaneously operating transition diagrams. The first one, marked as selection_state, is constantly active and continuously monitors the actual gear and the vehicle speed and compares them with the up_th and down_th limit values. The second transition diagram, marked as gear_state, analyzes the currently applied gear, and based on the signals for upshifting or downshifting, changes the resulting signal with the desired gear for the gearbox.  
In the initial phase of the simulation, the vehicle is in a stable state (no shifting), and the first gear is set in the gearbox. The TCU constantly monitors the vehicle speed and the driver's request (accelerator pedal position). When the speed value for upshifting or downshifting is exceeded by the current vehicle speed at the current power demand (blue lines in Figure 19, up_th values in Figure 21, red lines in Figure 19 and down_th values in Figure 21, respectively), the TCU sends a signal to the gearbox to engage a higher or lower gear. The gearshift time is recorded, and only in the case the shifting condition is present for a predefined time, shifting itself is performed. In this way, unnecessary shifting is excluded.  
Figure 23: Principle of operation of the gearbox control unit (W—required values, U—action command, X—internal state values, Y—output values).