Design and optimisation of an npn bipolar phototransistor for optical position encoders