• Tidak ada hasil yang ditemukan

Application of Receding Horizon Control

ducted fan is

m¨x = f2cosθ−f1sinθ my¨ = f2sinθ+f1cosθ−mg

Jθ¨ = rf2.

(3.1)

The parameters are the mass m, moment of inertia J, g is the acceleration due to gravity, and r is the distance from force f2 to the center of mass, i.e., the origin of the x-y frame.

The configuration variables x and y represent, respectively, horizontal and verti- cal inertial translations of the fan while θ is the rotation of the fan about the boom axis. These variables are measured via the optical encoders, and the derivatives are computed with a FIR filter. The inputsf1 and f2 are the body-fixed axial and trans- verse thrust components, respectively. Consistent with the notation in the previous chapter, we denote the state and input vectors z = (x, y, θ,x,˙ y,˙ θ) and˙ u = (f1, f2) and represent the dynamics in equation (3.1) as ˙z = f(z, u) in the optimal control problem defined below.

solution to the following problem minu(·)

Z t+T

t kz(τ;z(t))−zck2Q+ku(τ)−uck2R dτ +kz(t+T;z(t))−zck2P0, (3.2)

s.t.

˙

z(s) = f(z(s), u(s)) u(s)∈ U

z(s;z(t))∈ Z











s∈[t, t+T]. (3.3)

No terminal constraint is enforced in the experiments that follow. While the stability results in Chapter 2 required a terminal constraint, we note that Jadbabaie et al.

[32] prove stability in the absence of a terminal constraint, provided the other state and control constraints are absent. For the ducted fan problem, the system dynamics corresponds to equation (3.1) and the equilibrium point of interest is hover, with state and control vectorszc = (0,0,0,0,0,0) anduc = (mg,0), andmg is 7.3 N. Note that the cost on the control input in equation (3.2) is modified to reflect that the equilibrium control is not zero.

Regarding the state constraint set, the vertical space in the lab is limited, which translates to the bounds on the vertical position (in meters)y ∈[−1,1]. For the tests considered in this chapter, the fan does not hit the boundaries of this constraint, and it is not included in the optimization problem and Z = R6. The control constraint set is defined as

U =n

u= (f1, f2)∈R2 f1 ∈[0, Fmax], f2 ∈[−Fmax/2, Fmax/2]o ,

where Fmax = 11 N. In addition to the stated constraints, the control inputs are initially constrained to be within 0.25 N of the previously computed optimal inputs, at the appropriate instant of time. This amount of time will be detailed in the next section that describes how the timing of the receding horizon control process is done.

With respect to the cost in equation (3.2), the weighting matrices are defined as Q= diag(4,15,4,1,3,0.3), R = diag(0.5,0.5), P0 =γP,

whereγ = 0.075 andP is the unique stable solution to the algebraic Riccati equation corresponding to the linearized dynamics of equation (3.1) at hover and the weights QandR. We note that when the receding horizon control law is implementedwithout any terminal cost and/or the input constraints in the experiment,instabilityresulted.

Also, an inner-loop PD controller on θ,θ˙is implemented to stabilize to the open-loop receding horizon control states θ,θ˙. Theθ dynamics are the fastest for this system and although most receding horizon control laws were found to be nominally stable without this inner-loop controller, small disturbances could lead to instability, hence the use of the PD inner-loop. A schematic of the experimental setup with the details of the controller in dSPACE is shown in Figure 3.4. The controller is the receding

θ

.

θ, θ

.

θ,* * Σ

FIR

zref amplifier

θ

f2 f1 y

x

dfan

optical encoder

x,y,θ

u* RHC z

dSPACE force 2

curent PD

Figure 3.4: Ducted fan experimental setup with receding horizon and inner-loop controller.

horizon controller, implemented with a timing scheme defined in the next section, plus the PD controller. The resultant commanded forces are converted to currents for commanding the motor and RC servos. The reference statezref is used to explore the response of the closed-loop system to step changes in the value of the objective state. Specifically, we set zc = zref = (a,0,0,0,0,0), where a is a constant desired value for the horizontal position.

The optimal control problem is setup in NTG code by parameterizing the three position states (x, y, θ), each with 8 B-spline coefficients. Over the receding horizon time intervals, 11 and 16 breakpoints were used with horizon lengths of 1.0, 1.5, 2.0 and 3.0 seconds. Breakpoints specify the locations in time where the differential equa- tions and any constraints must be satisfied, up to some tolerance. The value of Fmax

for the input constraints is made conservative to avoid prolonged input saturation on the real hardware. The logic for this is that if the inputs are saturated on the real hardware, no actuation is left for the inner-loop theta controller and the system can go unstable. The value used in the optimization is Fmax = 9 N.

3.3.2 Timing Setup

Computation time is non-negligible and must be considered when implementing the optimal trajectories. The computation time varies with each optimization as the cur- rent state of the ducted fan changes. The following notation facilitates the description of how the timing is setup:

i : integer counter of receding horizon control computations,

ti : value of current time when receding horizon control computation i started, δc(i) : computation time required for ith computation (ti+1 =tic(i)),

u(i)(t) : optimal control from computation i, t∈[ti, ti+T].

A natural choice for updating the optimal trajectories for stabilization is to do so as fast as possible. This is achieved here by constantly re-solving the optimization.

When computation i is done, computation i+ 1 is immediately started, so ti+1 = tic(i). Figure 3.5 gives a graphical picture of the timing setup as the optimal control trajectories u(·) are updated. As shown in the figure, any computationi foru(i)(·) occurs for t ∈ [ti, ti+1] and the resulting trajectory is applied for t ∈ [ti+1, ti+2]. At t=ti+1computationi+1 is started for trajectoryu(i+1)(·), which is applied as soon as it is available (t=ti+2). For the experimental runs detailed in the results,δc(i) is typically in the range of [0.05, 0.25] seconds, meaning 4 to 20 receding horizon control

ti+2

time Input

computation (i)

computation (i+1) Legend

computed applied unused

δc(i) δc(i+1)

*u (i-1) T

ti+1 ti

*u (i) T

*u (i+1) T

X X X X

X X

X X X

Figure 3.5: Receding horizon input trajectories, showing implementation after delay due to computation.

computations per second. Each optimizationirequires the current measured state of the ducted fan and the value of the previous optimal input trajectoriesu(i−1) at time t =ti. This corresponds to, respectively, 6 initial conditions for state vectorz and 2 initial constraints on the input vectoru. Figure 3.5 shows that the optimal trajectories are advanced by their computation time prior to application to the system. A dashed line corresponds to the initial portion of an optimal trajectory and is not applied since it is not available until that computation is complete. The figure also reveals the possible discontinuity between successive applied optimal input trajectories, with a larger discontinuity more likely for longer computation times. The initial input constraint is an effort to reduce such discontinuities, although some discontinuity is unavoidable by this method. Also note that the same discontinuity is present for the corresponding open-loop optimal state trajectory, again with a likelihood for greater discontinuity for longer computation times. In this description, initialization is not an issue because we assume the receding horizon control computations are already running prior to any test runs. This is true of the experimental runs detailed in the results.