# Control of one leg of a six-legged robot

electrical engineering report and need support to help me learn.

Starting from Example 8.7 Control of one leg of a six-legged robot, find a dynamic system of your choice (existent or of you own design) to detail de design process (Figure 8.33), all other aspects, specifications you can identify and determine mathematically (preferably using Matlab).

Requirements:

Section 8.6 Design Examples 549ExamplE 8.7 Control of one leg of a six-legged robotThe Ambler is a six-legged walking machine being developed at Carnegie-Mellon University [23]. An artist’s conception of the Ambler is shown in Figure 8.32.In this example we consider the control system design for position control of one leg. The elements of the design process emphasized in this example are high-lighted in Figure 8.33. The mathematical model of the actuator and leg is provided. The transfer function is G1s2=1s1s2+2s+102. (8.57)100101102103104- 100- 50050100Magnitude (dB)Frequency (rad/s)100101102103104Frequency (rad/s)- 180- 160- 140- 120- 100Phase (deg)Low-frequencyhigh-gainspeciﬁcationP.M. = 60.45High-frequencylow-gainspeciﬁcationCrossover frequency vc = 84.5 rad/sFIgUre 8.30 Bode plot of compensated system with Gc1s2250c0.04s+1100s+1d. Time (s)v(t)00.020.040.060.080.10.120.140.160.180.200.20.40.60.811.21.4Percent overshoot P.O. = 19.4 %Settling time Ts = 0.11 sFIgUre 8.31 Step response of the closed-loop system.

550 Chapter 8 Frequency Response MethodsFIgUre 8.32 An artist’s conception of the six-legged Ambler.See Figures 8.32 and 8.34Design speciﬁcations: DS1: vb7 1Hz. DS2: P.O. 6 15% DS3: Zero steady-state error to a step.Control the robot legposition and maintain thedesired position in thepresence of disturbances.See Equation (8.58).Use control designsoftware.Leg position.See Equation (8.57).Establish the system conﬁgurationObtain a model of the process, theactuator, and the sensorIf the performance meets the speciﬁcations,then ﬁnalize the design.If the performance does not meet thespeciﬁcations, then iterate the conﬁguration. Identify the variables to be controlledEstablish the control goalsTopics emphasized in this exampleWrite the speciﬁcationsOptimize the parameters andanalyze the performanceDescribe a controller and select keyparameters to be adjustedFIgUre 8.33 Elements of the control system design process emphasized in this six-legged robot example.The input is a voltage command to the actuator, and the output is the leg po-sition (vertical position only). A block diagram of the control system is shown in Figure 8.34. The control goal isControl GoalControl the robot leg position and maintain the position in the presence of un-wanted measurement noise.

Section 8.6 Design Examples 551The variable to be controlled isVariable to Be ControlledLeg position, Y1s2.We want the leg to move to the commanded position as fast as possible but with minimal overshoot. As a practical first step, the design goal will be to produce a system that moves, albeit slowly. In other words, the control system bandwidth will initially be low.The control design specifications areControl Design SpecificationsDS1 Closed-loop bandwidth is vBÚ1 Hz.DS2 Percent overshoot is P.O.…15% to a step input.DS3 Zero steady-state tracking error to a step input.Specifications DS1 and DS2 are intended to ensure acceptable tracking perfor-mance. Design specification DS3 is actually a nonissue in our design: the actuator/leg transfer function is a type-one system so a zero steady-state tracking error to a step input is guaranteed. We need to ensure that Gc1s2G1s2 remains at least a type-one system.Consider the controller Gc1s2=K1s2+as+b2s+c. (8.58)As cS0, a PID controller is obtained with K P=K a, KD=K, and KI=Kb. We can let c be a parameter at this point and see if the additional freedom in selecting c≠0 is useful. It may be that we can simply set c=0 and use the PID form. The key tuning parameters areSelect Key Tuning ParametersK, a, b, and c.+-++ControllerGc(s)++N(s)MeasurementnoiseR(s)Desired legpositionY(s)Actual legpositionProcessG(s)Td(s)Ea(s)FIgUre 8.34 Control system for one leg.

