Programming Support

This area contains resources related to programming. In some cases topics are programming language dependant.

This page is to support both our team, as well as others, with programming guides and resources. A lot of knowledge is available across the web and we hope to collect what we find useful here. If you have a reference we should add, please feel free to contact us!

pidIn this tutorial we show you how to model, implement, and tune a PID controller using Matlab and Simulink. These methods require no Control Theory background and produce a very accurate controller without using the Guess and Check Method!


The videos below provide a complete tutorial on PID control as it applies to First Robotics. The primary purpose of the videos are to provide a method which can be used to tune PID gains without using a guess and check method, however, because this is an advanced topic we also briefly discuss some of the theory of a PID controller, provide useful imformation on the tools used, and demonstrate how PID can be implemented into a Labview Project.


The controller used is a custom PID controller that I developed as part of another personal project. The PID controller uses the Parallel implementation, and has dead-band cancellation, derivative filtering, integral-windup prevention, as well as gain scheduling. Team 2168 and I provide this PID controller for use by any First Robotics team for use, just please shout us out.


So check out the videos below, all the files we created throughout the videos are available for download from the link at the bottom of the page so you can follow along with the tutorial.


Note: Please bear with me as I post all of the videos. The most important one (Part 4) is already up.

Note 2: Please check back often, we will also be posting a complete implementation in Java, and convering a tutorial on how to implement and tune a PID controller for Velocity Control using the same method.



Introduction to PID  - Part 1


In this video I give an introduction to control systems and what a PID controller is. We discuss the basics of a controller, how the algorithm works, and how it can be used on a robot. At the end of the video I give a brief introduction to Matlab and Simulink.


Video Coming Soon



Implementing a PID Controller in Labview - Part 2


In this video I walk-through how to implement a PID control loop into your robot program. Starting with Labview 2011 and the default robot project, we create all the code we need to implement a control loop. The control loop used is a custom PID controller I developed.


Video Coming Soon



 Modeling your System Paramaters - Part 3


This video gives an example on how to mathematically model a plant. It is only provided as information. The model used through this is series is one which is common to all first teams. a Motor driving a load through a gear-box. This model was chosen so that most first teams could simply input their motor and load parameters and start tuning gains.


Video Coming Soon



 Turning Your PID Gains - Part 4


In this video I walk-though using Matlab and Simulink to tune the gains of a Parallel PID controller. The method presented in this video is simple and requires no previous control theory knowledge.


We demonstrate controller performance on a bench-top apparatus, so the viewer can see the response of the system. Different pitfalls are demonstrated to show the viewer some common problems with PID controllers, and how to fix them if observed. 


This method will work for tuning any PID controller... however if you choose not to use the controller provided and opt to use your own, please be very keen as to what implementation you are using. There are many different variants of PID controllers (Ideal, Series, Parallel) and each implementation requires a different way of tuning. Also, be aware if your controller contains advances features such as derivative filtering, or Integral windup prevention, these features affect the performance of your controller.








Download files {here}


Other Helpful links:



Valid XHTML 1.0 Transitional      See your web site through colorblind eyes with the colorblind web page filter.