Research on Two-Speed Battery Electric Vehicle Modeling and Shift Control Strategy

Global energy shortage and environmental degradation have accelerated the transformation of the automotive industry toward new-energy solutions. Among all emerging vehicle categories, battery electric cars are considered one of the most effective paths for achieving low-carbon mobility because they deliver zero tailpipe emissions and low operating noise. However, many battery electric cars currently adopt a fixed single-speed reduction gear, which creates a dilemma: the driving motor cannot always operate in its high-efficiency region, and dynamic performance, energy economy, and climbing ability are difficult to balance simultaneously. A two-speed transmission offers a promising solution to these issues by adjusting the gear ratio according to the driving conditions. It can effectively extend the high-efficiency operating region of the traction motor and improve the overall performance of electric cars.

In this research, a two-speed pure electric vehicle is selected as the research object. We systematically investigate the powertrain parameter matching process, gear-ratio optimization using a multi-objective metaheuristic, shift-pattern design, and real-time control verification through hardware-in-the-loop simulation. The aim is to show a complete development flow that can be adopted for commercial electric cars equipped with automated manual transmissions. The remainder of the article is organized as follows: Section 2 presents the vehicle specifications, parameter matching, and full vehicle modeling in MATLAB/Simulink. Section 3 describes the proposed non-dominated sorting whale optimization algorithm and its use in finding the optimal gear ratios, followed by the construction of dual-parameter shift schedules based on power and economy targets. Section 4 focuses on the dynamic shift control strategy, including the definition of driving modes, a logic-based shift controller, and an extended Kalman filter enhanced fuzzy control scheme. Section 5 introduces the hardware-in-the-loop test platform and verifies the controller functions. Finally, major conclusions are summarized.

1. Powertrain Configuration and Parameter Matching

Unlike internal-combustion-engine vehicles, battery electric cars are driven by an electric motor powered by a battery pack. The motor has the advantage of delivering high torque at low speed and maintaining a wide speed range. However, a single-speed reducer forces the motor to work over a broad speed band, which increases the difficulty of keeping all operating points within an efficient zone. A two-speed transmission can divide the driving tasks into two modes: first gear provides a large torque ratio for starting, acceleration, and climbing, while second gear provides a smaller ratio for high-speed cruising. Thus, the motor can be downsized without sacrificing acceleration or top-speed performance, and the battery electric car can maintain higher efficiency during city and highway driving.

2. Vehicle Specifications and System Modeling

2.1 Basic Parameters and Performance Targets

The vehicle evaluated in this study is a commercial electric van with a gross mass below 4500 kg. The main parameters are listed in Table 1. The target performance requirements are summarized in Table 2.

Table 1. Basic vehicle parameters
Parameter Symbol Value Unit
Curb mass m0 2925 kg
Full-loaded mass mx 4495 kg
Wheelbase l 3308 mm
Rotational mass conversion factor δ 1.2 –
Rolling resistance coefficient f 0.012 –
Frontal area A 5.336 m2
Air drag coefficient CD 0.6 –
Tire rolling radius r 0.373 m
Table 2. Required vehicle performance
Performance indicator Symbol Value Unit
Maximum speed ua,max 100 km/h
Maximum climbing grade imax >30 %
0-100 km/h acceleration time tacc <12 s
Driving range L >250 km

2.2 Single-Speed versus Two-Speed Configuration

To demonstrate the necessity of using a two-speed gearbox, we first constructed a simulation model for the same electric car with a fixed single-speed ratio. The simulation results show that the single-speed version can finish the 0-100 km/h acceleration in 11.7 s, but its maximum climbing grade is only 21.3% and its top speed is limited to 93.7 km/h. The single-speed layout therefore cannot satisfy the original target simultaneously. Increasing motor power and battery size might improve, but this would increase cost and energy consumption. A two-speed layout is more reasonable because it uses a gear pair to magnify torque in low-speed conditions while reducing motor speed at high vehicle velocities.

2.3 Drive Motor Selection and Power Sizing

