Model Based System Design for Electric Vehicle Conversion Model Based System Design for Electric Vehicle Conversion

Development of electric vehicle (EV) conversion process can be implemented in a low-cost and time-saving manner, along with the design of actual components. Model-based system design is employed to systematically compute the power flow of the electric vehicle propulsion and dynamic load. Vehicle specification and driving cycles were the two main inputs for the simulation. As a result, the approach is capable of predicting various EV characteristics and design parameters, such as EV performance, driving range, torque speed characteristics, motor power, and battery power charge/discharge, which are the necessity for the design and sizing selection of the main EV components. Furthermore, drive-by-wire (DBW) ECU function can be employed by means of model-based design to improve drivability. For the current setup, the system components are consisted of actual ECU hardware, electric vehicle models, and control area network (CAN) communication. The EV component and system models are virtually simulated simultaneously in real time. Thus, the EV functionalities are verified corresponding to objective requirements. The current methodology can be employed as rapid design tool for ECU and software development. Same methodology can be illustrated to be used for EV tuning and reliabil- ity model test in the future.


Introduction
Development in EV conversion has been vastly improved in the recent year. However, different vehicle models have different technical specifications, so conversion kits for each one of them have to be customized in order to meet the specific requirement such as range per charge and acceleration performance. Engineers, therefore, have to make the decision on the capacity of batteries and also how many of them are required to meet the driving demand. Moreover, selection of different types of motor is also presented as the main requirement [1]. Normal design process would require high-end expensive software to model the EV system. Furthermore, building the EV without the knowledge of the parameters within the system could costly lead to the failure of the design.
In addition, poor vehicle performance safety and reliability might occur when new electric propulsion characteristics do not match with the characteristics of replaced engine sharing the same chassis.
Therefore, a sub-ECU must be developed to harmonize EV propulsion dynamics and existing vehicle chassis characteristics called drive-by-wire (DBW) [2]. DBW functionality can then improve EV drivability by providing power demand to the electric motor drive according to the driver preference. However, installation of the DBW ECU without appropriate functional safety design and evaluation could induce such system failures or component malfunctions due to unpredicted behaviors during actual driving situations. Therefore, during the initial development process, ECU functions are needed to be established and evaluated against design and functional safety aspects beforehand [3,4].
To improve EV conversion development process, model-based design process is shown in Figure 1. The method would benefit the design engineer in making better decision for the conversion and also saving time and cost by reducing error during the design process [5][6][7]. The process can be employed to perform system simulation based on different scenarios and technical specification. Embedded system and DBW ECU can be realized by software rapid auto coding to shorten error correction and debugging time. Virtual prototyping test can be employed to validate design requirement and EV conversion specification. The in-the-loop tests can ensure accurate implementation of both software and hardware ECU for the conversion using real-time verification methodology. In this literature, the first model-based design for EV conversion prototyping development, which describes electric vehicle modeling including EV traction, EV components, and power flow models, is defined. Then, drive-by-wire ECU design and in-the-loop testing for EV conversion process are described in details. The last section illustrates versatility of modelbased design in EV conversion tuning and diagnostic application.

EV system modeling
In order to set up the simulation of EV, mathematical models have to be generated first from the engineering principles and theories. The four core models are traction model, motor model, battery model, and power flow model as follows.

Traction model
Forces acting on the vehicle govern the equation for vehicle traction as seen in Figure 2. Those forces comprised of tractive forces F te ð Þ, rolling resistance force F rr ð Þ, aerodynamic force F ad ð Þ, lateral acceleration force F la ð Þ, wheel acceleration force F wa ð Þ, hill climbing force F hc ð Þ [or component force of vehicle weight which depend on grade θ ð Þ], and the gross weight of the co EV mg ð Þ.
The governing relation can be found in Eq. (1) where traction needs to overcome the load that is equal to five other forces: where equation for each force components can be employed from many sources such as reference [2,4] and other automotive textbooks.

Motor efficiency model
In the EV conversion system, the motor replaces the internal combustion engine (ICE) in providing the torque to drive the wheel as shown in Figure 3, which also affects the traction where is copper losses coefficient, is iron losses coefficient, is windage loss coefficient, and is constant loss applied at any speed [6].

Battery discharge model
Battery's dynamic behavior does have a great effect on EV performance and range. Three common types of batteries, which are lead acid, nickel cadmium, and lithium ion batteries, are governed by Eqs. (5), (6), and (7) here, respectively. As seen in [4,6], open-circuit voltage E ð Þ of the batteries is changed as the state of charge changes and is calculated for each battery type below: -Lead acid: ð5Þ The open-circuit voltage also affects the battery current I B ð Þ in both states of charge and discharge as seen in Eqs. (8) and (9).
-Battery current discharge operating at power P bat ð Þ ð8Þ -Battery current charge during regenerative braking where is the battery resistance. Due to Peukert phenomenon [6], therefore it is necessary to take into account such effect by adding the power to the value, such as lead acid battery (k ≈ 1.12) and Lithium ion (k ≈ 1), when simulation of battery discharge is performed. Battery capacity is updated for each time step as shown in Eq. (10) and then used to update the depth of discharge in Eq. (11) for discharging state and in Eq. (12) for charging state as following: -Total charge removed from battery by the nth step of the simulation

