Hello and welcome to the honors week of this course.

I'm really pleased that you have chosen to study this optional material.

This week, we're going to look at a few advanced methods for dealing with

some real-world issues that relate to state of charge estimation.

We begin by looking at methods to deal with current-sensors that have a DC bias.

The Kalman filter theory that you learned about in

this course assumes that all noises have zero mean,

and if the current-sensor has a constant DC bias,

especially one that's unknown,

then this process noise that models

the error in the current-sensor will not have zero mean,

and the current-sensor reading then we'll introduce

a permanent state of charge estimation error.

Hall-effect type current-sensors are especially

prone to producing estimates with a DC bias and

that was why in the first course in this specialization I shared

with you that I prefer using shut-style current-sensors instead.

But even those can introduce a constant DC bias in the current-sensor reading if

the measurement electronics are not carefully designed in order to balance all effects.

So, what's the problem?

We find that the accumulated ampere-hours of bias tend to move this state of charge

estimate faster than the measurement update of the Kalman filter is able to correct.

The result is that our state of charge estimate will have

an offset with respect to the true state of charge,

and that offset might actually grow without bound.

So, how do we fix this?

Well, the best solution would be to fix the sensor, that is,

less design sensing hardware that eliminates all of the current-sensor bias.

Some hall-effect type current-sensors include,

special circuitry that attempts to eliminate the bias that's

fundamentally caused by magnetic hysteresis components of the sensor itself.

Shunt type sensing can also be designed to attempt to eliminate the bias by

carefully matching component values and choosing tight tolerances on resistances,

and capacitances, and so forth inside of the circuitry.

However, despite our best attempts,

there will always be some amount of bias and it would be good to have

a solution that can help eliminate that bias using software.

So, we will attempt to correct for

this unknown and possibly time-varying bias

algorithmically by estimating the value of the bias at each point in time,

and then subtracting that out from the current-sensor reading.

So, I stress that it's not the fact that we have bias that's the problem,

it's the fact that we don't know the bias,

and with hall-effect sensors in particular,

this bias can change over time and due to temperature changes and so forth.

We just don't know what the bias is and so we'd like to

be able to estimate that value and

subtract the bias from the current-sensor readings to give unbiased sensors.

I will quickly share with you one approach that we can take.

We desire to estimate the bias of the current-sensor and so we

augment the state of our model with one additional component,

that is, the current-sensor bias itself.

We give this state vector component the name,

i_b, where b stands for bias.

Then we design the rest of our model appropriately.

If we do that, the Kalman filter will automatically estimate

the current-sensor bias at the same time it is estimating the rest of this state vector.

Here, I produce the set of equations that illustrates what I mean.

Notice that the bias equation

is the one on the bottom and we'll talk about that in a moment,

but the rest of the equations are essentially the same from the standard enhanced

self-correcting model but with the small change

that every time input current i_k occurred previously,

we now have i_k minus i_kb.

We're subtracting out the estimate of the current-sensor bias.

So previously, the state of charge equation model,

presence state of charge is equal to the prior state of charge minus

the measured current plus

the process noise all scaled by the sample interval and the capacity.

But now, we subtract from the measured current the bias estimate.

Similarly, the diffusion resistor currency equation,

we're subtracting from the measured current the bias estimate,

and in the hysteresis factor,

we're subtracting the bias current,

and also for the hysteresis input,

we're subtracting the bias current from

the measured current inside of that sine function.

But we need a way for the Kalman Filter to adapt the bias.

So, we really need a state equation that describes how the bias changes over time,

and we don't have any idea how the bias changes over time.

Maybe it's a constant,

maybe it drifts over time due to temperature changes or unknown factors.

So, the final equation on this slide says that

the current bias is equal to the previous bias plus some noise factor, n_b.