552 Chapter 8 Frequency Response MethodsThe controller in Equation (8.58) is not the only controller that we can consider. For example, we might consider Gc1s2=K s+zs+p, (8.59)where K, z, and p are the key tuning parameters. The design of the type of controller given in Equation (8.59) will be left as a design problem at the end of the chapter.The response of a closed-loop control system is determined predominantly by the location of the dominant poles. Our approach to the design is to determine ap-propriate locations for the dominant poles of the closed-loop system. We can de-termine the locations from the performance specifications by using second-order system approximation formulas. Once the controller parameters are obtained so that the closed-loop system has the desired dominant poles, the remaining poles are located so that their contribution to the overall response is negligible.Per specification DS1, we want vB=1 Hz=6.28 rad>s. (8.60)From the percent overshoot specification, we can determine the minimum value of z. Thus for P.O.…15,, we require zÚ0.52; therefore, we will design with z=0.52. Even though settling time is not a design specification for this prob-lem, we usually attempt to make the system response as fast as possible while still meeting all the design specifications. From Figure 8.26 and Equation (8.60) it follows that vn=vB-1.1961z+1.8508=5.11 rad>s. (8.61)Then with vn=5.11 rad>s and z=0.52 and using Equation (8.36) we compute vr=3.46 rad>s.So, if we had a second-order system, we would want to determine values of the control gains such that vn=5.11 rad>s and z=0.52, which yields Mpv=1.125 and vr=3.46 rad>s.Our closed-loop system is a fourth-order system and not a second-order system. So, a valid design approach would be to select K, a, b, and c so that two poles are dominant and located appropriately to meet the design specifications. This will be the approach followed here.Another valid approach is to develop a second-order approximation of the fourth-order system. In the approximate transfer function, the parameters K, a, b, and c are left as variables. The objective would be to obtain an approximate transfer function TL1s2 in such a way that the frequency response of TL1s2 is very close to that of the original system.The loop transfer function isL1s2=Gc1s2G1s2=K1s2+as+b2s1s2+2s+1021s+c2,

Section 8.6 Design Examples 553and the closed-loop transfer function is T1s2=K1s2+as+b2s4+12+c2s3+110+2c+K2s2+110c+Ka2s+Kb. (8.62)The associated characteristic equation is s4+12+c2s3+110+2c+K2s2+110c+Ka2s+Kb=0. (8.63)The desired characteristic polynomial must also be fourth-order, but we want it to be composed of multiple factors, as follows:Pd1s2=1s2+2zvns+vn221s2+d1s+d02,where z and vn are selected to meet the design specifications, and the roots of s2+2zvns+vn2=0 are the dominant roots. Conversely we want the roots of s2+d1s+d0=0 to be the nondominant roots. The dominant roots should lie on a vertical line in the complex plane defined by the distance s=-zvn away from the imaginary axis. Letd1=2azvn.Then the roots of s2+d1s+d0=0, when complex or equal, lie on a vertical line in the complex plane defined by s=-azvn. By choosing a71, we effectively move the roots to the left of the dominant roots. The larger we select a, the further the nondominant roots lie to the left of the dominant roots. A reasonable value of a is a=12. Also, if we selectd0=a2z2vn2,then we obtain two real rootss2+d1s+d0=1s+azvn22=0.Choosing d0=a2z2vn2 is not required, but this seems to be a reasonable choice since we would like the contribution of the nondominant roots to the overall response to be quickly fading and nonoscillatory.The desired characteristic polynomial is then s4+2zvn11+a2s3+vn211+az21a+422s2 (8.64) +2azvn311+z2a2s+a2z2vn4=0.Equating the coefficients of Equations (8.63) and (8.64) yields four relationships involving K, a, b, c, and a: 2zvn11+a2=2+c, vn211+az214+a22=10+2c+K, 2azvn311+z2a2=10c+Ka, a2z2vn4=Kb.