In modern battery electric cars, the permanent magnet synchronous motor is often preferred because of its high power density, high efficiency, low noise, and excellent dynamic response. Therefore, the two-speed electric vehicle studied here uses a permanent magnet synchronous motor. The required peak motor power is determined from three extreme operating conditions: maximum speed, maximum climbing grade at a steady speed, and acceleration time from standstill to 100 km/h.

The general longitudinal dynamics equation of a vehicle is given by:

$$ P_{M}=\frac{1}{\eta_{t}}\left[\frac{mgf u_a\cos\alpha}{3600}+\frac{mg\sin\alpha \, u_a}{3600}+\frac{C_D A u_a^3}{76140}+\frac{\delta m u_a}{3600}\frac{du}{dt}\right] $$

For the maximum-speed condition, \(\alpha=0\) and \(du/dt=0\), so the required power is:

$$ P_{u_{\max}}\ge \frac{1}{\eta_t}\left(\frac{mgf u_{a,\max}}{3600}+\frac{C_D A u_{a,\max}^3}{76140}\right) $$

For a constant speed \(u_i\) on the maximum slope \(\alpha_{\max}\), the required power becomes:

$$ P_{i_{\max}}\ge \frac{1}{\eta_t}\left(\frac{mgf u_i\cos\alpha_{\max}}{3600}+\frac{mg u_i\sin\alpha_{\max}}{3600}+\frac{C_D A u_i^3}{76140}\right) $$

For the acceleration performance, we use an empirical formula that accounts for the required acceleration time:

$$ P_{t_{\max}}=\frac{1}{\eta_t}\left[\frac{mgf u_t}{3600}+\frac{C_D A u_t^3}{76140}+\frac{\delta m u_t^2}{7.2 t}\right] $$

where \(u_t\) is the final speed (100 km/h) and \(t\) is the specified acceleration time.

Combined with the vehicle parameters and further matching to a commercially available motor, the drive motor parameters used in this study are summarized in Table 3.

Table 3. Drive motor parameters
Item Value Unit
Peak power 120 kW
Rated power 65 kW
Peak torque 350 N m
Rated torque 270 N m
Maximum speed 12000 r/min
Rated speed 5500 r/min

2.4 Battery Parameters

The battery pack is the sole energy source for battery electric cars. In order to meet the required range of 250 km under the China Heavy-Duty Commercial Vehicle Test Cycle for Light Trucks (CHTC-LT), a lithium iron phosphate battery is selected because of its safety, long life, and acceptable energy density for commercial electric cars. The total energy needed can be estimated as:

$$ E_t = \frac{W L}{\eta_d} $$

where \(W\) is the energy consumption per kilometer, \(L\) is the required driving range, and \(\eta_d\) is the discharge depth. The number of series cells is:

$$ n = \frac{V_t}{V_c} $$

The selected battery parameters are shown in Table 4.

Table 4. Battery specifications
Item Value Unit
Total energy 110 kWh
Number of series cells 150 –
Single cell nominal voltage 3.6 V
Total pack voltage 540 V

2.5 Transmission Ratio Determination

The maximum gear ratio must satisfy the climbing requirement and the adhesion limit, while the minimum gear ratio must enable the desired maximum speed and overcome the resistance at that speed. The initial gear ratios are calculated according to the following conditions:

$$ i_{g,\max}\ge \frac{r\left(mg f\cos\alpha_{\max} + mg\sin\alpha_{\max} + \frac{C_D A u_i^2}{21.15}\right)}{T_{tq,\max} i_0 \eta_t} $$
$$ i_{g,\min}\le \frac{0.377 n_{\max} r}{u_{a,\max}} $$

After the preliminary matching, the initial transmission ratios are selected as \(i_1=4.55\), \(i_2=1.65\), and final drive ratio \(i_0=6.15\). Later, these ratios are optimized to further improve the performance of electric cars.

2.6 Full Vehicle Simulation Model

