A variable gain impedance controller for use in a control system for controlling a motorized prosthetic or orthotic apparatus provided with a joint The controller comprises a sensor input for receiving a signal indicative of an interaction between the apparatus and the ground, a torque sensor input for receiving a signal indicative of the torque at the joint and a variable gain scheduler in communication with the sensor input so as to receive data therefrom thereby providing a variable torque gain. The variable gain impedance controller adjusts its control on the apparatus based on the variable torque gain and the indicated torque so as to a) increase the joint resistance to motion when the signal received from the sensor input indicates an interaction between the apparatus and the ground and b) decrease the joint resistance to motion when the signal received from the sensor input indicates an absence of interaction between the apparatus and the ground.