3. EV conversion ECU design and in-the-loop testing

In current EV conversion development as shown in Figure 6, drive-by-wire (DBW) functions were developed by means of model-based design approach to synchronize the EV driving characteristics and to improve its drivability. The process starts by setting up parameters and variables for conceptual ECU system requirements. Then, the ECU I/O and signals for communications are formulated. Here, both software functions and embedded hardware design for DBW ECU should be completely determined. The next process is to virtually test DBW ECU against requirements' virtually simulated environment. In this process, the main functionalities along with faulty software or malfunction situation for the ECU can be tested. Bug in the software or communication can be tested and tuned safely with this in-the-loop testing methodology throughout the development process.

#### 3.1. Drive-by-wire ECU design

The main function of conceptual drive-by-wire ECU developed by [2] is to determine power demand from the driver, through vehicle supervisory control ECU, based on the pedal ratio in percentage as shown in Figure 7 and software algorithm. Next, percent pedal kickdown signal is sent to DWW ECU for torque command and regenerative percentage setting based on power to torque calculation and motor speed signals [9] in rule-based control algorithm. The input and output (I/O) parameters employed for DBW software and ECU are presented in Figure 8. Since new characteristics from EV propulsion are applied to the old chassis. New torque map shall be calculated to compensate EV conversion performance. The design process can be

Model Based System Design for Electric Vehicle Conversion

http://dx.doi.org/10.5772/intechopen.77265

11

Figure 7. Drive-by-wire ECU functions and signal connection to the supervisory ECU and the motor drive unit [2].

Figure 6. Novel methodology for rapid and safe EV software and hardware development [9].

Figure 6. Novel methodology for rapid and safe EV software and hardware development [9].

region is quite small compared to the field weakening region. The plot also reveals that low

In current EV conversion development as shown in Figure 6, drive-by-wire (DBW) functions were developed by means of model-based design approach to synchronize the EV driving characteristics and to improve its drivability. The process starts by setting up parameters and variables for conceptual ECU system requirements. Then, the ECU I/O and signals for communications are formulated. Here, both software functions and embedded hardware design for DBW ECU should be completely determined. The next process is to virtually test DBW ECU against requirements' virtually simulated environment. In this process, the main functionalities along with faulty software or malfunction situation for the ECU can be tested. Bug in the software or communication can be tested and tuned safely with this in-the-loop testing

The main function of conceptual drive-by-wire ECU developed by [2] is to determine power demand from the driver, through vehicle supervisory control ECU, based on the pedal ratio in percentage as shown in Figure 7 and software algorithm. Next, percent pedal kickdown signal is sent to DWW ECU for torque command and regenerative percentage setting based on power

motor speed is mostly required when driving in the urban area.

Figure 5. Torque speed map of EVC with SFUD driving cycle and no regenerative braking mode.

3. EV conversion ECU design and in-the-loop testing

methodology throughout the development process.

3.1. Drive-by-wire ECU design

10 New Trends in Electrical Vehicle Powertrains

Figure 7. Drive-by-wire ECU functions and signal connection to the supervisory ECU and the motor drive unit [2].

to torque calculation and motor speed signals [9] in rule-based control algorithm. The input and output (I/O) parameters employed for DBW software and ECU are presented in Figure 8.

Since new characteristics from EV propulsion are applied to the old chassis. New torque map shall be calculated to compensate EV conversion performance. The design process can be

done by setting up driving test profile and run the simulation for analysis. However, its

Model Based System Design for Electric Vehicle Conversion

http://dx.doi.org/10.5772/intechopen.77265

13

Simulation results from model-in-the-loop test can be analyzed to verify whether system requirements are met. Driving profile in Figure 14 can be set in several driving schedules as seen in Figure 10. After simulation is performed for DBW function, the parameters such as torque speed curve can be analyzed to check EV output such as performance in driving

Without actual driving, DBW parameters resulted from simulation can be analyzed in different scenarios such as forward driving and reverse driving. Major error can be corrected at this stage along with fault-tolerant function test such as limp home mode in case the DBW is