A forward-looking vehicle simulation environment is established using MATLAB/Simulink. The model consists of the following interconnected sub-models:

  • Driving cycle model: The CHTC-LT cycle is loaded to provide the target vehicle speed profile over time. This cycle contains urban, suburban, and motorway segments.
  • Driver model: A PID controller simulates the driver’s accelerator and brake operations by comparing the target speed and actual vehicle speed.
  • Drive motor model: The motor efficiency map and torque-speed envelope are implemented as lookup tables. The input is the demanded torque, and the output is the actual torque and electrical power consumption.
  • Battery model: An equivalent internal-resistance model uses the open-circuit voltage and internal resistance to update the state of charge (SOC).
  • Transmission model: The gear selection signal determines the transmission ratio. The shift logic is controlled by Stateflow.
  • Vehicle dynamics model: The longitudinal dynamics equation computes the acceleration, speed, and distance traveled.

This simulation platform is later used for gear-ratio optimization, shift-strategy design, and control-strategy verification.

3. Transmission Ratio Optimization and Shift Schedule Design

3.1 Optimization Problem Formulation

Gear ratios in a two-speed transmission strongly influence the overall performance of battery electric cars. To improve both acceleration performance and energy economy, the objective function considered here minimizes two conflicting targets: the 0-100 km/h acceleration time and the SOC consumption over a standard driving cycle. The design variables are the first gear ratio \(i_{g1}\), second gear ratio \(i_{g2}\), and final drive ratio \(i_0\).

$$ \min \, F(X) = \left[ F_t(X),\, F_c(X) \right]^T,\qquad X=\left[i_{g1}, i_{g2}, i_0\right] $$

with the following constraints:

$$ \begin{cases} 4.1 \le i_0 \le 6.7 \\ 3.4 \le i_{g1} \le 4.8 \\ 0.9 \le i_{g2} \le 1.9 \\ 2.6 \le i_{g1}/i_{g2} \le 4.1 \end{cases} $$

Because the vehicle simulation model is computationally expensive, the objective functions are approximated with polynomial response-surface models. Fifty sample points are generated using the optimal Latin hypercube design, and the simulation results are used to fit second-order polynomial functions. The resulting fitted expressions are:

$$ \begin{aligned} T_{acc} &= 0.20924486 i_{g1}^2 + 8.39827939 i_{g2}^2 + 0.95116101 i_0^2 + 0.51431661 i_{g1} \\ &\quad + 0.37603617 i_{g2} + 3.11362097 i_0 – 5.09251244 i_{g1} i_{g2} \\ &\quad + 18.24594979 i_{g1} i_0 – 118.06766725 i_{g2} i_0 + \cdots \end{aligned} $$
$$ \begin{aligned} SOC_{loss} &= 0.00026610 i_{g1}^2 + 0.00094521 i_{g2}^2 + 0.00000008 i_0^2 + 0.00036440 i_{g1} \\ &\quad – 0.00037964 i_{g2} + 0.00053958 i_0 + 0.00287531 i_{g1} i_{g2} \\ &\quad – 0.00773302 i_{g1} i_0 + 0.00003038 i_{g2} i_0 + \cdots \end{aligned} $$

The coefficients of determination are \(R^2=0.99871\) for acceleration time and \(R^2=0.99187\) for SOC loss, indicating an accurate approximation.

3.2 Non-Dominated Sorting Whale Optimization Algorithm

The whale optimization algorithm (WOA) simulates three hunting behaviors of humpback whales: encircling prey, spiral bubble-net feeding, and random search. In the multi-objective variant, non-dominated sorting and crowding distance are introduced to produce a Pareto front. The mathematical model for the encircling behavior is:

$$ \vec{D} = |\vec{C}\cdot\vec{X}^*(t)-\vec{X}(t)| $$
$$ \vec{X}(t+1)=\vec{X}^*(t)-\vec{A}\cdot\vec{D} $$

The spiral position update is:

$$ \vec{X}(t+1)=\vec{D}^{\,b}\cdot e^{bl}\cdot \cos(2\pi l)+\vec{X}^*(t) $$

where \(b\) is a constant controlling the logarithmic spiral shape and \(l\) is a random number in [-1,1]. The random search behavior is:

