PID control is an algorithm to provide a control signal based on an error signal, the integral of the error signal over time, and the time derivative of the error signal. The resulting equation is: This can be implemented in an analog circuit by using Op-amps and filters to perform the integration and differentiation functions. For this lab, you will be implementing PID in software. In that case you will execute a loop (loop index i) where (i) = sensor voltage(i) – setpoint voltage (i) = ((i) – (i-1)) / T where T = the number of seconds spent in each loop (this can be omitted and lumped into the gain constant D) where error_sum is incremented each loop: error_sum = error_sum + T *(i); The gain variable T allows you to slow the rate at which the integral accumulates should it be desirable to do so (this is usually the case if your algorithm executes much faster than the rate at which you can perform the control). To avoid integral “wind-up” (where the value of the integral term becomes too large following a sustained error), software limits are applied to error_sum: if (error_sum > high_limit) error_sum = high_limit; if (error_sum < low_limit) error_sum = low_limit; this prevents error_sum from reaching absurdly high or low values which the P gain will not be able to overcome should the error suddenly decrease. Tuning P, I, and D gain variables is often done by trial and error. Some more precise tuning methods are shown in the primer. Alternate algorithm An alternate form of the digital PID algorithm can be found in “Microprocessors in Instruments and Control” by R.J. Bibbero. This algorithm is inherently “anti wind-up”: Where: dOm =amount to be added to the output voltage each loop (Vout += dOm) Verror(i)= error voltage during ith iteration G = total loop gain I = Integral gain D = Derivative gain T = Time interval between each loop execution This is a relatively long lab, and you are allotted up to 2 weeks to do it, but please aim to do as much as possible (or possibly finish the lab) in the first week, so you’ll have more time to discuss and work on your robots sooner! Lab 5 – PID Control
Objectives
Pre-Lab
Additional Readings
Lab
Milestone
- Home
- ProjectLab
- ENPH 479 (Fall 2019)
- ENPH 459 (Fall 2019-Spring 2020)
- ENPH 353 - 2019 Term 2
- ENPH 253 (Summer 2019)
- Guides for 459/479
- ENPH 480/481
- Info for Project Sponsors
- Available Projects
- Hennings 115
- Lab Resources
- Student Awards
- Sign-Up Page
- Jobs
- Events and Talks
- Course Archive
- APSC 278 - 2018March
- ENPH 259 - presentations (2017 Nov)
- Sign-Up Page (APSC 101)
- Arduino (CUEBC 2016)
- COMM 386p (fall 2016)
- COMM 386p (Spring 2016)
- BAEN 580B (2015)
- BAEN 580B (2014)
- BAEN 542 (2013)
- Arduino Hands-On (2015)
- APSC 150 (Feb 2015)
- APSC 150 (Sept 2014)
- APSC 150 Tut 1.4 (Jan 2013)
- ENPH 459 (fall 2014)
- APSC 150 - electronics (2013)
- APSC 150 - Hand Tools (2013)
- IGEN 230 - mini-bootcamp (2012)
- PHYS 350 - projects (2017Jan-Apr)
- ENPH 479 (fall 2017)
- ENPH 479 (fall 2016)
- ENPH 479 (fall 2015)
- ENPH 479 (fall 2014)
- ENPH 479 (2013)
- ENPH 479 (2012)
- ENPH 479 - 2011/12
- APSC 479 - 2010/2011
- APSC 479 - 2009/10
- ENPH 459 (Fall 2018-Spring 2019)
- ENPH 459 (fall 2017)
- ENPH 459 (fall 2016)
- ENPH 459 (fall 2015)
- ENPH 459 (2013)
- ENPH 459 (2012)
- ENPH 459 - 2011/12
- APSC 459 - 2009/10
- APSC 459 2010/2011
- ENPH 253 (2018)
- ENPH 253 (2017)
- ENPH 253 (2016)
- ENPH 253 (2015)
- ENPH 253 (2014)
- ENPH 253 (summer 2013)
- ENPH 253 - 2012
- Phys 253-2011
- PHYS253 - 2010
- Phys 253 2009
- MINE 432 - Fall 2014
- PHYS 350 - projects (2011/12)
- MINE 432 - Fall 2010