When ECU hardware is ready for testing, software can embed into the ECU to operate in realtime environment. The process is called hardware-in-the-loop (HIL) test when the drive-bywire software algorithm is replaced by a physical ECU hardware while still connected to virtual environment as seen in Figure 11. Thus, HIL components consisted of an actual hardware, real-time interface, and virtual environments (models). It requires a capable communication protocol to handle real-time signal process where CAN protocol is chosen for this

Arrangement of HIL configuration allows the engineers to conduct test for DBW ECU where it is difficult to perform with the actual vehicle. EV fault and malfunction scenarios can be simulated within the system to check ECU resiliency and fault-tolerant setting. Test repetition and automation can simply be done by scheduling HIL system. Therefore, it helps to reduce testing time and test cases required for real driving. ECU performance testing can be

Figure 10. EV torque speed in four-quadrant driving results for analysis by means of model-in-the-loop simulation [8].

HIL System [12–17]. The overall specification of HIL system can be found in Table 1.

capability is not as effective as real-time simulation, which is presented in Section 3.4.

3.3. Simulation analysis

quadrants in Figure 10.

disconnected or malfunctioned.

3.4. Hardware-in-the-loop test

Figure 8. Input and output signal flow of the drive-by-wire ECU with CAN bus interface [2].

reviewed in Ref. [2]. The basic principle is to determine torque setting for various EV driving situations in four quadrants of torque speed map. This methodology can enable the design of more advanced features, such as driving modes, and other advanced driver assistance system (ADAS).

#### 3.2. Model-in-the-loop test

Initial concept of EV software functions can be tested by simulating EV system components and virtual environment of model-based software function test as seen in Figure 9 [4, 10, 11]. Model-based system design of EV component and drive-by-wire algorithm development can be consulted in details in Ref. [2]. In-the-loop models of driving test profile, supervisory control, DBW function, and motor are developed by using simulation software such as MATLAB/Simulink or others to emulate EV parameters and communication between the ECU and the driving load from vehicle dynamic model. System design requirement can be verified in this MBSF testing stage, such as toque map, and driving mode tests, which can be

Figure 9. Model-based software function test setup where drive-by-wire function model is connected within the loop with other joint models [9].

done by setting up driving test profile and run the simulation for analysis. However, its capability is not as effective as real-time simulation, which is presented in Section 3.4.

#### 3.3. Simulation analysis

Simulation results from model-in-the-loop test can be analyzed to verify whether system requirements are met. Driving profile in Figure 14 can be set in several driving schedules as seen in Figure 10. After simulation is performed for DBW function, the parameters such as torque speed curve can be analyzed to check EV output such as performance in driving quadrants in Figure 10.

Without actual driving, DBW parameters resulted from simulation can be analyzed in different scenarios such as forward driving and reverse driving. Major error can be corrected at this stage along with fault-tolerant function test such as limp home mode in case the DBW is disconnected or malfunctioned.

#### 3.4. Hardware-in-the-loop test

reviewed in Ref. [2]. The basic principle is to determine torque setting for various EV driving situations in four quadrants of torque speed map. This methodology can enable the design of more advanced features, such as driving modes, and other advanced driver assistance system

Figure 8. Input and output signal flow of the drive-by-wire ECU with CAN bus interface [2].

Initial concept of EV software functions can be tested by simulating EV system components and virtual environment of model-based software function test as seen in Figure 9 [4, 10, 11]. Model-based system design of EV component and drive-by-wire algorithm development can be consulted in details in Ref. [2]. In-the-loop models of driving test profile, supervisory control, DBW function, and motor are developed by using simulation software such as MATLAB/Simulink or others to emulate EV parameters and communication between the ECU and the driving load from vehicle dynamic model. System design requirement can be verified in this MBSF testing stage, such as toque map, and driving mode tests, which can be

Figure 9. Model-based software function test setup where drive-by-wire function model is connected within the loop

