If the object is at rest at the desired height, the force required to counter gravity is equal to the force of gravity itself. In other words, if the force of gravity is 500 and the DIRECTION of the force is DOWN, then the counter-force must be 500 and must be the inverse direction.
However, by countering only the gravity, you will not counter the additional downward force that comes from the downwards velocity (Z axis in this case).
I think you should code it so that there is a "target" height. If the hovercraft goes below that height, there must be an addition force in the upward direction to bring it back to the target height.
If it goes above the target height, then the "floating" force is reduced dependend on how height the hovercraft is above the target height.
If that force is taken away (or reduced), the hovercraft should fall back down again, but will go below the target once again though... you will need to add some kind of "dampener" to this process or it will bounce up and down forever.
hypothetical example:
target_height = ground_height + 10;
if(my.z < target_height)
{
float_force = target_height - my.z; // how FAR below the target height
// determins the float force
}
if(my.z > target_height)
{
float_force = my.z - target_height;
}
if(my.z == target_height)
{
float_force = -gravity; //TIMES* -1 because 500 is a negitive number
//and we want a positive version of 500
}
This is not full code, it would not work if you simply copied pasted it, but I hope you get my idea.
If this method works and you can dampen the process (so it does'nt bounce up and down forever) then it should behave like there is a repelling magnet below the hovercraft, or like it's on smooth water.