An infusion pump having a tubing clamping section including a movable and a stationary portion. The infusion pump includes at least one sensor for detecting a contact length of tubing within the movable and/or the stationary portion. The infusion pump includes a shuttle having a shuttle stationary and a shuttle moveable portion, and is configured to squeeze a length of the tubing between the shuttle portions. The infusion pump includes a motor connected to the shuttle moveable portion via a shaft. The motor moves the shuttle moveable portion towards and away from the shuttle stationary portion. The infusion pump includes a controller and an encoder that detects a position of the shaft. The controller converts the detected position into a travel distance of the shuttle moveable portion, and calculates a diameter and a thickness of the tubing based on the travel distance and the contact length of the tubing.