$$ \vec{D}=|\vec{C}\cdot\vec{X}_{rand}(t)-\vec{X}(t)| $$
$$ \vec{X}(t+1)=\vec{X}_{rand}(t)-\vec{A}\cdot\vec{D} $$

In this study, the population size is 150 and the maximum number of iterations is 200. We compare the Pareto front obtained by NSWOA with that of a conventional multi-objective genetic algorithm. The results show that NSWOA yields a more uniformly distributed Pareto front and converges about five times faster than the genetic algorithm. Therefore, NSWOA is more suitable for the gear-ratio optimization problem of electric cars.

3.3 Decision Making Using COWA-TOPSIS

The resulting Pareto front contains many non-dominated solutions. To select the best compromise solution, we combine the ordered weighted averaging operator with the TOPSIS method. First, the objective matrix is normalized; second, the objective weights are determined by the COWA operator. Then the weighted normalized matrix is constructed. The positive ideal solution \(Y^+\) and negative ideal solution \(Y^-\) are defined as:

$$ Y^+_n=\min_{m}(b_{mn}),\qquad Y^-_n=\max_{m}(b_{mn}) $$

The distance of each solution to the ideal solutions is computed:

$$ C_m^+=\sqrt{\sum_{n=1}^{2}(b_{mn}-Y_n^+)^2},\qquad C_m^-=\sqrt{\sum_{n=1}^{2}(b_{mn}-Y_n^-)^2} $$

and the closeness coefficient \(R_m\) is:

$$ R_m=\frac{C_m^-}{C_m^+ + C_m^-} $$

After ranking, the best compromise gear ratios are obtained as:

$$ i_{g1}=4.089,\qquad i_{g2}=1.728,\qquad i_0=5.820 $$

The top ten Pareto solutions are listed in Table 5.

Table 5. Top ten Pareto solutions and closeness coefficients
Rank \(i_{g1}\) \(i_{g2}\) \(i_0\) Acceleration time (s) SOC loss \(R_m\)
1 4.089 1.728 5.820 10.902 0.05518 0.90483
2 3.909 1.696 4.100 10.876 0.05523 0.90480
3 3.606 1.753 5.855 10.910 0.05517 0.90471
4 3.885 1.816 4.334 10.889 0.05521 0.90465
5 4.563 1.728 5.820 10.918 0.05516 0.90454
6 3.524 1.823 4.949 10.860 0.05526 0.90443
7 3.885 1.816 4.466 10.927 0.05514 0.90429
8 3.467 1.800 5.613 10.847 0.05529 0.90396
9 3.733 1.745 5.833 10.937 0.05513 0.90389
10 3.900 1.816 4.371 10.873 0.05525 0.90384

3.4 Simulation Comparison Before and After Optimization

The optimized ratios are compared with the initial ratios in the full vehicle simulation. The results are listed in Table 6.

Table 6. Simulation results of the initial and optimized designs
Performance category Item Initial design Optimized design Target
Dynamic performance 0-100 km/h time (s) 10.003 10.902 <12
Maximum grade (%) 49.9 43.3 >30
Maximum speed (km/h) 102.5 107.3 >100
Economic performance SOC consumption in CHTC-LT (%) 5.66 5.51 –
Equivalent range (km) 278.99 286.68 >250

Although the optimized acceleration time is slightly longer (10.902 s instead of 10.003 s), it still satisfies the design target. In contrast, the maximum speed increases from 102.5 km/h to 107.3 km/h, and the range improves by 7.69 km. Moreover, the motor efficiency distribution in the CHTC-LT cycle shows that the percentage of operating points with efficiency above 80% increases by 4.3%, confirming that the optimized ratios allow the motor to operate in a more efficient region more often.

3.5 Design of Gearshift Schedules

The gearshift schedule determines the optimal point at which the two-speed transmission should shift from first to second gear or vice versa. Although one-parameter schedules are simple and three-parameter schedules can provide more adaptive behavior, the two-parameter schedule represented by vehicle speed and accelerator-pedal opening is widely adopted for battery electric cars because of its good balance between performance, economy, and calibration complexity.

3.6 Dynamic-Power Shift Schedule

