Robotics Fundamentals 1, Chapter 7: Challenge 1 solution (the motor model, open loop, bang-bang and proportional control) Formulas: K = 1 / k ; tau(m) = J R / k^2 ; d = R T / k ; step response fraction = 1 - e^(-t / tau(m)) open loop: u = r / K + d ; speed = K ( u - d ) P control: e(ss) = ( r + K d ) / ( 1 + K Kp ) ; final speed = r - e(ss) bang-bang: t = tau ln( (final - start) / (final - end) ) ; final = K ( U - d ) (a) k = 0.04, R = 1.5, J = 2.4e-4. K = 1 / 0.04 = 25 rad/s per volt. tau(m) = J R / k^2 = 2.4e-4 x 1.5 / 0.0016 = 3.6e-4 / 0.0016 = 0.225 s. 63.2 % after one time constant: 0.225 s. 95.0 % after three: 3 x 0.225 = 0.675 s. 98.2 % after four: 4 x 0.225 = 0.900 s. (b) d = 1.2 V. d = R T / k, so T = d k / R = 1.2 x 0.04 / 1.5 = 0.032 N m. Open loop voltage for 75 rad/s: u = r / K + d = 75 / 25 + 1.2 = 3.0 + 1.2 = 4.2 V. Battery sag (every voltage 10 % lower): u = 0.9 x 4.2 = 3.78 V, speed = 25 x ( 3.78 - 1.2 ) = 25 x 2.58 = 64.5 rad/s. Error = 75 - 64.5 = 10.5 rad/s = 14 % of the target. Load rises to d = 2.0 V (voltage still 4.2 V): speed = 25 x ( 4.2 - 2.0 ) = 25 x 2.2 = 55 rad/s. Error = 20 rad/s = 26.7 % of the target. Open loop trusts the model, so every change in battery or load goes straight into the speed. (c) Kp = 0.16, so K Kp = 25 x 0.16 = 4 and 1 + K Kp = 5. With the 1.2 V load: e(ss) = ( 75 + 25 x 1.2 ) / 5 = ( 75 + 30 ) / 5 = 21 rad/s. Final speed = 75 - 21 = 54 rad/s. With no load: e(ss) = 75 / 5 = 15 rad/s. Final speed = 60 rad/s. For e(ss) = 3 rad/s with the load: ( 75 + 30 ) / ( 1 + 25 Kp ) = 3, so 1 + 25 Kp = 35, 25 Kp = 34, Kp = 1.36 V per rad/s. Why it is not practical: at the start the error is 75 rad/s, so the controller asks for 1.36 x 75 = 102 V from a 6 V supply: the output saturates for a long time, and the formula only describes the steady state. The loop gain K Kp = 34 is also far above what any real loop with sensor delay and a finite update rate can stand without ringing or going unstable (sections 7 and 8). The right answer is the integral term, which removes the offset with a modest Kp. (d) Supply 6 V, load 1.2 V, target 75 rad/s, hysteresis +-4: switch on below 71, off above 79. With the supply on: the speed heads for K ( 6 - 1.2 ) = 25 x 4.8 = 120 rad/s. With the supply off: the speed heads for K ( 0 - 1.2 ) = -30 rad/s (a limit of the formula, never reached; only the part of the curve between 71 and 79 is used). Climb from 71 to 79: t(on) = 0.225 x ln( (120 - 71) / (120 - 79) ) = 0.225 x ln( 49 / 41 ) = 0.225 x 0.17824 = 0.0401 s. Fall from 79 to 71: t(off) = 0.225 x ln( (79 + 30) / (71 + 30) ) = 0.225 x ln( 109 / 101 ) = 0.225 x 0.07623 = 0.0172 s. Period = 0.0401 + 0.0172 = 0.0573 s, switching frequency = 1 / 0.0573 = 17.5 Hz. With +-8 (on below 67, off above 83): t(on) = 0.225 x ln( 53 / 37 ) = 0.0809 s; t(off) = 0.225 x ln( 113 / 97 ) = 0.0344 s; period 0.1152 s; frequency 8.7 Hz. Doubling the band halves the switching rate (17.5 Hz to 8.7 Hz) and doubles the ripple (+-4 to +-8 rad/s): hysteresis trades ripple against switching.