I am writing code for a robotic slide lift. I can accurately get the position of of the lift but I would like to be able to keep the position of lift with little to no oscillation (small high frequency oscillations should be fine). I am using a PID control loop and I have spent a lot of time trying to tune it. However, since gravity is helping the thing down but slowing it when its trying to go up, it is impossible to tune the PIDs very well. Right now when it is trying to hold its position it slowly goes up to the target position then once it reaches it and just barely overshoots the next update it falls back down then repeats the process again.
I was thinking of getting the raw power value that the PID calculates and simply add some constant to it to compensate for gravity but I don't have access to the PID calculations so I would have to write the PID code myself.
Would this modified PID loop work or is there another control loop that will help to compensate for this asymmetric situation?
For reference, I control the lift using a joystick. I apply to move the lift up then whenever I stop giving power (the joystick is at the 0 position), the PID kicks in to try to keep the position at that time.