EV conversion system power flow model
To complete the simulation, the integrated power flow model is necessary to compute and update the rate of energy going in and out of battery cells, accessories, the motor, gearing components, and wheel to the road and back. Therefore, the model needs to be capable of mathematically simulating the power flow in both driving and braking as shown in Figure 4.
Traction model provides the power flow between the vehicle and the road P te ð Þ as shown in Eq. (13). Furthermore, the motor model provides the power going in for both driving and braking mode at the motor/battery connection P mot_in ð Þand at the motor/transmission connection P mot_out ð Þas indicated in Eqs. (14) and (15). The power parameters are affected by the motor efficiency η m À Á and the gearing efficiency η g . The battery power is also computed and updated (Eq. (16)) during charge and discharge operation using the battery model. Power P ac ð Þ is constantly drawn out of battery due to the use of accessories, such as car stereo and light, which is accounted in Eq. (16) [6,8].
-Energy required per second: -Motor power in driving mode: -Motor power in braking mode: ð15Þ -Battery power:

EV conversion simulation test
Models described in the previous section, especially traction model, are employed to simulate the electric vehicle conversion (EVC) performance by obtaining the velocity plot. The vehicle model specifications are approximately used as the input for the simulation. Other inputs are motor specification and road condition where Refs. [2,4,8] explained this specification in details.

Programming for simulation
The traction model is reduced to nonlinear first-order differential forms in [6,8] when all inputs are substituted. Then, differential equation of velocity is numerically solved using the MATLAB script (.m) file for each time step and updates the values in the program arrays. The out velocity can be plotted against time. The EVC performance here is specified as the time for vehicle to accelerate from 0 to 100 km/h.

EV driving simulation
The other important piece of information for the EV design is range per charge, which tells us how far the vehicle can travel before it needs to be recharged again. In order to obtain such information, the motor model, battery model, and power flow model introduced in the previous section are applied here along with additional inputs. Driving cycle needs to be reasonably selected to simulate the driving dynamics. For present simulation, simplified federal urban driving cycle (SFUD) in [6] is chosen since the vehicle is expected to be driven in the urban area most of the time. The main program [6,8] is employed to call inputs, including vehicle specification and driving cycle, and then execute the power flow model and battery model for each driving cycle and update parameters, such as range and DoD simultaneously. The range per charge then can be plotted when the program is done executing the program. Scenarios for EV range design can be explored using this simulation procedure [6,8].

EV conversion design parameter simulation
EV design parameters shown in the list below can be easily obtained using the simulation done earlier.
To obtain such information, we need to simply write the MATLAB commands in EV main program to update our interested parameters and then write the plot command.
An example of such torque speed map plots is shown in Figure 5, and the vehicle is still operated within the motor power range and maximum torque of 250 Nm. The constant torque region is quite small compared to the field weakening region. The plot also reveals that low motor speed is mostly required when driving in the urban area.

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.

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   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).

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  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.

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.

Hardware-in-the-loop test
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][13][14][15][16][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 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.

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 11. Hardware-in-the-loop (HIL) test configuration for drive-by-wire (DBW) ECU [9].

Components Specification
Drive- 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.   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.

EV conversion tuning and diagnostics
Model-based design can be employed to simulate scenarios where problem might occur during EV conversion process or to figure out the root cause of the problem [18]. The problem can then be realized beforehand by scenario test run to prevent the damage of the EV components and saving time to reinstall new part. The examples of model-based design for tuning and diagnostics can be demonstrated below.

Motor sizing mismatch scenario
This problem can occur during test run of EV conversion prototype where the motor drive converter becomes too hot during initial run of the EV. This problem forces the drive component to shut down to prevent circuit overheat. Therefore, the EV has to stop early to be checked. The torque map simulation can be executed to check whether there is mismatch between driving load and motor sizing as seen in Figure 14 or there is some serge in current during EV driving simulation due to poor EV conversion system design as seen Figure 15.

EV conversion driving range and energy storage technology
For the simplicity of modeling, PEM fuel cell with the lower heating value (LHV) plant will be reasonably modeled as a system with approximated value of efficiency [6]. Mass of liquid hydrogen supplied from cryogenic tank is calibrated to provide the same amount of energy supplied when compared to battery source. Because the fuel cell system was employed to entirely replace the batteries, regenerative braking option was not available. Comprehensive review for other types of fuel cell system and hydrogen storage for electric vehicle can be found in Larminie and Lowry's literature [4,6]. To model the power flow model for fuel cell electric pickup truck, the battery unit is simply replaced by fuel cell system for one way flow of power since there is no regenerative braking option available. The analysis can be seen in Ref. [8].

Fault-tolerant simulation
Another important aspect for EV reliability is the fault-tolerant function. This is the safety feature when the main components of the EV, such as ECU or sensors, are malfunctioned. It ensures that EV can still provide safe operation, although in an inefficient manner. One scenario is limp home mode where EV can still be driven under limited speed and performance. By employing model-based design, limp home mode scenarios can be simulated and analyzed. As a result, accelerator redundant system can be designed and tested to compensate when fault is detected within the EV system.

Noise and vibration simulation
Improper installation or configuration of EV components could seriously induce noise and vibration, resulting in damage or shorter lifespan of EV components or undesirable noise level. EV mechanical system model can be simulated at early stage to validate the level of noise, and vibration is acceptable before the actual bench testing. Vibration characteristics such as resonance Figure 15. EV simulation show excess current drawn from batteries during some period of EV driving. and force inducted due to rotating unbalance of the motor can be investigated and analyzed by means of model-based system design approach as well. Thus, proper noise and vibration handling method for EV system can be applied to protect and maintain EV components.

Conclusion
Model-based system analysis can be helpful to improve EV conversion system design, software and ECU development, testing, tuning, and diagnostic processes along with the actual EV prototype fabrication. It can also be used as a decision-making tool for future EV customization process. This methodology would benefit for EV conversion not only in terms of saving cost but also to shorten development period. As a result, reliable and low-cost EV conversion can be established.