The dynamic-power shift schedule aims to maximize acceleration. For a given accelerator-pedal opening, the acceleration of the vehicle in each gear can be derived from the traction force balance:

$$ a=\frac{du}{dt}=\frac{1}{\delta m}\left[\frac{T_{tq}i_g i_0\eta_t}{r}-mgf-\frac{C_D A u_a^2}{21.15}\right] $$

The optimal power upshift point is the speed at which the acceleration of the current gear equals the acceleration of the next gear:

$$ a_1(u_{shift})=a_2(u_{shift}) $$

If the acceleration in first gear exceeds that in second gear, first gear remains engaged; as soon as the acceleration in second gear becomes larger, an upshift is beneficial. Operation below the upshift speed in second gear should also force a downshift to first gear to maintain maximum tractive force. The downshift curve is usually offset by 5-10 km/h from the upshift curve to introduce hysteresis and prevent frequent shifting.

3.7 Economic Shift Schedule

For the economic schedule, the shift point is chosen so that the motor efficiency in first gear and second gear at the same accelerator-pedal opening are equal:

$$ \eta_1\left(T_1, n_1\right)=\eta_2\left(T_2, n_2\right) $$

Using the motor efficiency map, the speed corresponding to the point of equal motor efficiency is recorded for each identical pedal opening. These points construct an economic upshift line. A separate downshift line is introduced with a certain speed lag. The final economic shift schedule effectively keeps the motor in or near the high-efficiency zone, reducing the energy loss of electric cars during daily driving.

4. Shift Control Strategy for the Two-Speed Powertrain

4.1 Driving Mode Definition and Logic

The vehicle controller (VCU) must be able to distinguish between different vehicle states and driver intentions. The following driving modes are defined in our control strategy:

  • Park mode: the motor torque is zero and the braking system keeps the vehicle stationary.
  • Neutral mode: no driving torque is transmitted; this mode is used as an intermediate state.
  • Reverse mode: the motor rotates in the reverse direction; the gearbox locks in a fixed ratio.
  • Sport mode: the system uses the dynamic-power shift schedule to maximize acceleration and climbing capability.
  • Economy mode: the system uses the economic shift schedule to reduce energy consumption and extend the driving range.
  • Limp-home mode (failure mode): activated when a sensor or actuator fault is detected. In this mode, power is limited and the transmission remains in first gear to ensure safe travel.

The mode selection is implemented in Stateflow. The inputs include the parking signal, neutral signal, reverse signal, sport-mode request, economy-mode request, and failure signal. The control logic ensures that at most one exclusive mode is active. When a severe fault is detected, the vehicle refuses to enter sport or economy mode and switches to failure mode.

4.2 Shift Process Analysis

The two-speed AMT shift process can be divided into three phases: clutch separation, gear synchronization, and clutch engagement. During these phases, both the drive motor torque and clutch position must be coordinated to reduce shift shock and avoid excessive friction work.

The dynamic equations of the driveline can be written in the form:

$$ J_k\ddot{\theta}_k+C_k\dot{\theta}_k = T_e – M_c $$
$$ \left(J_c+\frac{J_v}{i_g^2}\right)\ddot{\theta}_c+\left(C_c+\frac{C_v}{i_g^2}\right)\dot{\theta}_c = M_c – T_f – \frac{M_v}{i_g} $$

where \(J_k\) and \(J_c\) are the equivalent inertia of the motor and transmission input shaft, \(C_k\) and \(C_c\) are their damping coefficients, \(i_g\) is the current gear ratio, \(T_f\) is the friction torque, \(M_c\) is the clutch torque, and \(M_v\) is the external resistance torque transferred from the wheels.

During clutch separation, \(M_c=0\), and during the synchronization phase, the synchronization torque is applied to the synchronizer sleeve. After engaging the new gear, the clutch must be closed smoothly so that the motor torque gradually builds up again. This time-domain analysis provides the foundation for the logic-based shift control algorithm.

4.3 Shift Logic Implementation in Stateflow

