This paper presents a non-model-based collision detection algorithm for robots without external sensors and with closed control architecture. A reference signal of repetitive motion is recorded from the robot operation. To detect collisions, the reference is compared with measurements from the robot. One of the key contributions is a novel approach to optimal matching of compared signals, which is ensured by the newly developed modified Dynamic Time Warping (mDTW) method presented in this paper. One of the main improvements of the mDTW is that it enables comparing a signal with the most similar section of the other signal. Partial matching also enables online application of time warping principles and reduces the time and computation resources needed to perform matching. In addition to mDTW, two complementary decision rules are developed to identify collisions. The first rule, based on the absolute difference between compared matched samples, uses statistically determined thresholds to perform rapid detection of unambiguous collisions. The second rule is based on Eigen values of the covariance matrix of matched samples, and it employs its higher sensitivity to detect collisions with lower intensity. Results from experimental validation of the proposed collision algorithm on two industrial robots are shown.