# PLUME – These last few days: Curve Fitting and Kalman Filter

I have done quite a lot of things since the last time i posted something here. I did mainly programming.

I implemented C++ classes for the computational part of the emitter and the receiver. It was a bit straight-forward. The receiver has a method to be set the voltages and a method to get the degrees of freedom. The emitter has a method to retrieve its calibration matrix.

Then we talked among us  and discovered that the symmetry problem would be hard to tackle: Because we have the absolute value of the voltages in the receiver coils, the receiver can be in each one of the each space octants (we only know the absolute values of the coordinates x,y,z).

So I tried to solve it by knowing the initial position and estimating the position in the future. When it is estimated that the receiver will change of octant, the 3-bit sign mask that will be used to compute the next signed position is changed accordingly to estimation. To estimate the position, I fit each of the coordinates with a parabola. the parabola is fitted using the 128 last-known position. Sadly it didn’t work well, there was to much noise in the position and it failed sometimes but enough often to be bad.

Then the group decided to add an IMU to the system to be used to solve the symmetry problem. And around the same time, we discovered that the phase of the measured voltages could be used to solve a part of the symmetry problem. It reduces the problem to a central symmetry. We can get the phases because to measure the voltages we already do a fft on the receiver.

Then I decided to read about kalman filters to see if we could use one to combine the data from the coils and the IMU to get a better precision. I did experiments on an axis combing position data (given by the coils) and accelerometer data assuming that we don’t have the voltage phase. Because the measured position is the absolute value of the real position, I had to use the non linear form of the Kalman filter (the discrete-time extended Kalman filter). Luckily the abs function is a simple non-linear function, so the jacobian matrix was simple (just a sign(x) instead of a 1 ). It works way better than the position estimation method with a parabola. The filter manages to estimate the position given the absolute value of the position and the acceleration, which solves the symmetry problem.

An hour ago, we found out that waiting for the IMU chip will add us a week delay. So we won’t have one.

I hope the phase method will work fine. ### 1 comment to PLUME – These last few days: Curve Fitting and Kalman Filter

• alexandre

You are using a resonant circuit with high Q at emitter and receiver. Those circuits can add a large phase offset (dephasing up to +-90°) if the drive frequency is lower or higher than the resonant frequency. You may need to calibrate this dephasing on each coil.