Gravity compensation device for compensating gravitational forces acting on a position-controlled device, wherein the position of said position-controlled device is measured by at least one position sensor and controlled by at least one position controller, the gravity compensation device comprising at least one first gravity compensation controller and at least one gravity compensation actuator, wherein the at least one first gravity compensation controller uses the output signals generated by the at least one position controller as input signals, thereby generating output signals used by the at least one gravity compensation actuator to compensate gravitational forces acting on said position-controlled device, the device further comprising a second gravity compensation controller, wherein the at least one first gravity compensation controller uses the output signals generated by the position controller as input signals, wherein the second gravity compensation controller uses the output signals generated by the at least one first gravity compensation controller as input signals, and wherein output signals from said second gravity compensation controller are used to control the gravity compensation actuator, wherein the output signals generated by the first gravity compensation controller are summed with a position setpoint signal of said position controller, whereby the resulting signal is used as setpoint for said second gravity compensation controller.