The shift controller uses vehicle speed, accelerator pedal opening, and current driving mode to determine the target gear. The shift thresholds in the controller are obtained from the dynamic-power or economic shift curves depending on the selected mode. The logic contains two main states: “first gear” and “second gear.” If the vehicle is moving at a speed higher than the upshift threshold for the current mode, the state changes from first gear to second gear. Conversely, if the vehicle speed drops below the downshift threshold, the state changes from second gear to first gear. Hysteresis is inherently achieved by using separate upshift and downshift curves.

Stateflow also controls the transition between “vehicle stopped” and “moving” states. When the vehicle speed is zero and the brake signal is active, the transmission enters neutral and then park mode if the vehicle remains stationary for more than two seconds. When the accelerator pedal is pressed and no reverse request is present, the vehicle starts in first gear.

4.4 Extended Kalman Filter for Vehicle State Estimation

In a real vehicle, not all state variables are measured directly with high accuracy. Acceleration and road slope are often difficult to obtain. Therefore, an extended Kalman filter (EKF) is designed to estimate the vehicle speed \(v\), the vehicle acceleration \(a\), and the road slope angle \(\theta\), using the motor torque and braking force as control inputs. The state vector is defined as:

$$ x_k=\left[\begin{array}{c} v_k \\ a_k \\ \theta_k \end{array}\right] $$

The control input vector is:

$$ u_k=\left[\begin{array}{c} T_{m,k} \\ F_{b,k} \end{array}\right] $$

The nonlinear discrete-time state equation is:

$$ x_{k+1}=f(x_k,u_k)+W_k $$

where

$$ f(x_k,u_k)=\left[\begin{array}{c} v_k+a_k \Delta t \\ \frac{1}{\delta m}\left(\frac{T_{m,k} i_g i_0\eta_t}{r}-mgf-\frac{C_D A v_k^2}{21.15}\right) \\ \theta_k \end{array}\right] $$

The observation equation is:

$$ z_k=h(x_k)+V_k=\left[\begin{array}{c} v_k \\ a_k \end{array}\right]+V_k $$

The EKF iteration consists of prediction:

$$ \hat{x}_{k|k-1}=f(\hat{x}_{k-1|k-1}, u_{k-1}) $$
$$ P_{k|k-1}=F_{k-1}P_{k-1|k-1}F_{k-1}^T+Q $$

and correction:

$$ K_k=P_{k|k-1}H_k^T\left(H_kP_{k|k-1}H_k^T+R\right)^{-1} $$
$$ \hat{x}_{k|k}=\hat{x}_{k|k-1}+K_k\left(z_k-h(\hat{x}_{k|k-1})\right) $$
$$ P_{k|k}=(I-K_kH_k)P_{k|k-1} $$

The state transition Jacobian matrix is

$$ F_k=\left[\begin{array}{ccc} 1 & \Delta t & 0 \\ -\frac{C_D A v_k \Delta t}{m\delta} & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] $$

The EKF provides filtered estimates of vehicle speed and acceleration, which are then used by the fuzzy controller to identify the appropriate shift mode.

4.5 Fuzzy Logic-Based Dynamic Shift Control

Conventional fixed shift schedules are based on steady-state conditions and cannot respond quickly to sudden changes in vehicle states under complex dynamic cycles. To solve this problem, a fuzzy controller is introduced. The inputs to the fuzzy controller are the estimated vehicle speed \(v\) and the estimated acceleration \(a\); the output is a weighting coefficient \(\beta\) that ranges between 0 and 1. When \(\beta<0.5\), the controller primarily uses the economic shift schedule; when \(\beta>0.5\), it uses the dynamic-power shift schedule. This fuzzy weighting enables the vehicle to adapt to the current driving demand.

The fuzzy sets are defined as follows:

  • Vehicle speed \(v\): three triangular membership functions labeled L, M, H over the universe [0,100] km/h;
  • Acceleration \(a\): five triangular membership functions labeled VS, S, M, L, VL over the universe [-10,10] m/s²;
  • Output \(\beta\): two membership functions labeled Se and Sp over the universe [0,1].

The fuzzy rule base is given in Table 7.

