The main code for the leg, "IntegratedPIDcontroller", contains the walking, stairs, and step response controllers. Once you have the leg completely built and wired, and have verified using the test code that each system works, you can begin working with the main controller. Watch the videos below to learn about how the tuning and control interface works and start getting familiar with the code. We have also included a diagram of the architecture of the code, in case you need to reference it.
To access all of our code see the U-Build Bionic Knee Github page. The main code for the leg is the IntegratedPIDcontroller file. Download this file and all of the contents in the folder. All of the other sketches in the IntegratedPIDController file are tabs that should appear at the top of Arduino when you open the main file. If they do not appear here, drag each file to the top of Arduino to make them into tabs. Make sure you have already setup Arduino and put all of the libraries in the correct location so Arduino can reference them. If you have not done this please go to our Setting up Arduino page.
Watch the following videos to learn about the Integrated Controller. Once you have finished learning about the controller interface, go to the PID Tuning tab to learn how to tune the controller to your specific device.
Integrated Controller Interface Demonstration
Integrated Controller Code Walkthrough
Control Architecture
You will first start in the control and tuning interface when you first open the serial monitor. From here you can set your gains and variables using the characters on the bottom of the image. To go into your controllers, press the respective letters and press 'e' to stop the controller and return back to the control and tuning interface. If you forget any commands, press 'm' to see the command menu.