A controllable electrowetting lens system has a feedback control loop for controlling the electrode arrangement drive signals to implement an autofocus function. The feedback control loop comprising an image analysis focus detection system and a variable gain element. The gain is adjusted based on the lens condition, for example as sensed by a capacitance sensing arrangement. The autofocus control loop can be optimized to the lens characteristics (because the lens characteristics change over time) and/or to external conditions such as temperature.