The U-Build Bionic Knee performs both walking and stair ascent. To successfully accomplish both of these tasks, the powered prosthetic must closely follow a joint path or trajectory during the swing phase of walking. We use close loop negative feedback control. While this may sound foreign, it is very simple. Essentially, we set a desired position, say 10 degrees of knee flexion, and measure the position of the robotic knee joint. If that knee joint reads 10 degrees, we do nothing. However, if the position of the knee joint is a value other than 10 degrees, say 20 degrees, we apply a small amount of current to our electric motor to turn the knee joint towards 10 degrees. This process of comparing the desired location of the knee joint (in this example 10 degrees) to the current position of the knee joint happens continuously and is called close loop control. We use close loop negative feedback control since we look at the difference between the desired knee position and the current knee position to generate our error signal. In this example, if the knee joint measures 20 degrees, but the desired position is 10 degrees, then the error is -10 degrees. As the motor moves the knee joint towards the desired position, the error decreases in magnitude. If we move past the desired position, say we reach 8 degrees, then the error is +2 degrees.

We turn the error calculated using our close loop negative feedback into a control signal to the motor through a proportional, integral, and derivative controller (PID Control). PID control is very common in robotics due to the simplicity of programming and tuning the controller. Notably, the controller performs three basic operations on the error signal. The operations include:

  • Multiplying the error signal by a proportionality constant Kp
  • Multiplying the integral or accumulated error by a gain Ki
  • Multiplying the derivative or change in error by a gain Kd

These three actions are known as proportional, integral, and derivative control and, when summed together to create a control signal, are called PID control!

Each element of the PID controller performs a slightly different function. First, proportional control, takes the current error and multiplies it by a gain to create a control signal. This means that if your knee joint is far from the desired position, a lot of current is sent to the motors to make them turn very fast. In contrast, if the knee joint is close to the desired position, only a small amount of current is sent to the motors. As you can imagine, proportional control runs into some problems. For example, external forces applied to the leg like gravity and inertia may cause the robotic leg to deviate from its current position. This will cause an error in joint position and current will be sent to the motor creating motor torque. Once the motor torque balances the external torque, the leg will be in equilibrium and will no longer move. However, this may occur at an angle different from the desired position so a steady state error will be present. The addition of integral control to a proportional controller can reduced steady state error. In integral control, we multiply the accumulated error by a gain. In the example with external torques, the accumulated error increases when the leg is not at the desired position. Thus, the control signal increases even when the contribution of the proportional controller is balanced by external forces, driving the leg to the desired position.

The last component of PID control is derivative control. Derivative control is tuned to reduce control overshoot. Overshoot occurs when the current position travels past the desired position. For example, if the leg is initial at 20 degrees and the desired position is set to 10 degrees, the initial control response might be quite large due to the error of -10 degrees and the current applied to the motors will cause the leg joint to accelerate and increase in velocity. When the leg reaches 10 degrees knee flexion, it may have so much kinetic energy, that it rotates past 10 degrees before the control signal causes the leg to return. This process is called overshoot and can be reduced with derivative control. Specifically, the derivative control multiples the rate of change (derivative) of error by a gain. Thus, if the robotic leg moves from 20 degrees to 10 degrees, the error changes from -10 degrees to something smaller, say -5 degrees. This means that the rate of change of the error is increasing, since the error increases from -10 to -5. In this scenario, in contrast to proportional and integral control which would both have negative contributions to control signal, the derivative control has a positive contribution and this contribution increases as the leg approaches the desired position more rapidly. This effectively reduces the control signal and minimizes overshoot.

Have any questions? Confused? The videos below from Northwestern University explain close loop control, PID control, and PID tuning.

Intro to PID

PID Improvements

PID tuning

Our PID Tuning Tutorial Videos

Check out the videos below to walkthrough our code and our PID tuning:

PID Code Walkthrough

PID Tuning