I designed this charging and protection system for a lithium iron phosphate electric vehicle battery pack that is intended for small and medium electric mobility platforms. The target electric vehicle battery pack has a nominal voltage of 48 V, a capacity of 20 Ah, and is built from 15 series-connected cells. The maximum allowable charge current is 20 A, the maximum allowable discharge current is 20 A, and the intended operating temperature range is 0 to 50 degrees Celsius. My objective is to provide a complete charging and protection architecture that can replace lead-acid packs in electric bicycles and electric motorcycles while also offering practical experience for larger electric vehicle battery pack applications.
The design is organized around two major subsystems. The first is the charging subsystem, which converts AC mains into a controlled DC charging profile. The second is the protection and control subsystem, which monitors voltage, current, temperature, internal resistance, and state of charge. Because the electric vehicle battery pack must operate safely and predictably, I treat charging, protection, communication, and state estimation as one integrated management problem rather than as isolated circuits.

Design Targets and Pack Parameters. The most important parameters of the electric vehicle battery pack are summarized below. These values guide the selection of the power stage, the protection thresholds, the sensing circuits, and the software algorithms.
| Parameter | Value | Notes |
|---|---|---|
| Nominal pack voltage | 48 V | 15 LiFePO4 cells in series |
| Cell nominal voltage | 3.2 V | Lithium iron phosphate chemistry |
| Cell charge cutoff | 3.6 V | Used for pack overcharge protection |
| Cell discharge cutoff | 2.1 V | Used for pack overdischarge protection |
| Pack capacity | 20 Ah | Rated capacity at standard conditions |
| Maximum charge current | 20 A | Protection limit and charger design limit |
| Maximum discharge current | 20 A | Protection limit and load design limit |
| Operating temperature | 0 to 50 degrees Celsius | Temperature compensation is applied outside this band |
| Charging power target | Up to approximately 550 W | Based on 55 V and 10 A typical charge profile |
I selected lithium iron phosphate as the cell chemistry because it offers a favorable combination of safety, cycle life, thermal stability, and cost. Compared with other lithium-ion positive materials, the electric vehicle battery pack built from LiFePO4 cells is less prone to thermal runaway, has a flat discharge plateau, and can tolerate moderate abuse better than many cobalt-based systems. The main penalty is lower low-temperature performance, so my protection and state-estimation software must account for temperature derating.
| Positive Material | Theoretical Capacity (mAh/g) | Practical Capacity (mAh/g) | Operating Voltage (V) | Safety | Relative Cost |
|---|---|---|---|---|---|
| LiCoO2 | 274 | 140 to 150 | 3.7 | Moderate | High |
| LiNiO2 | 274 | 190 to 210 | 2.5 to 4.2 | Poor | Medium |
| LiMn2O4 | 148 | 90 to 120 | 3.0 to 4.0 | Good | Low |
| LiMnO2 | 286 | 200 | 3.0 to 4.5 | Good | Low |
| LiFePO4 | 170 | 110 to 165 | 3.2 | Very good | Low |
For the electric vehicle battery pack, I define the usable operating window from approximately 31.5 V to 54.0 V. The upper limit corresponds to 3.6 V per cell, and the lower limit corresponds to approximately 2.1 V per cell. I intentionally leave a small margin above and below these values for protection thresholds, because measurement noise, cell imbalance, and transient voltage drops can otherwise cause false trips.
Battery Management Architecture. I divide the battery management system into a power loop and a control loop. The power loop contains the AC input rectifier, power factor correction stage, isolated DC/DC converter, output rectifier, and output filter. The control loop contains the mixed-signal microcontroller, voltage sensing, current sensing, temperature sensing, cell voltage sensing, internal resistance estimation, state-of-charge estimation, and communication interface. This separation makes the electric vehicle battery pack easier to debug because high-power switching behavior and low-power signal behavior can be analyzed independently before they are integrated.
| Subsystem | Primary Function | Key Variables |
|---|---|---|
| Charging power stage | Convert AC mains to controlled DC charging current and voltage | Input voltage, PFC output, transformer ratio, output current |
| Protection stage | Disconnect or limit the pack under abnormal conditions | Cell voltage, pack voltage, current, temperature, short-circuit state |
| Monitoring stage | Estimate the condition of the electric vehicle battery pack | SOC, internal resistance, temperature, charge throughput |
| Communication stage | Exchange status and control data with external devices | SMBus clock, SMBus data, packet fields, arbitration |
The management functions I require for the electric vehicle battery pack are continuous voltage monitoring, current monitoring, temperature monitoring, state-of-charge estimation, overcharge protection, overdischarge protection, overcurrent protection, short-circuit protection, cell balancing support, and external communication. I also include a final fuse in the main current path. The fuse is not a substitute for electronic protection; it is a last line of defense if a MOSFET fails, a sensor breaks, or a software fault disables the normal protection path.
Charging Architecture. Because the charger power exceeds 75 W, I include active power factor correction before the isolated DC/DC stage. Without power factor correction, the input current of a rectifier-capacitor front end is highly pulsed and contains strong odd harmonics. These harmonics increase RMS line current, reduce power factor, and inject distortion into the AC network. For an electric vehicle battery pack charger, a high power factor is desirable not only for regulatory reasons but also for efficient use of the available mains capacity.
I chose a two-stage architecture: a boost power factor correction stage followed by an isolated DC/DC converter. The boost stage regulates the intermediate DC bus to approximately 380 V and shapes the input current to follow the input voltage. The DC/DC stage provides galvanic isolation, voltage transformation, and constant-current or constant-voltage charging control. This architecture is more complex than a single-stage charger, but it gives me better control over power factor, output ripple, and protection behavior.
| Switching Converter Type | Isolation | Main Advantage | Main Limitation | Typical Power Range |
|---|---|---|---|---|
| Buck | No | Simple, efficient | Step-down only, no isolation | Low to medium |
| Boost | No | Simple, high power factor possible | Step-up only, no isolation | Low to medium |
| Buck-boost | No | Wide input range | Higher stress, no isolation | Low |
| Single-ended forward | Yes | Good drive, good current waveform | Transformer unidirectional utilization | 50 to 200 W |
| Flyback | Yes | Simple transformer and filter | High switch voltage stress | 20 to 100 W |
| Push-pull | Yes | Bidirectional core utilization | Flux imbalance risk | 100 to 500 W |
| Half-bridge | Yes | Lower switch voltage stress | Floating drive required | 100 to 700 W |
| Full-bridge | Yes | High power, good transformer use | Complex drive and many devices | 500 to 2000 W |
For a 550 W class charger feeding an electric vehicle battery pack, a full-bridge converter is a natural candidate. However, I selected a parallel single-ended forward topology because it reduces gate-drive complexity while still providing sufficient output power. In this arrangement, two forward converters operate in an interleaved manner. The output filter sees an effective ripple frequency higher than the switching frequency, which reduces filter size and output voltage ripple. The transformer core utilization is not as good as in a full-bridge converter, but the drive circuit is simpler and the reliability is easier to manage in a compact charger.
Power Factor Correction Design. I use a boost converter operating in continuous conduction mode with average current control. Average current control is preferred because it is less sensitive to noise than peak current control, does not require slope compensation in the same way, and can achieve low total harmonic distortion. The controller multiplies a scaled version of the rectified input voltage by the output of the voltage error amplifier. The resulting reference is compared with the sensed inductor current, and the current error amplifier commands the PWM comparator. This forces the average inductor current to track the input voltage waveform.
| PFC Control Method | Sensed Current | Switching Frequency | Conduction Mode | Noise Sensitivity | Typical Use |
|---|---|---|---|---|---|
| Peak current control | Switch current | Fixed | CCM | High | Boost PFC with slope compensation |
| Hysteretic current control | Inductor current | Variable | CCM | High | Boost PFC with logic control |
| Average current control | Inductor current | Fixed | CCM or DCM | Low | Boost PFC and general converters |
I set the PFC switching frequency to 100 kHz. This value keeps the boost inductor and EMI filter within practical size limits while avoiding excessive switching loss in the MOSFET. The maximum input voltage is calculated from the highest AC line voltage. Using 265 V RMS as the high line condition, I obtain:
$$V_{DC,MAX}=\sqrt{2}V_{AC,MAX}\approx 375\text{ V}$$
The maximum input current occurs at the minimum AC line voltage and maximum output power. Assuming an efficiency of 0.85 and an output power of 550 W:
$$I_{DC,MAX}=\frac{\sqrt{2}P_{OUT,MAX}}{\eta V_{AC,MIN}}\approx 7.04\text{ A}$$
The maximum duty cycle of the boost stage occurs at minimum AC input. With a 380 V intermediate bus, I calculate:
$$D_{MAX}=1-\frac{\sqrt{2}V_{AC,MIN}}{V_C}\approx 0.52$$
I choose a current ripple factor of 0.2 for the boost inductor design. The required inductance is:
$$L=\frac{\sqrt{2}V_{AC,MIN}D_{MAX}}{\eta K P_{OUT,MAX}f_{PFC}}\approx 2.44\text{ mH}$$
I selected a gapped core with an AL value of approximately 200 nH per turn squared. The required number of turns is:
$$N=\sqrt{\frac{L}{A_L}}\approx 110$$
The PFC switch must block the 380 V bus and conduct the maximum inductor current plus margin. I selected a 500 V, 15 A MOSFET. The boost diode must be a fast-recovery type because the converter operates in continuous conduction mode. I selected a 600 V, 8 A ultrafast diode. The output capacitor is sized from the hold-up requirement and ripple current. With a hold-up time of 60 ms and a bus voltage of 380 V, the required capacitance is approximately:
$$C\ge \frac{2P_{OUT}t_{HU}}{V_C^2-K^2}\approx 580\text{ }\mu\text{F}$$
I use a 600 microfarad, 400 V electrolytic capacitor with a parallel high-frequency film capacitor. The film capacitor reduces high-frequency ripple and improves the EMI behavior of the electric vehicle battery pack charger.
| PFC Component | Selected Rating | Design Reason |
|---|---|---|
| Rectifier bridge | 1000 V, 10 A | Line voltage margin and input current margin |
| Boost inductor | 2.44 mH, 110 turns | Current ripple and continuous conduction mode |
| PFC switch | 500 V, 15 A MOSFET | 380 V bus and 7.04 A peak input current |
| Boost diode | 600 V, 8 A ultrafast | Fast recovery in CCM operation |
| Output capacitor | 600 microfarad, 400 V | Hold-up time and ripple current |
Isolated DC/DC Design. The DC/DC stage converts the 380 V PFC bus into an isolated charging output. I set the switching frequency to 200 kHz. The switching period is:
$$T=\frac{1}{f_s}=5\text{ }\mu\text{s}$$
I limit the maximum duty cycle to 44 percent. Therefore, the maximum on-time is:
$$t_{on,max}=TD_{max}=2.2\text{ }\mu\text{s}$$
The secondary voltage required to deliver 55 V at maximum duty cycle is found from the forward converter voltage relationship:
$$U_s=\frac{(U_o+U_L+U_F)T}{t_{on}}$$
Using an output voltage of 55 V, an inductor and wiring drop of 0.2 V, and a Schottky diode drop of 0.5 V, the minimum secondary voltage is approximately:
$$U_{s,min}=\frac{(U_{o,max}+U_L+U_F)T}{t_{on,max}}\approx 126.6\text{ V}$$
The minimum DC bus voltage under brownout conditions is taken as 200 V. The required transformer turns ratio is:
$$N=\frac{U_{s,min}}{U_{dc,min}}\approx 0.633$$
I selected an EI or E-type ferrite core with an effective area of 148 square millimeters. The maximum flux density is limited to 0.2 T. The secondary turns are calculated as:
$$N_s=\frac{U_{s,min}t_{on,max}}{B_m S}\times 10^4\approx 9.40$$
I round the secondary turns to 10. The primary turns are:
$$N_p=\frac{N_s}{N}\approx 15.79$$
I round the primary turns to 16. The switch current is related to the output current by the turns ratio:
$$I_{DS}=\frac{N_s}{N_p}I_o=6.25\text{ A}$$
The primary RMS current is:
$$I_p=I_{DS}\sqrt{D_{max}}\approx 4.15\text{ A}$$
The secondary RMS current is:
$$I_s=I_p\frac{N_p}{N_s}\approx 6.64\text{ A}$$
Using a current density of 4 A per square millimeter, the required primary copper area is approximately 1.04 square millimeters, and the required secondary copper area is approximately 1.66 square millimeters. Because of skin effect at 200 kHz, I use multiple parallel strands. The primary uses four strands of AWG 22 wire in parallel, and the secondary uses ten strands of AWG 24 wire in parallel.
| Transformer Parameter | Calculated Value | Selected Value |
|---|---|---|
| Switching frequency | 200 kHz | 200 kHz |
| Maximum duty cycle | 0.44 | 0.44 |
| Secondary voltage | 126.6 V | 130 V class |
| Turns ratio | 0.633 | 16:10 |
| Primary turns | 15.79 | 16 |
| Secondary turns | 9.40 | 10 |
| Primary current | 4.15 A RMS | Four parallel strands |
| Secondary current | 6.64 A RMS | Ten parallel strands |
The output filter inductor is designed for a 10 percent current ripple. With a 10 A output, the ripple current is 1 A. The required inductance is:
$$L_o=\frac{(U_s-U_F-U_o)t_{on,max}}{\Delta I_L}\approx 71\text{ }\mu\text{H}$$
The output filter capacitor is selected from the desired output ripple voltage. For a 10 mV ripple target:
$$C_o=\frac{U_sT}{8L\Delta U}\approx 111.4\text{ }\mu\text{F}$$
I use an output capacitor bank rated for at least twice the output voltage, with a low-loss ceramic bypass capacitor in parallel. The main switches in the DC/DC stage are 500 V, 20 A MOSFETs. The secondary rectifiers are fast Schottky or ultrafast rectifiers selected for the 200 kHz switching frequency.
Feedback Control. The PFC voltage loop must have a crossover frequency below twice the AC line frequency. This prevents the voltage loop from distorting the input current reference and degrading power factor. I calculate the second-harmonic output ripple as:
$$V_{OPK}=\frac{P_m}{2\pi f_R C_{PFC}V_{PFC}}\approx 4.51\text{ V}$$
The voltage error amplifier gain is chosen as:
$$G_{VA}=\frac{\Delta V_{VAOUT}}{2V_{OPK}}\approx 36.65\times 10^{-3}$$
With an input divider resistance of 2.2 megohms, the feedback capacitor is approximately:
$$C_f=\frac{1}{2\pi f_R G_{VA}R_{IN}}\approx 110\text{ nF}$$
The voltage integrator frequency is approximately 0.866 Hz, which gives a feedback resistor of about 16.7 kilohms and a zero capacitor of about 1.1 microfarads. These values keep the PFC voltage loop slow enough for good power factor correction while still regulating the bus.
The PFC current loop must be fast enough to track the rectified line voltage. I use a current error amplifier with a bandwidth well above the line frequency. The current-loop compensation network uses a 2 kilohm input resistor, a 27 kilohm feedback resistor, a 100 pF high-frequency capacitor, and a 470 nF zero capacitor. This gives good tracking of the average inductor current and rejects switching noise.
For the DC/DC stage, I use voltage and current feedback loops that share the same optocoupler or feedback node. The current loop is used during constant-current charging, and the voltage loop is used during constant-voltage charging. The two error amplifiers are connected through diodes so that the lower output dominates. When the electric vehicle battery pack voltage is low, the current loop dominates and the charger behaves as a constant-current source. As the pack voltage rises, the voltage loop takes over and the charger transitions to constant-voltage mode. When the charge current falls below a threshold, the charger terminates the charge cycle.
| Feedback Loop | Dominant Mode | Reference Source | Purpose |
|---|---|---|---|
| PFC voltage loop | Slow bus regulation | Internal reference | Maintain 380 V bus and high power factor |
| PFC current loop | Fast average current tracking | Multiplier output | Shape input current to input voltage |
| DC/DC voltage loop | Constant voltage | Microcontroller DAC | Limit pack voltage near full charge |
| DC/DC current loop | Constant current | Microcontroller DAC | Charge the electric vehicle battery pack safely |
EMC Design. Switching power supplies generate both conducted and radiated electromagnetic interference. I address the three elements of EMC: the source, the coupling path, and the sensitive receiver. For the electric vehicle battery pack charger, the main sources are the PFC MOSFET, the DC/DC MOSFETs, the transformer leakage inductance, and the output rectifiers. The main coupling paths are the input and output cables, the transformer inter-winding capacitance, and the printed circuit board traces.
I place a line filter between the AC mains and the rectifier. The line filter contains common-mode chokes and differential-mode capacitors. The common-mode choke uses a single core with two identical windings so that differential currents cancel their magnetic flux, while common-mode currents see a high impedance. I also place an EMI filter close to the converter input. The filter includes common-mode inductors, differential-mode inductors, X capacitors, and Y capacitors. This low-pass network attenuates switching noise entering and leaving the charger.
| EMC Measure | Target Noise | Implementation |
|---|---|---|
| AC line filter | Differential and common mode | Chokes and X/Y capacitors |
| EMI input filter | High-frequency switching noise | Common-mode and differential-mode inductors |
| RC snubber | MOSFET voltage overshoot | Resistor, capacitor, and diode clamp |
| Transformer shielding | Radiated magnetic field | Shield winding and compact core geometry |
| PCB layout | Trace coupling | Short returns, wide power traces, orthogonal signals |
For the high-frequency transformer, I reduce leakage inductance by using a core shape with a low height-to-width ratio, minimizing insulation thickness, and interleaving windings where practical. Leakage inductance causes voltage spikes when the MOSFET turns off, so reducing it directly reduces EMI and switch stress. I also use an RC snubber across each main switch. The snubber absorbs the energy stored in the leakage inductance and clamps the drain-source voltage to a safer level.
On the printed circuit board, I keep high dv/dt and high di/dt loops as small as possible. Power traces are short and wide, and the return path is directly under the forward path where possible. I separate the control ground from the power ground and connect them at a single point. Sensitive analog traces, such as cell voltage sensing and temperature sensing, are routed away from switching nodes. I also place high-frequency decoupling capacitors close to the supply pins of the controllers and gate drivers.
Simulation and Verification. I simulated the charging power stage to verify switching waveforms, inductor current, output voltage, and transient response. The PFC switch drive waveform is a fixed-frequency pulse train. The PFC inductor current is triangular and centered on a slowly varying average value that follows the rectified line voltage. The PFC output voltage rises smoothly to approximately 380 V. The DC/DC switch drive waveform alternates at 200 kHz, and the output voltage settles near the target charging voltage. These results indicate that the power stage is suitable for the electric vehicle battery pack.
| Simulated Quantity | Target | Observed Behavior |
|---|---|---|
| PFC switch drive | 100 kHz pulse | Stable fixed-frequency switching |
| PFC inductor current | Continuous with low ripple | Triangular ripple around average line current |
| PFC output voltage | 380 V | Regulated with small low-frequency ripple |
| DC/DC switch drive | 200 kHz pulse | Stable alternating drive |
| DC/DC output voltage | Up to 55 V | Stable within charging tolerance |
Protection and Control Hardware. I use a mixed-signal microcontroller with an integrated multi-channel ADC, DAC, analog comparators, timers, and a serial management bus. The microcontroller coordinates charging, protection, state estimation, and communication. It also provides the reference values for the constant-current and constant-voltage loops. Because the electric vehicle battery pack must be monitored continuously, the firmware runs a periodic measurement loop and a faster protection loop.
Voltage sensing is performed with a resistor divider and an RC low-pass filter. The divider scales the pack voltage to the ADC range, and the filter removes switching noise. I set the overcharge threshold to 54.5 V with a release threshold of 53.5 V. I set the overdischarge threshold to 31.5 V with a release threshold of 37.5 V. I set the short-circuit threshold to 5 V and the short-circuit delay to 10 microseconds. I also define a charge-mode transition voltage of 52.5 V; when the pack reaches this value for one second, the charger transitions from constant current to constant voltage.
| Protection Function | Threshold | Release or Recovery | Delay |
|---|---|---|---|
| Overcharge voltage | 54.5 V | 53.5 V | 2 s |
| Overdischarge voltage | 31.5 V | 37.5 V | 500 ms |
| Short-circuit voltage | 5 V | Fault removal | 10 microseconds |
| Charge overcurrent | 20 A | Current normalization | 50 ms |
| Discharge overcurrent | 20 A | Current normalization | 50 ms |
| Full-charge cutoff | 200 mA | Charge restart | 3 s |
| Charge-mode transition | 52.5 V | Constant-voltage mode | 1 s |
Current sensing is implemented with a closed-loop Hall-effect current sensor. The sensor measures the magnetic field produced by the primary current and drives a secondary current that cancels the core flux. This method provides galvanic isolation, good accuracy, and fast response. The output voltage of the sensor is digitized by the ADC. The sign of the measured current indicates whether the electric vehicle battery pack is charging or discharging. The magnitude is compared with the charge and discharge overcurrent thresholds.
Temperature sensing uses an integrated temperature sensor with an analog output. The sensor is placed near the cells or on the cell mounting plate so that it measures the thermal environment of the electric vehicle battery pack rather than the temperature of the power electronics. The firmware derates the allowable charge current at low temperature and reduces or stops charging at high temperature. For LiFePO4, low temperature increases internal resistance and reduces available capacity, so temperature compensation is necessary for accurate state estimation.
Cell voltage sensing uses a differential amplifier and a voltage-controlled current source for each cell. The cell voltage is converted into a current, transmitted over a pair of wires, and converted back into a voltage at the measurement resistor. This approach rejects common-mode voltage from the series stack and reduces the effect of long wire runs. It is more accurate than simply subtracting adjacent tap voltages, although it requires more components.
Internal resistance is estimated by injecting a known current pulse and measuring the voltage change. This gives a direct estimate of ohmic resistance plus polarization effects. I use this value as a health indicator rather than as the primary SOC estimator, because the relationship between internal resistance and SOC is not monotonic. In an aged electric vehicle battery pack, internal resistance increases, so the internal resistance trend helps identify cells that are degrading faster than the rest.
State-of-Charge Estimation. I estimate state of charge using ampere-hour integration with compensation. The basic charge throughput is:
$$Q_{use}=\int_0^t i_t\,dt$$
For a discrete implementation, I sample the current at fixed intervals and accumulate:
$$Q_{use}=\sum_{t=1}^{n} i_t \Delta t$$
The remaining capacity is the full capacity minus the used capacity:
$$Q_{res}=Q_E-Q_{use}$$
The state of charge is therefore:
$$\text{SOC}=\frac{Q_{res}}{Q_E}=\frac{Q_E-Q_{use}}{Q_E}$$
If the electric vehicle battery pack is discharging, the current is treated as negative; if it is charging, the current is treated as positive. This convention makes the accumulation consistent. The main advantage of ampere-hour integration is that it works during dynamic operation and does not require the pack to rest. The main disadvantage is that errors accumulate over time, so compensation and periodic correction are required.
I model self-discharge, charging efficiency, and coulombic loss with a compensation current:
$$i_g=\eta(U,T)+\mu(T-T_0)$$
Here, U is the terminal voltage, T is the measured temperature, T0 is the reference temperature, and eta and mu are empirical coefficients. During charging, the effective current is reduced by the compensation current. During discharging, the effective current is increased by the compensation current. This represents the fact that not all charge entering the electric vehicle battery pack is stored, and not all stored charge is available at the terminals.
Temperature compensation is applied as a multiplicative factor:
$$\text{SOC}_T=\text{SOC}\times\left[1-\nu(T-T_0)\right]$$
The coefficient nu depends on the temperature range and is obtained from experimental data. For LiFePO4, the capacity falls significantly at low temperature. For example, if the 23 degrees Celsius capacity is 100 percent, the capacity at 0 degrees Celsius may fall to approximately 78 percent, and at minus 20 degrees Celsius it may fall to approximately 65 percent. These values are not used directly as SOC, but they show why temperature compensation is essential for an electric vehicle battery pack.
Age compensation is expressed through an aging factor:
$$A_F=\frac{Ah_{ref}-Ah_{pre}}{Ah_{ref}}$$
Here, Ah_ref is the maximum capacity observed during the life of the electric vehicle battery pack, and Ah_pre is the present capacity. The aging factor increases as the pack loses capacity, so it reduces the estimated usable charge.
Discharge-rate compensation uses the Peukert relationship:
$$I^n t=K$$
If two discharge tests are available, the exponent is:
$$n=\frac{\lg t_2-\lg t_1}{\lg I_1-\lg I_2}$$
The capacity constant K is:
$$K=I_1^n t_1$$
The effective capacity at an arbitrary current is:
$$Q_E=K I^{1-n}$$
For a variable-current discharge, I divide the current profile into small intervals and treat each interval as a constant-current segment. The SOC after each segment is:
$$\text{SOC}_j=1-\frac{\sum I_j t_j}{Q_{Ej}}$$
Combining these ideas gives a compensated SOC expression:
$$\text{SOC}=\frac{1-A_F}{K I^{1-n}}\left[1-\nu(T-T_0)\right]\sum \left(I+\eta(U,T)+\mu(T-T_0)\right)\Delta t$$
This expression is not a perfect physical model, but it is practical for a microcontroller. It captures the dominant effects: charge throughput, temperature, discharge rate, and aging. To prevent long-term drift, I use an open-circuit-voltage correction when the electric vehicle battery pack has rested long enough for the terminal voltage to relax. At rest, the open-circuit voltage is compared with the SOC estimated from ampere-hour integration. If the difference exceeds a tolerance, the SOC is corrected toward the open-circuit-voltage estimate.
| Compensation Factor | Variable | Effect on SOC | Practical Source |
|---|---|---|---|
| Charge efficiency | Current, voltage | Reduces stored charge | Charge and discharge tests |
| Self-discharge | Temperature, time | Slowly reduces stored charge | Resting voltage tests |
| Temperature | Cell temperature | Reduces available capacity at low temperature | Temperature chamber tests |
| Aging | Cycle count, capacity fade | Reduces full capacity | Capacity check cycles |
| Discharge rate | Current magnitude | Reduces available capacity at high current | Peukert tests |
| Open-circuit correction | Resting voltage | Corrects accumulated integration error | Relaxation curve |
SMBus Communication. I use the system management bus for communication between the protection controller and external devices. SMBus is a two-wire interface with a clock line and a data line. Both lines are open-drain, so they require pull-up resistors and can be shared by multiple devices. The protocol supports master and slave operation, acknowledges, arbitration, and timeout detection. For the electric vehicle battery pack, SMBus is attractive because it is simple, low-cost, and widely supported by battery management devices and interface bridges.
A typical SMBus transaction begins with a start condition, followed by a seven-bit address and a read/write bit. The receiver acknowledges the address. Then one or more data bytes are transferred, each followed by an acknowledge or not-acknowledge. The transaction ends with a stop condition. If two masters begin at the same time, arbitration ensures that only one continues. A master that loses arbitration releases the data line and monitors the bus. If the clock line is held low for more than 25 milliseconds, all devices treat it as a timeout and reset their communication state.
| Transaction Field | Bits or Bytes | Purpose |
|---|---|---|
| Start condition | 1 event | Begins a transfer |
| Slave address | 7 bits | Selects the target device |
| Read/write bit | 1 bit | Defines data direction |
| Acknowledge | 1 bit | Confirms address or data reception |
| Data bytes | 1 to 32 bytes | Carries commands, status, and measurements |
| Stop condition | 1 event | Ends the transfer |
The communication firmware reports pack voltage, current, temperature, SOC, protection status, and fault history. It also accepts commands to start charging, stop charging, set charge current, and request a self-test. Because the electric vehicle battery pack may be connected to different host systems, I keep the command set small and well-defined. This reduces the risk of communication errors and makes it easier to integrate the pack into a larger electric vehicle battery pack management network.
Integration and Operating Sequence. When the charger is connected, the microcontroller first checks that the electric vehicle battery pack voltage and temperature are within safe limits. If the pack is too cold, the charger reduces current. If the pack is too hot, the charger waits or stops. If the voltage is below the overdischarge release threshold, the charger enters a low-current precharge mode. Once the voltage rises above the precharge threshold, the charger enters constant-current mode. In constant-current mode, the current loop controls the DC/DC stage. When the pack reaches the transition voltage, the charger enters constant-voltage mode. In constant-voltage mode, the voltage loop controls the DC/DC stage. When the current falls below the full-charge threshold for the required delay, the charger terminates the charge and updates the SOC estimate.
During discharge, the microcontroller monitors the pack current and cell voltages. If any cell voltage falls below the overdischarge threshold, the discharge path is disabled. If the current exceeds the overcurrent threshold, the discharge path is disabled after the short delay. If a short circuit is detected, the path is disabled immediately. If the temperature exceeds the safe limit, the discharge current is reduced or disabled. These actions protect the electric vehicle battery pack and the load.
Cell Balancing. Although my main focus is charging and protection, the electric vehicle battery pack also requires cell balancing. I use a passive balancing method in which a small resistor is connected across a cell through a switch when that cell reaches the upper voltage limit. The resistor dissipates excess charge while the other cells continue to charge. This method is simple and low-cost, but it generates heat and wastes energy. For a larger electric vehicle battery pack, active balancing using charge transfer capacitors or inductors can be considered. Active balancing improves efficiency but increases complexity and cost.
| Balancing Method | Principle | Advantages | Disadvantages |
|---|---|---|---|
| Passive resistive | Bleed excess charge through a resistor | Simple, low cost, reliable | Heat, energy loss, slow |
| Capacitive active | Transfer charge between cells | Efficient, no heat dump | More components, control complexity |
| Inductive active | Transfer energy through magnetic components | High efficiency, fast | Cost, EMI, size |
Protection Coordination. Protection thresholds must be coordinated with the charging profile. The constant-voltage target must be below the overcharge threshold. The overcharge release must be above the constant-voltage target but below the overcharge threshold. The overdischarge threshold must be below the normal operating voltage but above the short-circuit threshold. The overcurrent threshold must be above the maximum normal load current but below the safe limit of the MOSFETs and wiring. This coordination prevents oscillation between charging and protection states.
| Condition | Normal Operating Range | Protection Setting | Coordination Rule |
|---|---|---|---|
| Charging voltage | 31.5 V to 54.0 V | Overcharge at 54.5 V | CV target below overcharge threshold |
| Constant-voltage target | 52.5 V to 54.0 V | Transition at 52.5 V | Transition below CV limit |
| Discharge voltage | 31.5 V to 54.0 V | Overdischarge at 31.5 V | Cutoff above short-circuit threshold |
| Discharge current | Up to 20 A | Overcurrent at 20 A | Limit below MOSFET and fuse rating |
| Short-circuit voltage | Above 5 V | Short at 5 V | Below overdischarge threshold |
Thermal Design. The charger and the electric vehicle battery pack both generate heat. In the charger, the PFC MOSFET, DC/DC MOSFETs, transformer, and output rectifiers are the main heat sources. I use a combination of copper pours, thermal vias, and a heatsink to keep junction temperatures below their limits. In the battery pack, heat is generated by internal resistance during charge and discharge. I place temperature sensors near the center of the pack where heat is most likely to accumulate. If the temperature exceeds the safe operating range, the microcontroller reduces the current. If the temperature continues to rise, it disables charging or discharging.
For low-temperature operation, I do not allow full charge current. The electrolyte and electrode kinetics are slower, so forcing high current can cause lithium plating and permanent capacity loss. I reduce the charge current below 10 degrees Celsius and disable charging below 0 degrees Celsius unless a heating system is present. This is an important difference between a simple lead-acid charger and a charger designed for a lithium iron phosphate electric vehicle battery pack.
Reliability and Fault Handling. I include watchdogs, plausibility checks, and redundant limits. The microcontroller watchdog resets the firmware if the main loop stalls. The ADC readings are checked against minimum and maximum plausible values. If a sensor fails open or short, the firmware enters a safe state. The protection thresholds are also implemented in hardware where possible, so a software fault does not leave the electric vehicle battery pack unprotected. The main fuse provides backup protection for severe overcurrent. The MOSFETs are selected with voltage and current margins so that transient spikes do not cause immediate failure.
Fault handling follows a priority order. A short circuit is the highest priority and disables the path immediately. Overcurrent is next and disables the path after a short delay. Overvoltage and undervoltage disable the relevant charge or discharge path after their respective delays. Overtemperature reduces current first, then disables the path if the temperature continues to rise. Communication faults are reported but do not disable the pack unless the host system requires a heartbeat.
| Fault | Detection Method | Immediate Action | Recovery |
|---|---|---|---|
| Short circuit | Voltage collapse and current spike | Disable both paths | Fault removal and restart |
| Overcurrent | Hall current sensor | Disable affected path | Current normalization and delay |
| Overcharge | Pack voltage divider | Stop charging | Voltage below release threshold |
| Overdischarge | Pack voltage divider | Stop discharging | Voltage above release threshold |
| Overtemperature | Temperature sensor | Reduce or stop current | Temperature within safe range |
| Communication loss | SMBus timeout | Report fault, hold state | Bus activity restored |
Future Improvements. I see several ways to improve this design. First, the compensation coefficients for SOC estimation should be refined with more experimental data from the specific electric vehicle battery pack. Second, the thermal design can be improved with forced-air cooling or liquid cooling for higher-power packs. Third, soft-switching techniques can reduce switching loss and EMI in the DC/DC stage. Fourth, active cell balancing can improve usable capacity in an aged electric vehicle battery pack. Fifth, the communication interface can be expanded with USB, RS-232, or RS-485 bridges for diagnostics and data logging. Sixth, the protection logic can be extended with model-based fault detection to identify soft internal short circuits before they become dangerous.
I also believe that the electric vehicle battery pack should be treated as a system with its charger, protection electronics, thermal management, and communication network. A charger that is designed only for voltage and current regulation is not sufficient for a lithium iron phosphate pack. The charger must interact with the battery management system, respect temperature limits, coordinate protection thresholds, and provide accurate state information. This integrated approach improves safety, extends cycle life, and makes the electric vehicle battery pack more practical for everyday use.
Conclusion. I have presented a charging and protection design for a 48 V, 20 Ah lithium iron phosphate electric vehicle battery pack. The charger uses a boost power factor correction stage followed by an isolated parallel single-ended forward DC/DC converter. The PFC stage operates at 100 kHz with average current control, and the DC/DC stage operates at 200 kHz with a 16:10 transformer ratio. The protection subsystem monitors pack voltage, cell voltage, current, temperature, and internal resistance. The state-of-charge estimator uses ampere-hour integration with temperature, rate, aging, and self-discharge compensation, and it is corrected by open-circuit voltage when the electric vehicle battery pack rests. The communication subsystem uses SMBus for simple and robust external data exchange. Simulation and design calculations show that the charger meets the target charging requirements and that the protection thresholds are coordinated with the safe operating window of the electric vehicle battery pack.