554 Chapter 8 Frequency Response MethodsIn our case z=0.52, vn=5.11, and a=12. Thus we obtain c=67.13 K=1239.2 a=5.17 b=21.48and the resulting controller is Gc1s2=1239 s2+5.17s+21.48s+67.13. (8.65)The step response of the closed-loop system using the controller in Equation (8.65) is shown in Figure 8.35. The percent overshoot is P .O.=14,, and the settling time is Ts=0.96 s.The magnitude plot of the closed-loop system is shown in Figure 8.36. The bandwidth is vB=27.2 rad>s=4.33 Hz. This satisfies DS1 but is larger than the vB=1 Hz used in the design (due to the fact that our system is not a second-order system). The higher bandwidth leads us to expect a faster settling time. The peak magnitude is Mpv=1.21. We were expecting Mpv=1.125.What is the steady-state response of the closed-loop system if the input is a sinu-soidal input? From our previous discussions we expect that as the input frequency increases, the magnitude of the output will decrease. Two cases are presented here. In Figure 8.37 the input frequency is v=1 rad>s. The output magnitude is approximately equal to 1 in the steady state. In Figure 8.38 the input frequency is v=500 rad>s. The output magnitude is less than 0.005 in the steady state. 00.511.500.20.40.60.811.21.4Time (s)y(t)P.O. = 14%Ts = 0.96sFIgUre 8.35 Step response using the controller in Equation (8.65).

Section 8.6 Design Examples 555This verifies our intuition that the system response decreases as the input sinusoidal frequency increases.Using simple analytic methods, we obtained an initial set of controller parame-ters for the mobile robot. The controller thus designed proved to satisfy the design requirements. Some fine-tuning would be necessary to meet the design specifica-tions exactly. ■051015202530-0.8-1-0.6-0.4-0.200.20.40.60.81Time (s)y(t)FIgUre 8.37 Output response of the closed-loop system when the input is a sinusoidal signal of frequency v=1 rad/s.10010110210300.20.40.60.811.21.4MagnitudeFrequency (rad/s)Mp = 1.21FIgUre 8.36 Magnitude plot of the closed-loop system with the controller in Equation (8.65).

556 Chapter 8 Frequency Response Methods00.20.40.60.8100.005- 0.005- 0.010.010.0150.020.0250.030.035Time (s)y(t)FIgUre 8.38 Output response of the closed-loop system when the input is a sinusoidal signal of frequency v=500 rad/s.8.7 Frequency resPOnse methODs using cOntrOl Design sOFtwareIn this section, we cover the functions bode and logspace. The bode function is used to generate a Bode plot, and the logspace function generates a logarithmically spaced vector of frequencies utilized by the bode function.Consider the transfer function G1s2=511+0.1s2s11+0.5s211+10.6>502s+11>5022s22. (8.66)The Bode plot corresponding to Equation (8.66) is shown in Figure 8.39. The plot consists of the logarithmic gain in dB versus v in one plot and the phase f1v2 in degrees versus v in rad/s in a second plot. As with the root locus plots, it will be tempting to rely exclusively on control design software to obtain the Bode plots. The software should be treated as one tool in a tool kit that can be used to design and analyze control systems. It is essential to develop the capability to obtain ap-proximate Bode plots manually. There is no substitute for a clear understanding of the underlying theory.A Bode plot is obtained with the bode function shown in Figure 8.40. The Bode plot is automatically generated if the bode function is invoked without left-hand arguments. Otherwise, the magnitude and phase characteristics are placed in the workspace through the variables mag and phase. A Bode plot can then be obtained with the plot or semilogx function using mag, phase, and v. The vec-tor v contains the values of the frequency in rad/s at which the Bode plot will be calculated. If v is not specified, the bode function will automatically choose the frequency values by placing more points in regions where the frequency response is changing quickly. If the frequencies are specified explicitly, it is desirable to gen-erate the vector v using the logspace function. The logspace function is shown in Figure 8.41.