A signal hardware-in-the-loop model for electric vehicles

ROBOMECH Journal, Nov 2016

Recently, researches on electric vehicle are focused on motion control and state estimation. These works require a model that imitate a real vehicle as close as possible. We propose in this paper a signal hardware-in-the-loop model of electric vehicles that includes driving system and vehicle model running in real-time in dSPACE-DS1103 control card. All the required states of the electric vehicle are monitored in Matlab/Simulink environment. The model is validated by implementing representative test cases. Results of this paper can be a useful tool for further electric vehicle researches.

A PDF file should load here. If you do not see its contents the file may be temporarily unavailable at the journal website or you do not have a PDF plug-in installed and enabled in your browser.

Alternatively, you can download the file locally and open with any standalone PDF reader:


A signal hardware-in-the-loop model for electric vehicles

Vo‑Duy and C. Ta Robomech J A signal hardware‑in‑the‑loop model for electric vehicles Thanh Vo‑Duy 0 0 Center for Technology Innovation, Hanoi University of Science and Technology , Dai Co Viet Road, Hanoi , Vietnam Recently, researches on electric vehicle are focused on motion control and state estimation. These works require a model that imitate a real vehicle as close as possible. We propose in this paper a signal hardware‑ in‑ the‑ loop model of electric vehicles that includes driving system and vehicle model running in real‑ time in dSPACE‑ DS1103 control card. All the required states of the electric vehicle are monitored in Matlab/Simulink environment. The model is validated by implementing representative test cases. Results of this paper can be a useful tool for further electric vehicle researches. Magic formula; Pacejkas tire model; Drivetrain model; Dynamic model; Kinematic model; Hardware‑ in‑ the‑ loop model; Electric vehicle - Background In order to enhance safety, efficiency and sustainability of a vehicle, driver support systems and fully automated intelligent transport systems are focused in various researches. Extensive development and testing process are necessary to ensure that these systems are safe and reliable. Until now, real road test on a real vehicle have been expensive, time-consuming and sometimes dangerous. So, developing control algorithm on a simulation model [1, 2] is a reasonable substitution. However, not only describing exactly characteristic of the vehicle, the model has to simulate driver’s behavior which is a very complicated task. Driver’s manipulation simulation needs a combination of several actions at the same time and normally it depends on experience of the driver. In such demands, testing platform based on a hardware-inthe-loop (HIL) model is a significant solution. HIL simulation is a technique that replaces physical parts of an electric vehicle by their mathematical representation or vice versa. Many platforms are found not only for electric vehicle [3, 4] but also for hybrid vehicles [5, 6] and general automotive application [7]. Nonetheless, these models has a common disadvantage that is still expensive since they require various hardware systems of both power electronics and control boards. Inheriting research work in [2], in this paper, we propose a signal HIL model of an electric vehicle that combines hardware of driving system and simulation model. This model has several prominent features such as: (1) applicable for all kind of 4-wheel-controlled vehicles, (2) cost effective, (3) drivable by human through hardware system, (4) fast implementation. The paper is organized as follows. "Hardware-in-the-loop simulation" section allocates the studied objective among types of introduced HIL model and proposes the configuration of the system. In "Vehicle dynamic and kinematic modelling" section, the dynamic and kinematic relationship in a vehicle is modeled. In "Drivetrain modeling" section, model of drivetrain is investigated. "Hardware and system design" section describes the design of the whole hardware in the loop system. "Experimental results" section illustrates the validation results and discusses about the advantages of the model. Finally, some conclusions are given in "Conclusions" section. © The Author(s) 2016. This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. Hardware‑in‑the‑loop simulation Classification Hardware-in-the-loop simulation plays an important role in research of many fields, such as robotics, transportation, electric drive, aerospace, etc. Other than software simulation which is used to check control performance, by replacing one or several real devices for mathematical model, the HIL simulation is used for evaluation of real-time embedded system before implementation on real process. Depending on which parts are replaced as well as the objective of the research, HIL model can be divided into 3 types [8]. • Signal HIL model as shown in Fig. 1a. In this type of model, the entire system model is simulated in realtime simulation environment while the controller is implemented in hardware. Only control and measurement signal are managed in the model. Therefore, this model is called signal HIL simulation. • Power HIL model splits the whole system into subsystems which will be designated as tested objects or simulation ones. In this type of model, both power and signal are managed as illustrated in Fig. 1b. This model gives the most accurate test results since it uses actual subsystems as a part of experiment. • Reduced-scaled HIL model. Its principal is similar to that of power HIL model but the tested power parts are replaced by equivalent subsystems with reduced power. And of course, the replaced subsystems must have the same characteristic with the original ones. This paper deals with the signal HIL model because of its simplicity and application ability. This kind of model emphasizes in evaluating performance of controller and estimation algorithm in real-time. Various tests can be repeated as many times as needed without any effect to the real system. In EV research, the signal HIL control system can be built as illustrated in Fig. 2. The model of the EV is compiled to run in real-time simulation environment while controller and measurement (or estimator) are implemented by using microcontrollers, DSPs or FPGAs which depend upon user’s demands. For motion control or parameters estimation of an EV, the system’s inputs may come from a driver’s behavior collector that gathers driver’s commands. In the middle of the control/measurement block and model of the EV, a signal conditioner is needed to harmonize signals exchanged between these 2 blocks. Generally, this conditioning circuit is called interface system. To be applicable to different studies, research of this paper focuses on driver’s behavior and signal HIL model of an EV. Due to user’s study interest, diverse hardware of controller can be inserted into this model which shows the flexibility of the solution. System configuration A vehicle moving in three dimension space can be seen as a rigid body with 6 degree of freedom (DOF). However, to reduce complexity of the model as well as to increase computational performance, the following assumptions are made: Signal HIL System Model Real- me Hardware Implementa on Real- me Simula on The Studied System Subsystem No.1 (Full Power) Or Equivalent (Reduced-scaled Power) HIL Model of Subsystem No.2 Real- me Hardware Implementa on Real- me Simula on Measurement or Es ma on Signal HIL Model of the Electric Vehicle Fig. 2 Signal hardware‑in‑the ‑loop model with control system of an EV • The vehicle moves on the flat surface. • Effect of roll and pitch motion are neglected. The model is now simplified to 3 DOF including longitudinal, lateral and yaw motion as shown in Fig. 3a. System configuration is illustrated in Fig. 3b. There are two main parts in this configuration, hardware and software. The hardware of the system includes dSPACE-DS1103 for hardware interface and driving system with accelerator pedal, brake pedal and steering wheel. The software is the model of the electric vehicle that simulates drivetrain, vehicle dynamic and kinematic. The models are compiled and implemented in dSPACE-DS1103 to obtain vehicles states, such as longitudinal velocity, lateral velocity, yaw rate, etc. These information is then passed to Matlab/ Simulink which is used as host environment for monitoring whole system. Vehicle dynamic and kinematic modelling Vehicle kinematic Figure  3a shows the vehicle model with fix-body frame at the center of gravity (COG) which is used as the reference coordinate frame. As in [9], the kinematic relationships among velocities, yaw rate and accelerations of the vehicle are written as follows: where ax and ay are the longitudinal and lateral acceleration of vehicle COG, vx, vy and r are longitudinal velocity, lateral velocity and yaw rate of the vehicle respectively. Force model The forces applied to the moving vehicle can be listed as: • Tire-road contact forces include longitudinal forces Fxi and lateral forces Fyi, i = 1 . . . 4 with respect to front-left, front-right, rear-left, rear-right wheels • Air resistance force Fair Assume that rolling resistance is small and can be neglected. The force balance in longitudinal, lateral direction and the torque balance around the vertical axis are given by: where cW is the aerodynamic drag coefficient, A is the frontal area of the vehicle, ρ is the air density, bf and br are the front and rear track width, lf and lr are the distance from front and rear axles to the COG of the vehicle, δ is the steering angle of driven wheels, m and Jz denote vehicle’s total mass and moment of inertia around vertical axis respectively. Tire model In order to solve Eq. (2) to obtain acceleration in 3 DOF, the tire-road forces must be determined. However, these forces are nonlinear and depend on many parameters, e.g. road condition, tire quality, slip ratio, side slip angle. Their nonlinearity are illustrated in the Fig. 4a, b corresponding to longitudinal and lateral direction. In [10, 11], Pacejka has proposed tire formula (called Magic Formula) based on semi-empirical tire model to calculate longitudinal forces as follows: Fxi = D sin (C arctan ((B(1 − E)( i + Shi) +E arctan (B( i + Shi)))) + Svi) in which i is the slip ratio of the ith wheel, B, C, D, E, Shi and Svi are the variables that are functions of coefficients bn, with n = 0 . . . 10 as: B = E = CD where Fzi are the normal force of the ith wheel. The lateral forces is also written as follows: Fyi = D sin ((C arctan (B(1 − E)(αi + Shi) +E arctan(B(αi + Shi)))) + Svi) C = a0 D = Fzi(a1Fzi + a2) E = a6Fzi + a7 a3 sin(2 arctan Faz4i )) B = CD (1 − a5|γ |) Shi = a8γ + a9Fzi + a10 Svi = (a11Fz2i + a12Fzi)γ + a13Fzi + a14 where αi is the sideslip angle of the ith wheel, γ is the camber angle that is set to zero in this model. The coefficients bn in (5) and an,n = 0 . . . 14 in (7) have fixed values depend on the tire and the road conditions. If the vehicle is parked on level pavement, the normal forces depend only on gravitational acceleration, total mass and geometric features of the vehicle. When speeded up with an acceleration, the normal forces under front and rear wheels are written as [9]: dSPACE DS1103 Host Computer Vehicle’s Drivetrain Model Vehicle’s Dynamic & Kinema c Model Matlab/Simulink Fz1 = krx − kx Fz2 = krx − kx Fz3 = Fz4 = krx = = Fz1,xFz1,y (8a) = Fz2,xFz2,y (8b) = Fz3,xFz3,y (8c) = Fz4,xFz4,y (8d) mg llr ; kfx = 21 Icy Road Wet Asphalt Dry Asphalt Wet Asphalt Dry Asphalt kry = 2 kfy = in which, g is the gravitational constant, l = lf + lr is the wheelbase and h denotes the height of COG of the vehicle with respect to the ground. The coefficientskrx, kfx, kx, kry, kfy in (9) are constants and can be calculated once at the beginning of the program to improve computational performance. Sideslip angle and slip ratio Sideslip angle and slip ratio play important roles in controlling vehicles. They must be determined to complete Pacejka’s tire model. The slip ratio is the difference between wheel velocities Reff ωi and longitudinal velocity vx when the vehicle is moving. i = where Reff is the effective radius of tire. It is can be assumed that slip ratio of all wheels are the same when the vehicle moving straight since angular velocities of all wheels are equal. However, when cornering, the lateral motion takes into account and this makes the difference in velocity between wheels. In such a case, the cornering radius must be obtained to determine the slip ratio. As in [12], when the vehicle moves in corner with steering angle δ, its COG will draw a circle with radius that can be written as: R = Therefore, the angular velocity of individual wheels can be calculated from angular velocity of the shaft ω as follows: From (10)–(12), the slip ratio of all wheel of the vehicle can be obtained.The sideslip angle of tires are given by: vx − b2f r vy − lr r vx − b2r r vy − lr r Drivetrain modeling Drivetrain of a vehicle is series of component that dispatches power to driving wheels. In internal combustion engine vehicles (ICEV), the main parts of drivetrain may include traction engine, clutch, transmission with gear, shafts and wheels. On the other hand, electric vehicle is simplified with electric motor(s), transmission with fixed ratio (also called overall reduction ratio) and wheels [13, 14]. Figure  5 shows the typical configuration of electric vehicle. As illustrated, the electric motor rotates and generates torque on its shaft to deliver power to wheels through transmission and differential. In general, differential mechanism basically allows each wheel to spin freely of the other while providing power to both. Differential plays an important role in case of front wheel drive or rear wheel drive vehicles but it is absent in 4-wheel motor drive electric vehicle since the rotation of wheels of such kind of vehicle can be controlled independently. The model of differential can be described by (12). Transmission of an electric vehicle is responsible for transferring torque from motor shaft to differential with fixed ratio Ki. Torque outputs from transmission can be written as below: Tt = KiTe where Te is the torque that is generated by motor. The torque balance around the transmission shaft is [15, 16] = Tt − Reff Ftotal − Tb = KiTe − Reff Ftotal − Tb where Ftotal = i4=1 Fxi is the total longitudinal force on all wheels of the vehicle that is converted back to shaft of transmission, Jx is the moment of inertia of the vehicle and Tb is the brake torque that is proportional to brake command of the driver. One of the major advantages of electric vehicle is the quick torque response of the electric motor compared to the internal combustion engine of conventional cars. Therefore, the motor drive system can be considered as a 1st order transfer function as illustrated in Fig. 6, where the Km is the gain and Tm is the time constant. Transmission (Reduc on ra o Ki) Fig. 5 Electric vehicle drivetrain configuration Tm.s+1 Motor and Controller Transmission Ratio Effetive Radius 3 Ftotal Fig. 6 Model of drivetrain Hardware and system design Simulating driving action can be done by many simulation softwares, e.g. Matlab/Simulink. However, imitating behavior of the driver is not as easy as drag-and-dropping some unit steps or signal builders since it requires combination of many complex actions. In this paper, a racing wheel Betop 3181 is utilized as the driving system which has steering wheel, accelerator and brake pedals. Basically, racing wheels are connected to computer by USB protocol with manufactures driver and it is impossible to decrypt data transfered through USB port of this device. Therefore, a hardware modification is made to extract signal from potentiometers that are attached to each part of the racing wheel. These signals are analogous and then assigned to the inputs of dSPACE-DS1103 control board. On the computer side, the dSPACE-DS1103 control board is selected as the real-time simulation environment that runs the vehicle model. The inputs from the racing wheel are defined in the Matlab/Simulink and connected to appropriate inputs of the vehicle model. Figure  7 shows the description of whole hardware system and Fig. 8 illustrate the complete model in Matlab/Simulink. The model in Fig. 8 contains the vehicle dynamic block which is written in S-function block, vehicle kinematic block, drivetrain and the dSPACE-DS1103 Input/Output Interface. Experimental results Validation scenarios In order to validate the HIL model, two test cases are implemented. In the first test, the vehicle model is controlled to run straight with random speed. This can evaluate the performance of accelerator and brake pedal as well as the simulation model in the longitudinal direction. The second test is to evaluate responses of the system when the car is driven in periodic cornering. According Fig. 7 Hardware description to this test, the vehicle at first is accelerated to a given speed, then the steering wheel is turned in clockwise and anti-clockwise periodically. As the result, the car should turn right and left, respectively. The system parameters used in the model are based on the Electric Vehicle i-MiEV by Mitsubishi and listed in Table 1. Effetive Radius Results The real-time data from the dSPACE-DS1103 can be saved and monitored in Matlab/Simulink environment as illustrated in Fig.  3. Figure  9 shows the first test results when the vehicle runs straight. Normally, accelerator and brake pedal are not allowed to be pushed at the same time. This is illustrated in Fig. 9a for accelerator pedal position and Fig.  9b for brake pedal position. When the accelerator is pushed, longitudinal velocity increases and so as acceleration. The deeper position of the pedal, the higher velocity and acceleration. Considering the time interval (0–20 s), the Fig.  9 can be interpreted as follows. When the accelerator pedal is pushed in the first 14 s, the car is sped up with the acceleration of about 2.5 m/s2 (Fig. 9c) maximum, as the car reaches the velocity of 24 m/s2 (Fig. 9d). At t = 14 s, the accelerator pedal is released as the brake pedal is pushed, the car is quickly slowed down to 12  m/s2 with deceleration as much as −4 m/s2 at the instant t = 20 s. The remained wave forms of this test can be explained similarly. In this model, position of the acceleration pedal is limited at 90% and as can Vehicle Dynamic Vehicle Kinematic be seen, when the pedal is pushed at 84%, the velocity reaches to 29 m/s2 (104 km/h). This approximately equals to specification of i-MiEV (128 km/h at top speed [17]). The second test’s results are illustrated in Fig. 10. As shown in Fig. 10a, the steering angle is turned from zero to negative and positive values periodically. This results in the change of yaw rate of the vehicle accordingly in Fig.  10c. Also, the longitudinal velocity varies with this change. For the purpose of explanation, let’s have a close look at the first 10 s, for example, while the vehicle is driven at velocity of about 7 m/s, the vehicle is turned right as the steering angle is changed from zero (at t = 3 s) to about 0.13 rad maximum (at t  =  6 s). This makes the car rotating around its vertical axis with the yaw rate of about 0.17 rad/s maximum. After that, at t  = 8 s, the steering angle is changed to a negative value of −0.08 rad causing the car turning left, the yaw rate also changes to −0.17 rad/s. As the steering angle is turned clockwise and anti-clockwise, the velocity in Fig. 10b of the vehicle is oscillated from 2.5 m/s minimum to 11 m/s maximum. This is caused by the centripetal effect as mentioned in Table 1 Simulation model parameters (1). At the end of simulation, when the steering wheel turns back to zero, yaw rate and longitudinal are returned to their steady states. Discussion It is worth to point out the specific features and the advantages of the proposed HIL model. • Modeling with S-function. The vehicle model is built on Simulink with S-function blocks (Fig.  8), which allow to extract more state variables of studied system for estimation, observation or control purpose. This can be done easily by adding required variables to the output field of the function callback definition. • Role of the interface system. After re-compiling the model, the output signals presenting the variables are available digitally. In order to proceed further, they must be assigned to the DAC outputs of DS1103. A conditioning interface system is required (Fig.  2) for different EV model and peripheral hardware, as DS1103’s DAC outputs have ±10 voltage range. • Real-time performance evaluation and other capabilities. For the sake of applications of proposed Signal HIL model, electronic control unit (ECU) design scheme, for instance, the controller is developed on basis of a hardware platform, such as DSP, FPGA or MCU. Beside processing measurement signals of state variables as mentioned above, these platforms ) d (ra0.05 e l g n A 0 g n i r -tee0.05 S c Longitudinal acceleration 5 10 15 20 Time (s) c Yaw rate Fig. 10 Wave‑forms in cornering test 2) 3 / 2 s m (n 1 o a 0 r le-1 e c lcA-2 in-3 a d itu-4 g Lno-5 0 ) s /25 m ( y itc20 o l e lV15 a n id10 u t ign 5 o L 30 40 50 60 Time (s) a Accelerator pedal b Brake pedal a Steering angle b Longitudinal velocity d Longitudinal velocity Fig. 9 Wave‑forms in longitudinal run test must reserve inputs for driving system (accelerator and brake pedal positions, steering angle). The estimation or control algorithm will be implemented and applied a set of control value to the outputs of the platform, i.e. drive motor’s torque command, applied brake torque or steering angle. This control set will then be sent to the HIL model through the interface system. When running the whole control system, it can be seen that, both signal HIL model and driving system are implemented in real-time and obviously, the controller will be tested in real-time. This can evaluate the accuracy and performance of control/ estimation algorithm as well as stability of hardware design since the test can be repeated and expanded as needed. Furthermore, by utilizing ability of simulating critical situations, this HIL solution can assess the controller in different modes, especially in fault operation. • Cost-effective and fast implementation. The HIL model in this paper utilizes only regular equipments. There are 2 main parts of the model, the dSPACEDS1103 and the driving system, in which, the DS1103 or similar simulation platform is the minimum requirement for almost all HIL model. The driving system is the low cost racing wheel that can be found easily. In addition, since all the vehicle model is built on Simulink with S-function blocks and transfer functions and the connections of the system are really simple, the researcher can develop very fast their own platform for their studies. This paper has proposed the design of a signal hardwarein-the-loop model for electric vehicle. In this system, the hardware is a racing wheel with all functions of a real driving system, the model of electric vehicle including drivetrain, dynamic and kinematic model is built based on Magic Formula of tire-road contact relationship. The performance of system is validated by two representative testing scenarios which are monitored in Matlab/Simulink environment. The proposed HIL system has been developed in our laboratory and it is shown to be a good tool for studies on motion control and state estimation of electric vehicle. The other purposes, such as energy management or autonomous control are under progress. In addition, the accuracy of the HIL model will be evaluated by comparing with a commercial software and/or experimentation on a real electric vehicle system. Authors’ contributions This work is carried out by the first author in his PhD. program under the supervision of the second author. Both authors read and approved the final manuscript. Acknowledgements This study was supported by the State granted Project KC03.08/11‑15: Design of Control System and Drive for Electric Vehicles. Competing interests The authors declare that they have no competing interests. 1. Schaltz E ( 2011 ) Electrical vehicle design and modeling . In: Soylu S (ed) Electric vehicles-modelling and simulations, 1st edn . p 1 - 24 2. Vo‑Duy T , Ta MC ( 2015 ) A universal dynamic and kinematic model of vehicles . Proceeding of the IEEE vehicle power and propulsion conference (VPPC) , p 1 - 6 . doi:10.1109/VPPC. 2015 .7352889 3. Poon JJ , Kinsy MA , Pallo NA , Devadas S , Celanovic IL ( 2014 ) Hardwarein‑the ‑loop testing for electric vehicle drive applications . Proceeding of the applied power electronics conference and exposition (APEC) , p 2576 - 2582 4. Tabbache B , Ayoub Y , Marouani K , Kheloui A , Benbouzid M ( 2012 ) A simple and effective hardware‑in‑the ‑loop simulation platform for urban electric vehicles . Proceeding of the IEEE international conference on renewable energies and vehicular technology , p 251 - 255 5. Dufour C , Ishikawa T , Abouridal S , Belangerl, J ( 2007 ) Modern hardwarein‑the ‑loop simulation technology for fuel cell hybrid electric vehicles . Proceeding of the IEEE vehicle power and propulsion conference , p 432 - 439 6. Maxwell T , Patil K , Bayne S , Gale R ( 2011 ) Hardware‑in‑the ‑loop testing of gm two‑mode hybrid electric vehicle . IEEE workshop on control and modelling for power electronics (COMPEL) , p 1 - 5 7. Schulte T , Kiffe A , Puschmann F ( 2012 ) Hil simulation of power electronics and electric drives for automotive applications . Electronics 16 ( 2 ): 130 - 135 8. Bouscayrol A (ed) (2011) Hardware‑in‑the ‑loop simulation . Industrial electronics handbook, 2nd edn , tome 3 , Chapter M35 . Taylor and Francis, Chicago 9. Kiencke U , Nielsen L ( 2000 ) Automotive control systems . Springer, Berlin 10. Bakker E , Nyborg L , Pacejka HB ( 1987 ) Tyre modelling for use in vehicle dynamics studies . SAE 870421 11. Pacejka HB ( 2006 ) Tyre and vehicle dynamics . Butterworth‑Heinemann, Amsterdam 12. Jazar RN ( 2009 ) Vehicle dynamics: theory and application . Springer, Berlin 13. Newsroom O ( 2014 ) 2014 mitsubishi i‑miev: most affordability‑price 100% electric powered production vehicle available in america . media. mitsubishicars.com 14. Corporation MM ( 2014 ) Mitsubishi motors to bring new‑ generation ev i‑miev to market . ASTROMAN magazine 15. Fujimoto H , Amada J , Maeda K ( 2012 ) Review of traction and braking control for electric vehicle . Proceeding of the IEEE vehicle power and propulsion conference , p 1292 - 1299 16. Suzuki T , Fujimoto H ( 2010 ) Slip ratio estimation and regenerative brake control without detection of vehicle velocity and acceleration for electric vehicle at urgent brake‑turning . The 11th IEEE international workshop on advanced motion control , p 273 - 278 17. Wikipedia : Mitsubishi i‑miev . Wikipedia.org. Accessed 24 Oct 2016

This is a preview of a remote PDF: http://www.robomechjournal.com/content/pdf/s40648-016-0068-9.pdf

Thanh Vo-Duy, Minh C. Ta. A signal hardware-in-the-loop model for electric vehicles, ROBOMECH Journal, 2016, 29, DOI: 10.1186/s40648-016-0068-9