(ADAS).

3.2. Model-in-the-loop test

12 New Trends in Electrical Vehicle Powertrains

with other joint models [9].

When ECU hardware is ready for testing, software can embed into the ECU to operate in realtime environment. The process is called hardware-in-the-loop (HIL) test when the drive-bywire software algorithm is replaced by a physical ECU hardware while still connected to virtual environment as seen in Figure 11. Thus, HIL components consisted of an actual hardware, real-time interface, and virtual environments (models). It requires a capable communication protocol to handle real-time signal process where CAN protocol is chosen for this HIL System [12–17]. The overall specification of HIL system can be found in Table 1.

Arrangement of HIL configuration allows the engineers to conduct test for DBW ECU where it is difficult to perform with the actual vehicle. EV fault and malfunction scenarios can be simulated within the system to check ECU resiliency and fault-tolerant setting. Test repetition and automation can simply be done by scheduling HIL system. Therefore, it helps to reduce testing time and test cases required for real driving. ECU performance testing can be

Figure 10. EV torque speed in four-quadrant driving results for analysis by means of model-in-the-loop simulation [8].

Figure 11. Hardware-in-the-loop (HIL) test configuration for drive-by-wire (DBW) ECU [9].


protocol is set for PC and ECU real-time interface as seen in Figure 12. Simple driving profile for this specific DBW test consists of different driving patterns to represent accelerator pressing by the driver in Figure 13. More complicated driving profile can be designated based on test

Model Based System Design for Electric Vehicle Conversion

http://dx.doi.org/10.5772/intechopen.77265

15

scenarios and particular interest.

Figure 12. Hardware component integration setup for ECU function tests [9].

Figure 13. Driving profile test profile based on accelerator pedal position [9].

Table 1. Details of HIL test system specification [9].

conducted for EV high speed where it is difficult for real driving test. All model and ECU parameters can be adjusted simultaneously during the test, in real time, enabling more accurate parameter tuning. Therefore, system requirements can be verified in real time in this process.

#### 3.5. Real-time ECU test analysis

To perform DBW ECU HIL test for this work, Simulink real-time workshop toolbox is chosen along with real-time application module for driving profile and vehicle dynamics, and CAN

Figure 12. Hardware component integration setup for ECU function tests [9].

protocol is set for PC and ECU real-time interface as seen in Figure 12. Simple driving profile for this specific DBW test consists of different driving patterns to represent accelerator pressing by the driver in Figure 13. More complicated driving profile can be designated based on test scenarios and particular interest.

Figure 13. Driving profile test profile based on accelerator pedal position [9].

conducted for EV high speed where it is difficult for real driving test. All model and ECU parameters can be adjusted simultaneously during the test, in real time, enabling more accurate parameter tuning. Therefore, system requirements can be verified in real time in

Real-time platform MathWork Simulink real-time workshop

Figure 11. Hardware-in-the-loop (HIL) test configuration for drive-by-wire (DBW) ECU [9].

Components Specification

Drive-by-wire ECU Real-time rapid prototyping board

Vehicle dynamic and driving profile real-time applications Real-time processor board

Interface CAN bus 2.0 (high speed)

Physical connection CAN: DB9 connector Power supply 12 V terminal Protocol sampling time 10 ms

CPU: ARM Cortex-M4 32bits 168 MHz

CPU: ARM Cortex-M4 32bits 168 MHz

RAM: 8 Mb

RAM: 8 Mb

Baud rate: 500 kBaud

To perform DBW ECU HIL test for this work, Simulink real-time workshop toolbox is chosen along with real-time application module for driving profile and vehicle dynamics, and CAN

this process.

3.5. Real-time ECU test analysis

Table 1. Details of HIL test system specification [9].

14 New Trends in Electrical Vehicle Powertrains

Based on the driving profile, the test results can be analyzed. In-depth test analysis can be consulted in Ref. [9]. In this case, performance parameters such as vehicle speed and acceleration are monitored for ECU validation.
