Introduction to Experimental Robotics CSCI 1108 — Lecture 16 Review (PID, binary rep. constraints) CSCI 1108 Lecture 16 1 / 11
PID Controller Review PID Controller is not an exactly straightforward solution It was developed by Nicolas Minorsky in 1922 for automatic ship steering, by his analysis of behaviour of a helmsman (person steering a ship) Previous development is mostly P-control: ◮ Christiaan Huygens 17th century regulate gap in millstones in windmills based on speed ◮ James Watt “conical pendulum” governor for steam engine, patented 1788 ◮ etc. CSCI 1108 Lecture 16 2 / 11
PID in Hardware: Pneumatic PID controller P, I, and D terms adjusted by the dials at the top By Snip3r at Dutch Wikipedia, CC BY-SA 3.0, https: //commons.wikimedia.org/w/index.php?curid=1942158 CSCI 1108 Lecture 16 3 / 11
Some Control Examples 1. Thymio steering following a black tape 2. Car steering, particularly on a snowy road 3. Boat steering 4. Driving a car at a desired speed 5. Tap water temperature control (or room thermostat) Other examples: moving robotic arm, etc. CSCI 1108 Lecture 16 4 / 11
General Parameters in Controller Analysis Process variable ( PV , or p ) — sensed value that we want to control SetPoint ( SP , or s ) — desired target value of the p Error ( e ) — difference between p and s ; e = p − s Control variable or manipulated variable ( CV , MV , or c ) — input into the process that we can control We also consider the variable of time t in the analysis Describe these variables in the five given examples. CSCI 1108 Lecture 16 5 / 11
Controllers: P, PI, PID, (PD) What happens in each case if we use the P controller? When can I controller help P controller in PI controller? How does D controller helps i PID controller? How does PD controller operates? CSCI 1108 Lecture 16 6 / 11
PID Controller Formula The general formula for PID control is: � t e ( t ′ ) dt ′ + K d · de ( t ) c ( t ) = K p · e ( t ) + K i · dt 0 The controller depends on K p , K i and K d parameters, in the proportional, integral, and derivative parts One way to look at the formula is: ◮ Proportional compensates for the error in the present—instantaneous deviation from setpoint, ◮ Integral compensates for the errors in the past—the accumulated deviation from setpoint, and ◮ Derivative compensates for the rror in the future—treating the derivative as the “trend” in the error CSCI 1108 Lecture 16 7 / 11
Binary Representation Constraints Review Let us look again at the example of calculating circumference of a circle of diameter d = 80mm Formula c = π · d , and we know π ≈ 3 . 14159 Correct value: c ≈ 251 . 3274 ≈ 251mm We can use a very coarse integer approximation π ≈ 3 and get c ≈ 240 Other solution: represent π = PI / PId , where PI = 31416 and PId = 10000 However, “ c = d * PI / PId ” does not work well Why? How can we solve this problem? CSCI 1108 Lecture 16 8 / 11
Binary Worked-out Example Let us see what is happening in the calculation: c = d * PI / PId d=80 and PI=31416 , which are in binary: d = 0101 0000 and PI = 0111 1010 1011 1000 When we multiply those numbers, d * PI we get: 0010 0110 0101 1001 1000 0000 which is the exact value of 2 , 513 , 280 = 80 × 31416 , but it needs 32 bits to be represented (or at least 23) What happens is that Aseba has to ‘clip’ the result to the last 16 bits CSCI 1108 Lecture 16 9 / 11
Binary Worked-out Example (2) When we clip the following number ( d * PI = 80 × 31416 = 2 , 513 , 280 ): 0010 0110 0101 1001 1000 0000 to the last 16 bits, we get: 0101 1001 1000 0000 = 128 + 256 + 2048 + 4096 + 16384 = 22912 which is indeed what Aseba shows if we make the calculation. This is why we get the final result of c = d * PI / PId to be 22913/10000=2 in Aseba CSCI 1108 Lecture 16 10 / 11
Binary Worked-out Example (3) If we use the native function call: call math.muldiv(c, d, PI, PId) the complete calculation will be done on 32-bit precision and we get the correct value: 80*31416/10000=2,513,280/10000=251 Note: If you wonder how Aseba does division in binary, you can try to divide 22913 by 10000 using binary representation: 22913 = 0101 1001 1000 0000 and 10000 = 0010 0111 0001 0000 CSCI 1108 Lecture 16 11 / 11
Recommend
More recommend