Recursive algorithms, such as recursive least squares (RLS) or Kalman filters, are commonly used in battery management systems to estimate the electrical impedance of the battery cell. However, these algorithms can in some cases run into problems with bias and even divergence of the estimates. This article illuminates problems that can arise in the online estimation using recursive methods, and lists modifications to handle these issues. An algorithm is also proposed that estimates the impedance by separating the problem in two parts; one estimating the ohmic resistance with an RLS approach, and another one where the dynamic effects are estimated using an adaptive Kalman filter (AKF) that is novel in the battery field. The algorithm produces robust estimates of ohmic resistance and time constant of the battery cell in closed loop with SoC estimation, as demonstrated by both in simulations and with experimental data from a lithium-ion battery cell.