A method for controlling a mechanical system having a plurality of components interlinked by a plurality of driven joints, the method comprising: receiving a motion demand signal representing a desired physical position of a part of the mechanical system; and measuring the configuration of each of the driven joints and forming a state signal representing the measured configurations, wherein the method is characterised in that it comprises: measuring the torques or forces about or at the driven joints and forming a load signal representing the measured torques or forces; implementing an impedance control algorithm (52; 60) comprising: solving an ordinary differential equation to determine a target physical position of the part of the mechanical system, the ordinary differential equation having inputs of the motion demand signal, the load signal, and impedance parameters, the impedance parameters being a function of the state signal, performing an inverse kinematic computation to determine a configuration for each of the driven joints that is suitable for positioning the part of the mechanical system at the target physical position, and forming a target signal indicating those configurations as the target configuration for each of the driven joints; and forming a set of drive signals for the joints by, for each joint, comparing the target configuration of that joint as indicated by the target signal to the measured configuration of that joint as indicated by the state signal. receiving a motion demand signal representing a desired physical position of a part of the mechanical system; and measuring the configuration of each of the driven joints and forming a state signal representing the measured configurations, measuring the torques or forces about or at the driven joints and forming a load signal representing the measured torques or forces; implementing an impedance control algorithm (52; 60) comprising: solving an ordinary differential equation to determine a target physical position of the part of the mechanical system, the ordinary differential equation having inputs of the motion demand signal, the load signal, and impedance parameters, the impedance parameters being a function of the state signal, performing an inverse kinematic computation to determine a configuration for each of the driven joints that is suitable for positioning the part of the mechanical system at the target physical position, and forming a target signal indicating those configurations as the target configuration for each of the driven joints; and solving an ordinary differential equation to determine a target physical position of the part of the mechanical system, the ordinary differential equation having inputs of the motion demand signal, the load signal, and impedance parameters, the impedance parameters being a function of the state signal, performing an inverse kinematic computation to determine a configuration for each of the driven joints that is suitable for positioning the part of the mechanical system at the target physical position, and forming a target signal indicating those configurations as the target configuration for each of the driven joints; and forming a set of drive signals for the joints by, for each joint, comparing the target configuration of that joint as indicated by the target signal to the measured configuration of that joint as indicated by the state signal.