Table 7. Fuzzy rule base
Acceleration \(a\) Vehicle speed \(v\)
L M H
VS Se Se Se
S Se Se Sp
M Se Sp Sp
L Sp Sp Sp
VL Sp Sp Sp

The fuzzy output is defuzzified using the center-of-gravity method:

$$ \beta = \frac{\sum_{i=1}^{n} \mu_i \, z_i}{\sum_{i=1}^{n}\mu_i} $$

where \(z_i\) is the output value of rule \(i\) and \(\mu_i\) is the corresponding membership degree. The resulting control surface is a smooth mapping from \(v\) and \(a\) to \(\beta\). Because \(\beta\) is used to blend the two shift schedules, the actual gearshift threshold is continuously adjusted. Simulation tests under the CHTC-LT condition verify that the fuzzy controller changes the mode coefficient appropriately: during rapid accelerations \(\beta\) is below 0.5, causing the strategy to select the dynamic-power shift curve; when the vehicle is driven gently at nearly constant speed, \(\beta\) exceeds 0.5 and the economic shift curve is selected. The mode-switching hysteresis further reduces unnecessary transitions between the dynamic and economic shift laws.

4.6 Simulation Results of the Dynamic Strategy

The proposed EKF-based fuzzy shift control is implemented in the full vehicle model. The CHTC-LT drive cycle is divided into many segments, including accelerations, decelerations, stops, and high-speed cruising. The controller responds correctly in all segments. The gear command is generated only when the filtered speed and the fuzzy weighting indicate an appropriate shift. The simulation results show that the fuzzy controller can prevent frequent gear switching when the vehicle alternately accelerates and decelerates while crossing a small threshold. The output of the driving mode remains stable under constant-speed driving, and the strategy switches to sport mode only for strong acceleration demands. These results confirm the expected adaptive behavior of the control strategy.

5. Hardware-in-the-Loop Testing

5.1 HIL Test Platform Architecture

To validate the real-time performance and reliability of the shift controller, a hardware-in-the-loop (HIL) test platform is built using National Instruments (NI) PXI equipment and NI VeriStand software. The platform comprises three main parts: a PC host, an HIL cabinet, and the real VCU. The HIL cabinet contains the PXI real-time system, signal conditioning modules, fault insertion units, and a programmable power supply. The real vehicle controller under test is placed in a dedicated drawer and connected to the HIL I/O board via a wiring harness.

The software architecture uses NI VeriStand as the experiment manager. The vehicle Simulink model is compiled into a dynamic link library with the NI VeriStand target file and then loaded into the PXI real-time processor. The control strategy is developed in Simulink with the ECUCoder toolbox, and the generated executable file is flashed into the VCU through a CAN bus. The communication between the host PC and the HIL cabinet is established through a Gigabit Ethernet connection.

5.2 Hardware Configuration

The HIL hardware components are listed in Table 8.

Table 8. Hardware components in the HIL platform
Unit Model/Description Quantity
PXI chassis NI PXIe-1062Q, 8 slots 1
Real-time processor NI PXIe-8861 Intel Xeon quad-core 1
CAN communication board NI PXIe-8510 1
AI board NI PXI-6224, 32 ch, 16 bit 1
AO board NI PXI-6738, 32 ch, 16 bit 1
DI conditioning card 8 ch, isolated DO conversion 8
DO conditioning card 8 ch, TTL to 12/24 V 8
AI conditioning card 8 ch, overvoltage protection 60 V 4
AO conditioning card 8 ch, increased output drive capability 4

5.3 Controller Mode-Switching Test

In the mode-switching test, the controller is commanded to transition among Park, Neutral, Reverse, Economy, and Sport modes, with each mode held for 10 s. The test results show that the VCU responds promptly to every mode request. The output signals in each mode are stable and they agree with the expected values. No false transition is observed when no mode request is active. An additional fault test is conducted by simulating a sensor failure. When the failure signal becomes high, the controller immediately enters limp-home mode, limits the motor torque, and ignores the Sport/Economy mode requests. The engine does not turn off and the vehicle can still move to a safe area, proving the fault-tolerant capability of the control strategy.

5.4 Upshift Test

