The objective of this paper is to design a heart rate (HR) controller for a treadmill so that the HR of an individual running on it tracks a pre-specified, potentially time-varying profile specified by doctors for the cardiac recovery of the person. Initially, a parameter estimation algorithm is presented with the aim of estimating the values of the parameters of a model relating the speed of the treadmill with the HR of an individual. The parameter estimation problem is formulated as an optimization one and solved by using Particle Swarm