Location.Engine.Kalman

Hi Guys,
I am working on MDEK1001 Modules and I have tested several experiments where I observed that as far I get further from one Anchor, the more Errror I will see in the ranging. I am using KALMAN filetr where I model the ranging as an observation. My idea is to implement the kalman filter in the way that if I am getting further from one Anchor so I can add less weight on the kalman filter gain on it and rely on the other ones. So that I can compensate the error. I have simulated the kalman filter on Matlab with my raw data ranging. My question is that how can disable the location engine and implement my own custome one tag. I have seen the API and firmware guide. However, I do not still have any idea hoe can I implement it on the board since the DRTLS is working on its own structure. Can anyone give my dome guides in detail ecplanation?
I do not have any idea about working with firmware and what are the posiblities to change sth on it ?

Thanks