For the upshift test, the vehicle starts from standstill in first gear under a wide-open accelerator command. The vehicle accelerates and the speed profile is displayed in the host interface. When the actual speed reaches the upshift threshold, the controller outputs an upshift command; the gear changes from first to second. The test curves show that the upshift is completed in a short time and the speed profile exhibits only a small plateau due to torque interruption during clutch separation. After the gear engagement, the vehicle speed continues to increase with a smaller slope because second gear provides lower torque. No abnormal signals are observed during the entire upshift process.

5.5 Downshift Test

The downshift test starts with the vehicle operating in second gear at 100 km/h. A braking command is applied to reduce the speed. When the speed crosses the downshift threshold, the controller sends a downshift command and the gear returns to first. Since the vehicle continues braking until standstill, the downshift process does not significantly disturb the velocity profile. The test confirms that the controller generates the downshift command exactly when needed and the transmission actuator is able to execute the gear change without malfunction.

5.6 CHTC-LT Drive Cycle Test

A long-duration CHTC-LT test is run to verify the reliability of the controller under realistic conditions. Figure 5.1 shows the target and actual speed profiles; they almost overlap, confirming excellent speed-tracking capability. During the cycle, the driving mode changes between economy and sport modes many times according to the fuzzy output. Table 9 summarizes the key test results.

Table 9. Key results of the CHTC-LT HIL test
Indicator Result
Mode-switching response time <0.5 s
False limp-home activation 0
Unintended gear changes 0
Maximum speed error <0.5 km/h
Total test duration 1 CHTC-LT cycle (1800 s)

The HIL test demonstrates that the two-speed shift control strategy developed in this study is both effective and robust. The controller handles mode transitions smoothly, executes upshift and downshift correctly, and behaves stably under the complete CHTC-LT driving cycle. Therefore, the proposed model-based development process is suitable for the engineering implementation of two-speed transmissions in battery electric cars.

6. Conclusion

This research presents a comprehensive study on the modeling, optimization, and shift control of a two-speed pure electric vehicle. The main contributions and conclusions are summarized below.

First, the vehicle specifications are defined and the powertrain parameters are matched. A two-speed layout is preferred over a single-speed layout because it enables the electric motor to operate in its high-efficiency region more often while still providing sufficient torque at low speed and adequate top speed at high speed. The selected motor and battery parameters satisfy the acceleration, gradeability, and driving-range targets.

Second, a non-dominated sorting whale optimization algorithm is developed to optimize the first-gear ratio, second-gear ratio, and final drive ratio. The objective functions are approximated using polynomial response surfaces to reduce computational cost. The COWA-TOPSIS method is used to select the best compromise solution from the Pareto front. The optimized design improves the SOC consumption by 2.65% and extends the range by 7.69 km compared with the initial design while maintaining all dynamic performance constraints.

Third, dynamic-power and economic shift schedules are designed based on the optimized gearbox. A dual-parameter control map taking vehicle speed and accelerator-pedal opening as inputs is constructed. Hysteresis between the upshift and downshift curves prevents frequent shifting.

Fourth, a dynamic shift control strategy is developed. Driving modes are defined and implemented in Stateflow. An EKF is designed to estimate the vehicle speed and acceleration. A fuzzy controller uses these estimates to weight the economic and power shift schedules adaptively. Simulation results demonstrate that the fuzzy logic approach can change the shift mode according to driving demand, and it maintains smooth and stable gear changes in a transient drive cycle.

Finally, a hardware-in-the-loop test platform is built using NI PXI equipment and NI VeriStand. The real VCU is tested for mode switching, upshift, downshift, and full CHTC-LT cycle operation. The test results verify the real-time capability and reliability of the proposed control strategy. The developed HIL platform provides a solid foundation for future calibration and rapid control prototyping of two-speed battery electric cars.

Future work will extend the approach to extreme conditions such as continuous uphill driving and emergency braking. In addition, model predictive control methods and vehicle-to-everything information could be introduced to further improve the adaptability of the shift controller. Real-vehicle validation on a test track will also be performed before production implementation.

Scroll to Top