Devices and methods for delivering therapeutic fluid to a patients body are described. The devices may comprise a dispensing unit having a reservoir, a driving mechanism having a movable member for delivering therapeutic fluid to a patients body, at least one sensor for sensing a relative position of the movable member and generating a signal, and a processor for controlling the driving mechanism to deliver an amount of therapeutic fluid that compensates for a change in the flow of the therapeutic fluid occurring during fluid delivery. The methods may be implemented by operating the driving mechanism, receiving a signal based on the position of the movable member, determining an amount of therapeutic fluid to deliver, and controlling the driving mechanism to deliver an amount of fluid that compensates for a change in flow occurring during fluid delivery.