A position sensor system for measuring a position of a target movable along a predefined trajectory outside a plane, the target being adapted for generating or modifying a magnetic field, the position sensor system comprising: - a first magnetic sensor fixedly arranged at a first position in said plane; - a second magnetic sensor fixedly arranged at a second position in said plane, the first and second position being spaced apart by a predefined distance D; characterised in that the predefined trajectory is a straight line substantially perpendicular to the plane, and an intersection point of the straight line and the plane is located substantially halfway between the first magnetic sensor and the second magnetic sensor; the first magnetic sensor is adapted for measuring a first magnetic field component Bu1 of said magnetic field, oriented in a first direction parallel to said plane; the second magnetic sensor is adapted for measuring a second magnetic field component Bu2 of said magnetic field, oriented in said first direction parallel to said plane; - a controller communicatively connected to the first and the second magnetic sensor (201, 202), and adapted for determining the out-of-plane position of the movable target along said straight line in one of the following ways: i) determining a magnetic field gradient [Bu1-Bu2] /D of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position as a function of said magnetic field gradient; or ii) determining a magnetic field difference [Bu1-Bu2] of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position based on said magnetic field difference, taking into account said predefined distance D, using a predefined look-up table or using a predefined mathematical formula. - a first magnetic sensor fixedly arranged at a first position in said plane; - a second magnetic sensor fixedly arranged at a second position in said plane, the first and second position being spaced apart by a predefined distance D; the predefined trajectory is a straight line substantially perpendicular to the plane, and an intersection point of the straight line and the plane is located substantially halfway between the first magnetic sensor and the second magnetic sensor; the first magnetic sensor is adapted for measuring a first magnetic field component Bu1 of said magnetic field, oriented in a first direction parallel to said plane; the second magnetic sensor is adapted for measuring a second magnetic field component Bu2 of said magnetic field, oriented in said first direction parallel to said plane; - a controller communicatively connected to the first and the second magnetic sensor (201, 202), and adapted for determining the out-of-plane position of the movable target along said straight line in one of the following ways: i) determining a magnetic field gradient [Bu1-Bu2] /D of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position as a function of said magnetic field gradient; or ii) determining a magnetic field difference [Bu1-Bu2] of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position based on said magnetic field difference, taking into account said predefined distance D, using a predefined look-up table or using a predefined mathematical formula. - a controller communicatively connected to the first and the second magnetic sensor (201, 202), and adapted for determining the out-of-plane position of the movable target along said straight line in one of the following ways: i) determining a magnetic field gradient [Bu1-Bu2] /D of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position as a function of said magnetic field gradient; or ii) determining a magnetic field difference [Bu1-Bu2] of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position based on said magnetic field difference, taking into account said predefined distance D, using a predefined look-up table or using a predefined mathematical formula. i) determining a magnetic field gradient [Bu1-Bu2] /D of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position as a function of said magnetic field gradient; or ii) determining a magnetic field difference [Bu1-Bu2] of said first and second magnetic field component (Bu1, Bu2), and determining the out-of-plane position based on said magnetic field difference, taking into account said predefined distance D, using a predefined look-up table or using a predefined mathematical formula.