Patent ID: 8676525

Claim:
A method of determining a current in a switched mode power supply using linear least squares to fit a line defined by an equation having at least two coefficients to measured current values, the coefficients of the line being obtained using the relationship c=AI m , where c is a vector of the coefficients, I m is a vector of the measured current values and A is a matrix relating c to I m , the method comprising: storing values representing at least one pre-calculated matrix A; receiving measured current values (I m (y)), each value representing the current flowing in the switched mode power supply at a different time; using the stored values representing the matrix A and the received measured current values (I m (y)) to calculate, with a processor, a respective initial value for each of the coefficients of the line; for each measured current value: calculating, with the processor, an estimated current (I est ) using the equation of the line and the calculated initial values of the coefficients; determining, with the processor, a difference between the measured current value (I m (y)) and the estimated current value (I est ) to generate a difference value (e); and comparing, with the processor, the difference value (e) against a threshold (e T ) and, if the difference value is greater than the threshold, calculating updated values of the coefficients using the stored values representing the matrix A and the difference value (e); and determining, with the processor, a value for the current in the switched mode power supply using the updated values of the coefficients.