1. 程式人生 > 實用技巧 >Nonlinear State Estimation of a Degrading Battery System

Nonlinear State Estimation of a Degrading Battery System

This example shows how to estimate the states of a nonlinear system using an Unscented Kalman Filter in Simulink™.

Overview

Consider a battery model with the following equivalent circuit

The model consists of a voltage source, a series resistorand a single RC block with componentsand. The battery alternates between charging and discharging cycles.In this example, you estimate the state of charge (SOC) of the battery model using measured currents, voltages, and temperature of the battery. You assume the battery is a nonlinear system, and estimate the SOC using an Unscented Kalman Filter.

Battery Model

The battery model with thermal effect is implemented using Simscape software.

The state transition equations for the battery model are given by:

whereandare the thermal and SOC-dependent resistor and capacitor in the RC block,is the voltage across capacitor,is the input current,is the battery temperature,is the battery capacity (unit: Ah), andis the process noise.

The input currents are randomly generated pulses when the battery is discharging and constant when the battery is charging.

The measurement equation is given by:

whereis the measured output voltage,is the serial resistor,is the electromotive force from voltage source, andis the measurement noise.

In the model,andare 2D look-up tables that are dependent on SOC and battery temperature. The parameters in the look-up tables are identified using experimental data.

Estimate State of Charge (SOC)

To use the Unscented Kalman Filter block, you specify the measurement and state transition functions using either Matlab or Simulink functions. This example demonstrates the use of Simulink functions. Since Unscented Kalman Filters are discrete-time filters, first discretize the state equations. In this example, Euler discretization is employed. Let the sampling time be. For a general nonlinear system, the system can be discretized as:

The state vectors of the nonlinear battery system are:

Applying Euler discretization gives the following equations:

The discretized state transition equation is implemented in the Simulink function namedbatteryStateFcn. The function inputxis the state vector, and the function outputxNextis the state vector at the next step, calculated using the discretized state transition equations. In the function, you need to specify the signal dimensions and data type ofxandxNext. In this example, the signal dimension forxandxNextis 2, and the data type is double. Additional inputs tobatteryStateFcnare the temperature, estimated capacity, and current. Note that the additional inputs are inputs to the state transition equations and are not required by the Unscented Kalman Filter block.

Similarly, the measurement function is also implemented in the Simulink function namedbatteryMeasurementFcn.

Configure the Unscented Kalman Filter block parameters as follows:

In theSystem Modeltab, specify the block parameters as shown:

You specify the following parameters:

  • Function in State Transition:batteryStateFcn.

The name of the simulink function defined previously that implements the discretized state transition equation.

  • Process noise:Additive, with time-invariant covariance.Additiveimplies that the noise term is added to the final signals directly.

The process noise for SOC andare estimated based on the dynamic characteristics of the battery system. The battery has a nominal capacity of 30 Ah and undergoes either discharge or charge cycles at an average current amplitude of 15A. Therefore, one discharging or charging process would take around 2 hours (7200 seconds). The maximum change is 100% for SOC and around 4 volts for.

The maximum changes per step in SOC andareand, whereis the sampling time of the filter. In this example,is set to be 1 second.

Thus, the process noiseis:

.

  • Initial State:.

The initial value for SOC is assumed to be 100% (fully charged battery) while initial value foris set to be 0, as we do not have any prior information of.

  • Initial Covariance:

Initial covariance indicates how accurate and reliable the initial guesses are. Assume the maximum initial guess error is 10% for SOC and 1V for. The initial covariance matrix is set to be.

  • Unscented Transformation Parameters: The parameter are specified based on [2]

     - Alpha: 1. Determine the spread of sigma points around x. Set Alpha to be 1 for larger spread.
     - Beta: 2. Used to incorporate prior knowledge of the distribution. The nominal value for Beta is 2.
     - Kappa: 0. Secondary scaling parameter. The nominal value for Kappa is 0.
  • Function in Measurement:batteryMeasurementFcn.

The name of the Simulink function defined previously that implements the measurement function.

  • Measurement noise:Additive, with time-invariant covariance 1e-3.

The measurement noiseVis estimated based on measurement equipment accuracy. A voltage meter for battery voltage measurement has approximately 1% accuracy. The battery voltage is around 4V. Equivalently, we have. Therefore,.

  • Sample Time:.

Results

To simulate the system, load the battery parameters stored in the fileBatteryParameters.mat. The file contains the battery parameters including,,.

load BatteryParameters.mat
Simulate the system.
sim('BatteryExampleUKF')

At every time step, the Unscented Kalman Filter provides an estimation for SOC, based on voltage measurements. Plot the real SOC, the estimated SOC, and the difference between them.

After an initial estimation error, the SOC converges quickly to the real SOC. The final estimation error is within 0.5% error. Thus, the Unscented Kalman Filter gives an accurate estimation of SOC.

原文地址:https://de.mathworks.com/help/control/ug/nonlinear-state-estimation-of-a-degrading-battery-system.html