Rodin has a primitive king safety routine with tropism, number of attacker, a scale factor and a trigger when there are enought material to do mate. I based it at first in a few ideas I see in simple programs like CPW or TSCP. It has been working well, altought it is not perfect. I see now I need a better one. i.e. it does not look at squares above the pawn shield (King_file + 2), or it does not count other features. During last month I have noted this could be a improvement area because at the strenght of Rodin it looses many games because an improper king safety eval.
So far I have developed two or three systems to try, in original and creative ways, where I have included new features like holes, defending pieces, pawn storm and so on. I have made one like the Rebel method of table[] and defects & attacks counter, and also another method of apply bonus and malus for each term evaluated. These systems look good at first, they seems very logical, but I have encounter I big problem to tune so many parameters, not only about the eval, but make search to take adventage of the new routine.
Any test I have done with those algorithms and probes changing values lead to a decrease of near 100 ELO points after 400/500 games played.
My problem so looks in how to make all (value, routines and search) work together. This is not like evaluating a typical eval term where you only change a value and test it, because king safety is a sum of various eval terms which need to work together. I see the part of finding the exact king safety eval terms is very difficult.
This post is asking for help, about how other has dealed with this issue, opinions or tips. I have read other' source code and all they look to me very difficul to tune (i.e. crafty or stockfish). Also there are not two routines the same. All engines seem to have its own and original routine, - which is a good thing

I think a good king safety is a need for having a strong engine. Any tip or advice in how to improve my king safety would be much appreciate.
Thanks.
Fermín