A method for tuning a dynamical model of an industrial robot on a foundation, the robot comprising a number of moveable arm sections (12, 14) and the method comprising the steps of: - providing a first dynamical model of the robot, the first dynamical model comprising first model parameters (c1, c2, k1, k2, m1, m2) representing dynamical properties of the robot where there is one group of parameters per arm section, each being modelled as a combination of a mass parameter, a spring parameter and a damping parameter; - providing a second dynamical model of a foundation the robot is attached to, the second dynamical model comprising second model parameters (c3, k3, m3) representing dynamical properties of the foundation, wherein the second model parameters comprise at least one group of parameters, said group comprising a mass of the foundation, at least one corresponding spring parameter and at least one corresponding damping parameter; - obtaining information about dynamical properties of the foundation by moving an arm section of the robot through vibrating with vibrations scanning a certain frequency range, and by measuring a property affected by the movement; and - setting the second model parameters (m3, k3, c3) on the basis of the information about the dynamical properties of the foundation obtained in the previous step based on knowledge of the parameter values of the first model, wherein the obtaining of information by moving the robot and by measuring the property and the setting of the second model parameters comprises determining the resonance frequencies of a relationship between the measured property and torque of the arm section in the scanned frequency range and setting the values of the second model based on one of the resonance frequencies given knowledge of the parameters of the first model, and wherein the measured property is a position of the robot. - providing a first dynamical model of the robot, the first dynamical model comprising first model parameters (c1, c2, k1, k2, m1, m2) representing dynamical properties of the robot where there is one group of parameters per arm section, each being modelled as a combination of a mass parameter, a spring parameter and a damping parameter; - providing a second dynamical model of a foundation the robot is attached to, the second dynamical model comprising second model parameters (c3, k3, m3) representing dynamical properties of the foundation, wherein the second model parameters comprise at least one group of parameters, said group comprising a mass of the foundation, at least one corresponding spring parameter and at least one corresponding damping parameter; - obtaining information about dynamical properties of the foundation by moving an arm section of the robot through vibrating with vibrations scanning a certain frequency range, and by measuring a property affected by the movement; and - setting the second model parameters (m3, k3, c3) on the basis of the information about the dynamical properties of the foundation obtained in the previous step based on knowledge of the parameter values of the first model, wherein the obtaining of information by moving the robot and by measuring the property and the setting of the second model parameters comprises determining the resonance frequencies of a relationship between the measured property and torque of the arm section in the scanned frequency range and setting the values of the second model based on one of the resonance frequencies given knowledge of the parameters of the first model, and wherein the measured property is a position of the robot.