A variable gain impedance controller for use in a control system for controlling a prosthetic or orthotic apparatus (10, 140) provided with a joint (34, 44), the controller comprising: a first sensor input for receiving a signal indicative of an interaction between the apparatus (10, 140) and the ground (32, 150); a torque sensor input for receiving a signal indicative of the torque at the joint (34, 44); a variable gain scheduler in communication with the first sensor input so as to receive data therefrom thereby providing a variable torque gain; wherein the variable gain impedance controller is adapted to adjust its control on the apparatus (10, 140) based on the variable torque gain and the indicated torque so as to increase the joint resistance to motion when the signal received from the first sensor input indicates an interaction between the apparatus (10, 140) and the ground (32, 150), and/or decrease the joint resistance to motion when the signal received from the first sensor input indicates an absence of interaction between the apparatus (10, 140) and the ground (32, 150); characterized in that said controller further comprising a position sensor input for receiving a signal indicative of the position of the joint (34, 44) and hence corresponding to an indicated position; wherein the variable gain scheduler further provides a variable velocity gain based and a variable position gain, and wherein the variable gain impedance controller is adapted to adjust its control on the apparatus (10, 140) based on the variable velocity gain, a difference between a velocity set-point and a velocity estimation, the variable position gain, a difference between a position set-point and the indicated position, the variable torque gain and the indicated torque so as to increase the joint resistance to motion when the signal received from the first sensor input indicates an interaction between the apparatus (10, 140) and the ground (32, 150) and/or decrease the joint resistance to motion when the signal received from the first sensor input indicates an absence of interaction between the apparatus (10, 140) and the ground (32, 150). a first sensor input for receiving a signal indicative of an interaction between the apparatus (10, 140) and the ground (32, 150); a torque sensor input for receiving a signal indicative of the torque at the joint (34, 44); a variable gain scheduler in communication with the first sensor input so as to receive data therefrom thereby providing a variable torque gain; wherein the variable gain impedance controller is adapted to adjust its control on the apparatus (10, 140) based on the variable torque gain and the indicated torque so as to increase the joint resistance to motion when the signal received from the first sensor input indicates an interaction between the apparatus (10, 140) and the ground (32, 150), and/or decrease the joint resistance to motion when the signal received from the first sensor input indicates an absence of interaction between the apparatus (10, 140) and the ground (32, 150); characterized in that said controller further comprising a position sensor input for receiving a signal indicative of the position of the joint (34, 44) and hence corresponding to an indicated position; wherein the variable gain scheduler further provides a variable velocity gain based and a variable position gain, and wherein the variable gain impedance controller is adapted to adjust its control on the apparatus (10, 140) based on the variable velocity gain, a difference between a velocity set-point and a velocity estimation, the variable position gain, a difference between a position set-point and the indicated position, the variable torque gain and the indicated torque so as to increase the joint resistance to motion when the signal received from the first sensor input indicates an interaction between the apparatus (10, 140) and the ground (32, 150) and/or decrease the joint resistance to motion when the signal received from the first sensor input indicates an absence of interaction between the apparatus (10, 140) and the ground (32, 150).