<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Autonomous Spacecraft Attitude Reorientation Using Robust Sampled-Data Control Barrier Functions</title></titleStmt>
			<publicationStmt>
				<publisher>AIAA</publisher>
				<date>10/01/2023</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10492726</idno>
					<idno type="doi">10.2514/1.G007456</idno>
					<title level='j'>Journal of Guidance, Control, and Dynamics</title>
<idno>0731-5090</idno>
<biblScope unit="volume">46</biblScope>
<biblScope unit="issue">10</biblScope>					

					<author>Joseph Breeden</author><author>Dimitra Panagou</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[<p>This paper presents a provably safe method for constrained reorientation of a spacecraft in the presence of input constraints, bounded disturbances, and fixed frequency zero-order-hold (ZOH) control inputs. The set of states satisfying all pointing and rate constraints, herein called the safe set, is expressed as the intersection of the sublevel sets of several constraint functions, which are subsequently converted into control barrier functions (CBFs). The method then extends prior results on utilizing CBFs with ZOH controllers to the case of relative-degree-2 constraint functions, as occurs in the constrained attitude reorientation problem. The developed sampled-data controller is also shown to remain provably safe in the presence of input constraints and bounded disturbances. Finally, the method is validated and compared to three prior approaches via both low-fidelity and mid-fidelity simulations.</p>]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Nomenclature</head><p>f 1 ; f 2 ; g 1 ; g 2 = arbitrary functions in model definition H i = inner constraint set corresponding to h i , index potentially omitted H &#916; i = subset of inner constraint set corresponding to h i with margin &#916;, index potentially omitted h i = generic control barrier function, index potentially omitted M 1 ; M 2 ; M alt 2 = constants of a constraint function of relative degree 1 M - 2 ; M 2 ; M - 3 ; M 3 = constants of a constraint function of relative degree 2 p &#951; ; p alt &#951; = polynomials that upper bound evolution of a constraint function of relative degree 1 p &#954; ; p h = polynomials that upper bound evolution of a constraint function of relative degree 2 Q i = constraint set corresponding to &#954; i , index potentially omitted Q &#948; i = subset of constraint set corresponding to &#954; i with margin &#948;, index potentially omitted q = state coordinates in Eq. ( <ref type="formula">1</ref>), also used as quaternion in Eq. (2) S = safe set (intersection of constraint sets) ssq&#8758;R &#8594; R = ssq&#955; &#955;j&#955;j (ssq is monotone increasing, invertible, and once continuously differentiable) T = time step of discretization T = set of considered times t = time (arbitrary units) t s = specific time instance on a trajectory (see also &#963;) t 0 = initial time U = set of allowable control inputs U z i = set of guaranteed safe control inputs for the ith constraint, index potentially omitted u = control input V i = constraint set corresponding to &#951; i , index potentially omitted v = state velocities in Eq. (1) w = vector of wheel states w i in Eq. (2) X = set of possible states x = full state vector x is equal to q; v Z = inverse of combined matrix of moments of inertia Z 11 ; Z 12 ; Z 21 ; Z 22 = submatrices of Z Z i = robust inner constraint set corresponding to &#954; i or &#951; i , index potentially omitted &#951; i = generic relative-degree-1 constraint function, index potentially omitted &#954; i = generic relative-degree-2 constraint function, index potentially omitted &#956; = parameter used to define control barrier functions for relative-degree-2 constraints &#926; = set of considered disturbances &#958; = perturbing input &#963; = specific time instance on a trajectory (see also t s ) &#964; = arbitrary number in R &#8805;0 &#981; = function for _ &#951; under no disturbances &#981; 1 ; &#981; 2 = functions used for constructing relativedegree-1 safety conditions &#968; = function for &#954; under no disturbances &#969; = angular velocity state in Eq. (2) ; , ;</p><p>= open interval, closed interval</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. Introduction</head><p>T HIS paper extends the recent theory of control barrier functions (CBFs) to solve the problem of constrained spacecraft attitude reorientation. At present, most spacecraft reorientations are accomplished either via shortest-path maneuvers, which can be easily implemented onboard a spacecraft, or else are preplanned by ground operators when more complex maneuvers are required. As the number of active spacecraft increases, there is potential for reducing operating costs in the latter case by increasing spacecraft autonomy, i.e., by computing maneuvers onboard without consulting ground operators. A common scenario in which shortest-path maneuvers are not allowable is when a spacecraft is not permitted to point sensitive instruments (body-fixed vectors) at bright objects (inertially fixed vectors), or equivalently, when a spacecraft is required to keep an instrument pointed in a specified direction.</p><p>The problem of constrained reorientation has been studied extensively, using methods including path planners <ref type="bibr">[1]</ref><ref type="bibr">[2]</ref><ref type="bibr">[3]</ref><ref type="bibr">[4]</ref><ref type="bibr">[5]</ref><ref type="bibr">[6]</ref><ref type="bibr">[7]</ref><ref type="bibr">[8]</ref><ref type="bibr">[9]</ref><ref type="bibr">[10]</ref>, model predictive controllers (MPCs) <ref type="bibr">[11]</ref><ref type="bibr">[12]</ref><ref type="bibr">[13]</ref><ref type="bibr">[14]</ref><ref type="bibr">[15]</ref>, sliding mode controllers (SMCs) <ref type="bibr">[16]</ref><ref type="bibr">[17]</ref><ref type="bibr">[18]</ref>, reference governors <ref type="bibr">[19]</ref>, and barrier functions <ref type="bibr">[20]</ref><ref type="bibr">[21]</ref><ref type="bibr">[22]</ref><ref type="bibr">[23]</ref><ref type="bibr">[24]</ref>. It has also been studied using CBFs combined with path planning *Ph.D. Candidate, Department of Aerospace Engineering; jbreeden@ umich.edu. Student Member AIAA (Corresponding Author).</p><p>&#8224; Associate Professor, Department of Robotics and Department of Aerospace Engineering; dpanagou@umich.edu. Member AIAA.</p><p>in <ref type="bibr">[25]</ref>, along with cursory treatment using CBFs with controllers computed online in <ref type="bibr">[26]</ref><ref type="bibr">[27]</ref><ref type="bibr">[28]</ref><ref type="bibr">[29]</ref>. Compared to prior approaches, this paper develops a method that provably guarantees both state constraint (i.e., instrument pointing requirements are obeyed) and input constraint (i.e., maximum allowable torques are not exceeded) satisfaction in the presence of bounded disturbances and under a sampled-data control law. The final control law is the output of a four-dimensional quadratic program (QP) that is computationally lightweight. These guarantees are particularly useful when designing SmallSat attitude controllers, which often operate with infrequent ground contact, using undersized actuators (i.e., tight input constraints), at low altitudes (i.e., large disturbances), at low control sampling frequencies, and with limited computational capabilities.</p><p>To employ standard CBF terminology, we refer to the set of states with allowable separations between all instruments and all bright objects, and with allowable angular rates, as the safe set, which we assume to be nonempty at all times. The central problem is that of rendering trajectories always inside the safe set from some viable set <ref type="bibr">[30]</ref> of initial conditions where this problem is well-posed.</p><p>Early work on constrained reorientation in <ref type="bibr">[20]</ref> developed a Lyapunov function for safe reorientation in terms of Euler angles, though this Lyapunov function may be nonconvex. The authors in <ref type="bibr">[1]</ref> noted that this same constraint could be expressed as a convex set of quaternions, and in <ref type="bibr">[21,</ref><ref type="bibr">22]</ref> authors developed a strictly convex Lyapunov function in terms of quaternions. The work in <ref type="bibr">[17,</ref><ref type="bibr">18]</ref> added an angular velocity constraint and actuator-allocation algorithm to the same technique. The work in <ref type="bibr">[24]</ref> expanded the technique to modified Rodrigues parameters and proposed a method for ensuring input constraint satisfaction. Note that, while these Lyapunov functions resulted in simple control laws that could be implemented online, none of these approaches consider controller sampling, and these controllers can result in slow trajectories, as we show in Sec. V.</p><p>An early path-planning technique utilized a variant of rapidly exploring random trees to find safe paths in SO3 space <ref type="bibr">[10]</ref>. Later, path-planning techniques using direct optimization along with the quaternion constraint identified in <ref type="bibr">[1]</ref> were developed in <ref type="bibr">[1,</ref><ref type="bibr">2,</ref><ref type="bibr">6]</ref> and combined with translational planning in <ref type="bibr">[5]</ref>, though these methods are potentially too computationally intensive to implement online on a spacecraft processor. Related work in <ref type="bibr">[3,</ref><ref type="bibr">4,</ref><ref type="bibr">8]</ref> discretized the safe set to a finite set of nodes and used graph search techniques to plan paths between the nodes. The maneuvers resulting from these techniques are safe but possibly inefficient due to the discretization. The planners in <ref type="bibr">[7,</ref><ref type="bibr">9]</ref> add additional refinements to improve efficiency, whereas the controller proposed in <ref type="bibr">[25]</ref> executes a faster transition between the path nodes and uses CBFs to keep the trajectory within a safe region around the preplanned path. By comparison, the approach employed in this work and in <ref type="bibr">[21,</ref><ref type="bibr">22]</ref> only keeps the state away from unsafe states rather than in a neighborhood of a precomputed safe path as in <ref type="bibr">[25]</ref>.</p><p>MPC approaches to constrained reorientation, such as <ref type="bibr">[11]</ref> and its extensions in <ref type="bibr">[12,</ref><ref type="bibr">13]</ref>, are generally special applications of pathplanning techniques. Similarly, the SMC approach in <ref type="bibr">[16]</ref><ref type="bibr">[17]</ref><ref type="bibr">[18]</ref> and the approximate optimal control via reinforcement learning in <ref type="bibr">[23]</ref> are special applications of the barrier functions used in <ref type="bibr">[21,</ref><ref type="bibr">22]</ref>. While MPC and optimal control can provide safety guarantees, in this paper, we seek a method that is less computationally intensive. The reference governor approach in <ref type="bibr">[19]</ref> is notable because it developed an explicit control law without path planning that is guaranteed to satisfy input constraints. However, few of the aforementioned approaches explicitly consider disturbances, whereas there is extensive CBF literature on disturbance rejection <ref type="bibr">[31,</ref><ref type="bibr">32]</ref>, and a recent result on simultaneous disturbance rejection and input constraint satisfaction <ref type="bibr">[33]</ref>. Finally, spacecraft often operate with digital controllers with slow update cycles. Path planners and MPC can account for controller sampling given sufficiently sophisticated models, while most Lyapunov methods cannot. On the other hand, margins for controller sampling have also been considered in prior CBF literature such as <ref type="bibr">[29,</ref><ref type="bibr">34]</ref>, which this paper will extend to also account for relative-degree-2 state constraints, input constraints, and disturbance rejection.</p><p>CBFs are a Lyapunov-like method for determining safe control inputs, i.e., control inputs that generate trajectories that provably satisfy the state constraints. For an overview of CBFs, see <ref type="bibr">[35]</ref>. In this methodology, we assume that each requirement that the system trajectories must satisfy is expressed as the state belonging to a given constraint set (e.g., the set of states such that a particular instrument is sufficiently far away from a particular bright object). The safe set is then the intersection of all constraint sets <ref type="bibr">[36,</ref><ref type="bibr">37]</ref>. For each constraint set, we then construct a corresponding CBF (e.g., <ref type="bibr">[33,</ref><ref type="bibr">38,</ref><ref type="bibr">39]</ref>) and associated zero-sublevel set, herein called an inner constraint set. Each CBF then provides a pointwise condition on the control input that is sufficient to ensure that state trajectories always belong to the CBF's inner constraint set. Multiple CBFs and inner constraint sets may then be combined to establish forward invariance of a subset of the safe set <ref type="bibr">[36,</ref><ref type="bibr">37]</ref>. Application of CBFs to attitude control was first suggested in <ref type="bibr">[27]</ref>, and in fact, it would be simple to express the quaternion constraint developed in <ref type="bibr">[1]</ref> as a CBF. However, such a CBF would suffer from the same challenges with input constraints, disturbances, and controller sampling as the related Lyapunov approaches in <ref type="bibr">[17,</ref><ref type="bibr">18,</ref><ref type="bibr">21,</ref><ref type="bibr">22]</ref>. These challenges are amplified when some of the constraint functions are of relative degree 2 with respect to the system dynamics, as is the case for spacecraft pointing constraints. That said, extensions of <ref type="bibr">[35]</ref> in the CBF literature provide several general tools for addressing these challenges <ref type="bibr">[29,31-33, 35,40,41]</ref>, as well as other potentially relevant phenomena not presently considered. The authors have recently addressed input constraint satisfaction, robustness to disturbances, and zero-order-hold (ZOH) controller sampling with CBFs individually in <ref type="bibr">[29,</ref><ref type="bibr">33,</ref><ref type="bibr">41]</ref>, and will incorporate and extend all of these results in this paper. In particular, we will show in Example 1 that the ZOH discretization method in <ref type="bibr">[29]</ref> is not immediately compatible with the input constraint work in <ref type="bibr">[33,</ref><ref type="bibr">40,</ref><ref type="bibr">41]</ref>, so the bulk of Sec. III is devoted to reconciling these two approaches while minimizing conservatism. We then apply all the CBF conditions together online using an m-dimensional (QP), where m is the number of control inputs and is generally far smaller than the dimension of the optimizations in planning or MPC approaches.</p><p>The rest of this paper is organized into both 1) a general method accomplishing the above foci for arbitrary systems and constraints, and 2) a case study that applies this method to the constrained reorientation problem. The case study is presented in parallel as each step of the theory is developed for numerical motivation. Section II presents the formulation of the general problem, and of the specific system and constraints used in the case study. Section III presents the main result combining ZOH control inputs <ref type="bibr">[29]</ref> with input constraints <ref type="bibr">[33,</ref><ref type="bibr">40,</ref><ref type="bibr">41]</ref> and disturbances <ref type="bibr">[31,</ref><ref type="bibr">33]</ref> for relative-degree-2 constraints (e.g., pointing constraints), while Sec. IV presents a related extension of <ref type="bibr">[29]</ref> for relative-degree-1 constraints (e.g., angular rate constraints). Section V presents the real-time QP controller and simulations both in MATLAB and in a NASA-developed attitude control simulator. Section VI presents concluding remarks. Proofs of the theorems in Secs. III and IV are contained in the Appendix.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. Preliminaries and Problem Formulation</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Model</head><p>Drawing upon <ref type="bibr">[37]</ref>, let q &#8712; Q &#8838; R n 1 be the coordinates and v &#8712; V &#8838; R n 2 the velocities of a second-order system:</p><p>_ v f 2 t; q; v g 1 t; q; vu g 2 t; q; v&#958; (1b)</p><p>and control u &#8712; U &#8834; R m , where U is compact, and disturbance &#958; &#8712; &#926; &#8834; R p , where &#926; is bounded. Assume that function f 1 is twice continuously differentiable in all arguments, that functions f 2 ; g 1 ; g 2 are continuously differentiable in all arguments, and that f 1 ; f 2 ; g 1 ; g 2 ; u; &#958; are sufficiently regular so as to admit unique system trajectories for the entire time domain T. The results of this paper hold for general f 1 ; f 2 ; g 1 ; g 2 , but we are most interested in applications to attitude control, so suppose the following specific system.</p><p>Case Study Part i (System Definition): Assume a single rigid-body spacecraft. Let F N be an inertial frame and F B a spacecraft-fixed frame. For this case study, let Q fq &#8712; R 4 jkqk 1g be the quaternion space and let q q 0 ; q 1 ; q 2 ; q 3 T &#8712; Q be the quaternion (with scalar element q 0 first) that rotates from F N to F B . Let &#969; &#8712; R 3 be the angular velocity of F B with respect to F N expressed in frame F B . Suppose that the spacecraft has m reaction wheels. Let a i ; i 1; : : : ; m, a i &#8712; R 3 , ka i k 1, denote the spin axes of the wheels in frame F B , and define A &#8712; R 3&#215;m as A &#8796; a 1 ; : : : ; a m . Let w i ; i 1; : : : ; m, w i &#8712; R, denote the angular velocity of the wheels with respect to F B , and define w &#8712; R m as w w 1 ; : : : ; w m T . The system velocities as in Eq. (1b) are v &#969;; w &#8712; V R 3m . Assume that each wheel is axially symmetric and let J w;i &#8712; R &gt;0 be the axial moment of inertia of the ith wheel, and let J w &#8712; R m&#215;m be a diagonal matrix whose ith row and column element is J w;i . Let J b be the moment of inertia of the spacecraft without wheels plus the transverse moments of inertia of the wheels (e.g., see <ref type="bibr">[42]</ref> (Eq. 3.140, Chap. 3.3.5.1)) expressed in frame F B , and let J tot &#8796; J b m i1 J w;i a i a T i denote the total moment of inertia of the spacecraft. Assume that J b and J w are constant. The spacecraft state is then x q; &#969;; w &#8712; X Q &#215; R 3m and the dynamics <ref type="bibr">[43]</ref> are</p><p>where u &#8712; U &#8834; R m is the commanded wheel torque. The maximum wheel torque is limited to u max , so U fu &#8712; R m jkuk &#8734; &#8804; u max g. For this particular case study, we suppose a 6U CubeSat with parameters given in Table <ref type="table">1</ref> and visualized in Fig. <ref type="figure">1</ref>. Note that we have chosen a configuration with four wheels in Table <ref type="table">1</ref> rather than a more typical three-wheel configuration in order to demonstrate the general applicability of these results. The wheel moments of inertia and maximum torques in Table <ref type="table">1</ref> are based off a commercially available wheel package, &#8225; with the maximum per-wheel torque reduced to be comparable to a three-wheel configuration. Let &#926; f&#958; &#8712; R 3 jk&#958;k &#8804; &#958; max g for &#958; max in Table <ref type="table">1</ref>, which comes from approximate values of aerodynamic drag on a 6U CubeSat at 500 km altitude.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Safety Constraints</head><p>Next, suppose that the trajectories of Eq. ( <ref type="formula">1</ref>) are required to lie in the intersection of several constraint sets, each defined by the zero sublevel set of some constraint function. Let &#954; i &#8758;T &#215; Q &#8594; R for i 1; : : : ; N 1 denote the relative-degree-2 constraint functions, and let &#951; i &#8758;T &#215; V &#8594; R for i N 1 1; : : : ; N 1 N 2 denote the relativedegree-1 constraint functions. The constraint sets are</p><p>and the resultant safe set is</p><p>where Q i , V i , and S are permitted to be time-varying. As an abuse of notation, we will generally write &#954; i t; x and &#951; i t; x in place of &#954; i t; q and &#951; i t; v in order to match the CBF notation in Sec. II.C. Some constraint functions that are common in attitude control are as follows; these constraints are also the basis of our simulations in Sec. V.</p><p>Case Study Part ii (Constraints): For the spacecraft system in Eq. ( <ref type="formula">2</ref>), let b &#8712; R 3 , kbk 1, be a body-fixed vector, such as an instrument boresight vector (e.g., the green or blue vectors in Fig. <ref type="figure">1</ref>). Let st, kstk 1, be a vector, potentially time-varying (provided s is thrice continuously differentiable), for which we require that the angle between st and b is always at least &#952; (e.g., the local sun vector, represented by the yellow vector in Fig. <ref type="figure">1</ref>). This leads to a constraint function of the form</p><p>where Rq is</p><p>2q 1 q 2 -2q 0 q 3 2q 0 q 2 2q 1 q 3 2q 0 q 3 2q 1 q 2 1 -2q 2 1 -2q 2 3 2q 2 q 3 -2q 0 q 1 2q 1 q 3 -2q 0 q 2 2q 0 q 1 2q 2 q 3 1 -</p><p>This is a relative-degree-2 constraint function, since _ &#954; b is not a function of u; &#958;. Note that Eq. ( <ref type="formula">5</ref>) can be used to express both keep-out and keep-in zones. Also note that &#954; b in Eq. ( <ref type="formula">5</ref>) is equivalent to &#954; b t; q q T Mq in <ref type="bibr">[1]</ref> (Eq. 2.5), where M is given in <ref type="bibr">[1]</ref> (Eq. 2.6) and q -q 1 ; -q 2 ; -q 3 ; q 0 T is the conjugate of q where jP ij j &lt; 10 -20 for i &#8800; j e max 5.09210 -5 kg &#8901; m 2 &#8725;s 2 w max 628.3 rad&#8725;s &#958; max 1.0010 -5 N &#8901; m with the scalar element q 0 last (the conjugate arises because of notational differences with <ref type="bibr">[1]</ref>). Next, we also require that the maximum angular rate of the spacecraft is bounded for safety of the spacecraft structure. This leads to the constraint function &#951; &#969; t; v &#969; T P&#969;e max <ref type="bibr">(7)</ref> where e max &#8712; R and P &#8712; R 3&#215;3 are given in Table <ref type="table">1</ref>. The values of e max and P are constructed so that the safe set allows for angular rates of up to 1 deg/s on the largest principal axis and up to 2.730 deg&#8725;s on the smallest principal axis, and will be elaborated upon in Case Study Parts xi-xii. This is a relative-degree-1 constraint, since _ &#951; &#969; is a function of u; &#958;. Finally, we require that the wheel angular velocities are limited, so introduce m constraint functions:</p><p>where w max is a constant. This paper will assume that a suitable momentum dumping control law (e.g., scheduled thruster or magnetorquer application) has been developed so that the constraints encoded by &#951; w i t; x are always satisfied without impacting the rest of the control design. Thus, we only focus on the relative-degree-1 constraint in &#951; &#969; and the relative-degree-2 constraint in &#954; b , though we still incorporate the wheel rate bounds in Eq. ( <ref type="formula">8</ref>) in the safe set construction in Eq. ( <ref type="formula">4</ref>). Finally, for this case study, suppose that there are two constraints of the form Eq. ( <ref type="formula">5</ref>) for body-fixed vectors b 1 and b 2 , so the safe set is</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Continuous-Time CBFs</head><p>This paper will utilize and extend CBF theory to address the problem of rendering state trajectories always inside the safe set. A formal definition of CBF with robustness to bounded disturbances is as follows.</p><p>Definition 1 ([33] Def. 3): For the system (1), a continuously differentiable function h i &#8758;T &#215; X &#8594; R is a CBF on the set S if there exists a locally Lipschitz continuous class-K function</p><p>where H i is called the inner constraint set and is given by</p><p>That is, a scalar-valued function h i is a CBF if there is sufficient control authority given the set U that the total derivative of h i can be upper bounded regardless of the disturbance value &#958; in the considered set &#926;. The following lemma, derived from <ref type="bibr">[33]</ref> (Lemma 4) and <ref type="bibr">[37]</ref> (Lemma 3), can then be used to guarantee forward invariance (i.e., safety) of the set</p><p>for all t &#8712; t 0 ; t f , where t f is possibly &#8734;, then xt remains in H i t for all t &#8712; t 0 ; t f . That is, as long as the control law satisfies the condition <ref type="bibr">(11)</ref>, called the CBF condition, the state trajectory cannot leave H i ; i.e., H i is a controlled-invariant set. In general, H i is not equivalent to S, because there may exist states in St 0 that are instantaneously safe at t 0 , but that cannot be rendered safe for all t &#8712; t 0 ; t f <ref type="bibr">[33]</ref>. Thus, we call H i an inner constraint set. We note that Lemma 1 can be applied to any number of CBFs, so we seek a collection of CBFs fh i g M i1 such that &#8745; M i1 H i is a subset of S in Eq. ( <ref type="formula">4</ref>) (see <ref type="bibr">[37]</ref> Lemmas 2 and 3). Specifically, our final control law will employ one CBF h i for each constraint function &#954; i or &#951; i (equivalently, one CBF set H i for each constraint set Q i or V i ) in order to leverage existing literature <ref type="bibr">[33,</ref><ref type="bibr">40,</ref><ref type="bibr">41]</ref>, though such a one-to-one correspondence is not necessary <ref type="bibr">[37]</ref>.</p><p>Denote the set of control inputs satisfying Eq. ( <ref type="formula">11</ref>) as U h i t; x. Note that the total derivative of h i is</p><p>so each condition <ref type="bibr">(11)</ref>, i 1; : : : ; N 1 N 2 , is affine in u and each U h i is a half-space. Thus, a QP-based control law as in <ref type="bibr">[35]</ref> (Sec. II.C) can efficiently solve for u satisfying several constraints of the form Eq. ( <ref type="formula">11</ref>) simultaneously.</p><p>For each relative-degree-1 constraint &#951; i in Eq. (3b), we will choose the CBF h i &#8801; &#951; i so H i &#8801; V i . For the relative-degree-2 constraints &#954; i in Eq. (3a), various methods to construct a CBF h i such that H i &#8838; Q i are covered in <ref type="bibr">[33,</ref><ref type="bibr">40,</ref><ref type="bibr">41]</ref>, and this paper will extend the method in <ref type="bibr">[33]</ref> (Sec. 3.1) specifically. For a constraint function &#954; i satisfying certain properties (covered in <ref type="bibr">[33]</ref> Sec. 3.1), one possible choice of CBF is</p><p>for some parameter &#956; &gt; 0. This choice of CBF does not work for all systems, but is particularly useful for systems similar to the double integrator, such as a double integrator with small nonlinearities. We hypothesize that Eq. ( <ref type="formula">13</ref>) can be used for pointing constraints as in Eq. ( <ref type="formula">5</ref>), so this is the only CBF for relative-degree-2 constraint functions &#954; i considered in this paper. Possible extensions of the other CBFs in <ref type="bibr">[33,</ref><ref type="bibr">40]</ref> to ZOH control inputs are left to future work. Let &#956; 1 &gt; &#956; 2 &gt; 0, and let h i;&#956; 1 and h i;&#956; 2 be two corresponding CBFs. Note that H i;&#956; 1 &#8835; H i;&#956; 2 . Thus, the least conservative CBF of the form (13) will have the largest allowable parameter &#956;. Also note that with h i as in Eq. ( <ref type="formula">13</ref>), the set H i is does not meet our requirement that H i is a subset of Q i . To address this, we recall the following lemma.</p><p>Lemma 2 ([33] Lemma 7): Let ut; x be a control law. For some function &#954; i , let h i be as in Eq. ( <ref type="formula">13</ref>). If xt 0 &#8712; H i t 0 &#8745; Q i t 0 and u satisfies Eq. ( <ref type="formula">11</ref>) for all t &#8712; t 0 ; t f , where t f is possibly &#8734;, then xt remains in</p><p>That is, even though Lemma 1 only guarantees forward invariance of H i , because of the special form of h in Eq. ( <ref type="formula">13</ref>), the set H i &#8745; Q i is also rendered forward invariant. We now consider how Eq. ( <ref type="formula">13</ref>) applies to our case study.</p><p>Case Study Part iii (Continuous-Time CBF): For the constraint function &#954; b in Eq. ( <ref type="formula">5</ref>), the function h b in Eq. ( <ref type="formula">13</ref>) is a CBF on S as in Definition 1 for any parameter 0 &lt; &#956; &#8804; 0.0025.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Robust Sampled-Data Formulation</head><p>Thus far, all results have been for continuous controller updates, but our goal is to apply the CBFs ( <ref type="formula">13</ref>) and ( <ref type="formula">7</ref>) when the controller is instead updated at a fixed frequency. Now suppose that the control input u is updated at discrete times t k ; k &#8712; N, where t k1t k T for fixed time-step T &gt; 0, and that u is fixed between time steps k and k 1. That is, we seek a ZOH control law ut u k ; &#8704;t &#8712; t k ; t k1 <ref type="bibr">(14)</ref> where</p><p>Since the control input is updated only at the times t k , it is difficult to ensure that Eq. ( <ref type="formula">11</ref>) is satisfied at every time instant (i.e., including between time steps), as is required for Lemma 1 to apply. The work in <ref type="bibr">[29]</ref> summarizes three stricter versions of Eq. ( <ref type="formula">11</ref>) that when applied only at times t k ; k &#8712; N ensures that the original condition <ref type="bibr">(11)</ref> is always satisfied between time steps, and a related method that accomplishes the same result without using Eq. ( <ref type="formula">11</ref>). However, the methods in <ref type="bibr">[29]</ref> do not easily apply to CBFs constructed from relative-degree-2 constraint functions, such as in Eq. ( <ref type="formula">13</ref>). This is demonstrated by way of the following example.</p><p>Example 1: Given a relative-degree-2 constraint function &#954; i , one possible CBF is that in Eq. ( <ref type="formula">13</ref>) for some constant &#956; &gt; 0. According to <ref type="bibr">[29]</ref> (Thm. 3), this CBF can be rendered safe in a ZOH fashion if for all x &#8712; H i t; t &#8712; T there exists u &#8712; U such that</p><p>where r &#8805; 0 is a parameter defined in <ref type="bibr">[29]</ref> (Eq. ( <ref type="formula">17</ref>)). As explained in <ref type="bibr">[29]</ref>, r could either be a constant ("global" case), or a function of t; x ("local" case) depending on the implementation. In either case, r represents possible values of &#954; i and, for that reason, is usually lower bounded by a positive number, here denoted r 0 &gt; 0 (in the global case, let r 0 r).</p><p>The issue that arises here is that, for any arbitrarily small &#948; &gt; 0, there exist x &#8712; H i t; t &#8712; T such that _ &#954; i t; x &#948; and &#954; i t; x &#948; 2 2&#956; . For such x, Eq. ( <ref type="formula">15</ref>) simplifies to</p><p>Because r &#8805; r 0 &gt; 0, it follows that lim &#948;&#8594;0 &#1013;&#948; -&#8734;. That is, the ZOH sampling margin r causes the required &#954; i to go to -&#8734; near the boundary of H i , which also causes the required u to become unbounded. Thus, the methods in <ref type="bibr">[29]</ref> cannot be applied to the CBF <ref type="bibr">(13)</ref>, or any of the relative-degree-2 strategies in <ref type="bibr">[33]</ref>, if there are also input constraints.</p><p>Thus, the method in <ref type="bibr">[29]</ref> suffers from the infeasibility of the condition <ref type="bibr">[29]</ref> (Eq. 5) when the control input u is constrained. The interested reader can examine this problem further by downloading the code linked in <ref type="bibr">[29]</ref> and increasing the value of the constant &#956; in <ref type="bibr">[29]</ref> (Table <ref type="table">1</ref>). Thus, the central problem of this paper is as follows.</p><p>Problem 1: Given the safe set S in Eq. ( <ref type="formula">4</ref>), focus on a single constraint function &#951; i &#8758;T &#215; V &#8594; R or &#954; i &#8758;T &#215; Q &#8594; R that is of relative degree 1 or 2, respectively, with respect to the dynamic model <ref type="bibr">(1)</ref>. Assume that xt k &#8712; St k in Eq. (4) at the current sample time k, and that all other constraints xt &#8712; Q j t and xt &#8712; V j t for j &#8800; i are satisfied for all t in the inter-sample period t k ; t k1 . We seek to derive a set Z i t &#8838; Q i t or Z i t &#8838; V i t for all t &#8712; T and a set</p><p>We refer to set Z i as the ith robust inner constraint set. Similar to how we restricted the constraint set Q i to the inner constraint set H i to account for input constraints, leading to the safe control set U h i , in this paper, we will further restrict the allowable sampled states to the new set Z i to account for disturbances and controller sampling, leading to the new safe control set U z i . Figure <ref type="figure">2</ref> shows the relation between Q i (cyan), H i (hashed), and Z i (gray) for a relative-degree-2 constraint function. Section III will address the relative-degree-2 case of Problem 1, while Sec. IV will address the simpler relativedegree-1 case.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. Method for Relative Degree Two</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Strategy</head><p>We begin by addressing the relative-degree-2 case of Problem 1, as the relative-degree-1 case easily follows. In this section, we drop the subscript i, so let &#954; denote any relative-degree-2 constraint function [e.g., Eq. ( <ref type="formula">5</ref>)], and h the corresponding CBF as in Eq. ( <ref type="formula">13</ref>). The core idea of this method, and those in <ref type="bibr">[29,</ref><ref type="bibr">34]</ref>, is that given ht k ; xt k &#8804; 0, we want to identify a formula for a worst-case value of ht k &#964;; xt k &#964;, denoted h bound t k ; xt k ; &#964;, for &#964; &#8712; 0; T and find a suitable control input to ensure that h bound t k ; xt k ; &#964; is nonpositive for all &#964; &#8712; 0; T. However, the problem highlighted in Example 1 is that the worst-case formulas h bound following from all the methods in <ref type="bibr">[29,</ref><ref type="bibr">34]</ref> rely upon linear approximations of h on the interval t k ; t k1 . The obvious extension is to use a higherorder approximation of the worst-case trajectory that h could follow between time steps. However, when using a higher-order approximation, it is no longer sufficient to only check that h bound t k ; xt k ; T &#8804; 0, as there may exist &#964; &#8712; 0; T such that h bound t k ; xt k ; &#964; &gt; h bound t k ; xt k ; T, as visualized by the red and cyan points in Fig. <ref type="figure">3</ref>. Thus, unlike in <ref type="bibr">[29,</ref><ref type="bibr">34]</ref>, we must instead check that h bound t k ; xt k ; &#964; &#8804; 0 for all &#964; &#8712; 0; T, which adds complexity to the problem. To address this possibility of exiting and returning to the inner constraint set, we seek local maximizers &#963; (e.g., the red circle in Fig. <ref type="figure">3</ref>) such that h bound t k ; xt k ; &#963; &#8805; h bound t k ; xt k ; &#964; for all &#964; &#8712; 0; T. We then identify a bound &#916; on the differences h bound t k ;xt k ;&#963;ht k ;xt k and h bound t k ; xt k ; &#963;h bound t k ; xt k ; T and define the sets for all &#964; &#8712; 0; T. This is visualized in Fig. <ref type="figure">2</ref>, where the red sample trajectory is always safe, because at the sample times t k , the trajectory meets the stricter condition of being in the gray set.</p><p>To define a set Z as in Problem 1, we will need expressions for suitable &#916; in Eq. ( <ref type="formula">16</ref>) and &#948; in Eq. ( <ref type="formula">17</ref>), from which it will follow that Z H &#916; &#8745; Q &#948; . We seek to minimize conservatism, i.e., to choose the smallest &#948;; &#916; for which we can still provably demonstrate safety between each t k and t k1 . To this end, Secs. III.C and III.D study possible expressions for &#948;; &#916; that work well for the system (2), and that lead to a final control strategy summarized in Theorem 4. We begin by presenting a naive approach to determining &#916;; &#948;. Assuming a second-order h bound function [such as that in Eq. ( <ref type="formula">28</ref>)], the required margin &#916; can be determined entirely by the values of the second derivative h. Thus, consider the following (very conservative) baseline example with numbers derived from our case study.</p><p>Case Study Part iv (A Naive Approach to Computing Maximum Overshoot): Let the time step for the controller of Eq. ( <ref type="formula">2</ref>) be T 0.2 s. Let h b as in Eq. ( <ref type="formula">13</ref>) be a CBF for &#954; b in Eq. ( <ref type="formula">5</ref>) and suppose that &#956; 0.00167 as in Table <ref type="table">2</ref> (which we will justify later). Suppose that &#958; &#8801; 0 for this example. Let r min x&#8712;St;t&#8712;T;u&#8712;U h b t; x; u; 0 -0.550. It follows that one possible upper bound on the overshoot of h b between time steps is &#916; -1 8 T 2 r 2.7510 -3 . We will show in Secs. III.C and III.D that this is over 200 times as conservative as necessary for this system.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Sampling and Robustness Constants</head><p>We now proceed similarly to <ref type="bibr">[29]</ref> by defining several constants of the system, analogous to the Lipschitz constants in <ref type="bibr">[29]</ref>, and then using these constants to bound system behavior. First, define </p><p>The constants M - 2 and M 2 represent bounds on our uncertainty in &#954; because of the unknown disturbance. We assume that Eqs. ( <ref type="formula">18</ref>) and ( <ref type="formula">21</ref>) are well-defined. We represent the component of &#954; that is certain using the function &#968; as follows:</p><p>In practice, the value of &#968; is exactly known only at the sampling times t k , so we also define the constants to describe our uncertainty in the evolution of &#968; between time steps due to both the ZOH sampling and the disturbance. That is, for &#964; &gt; 0,</p><p>Note that the control input u is the same on both sides of the inequalities in Eq. ( <ref type="formula">22</ref>), so these inequalities are only useful during a single ZOH time step. Also, unlike in <ref type="bibr">[29]</ref>, we assume the bounds M - 2 ; M 2 ; M - 3 ; M 3 are global (i.e., are computed over all of S for simplicity, though extensions for local bounds computed online as in <ref type="bibr">[29]</ref> could also be developed at greater computational cost. If the global bounds ( <ref type="formula">18</ref>) and ( <ref type="formula">21</ref>) are undefined, then more involved analysis than is presently considered may be required. Note that we defined the lower bounds M - 2 ; M - 3 and upper bounds M 2 ; M 3 separately to cover cases such as when the dynamics and/or disturbance environment are known to tend to increase/decrease h [e.g., if the unsafe state is of higher/lower potential energy than other states, such as would occur if gravity gradient were included in Eq. ( <ref type="formula">2</ref>)]. In other cases, it may occur that M - 2 -M 2 and M - 3 -M 3 . In the upcoming theorems, we will need the following relations. Let &#963; be some time in t k ; t k1 , where u is constant on t k ; t k1 , and let &#964; &#8712; R &#8805;0 be such that &#963; &#964; (or &#963; -&#964;) is also within t k ; t k1 . Then, using only the time argument for brevity, it holds that &#954;&#963;</p><p>Case Study Part v (Constants): For the system (2) and constraint &#954; b in Eq. ( <ref type="formula">5</ref>), the values of M - 2 ; M 2 ; M - 3 ; M 3 are given in Table <ref type="table">2</ref>. Note that these values hold for all &#952; &#8804; &#960;&#8725;2 in Eq. ( <ref type="formula">5</ref>), and are larger than the resultant values (i.e., are overly conservative) when &#952; &gt; &#960;&#8725;2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Determining &#916;;&#948; When h and &#954; Share Maximizers</head><p>Using the above constants, we now determine suitable values of &#916;; &#948; for Eqs. ( <ref type="formula">16</ref>) and <ref type="bibr">(17)</ref> in two parts. First, we note that a necessary condition for a maximizer &#963; of h occurring between time steps t k and t k1 is _ h&#963;; x&#963;; u k ; &#958; 0. Because of the form of h in Eq. ( <ref type="formula">13</ref>), a sufficient condition for _ h 0 is _ &#954; 0, so maximizers of h will often be co-located with maximizers of &#954;, as illustrated by the blue lines in Fig. <ref type="figure">4</ref>. Thus, this subsection determines appropriate margins &#916;; &#948; specifically when the maximizers of &#954; and h are co-located, while the following subsection determines these margins when this is not the case (green lines in Fig. <ref type="figure">4</ref>). We begin with the following lemma.</p><p>Lemma 3: Suppose that &#954; is thrice differentiable and of relative degree 2 with respect to Eq. ( <ref type="formula">1</ref>), and u is constant on t k ; t k1 . If &#963; &#8712; t k ; t k1 is the time of a local maximizer of h in Eq. ( <ref type="formula">13</ref>) on t k ; t k1 and _ &#954;&#963;; x&#963; 0, then &#963; is also a local maximizer of &#954; on t k ; t k1 and it must hold that 0 &#8805; &#954;&#963;; x&#963;; u; &#958; &#8805; -&#956;. The consequence of Lemma 3 is that, provided that the stated condition holds, we can now use knowledge about &#954; to upper bound the variation in h between time steps. Lemma 3 is particularly helpful because analysis of &#954; is generally simpler than analysis of h, and because &#956; is a tunable parameter. Note that maximizers of the CBF h can also occur when _ &#954;&#963;; x&#963; &#8800; 0 and in these cases Lemma 3 would no longer apply, thus motivating Lemma 4 in Sec. III.D. However, when Lemma 3 does hold, we can substantially reduce the required conservatism to prevent xt from leaving Ht between sample times, as illustrated using our case study as follows.</p><p>Case Study Part vi (Application of Lemma 3): Suppose the same setup as in Case Study Part iv and suppose that the conditions of Lemma 3 hold. It follows that h&#963;; x&#963; &#954;&#963;; x&#963;, so we can instead compute &#916; as a bound on the possible overshoot of &#954; between time steps. Let r min x&#8712;St;t&#8712;T ;u&#8712;U &#954; ::: t; x; u; 0 -0.0262</p><p>(recall that Case Study Part iv assumed &#958; &#8801; 0), which leads to the new bound &#916; -1 8 T 2 r 1.3110 -4 . Finally, since Lemma 3 also says that &#954;&#963;; x&#963;; u; &#958; &#8805; -&#956;, and we can show that min x&#8712;St;t&#8712;T ;u&#8712;U &#954; ::: t; x; u; 0 -0.0062, it follows that &#954;t; xt; u; 0 &#8805; r -&#956; -0.0062T -0.00291 for all t &#8712; t k ; t k1 assuming &#963; &#8712; t k ; t k1 , which leads to &#916; -1 8 T 2 r 1.4610 -5 . Thus, Lemma 3 reduces the conservatism &#916; on H needed to ensure safety during the between-sample interval compared to Case Study Part iv.</p><p>We now apply Lemma 3 to calculate a general formula for appropriate margins &#916;; &#948; in Eqs. ( <ref type="formula">16</ref>) and (17) on ht k ; x k ; &#954;t k ; x k to ensure that x remains safe between sampling times.</p><p>Theorem 1: Suppose that &#954; is thrice differentiable and of relative degree 2 with respect to Eq. ( <ref type="formula">1</ref>), and u is constant on t k ; t k1 . Suppose that all maximizers &#963; of h in Eq. ( <ref type="formula">13</ref>) on the interval t k ; t k1 satisfy _ &#954;&#963;; x&#963; 0. Define &#948; 1 as <ref type="formula">16</ref>) and ( <ref type="formula">3</ref>) and xt k1 &#8712; Ht k1 &#8745; Q &#948; 1 t k1 in Eqs. ( <ref type="formula">10</ref>) and ( <ref type="formula">17</ref>), then xt &#8712; Ht for all t &#8712; t k ; t k1 .</p><p>Case Study Part vii (Application of Theorem 1): Using the values of M - 2 ; M 2 ; M - 3 ; M 3 ; &#956; in Table <ref type="table">2</ref>, it follows that &#948; 1 1.1010 -5 in Eq. <ref type="bibr">(24)</ref>. This is of similar magnitude to the value of &#916; in Case Study Part vi, as expected, and is equivalent to 2.27 arcseconds of shrinkage of the inner constraint set.</p><p>Thus, in the case where the maximizers of &#954; and h are consistent, we have an explicit formula for how much we should further restrict the set H at the sample times to ensure that the state never leaves the set H between the sample times. Having established this, we note that the requirements of Theorem 1 are still overly conservative. This is because we assumed that H &#916; and Q &#948; were defined using the same margin parameter &#916; &#948; &#948; 1 . For certain systems, applying different margins &#916; 2 on ht k ; x k and &#948; 2 on &#954;t k ; x k may reduce this margin, as presented in the following theorem.</p><p>Theorem 2: Suppose that &#954; is thrice differentiable and of relative degree 2 with respect to Eq. ( <ref type="formula">1</ref>), and u is constant on t k ; t k1 . Suppose that all maximizers &#963; of h in Eq. ( <ref type="formula">13</ref>) on the interval t k ; t k1 satisfy _ &#954;&#963;; x&#963; 0. Suppose that there exist constants &#948; 2 &#8805; 0 and &#916; 2 &#8805; 0 for which it holds that <ref type="formula">16</ref>) and ( <ref type="formula">3</ref>) and xt k1 &#8712; H &#916; 2 t k1 &#8745; Q &#948; 2 t k1 in Eqs. ( <ref type="formula">16</ref>) and ( <ref type="formula">17</ref>), then xt &#8712; Ht in Eq. ( <ref type="formula">10</ref>) for all t &#8712; t k ; t k1 . The primary difference between Theorem 1 and Theorem 2 is that, in Theorem 1, the form for &#948; 1 was provided explicitly. On the other hand, in Theorem 2, neither &#948; 2 nor &#916; 2 is uniquely defined. If we fix either &#948; 2 or &#916; 2 , we can use condition <ref type="bibr">(25)</ref> to compute the other constant. It follows from Theorem 1 that one valid combination is &#916; 2 &#948; 2 &#948; 1 . Another helpful strategy is to set &#916; 2 &#916; 3 , where &#916; 3 is presented in the next subsection, and to then compute the smallest allowable &#948; 2 . We also note that, unlike Theorem 1, the conditions of Theorem 2 are recursively feasible. That is, the ending condition</p><p>Case Study Part viii (Application of Theorem 2): Using the values of M - 2 ; M 2 ; M - 3 ; M 3 ; &#956; in Table <ref type="table">2</ref>, one possible combination satisfying Eq. ( <ref type="formula">25</ref>) besides &#916; 2 &#948; 2 &#948; 1 is &#916; 2 1.310 -5 and &#948; 2 9.710 -6 .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Determining &#916;; &#948; When h and &#954; Have Distinct Maximizers</head><p>Now that we have thoroughly covered excursions outside the sets H &#916; ; Q &#948; when Lemma 3 applies, we finally discuss the behavior between sampling times when this is not the case, as is illustrated by the green lines in Fig. <ref type="figure">4</ref>.</p><p>Lemma 4: Suppose that &#954; is thrice differentiable and of relative degree 2 with respect to Eq. ( <ref type="formula">1</ref>), and u is constant on t k ; t k1 , where t k1 t k T. Suppose that M 3 &gt; 0, M - 3 &lt; 0, and &#956; &#8805; M 2 -M - 2 maxfjM 3 j; jM Case Study Part ix (Application of Lemma 4): Using the values of M - 2 ; M 2 ; M - 3 ; M 3 ; &#956; in Table <ref type="table">2</ref>, it follows that &#916; 3 1.0910 -5 in Eq. (A34). This occurs for &#947; 3.610 -6 , &#963;t k 0.13 s, and t s -&#963; 0.0023 s. In this case, &#916; 3 &lt; &#948; 1 , but this is not guaranteed in general.</p><p>Remark 1: Note that the necessary condition &#954;&#963;; x&#963;; u; &#958; -&#956; in the proof of Lemma 4 [preceding Eq. (A16)] is very specific, so in the authors' experience, maximizers of h meeting the conditions of Lemma 4 are rarer than maximizers meeting the conditions of Lemma 3. However, the conditions of Lemma 4 occur more frequently if &#956; is chosen very small. Thus, we have now identified bounds on the overshoot of &#954; between time steps both when &#954; and h share maximizers (Lemma 3) and when the maximizer of &#954; is distinct from the maximizer of h</p><p>Fig. <ref type="figure">4</ref> Illustration of trajectories where the maximizers of &#954; and h on t k ;t k1 are co-located (blue), and where the maximizer of h precedes that of &#954; (green).</p><p>(Lemma 4). We thus have all the tools we need to define the robust inner constraint set Z. We now combine Theorem 2 and Lemma 4 to state our main theorem. Theorem 3: Suppose that &#954; is thrice differentiable and of relative degree 2 with respect to Eq. ( <ref type="formula">1</ref>), and u is constant on t k ; t k1 , where t k1 t k T. Suppose that M 3 &gt; 0, M - 3 &lt; 0, and &#956; &#8805; M 2 -M - 2 maxfjM 3 j; jM - 3 jgT. Suppose that there exist &#948; 2 and &#916; 2 satisfying condition <ref type="bibr">(25)</ref>, and that &#916; 2 &#8805; &#916; 3 in Eq. (A34). If</p><p>It follows from Theorem 3 that we can express the robust inner constraint set as in Fig. <ref type="figure">2</ref> as</p><p>Remark 2: Note that &#948; 1 in Eq. ( <ref type="formula">24</ref>) decreases with decreasing &#956;, while &#916; 3 in Eq. (A34) tends to increase with decreasing &#956;. Although &#956; is a tunable variable, this tradeoff suggests that there is some minimum amount of margin required when using a ZOH controller, regardless of the choice of &#956;. Note that both &#948; 1 and &#916; 3 decrease with decreasing T.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E. Determining the Set of Safe Controls</head><p>Now that we have thoroughly addressed the problem of overshoot between time steps, we seek a condition on u that guarantees ht k1 ; xt k1 &#8804; -&#916; 2 and &#954;t k1 ; xt k1 &#8804; -&#948; 2 so that we may apply Theorem 3. Moreover, we seek a choice of parameters &#948; 2 ; &#916; 2 ; &#956; such that this condition is always feasible with respect to the input constraints everywhere in Z in Eq. <ref type="bibr">(26)</ref>. To this end, define the following polynomials in &#964;: Theorem 4: Suppose that &#954; is thrice differentiable and of relative degree 2 with respect to Eq. ( <ref type="formula">1</ref>); M - 3 ; M 3 ; &#948; 2 ; &#916; 2 ; &#916; 3 ; &#956; satisfy the conditions of Theorem 3; Z is as given in Eq. ( <ref type="formula">26</ref>); and u satisfies Eq. ( <ref type="formula">14</ref>) for every k &#8712; N. If xt 0 &#8712; Zt 0 and</p><p>both hold for every k &#8712; N, then xt &#8712; Qt for all t &#8712; T. Note that while the upper bounds p &#954; and p h are valid for any &#964; &#8805; 0, Theorem 4 only considers the values of p &#954; and p h at &#964; T, and thus relies on the analysis leading up to Theorem 3 (which was not dependent on p &#954; ; p h ) to guarantee that &#954; remains nonpositive between sampling times, i.e., for &#964; &#8712; 0; T. Based on Theorem 4, we conclude with the following definition of a CBF for ZOH applications, analogous to that in <ref type="bibr">[35]</ref> (Def. 2).</p><p>Definition 2: For a thrice continuously differentiable constraint function &#954; i , the function h i &#8758;T &#215; X &#8594; R in Eq. ( <ref type="formula">13</ref>) with parameter &#956; is a degree-2 ZOH CBF (D 2 ZohCBF) on the set S for time-step T if there exist constants &#948; 2 ; &#916; 2 satisfying Eq. ( <ref type="formula">25</ref>) and &#916; 2 &#8805; &#916; 3 in Eq. (A34) such that min u&#8712;U maxfp &#954; i t; x; u; T &#948; 2 ; p h i t; x; u; T &#916; 2 g &#8804; 0;</p><p>where Z i , p &#954; i , and p h i are given in Eqs. <ref type="bibr">(26)</ref><ref type="bibr">(27)</ref><ref type="bibr">(28)</ref>, respectively. We revert to using the i indexing notation in Definition 2 for completeness (recall that this entire section and thus Definition 2 too are for one constraint at a time). Similar to Eq. ( <ref type="formula">9</ref>) with continuous control, Eq. ( <ref type="formula">30</ref>) accounts for the allowable control set U, so if h is a D 2 ZohCBF, then the conditions <ref type="bibr">(29)</ref> are feasible in the presence of input constraints for all xt &#8712; Zt; t &#8712; T. Equivalently, if h is a D 2 ZohCBF then the set U z t; x &#8745; U is nonempty for all x &#8712; Zt &#8745; St, t &#8712; T, where</p><p>The only remaining component is to determine a valid triple &#948; 2 ; &#916; 2 ; &#956;. One such triple is &#948; 2 &#948; 1 in Eq. ( <ref type="formula">24</ref>), &#916; 2 &#916; 1 where &#916; 1 &#8796; maxf&#948; 1 ; &#916; 3 g in Eqs. ( <ref type="formula">24</ref>) and (A34), and &#956; &#956; as follows:</p><p>assuming that &#956; exists. One can also choose &#956; &#8804; &#956; &#948; 2 ; &#916; 2 . Note that for large &#958; or T, &#948; 2 and &#916; 2 will also be large, and there may be no &#956; satisfying Eq. ( <ref type="formula">32</ref>) and the conditions of Theorem 3, indicating that Eq. ( <ref type="formula">1</ref>) cannot be safely controlled at such a sampling time T. A plot of &#956; using &#948; 2 &#948; 1 and &#916; 2 &#916; 1 for dynamics ( <ref type="formula">2</ref>) is shown in Fig. <ref type="figure">5</ref>, where the black region is where &#956; does not exist or is less than M 2 -M - 2 maxfjM 3 j; jM - 3 jgT. Case Study Part x (Selection of &#956; for Input Constraints): Using the values of M - 2 ; M 2 ; M - 3 ; M 3 in Table <ref type="table">2</ref>, the choice &#948; 1 ; &#948; 1 ; &#956; &#948; 1 ; &#948; 1 where &#956; &#948; 1 ; &#948; 1 0.00167 as in Eq. ( <ref type="formula">32</ref>) is one valid triple. Alternatively, &#948; 2 ; &#916; 2 ; &#956; &#948; 2 ; &#916; 2 is another such triple. We note that &#956; &#948; 2 ; &#916; 2 is slightly larger than &#956; &#948; 1 ; &#948; 1 , but the difference is only in the fourth significant digit of &#956; for this particular system. The authors observed a greater difference between &#956; &#948; 2 ; &#916; 2 and &#956; &#948; 1 ; &#948; 1 for problems where u max was greater. Thus, ZOH discretization has led to a more conservative result than the continuous-time case with &#956; 0.0025 in Case Study Part iii.</p><p>Note that the polynomial p &#954; is linear in &#968;, and therefore affine in u, so one can encode Eq. (29a) in a QP-based control law as in <ref type="bibr">[35]</ref> (Sec. II-C). The polynomial p h has nonlinear dependence on &#968; (because of the ssq function), but p h is still monotone increasing in &#968;, Fig. <ref type="figure">5</ref> Plot of &#956; in Eq. ( <ref type="formula">32</ref>) variation with the disturbance bound &#958; max and sampling period T for the system (2), where "x" marks the case study parameters.</p><p>and thus one can write p h &#8804; -&#916; 2 in Eq. (29b) equivalently as &#968; &#8804; &#968; max for some number &#968; max (the expression for &#968; max is omitted for brevity, but the interested reader is referred to the function get_PhiQ in the simulation code in Sec. V). Thus, one can also encode Eq. (29b) in a QP, and the set U z in Eq. ( <ref type="formula">31</ref>) is a polytope. In conclusion, the sets Z in Eq. ( <ref type="formula">26</ref>) and U z in Eq. ( <ref type="formula">31</ref>) solve the relativedegree-2 case of Problem 1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. Method for Relative Degree 1 A. Preliminary Method</head><p>We now extend the method in Sec. III to constraint functions that are of relative degree 1 with respect to the dynamics <ref type="bibr">(1)</ref>. As before, we drop the subscript i and assume that &#951; represents any relative-degree-1 constraint function. In this section, we assume that &#951; is also a CBF, so we will not need to employ the intermediary step of defining h and H, as was done for relative-degree-2 constraints. Similar to Eq. ( <ref type="formula">19</ref> In this section, we only require the upper bounds on Eqs. ( <ref type="formula">34</ref>) and ( <ref type="formula">36</ref>), so we omit the superscripts + andused in the prior section.</p><p>Here, M 1 and M 2 are analogous to M 2 and M 3 , respectively, from Sec. III.B. Now define the following polynomial in &#964;</p><p>which serves as an upper bound on the evolution of &#951; and is employed in the following theorem. Theorem 5: Suppose that &#951; is twice differentiable and of relative degree 1 with respect to Eq. ( <ref type="formula">1</ref>) and u satisfies Eq. ( <ref type="formula">14</ref>) for every k &#8712; N. Suppose that M 2 &#8805; 0 in Eq. <ref type="bibr">(36)</ref>. If xt 0 &#8712; Vt 0 and</p><p>for every k &#8712; N, then xt &#8712; Vt for all t &#8712; T. Note that Theorem 5 is a straightforward extension of <ref type="bibr">[29]</ref> (Cor. 3) to systems with disturbances, while the insights in the following subsection are new to this paper and motivated specifically by the system in Eq. <ref type="bibr">(2)</ref>.</p><p>Case Study Part xi (Application of Theorem 5): For the system (2), in order for the constants M - 2 ; M 2 ; M - 3 ; M 3 for &#954; b in Eq. ( <ref type="formula">5</ref>) to be well-defined [i.e., for S in Eqs. ( <ref type="formula">18</ref>) and ( <ref type="formula">21</ref>) to be compact], the maximum system angular velocity must be bounded. There are various ways to encode such a bound. First, if one desires that k&#969;k &#8804; &#969; max for some &#969; max &#8712; R &gt;0 , then one could use either &#951; 1 t; x k&#969;k -&#969; max or &#951; 2 t; x k&#969;k 2 -&#969; 2 max . Note that M 2 is undefined for the constraint function &#951; 1 , so Theorem 5 does not apply. Instead, suppose that we choose &#951; 2 . Then, letting &#969; max 0.0175 rad&#8725;s, it follows that M 2 0.00153. While &#951; 2 satisfies the definition of D 1 ZohCBF, this leads to an effective margin of 1 2 M 2 T 2 &#8725;w 2 max &#8776; 10%, which is rather large. While this does not directly impact the robust inner constraint set Z in Eq. ( <ref type="formula">46</ref>), this margin in effect makes certain states in the safe set inaccessible (see <ref type="bibr">[29]</ref> for a more extensive discussion of ZOH margins), so we would like to reduce this margin Next, suppose that the matrix Z in Eq. ( <ref type="formula">2</ref>) is of the form</p><p>where</p><p>Note that, under the dynamics in Eq. ( <ref type="formula">2</ref>), k&#969;k 2 is not a conserved quantity, so if the spacecraft is not spinning about a principal axis, it will take active control effort to keep the state within a level set of &#951; 2 . On the other hand, kinetic energy is a conserved quantity, which takes no control effort to maintain (unless the disturbance adds energy to the system). For this reason, define P in &#951; &#969; in Eq. ( <ref type="formula">7</ref>) as P Z -1 11 , so that &#951; &#969; encodes a maximum kinetic energy constraint. Then, using &#951; &#969; in Eq. ( <ref type="formula">7</ref>) with e max in Table <ref type="table">1</ref>, one finds M 2 8.3010 -5 , leading to a smaller effective margin of 1 2 M 2 T 2 &#8725;e max &#8776; 3.3%.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Reducing Conservatism</head><p>Before we present a definition for a valid CBF for the relativedegree-1 case, we present an extension of Theorem 5 that reduces conservatism for certain systems and constraint functions, and in particular the constraint function &#951; &#969; in our case study in Eq. ( <ref type="formula">7</ref>). In developing this paper, the authors noticed that the main contributor to M 2 for the constraint function in Eq. ( <ref type="formula">7</ref>) was the control input u. While x and &#958; are not known exactly between time steps t k and t k1 , the value of ut ut k for t &#8712; t k ; t k1 is a known quantity, and thus can be removed from the uncertainty bound M 2 . Motivated by this, suppose that there exists functions</p><p>for all t &#8712; T; x &#8712; S; u &#8712; U; &#958; &#8712; &#926;. The value of &#981; 1 u is known, so define a constant analogous to Eq. ( <ref type="formula">36</ref>) using &#981; 2 only as</p><p>Then we can define the polynomial</p><p>Corollary 1: Suppose that &#951; is twice differentiable and of relative degree 1 with respect to Eq. ( <ref type="formula">1</ref>) and u satisfies Eq. ( <ref type="formula">14</ref>) for all k &#8712; N. Suppose that &#981; 1 in Eq. ( <ref type="formula">41</ref>) is positive semidefinite and M alt 2 &#8805; 0 in Eq. <ref type="bibr">(42)</ref>. If xt 0 &#8712; Vt 0 and</p><p>for every k &#8712; N, then xt &#8712; Vt for all t &#8712; T.</p><p>We are now ready to give the complete requirements for a relativedegree-1 constraint function &#951; to be a CBF in ZOH applications.</p><p>Definition 3: A twice continuously differentiable function &#951; i is a degree-1 ZOH CBF (D 1 ZohCBF) on the set S for time-step T if there exists a positive semidefinite function &#981; 1 &#8758;U &#8594; R &#8805;0 and a function &#981; 2 &#8758;T &#215; S &#215; U &#215; &#926; (where one can use &#981; 1 u &#8801; 0) satisfying Eq. ( <ref type="formula">41</ref>) such that</p><p>where p alt &#951; i is as given in Eq. ( <ref type="formula">43</ref>). That is, &#951; is a D 1 ZohCBF if the condition (39) is always feasible inside the safe set. Unlike Definition 2, Definition 3 does not contain any additional tuning parameters. We assume that the function &#951; has already been constructed or tuned so as to be possible to render the corresponding set V forward invariant in the presence of input constraints. This is reasonable in the context of spacecraft attitude control, because the function &#951; &#969; in Eq. ( <ref type="formula">7</ref>) represents spacecraft kinetic energy. A fundamental requirement of control design should be that the spacecraft is able to reduce its kinetic energy from any safe state. In math, this requirement is equivalent to Eq. ( <ref type="formula">45</ref>) for &#951; &#969; . One case in which this requirement is not satisfied is if the spacecraft is allowed to achieve large angular velocities while operating at a control frequency too slow to stabilize the system. In this case, no amount of tuning will yield a safe controller, so Eq. ( <ref type="formula">45</ref>) will be violated, and one will need to operate at lower angular velocities or smaller time steps to achieve a stable system and satisfy Eq. <ref type="bibr">(45)</ref>.</p><p>For the D 1 ZohCBF, denote</p><p>which solves the relative-degree-1 case of Problem 1. Note that if &#981; 1 &#8801; 0 in Eq. ( <ref type="formula">41</ref>), then U z in Eq. ( <ref type="formula">46</ref>) is a half-space and safe control inputs can again be computed using a QP-based control law. Alternatively, if &#981; 1 is a convex function, then U z in Eq. ( <ref type="formula">46</ref>) is not necessarily a polytope, but will still be a convex set, allowing the use of other convex optimization tools to choose control inputs. For instance, in Sec. V.A, &#981; 1 will be a strictly convex quadratic function, yielding a quadratically constrained quadratic program (QCQP) as a control law.</p><p>Case Study Part xii (Application of Corollary 1): Suppose that &#951; 2 is as described in Case Study Part xi, and let &#981; 1 u 2u T Z T 12 Z 12 u. This leads to M alt 2 4.8810 -4 , resulting in an effective margin of 1 2 M alt 2 T 2 &#8725;w 2 max &#8776; 3.2%, much less than in the prior case with &#981; 1 u &#8801; 0. Thus, when &#981; 1 u is large, we still end up applying the same amount of margin as in Case Study Part xi, but when &#981; 1 u is small (i.e., u is small), the margin inherent in p alt &#951; in Eq. ( <ref type="formula">43</ref>) is reduced compared to the margin in p &#951; in Eq. <ref type="bibr">(38)</ref>.</p><p>Next, for &#951; &#969; with P as described in Case Study Part xi, let &#981; 1 u u T Z T 12 PZ 12 u, resulting in M alt 2 1.9510 -5 . This yields an effective margin of 1  2 M alt 2 T 2 &#8725;e max &#8776; 0.77%, and is therefore the setup used for simulation in Sec. V.A.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. Simulations A. Preliminary Simulations</head><p>In this section, we demonstrate the above methods in simulation. We assume a spacecraft with two instruments with boresight vectors b 1 , b 2 and keep-out zones &#952; 1 , &#952; 2 in Table <ref type="table">3</ref>, which induce two pointing constraint functions &#954; 1 , &#954; 2 of the form in Eq. <ref type="bibr">(5)</ref>. Let s 1 s 2 be the local sun vector, which is slowly time-varying. We construct two D 2 ZohCBFs h 1 , h 2 as in Sec. III with the constants in Table <ref type="table">2</ref>. Suppose that there is also an angular velocity constraint function &#951; 3 of the form in Eq. ( <ref type="formula">7</ref>) with the previously presented parameters in Table <ref type="table">1</ref>, and with &#981; 1 u u T Z T 12 PZ 12 u as discussed in Case Study Part xii. Then &#951; 3 is a D 1 ZohCBF. The set of safe control inputs is U &#8745; U z1 t; x &#8745; U z2 t; x &#8745; U z3 t; x.</p><p>Suppose that the spacecraft (visualized in Fig. <ref type="figure">1</ref>) is required to point instrument b 1 at inertially fixed target b t , given in Table <ref type="table">3</ref>. Define the following shortest-path proportional-derivative control law:</p><p>where u pd may be unsafe and does not necessarily satisfy the input constraints. Here, let sat be the saturation function and Z &#8224; 12 be the Moore-Penrose pseudoinverse. We then construct the final control law as a QCQP:</p><p>Using this "ZohCBF" controller, we simulated a single reorientation maneuver with initial and final parameters given in Table <ref type="table">3</ref>, and in the presence of a random disturbance bounded by &#958; max in Table <ref type="table">1</ref>. For   more details, we refer the interested reader to the simulation code. &#167; The simulation is short enough that we do not presently concern ourselves with momentum management (i.e., ensuring that w i remains bounded for i 1; 2; 3; 4). A diagram of the excluded pointing zone and the trajectories of the two instrument vectors is shown in Fig. <ref type="figure">6</ref>, and a video of the reorientation in three dimensions can be found below. &#182; The constraint values over the maneuver duration are shown in Fig. <ref type="figure">7</ref>, and the control inputs are shown in Fig. <ref type="figure">8</ref>. As expected, safety is maintained, and the control input constraints are always satisfied. The absolute value of the maximum value of &#951; 3 in Fig. <ref type="figure">7</ref> is the "controller margin" explained in <ref type="bibr">[29]</ref>. Both ZohCBF plots in Fig. <ref type="figure">7</ref> exhibit a controller margin, but the margin is only noticeable for the constraint &#951; 3 without zooming in.</p><p>For comparison, we also simulated the controllers in 1) [21] (Eq. 22), denoted "Log-B", with &#945; 0.75, &#946; 8, k 1 0.0165; 2) <ref type="bibr">[17]</ref> (Eq. 17) denoted "SMC", with k 0.01, k 1 5015, k 2 0.0167, d &#8801; 0; and 3) <ref type="bibr">[12]</ref>, denoted "NMPC", with n 5, h 0.2, Q 1 P 1 0.01I, Q 2 P 2 38I, Q 3 100I, where I is the identity matrix. The resultant trajectories are shown in Figs. <ref type="figure">6</ref><ref type="figure">7</ref><ref type="figure">8</ref>and described in Table <ref type="table">4</ref>, where all simulations were run on a 3.5 GHz Intel Xeon processor. While the Log-B and SMC controllers do not guarantee safety in the presence of input constraints or ZOH control inputs, Figs <ref type="figure">6</ref><ref type="figure">7</ref><ref type="figure">8</ref>show that when properly tuned, all of the above controllers can behave similarly. That said, the ZohCBF controller took a different route around the exclusion zone than all of the comparison controllers. The ZohCBF and NMPC controllers approached closer to the edge of the safe set than the Log-B and SMC controllers, and the NMPC controller briefly violated the &#954; 1 constraint. Also, the Lyapunov function introduced in <ref type="bibr">[21]</ref> is infinitely differentiable, so the trajectories under the Log-B controller are smooth. We observe this particularly in Fig. <ref type="figure">7</ref>, where the green lines have unique maximizers, whereas the other controllers spend much of the trajectory very close to zero. This allowed the ZohCBF controller to achieve the fastest settling time, defined here as time to 0.1 deg error, in Table <ref type="table">4</ref>. We note that for larger values of k 1 , the Log-B controller could be faster but would exceed the angular velocity constraint, and for much larger values of k 1 , the Log-B controller would violate the pointing constraints due the ZOH implementation. The NMPC controller approached the target at a rate similar to the ZohCBF controller, but exhibited oscillations around the target due to the small prediction horizon, thus resulting in a large settling time.</p><p>The SMC controller was the slowest due to the upper bound on k implied by <ref type="bibr">[17]</ref> (Eq. <ref type="bibr">16)</ref>.</p><p>Another notable difference between the ZohCBF and Log-B controllers is that the Lyapunov function in <ref type="bibr">[21]</ref> is strictly convex, so the controller is globally convergent. This is not true of the ZohCBF or NMPC controllers. To examine this, we increased the value of &#952; 1 ; &#952; 2 to 0.95 rad and resimulated the ZohCBF and Log-B controllers. The results are shown in Figs. 9 and 10 and Table <ref type="table">5</ref> and are demonstrated in the video below. ** Note that the blue lines (ZohCBF controller) in Fig. <ref type="figure">9</ref> both approach the edge of the red region, and then stop when the controller cannot safely move closer to the target direction (green dot) due to the set S &#8745; Z 1 &#8745; Z 2 &#8745; Z 3 being nonconvex. The spacecraft remains safe, but does not complete its objective. On the other   hand, the Log-B controller is eventually able to navigate around the exclusion zone and converge to the target vector. That said, the Log-B controller is very slow in Table <ref type="table">5</ref>. Lastly, we note that the ZohCBF technique can be applied to any nominal controller, so we introduce the control law u combined arg min u&#8712;U&#8745;U z 1 t;x&#8745;U z 2 t;x&#8745;U z 3 t;x kuu logb-fast t; xk 2 (49)</p><p>which we call the "Combined" controller. The controller u logb-fast in Eq. ( <ref type="formula">49</ref>) is the same as the Log-B controller, but with a much more aggressive choice of gain k 1 0.04. Without the ZohCBF application, the controller u logb-fast would violate the system energy constraint &#951; 3 , but with the additional ZohCBF acting as a safety-filter, the controller u combined yields the orange trajectory in Figs. 9 and 10. Unlike under u zohcbf , the trajectory under u combined converged to the target, and exhibited a reduced settling time in Table <ref type="table">5</ref> compared to the Log-B controller. Remark 3: We note that while the controllers (48) and (49) were successful in the simulations above, it still may be possible for the optimizations (48) and (49) to become infeasible because these controllers apply multiple CBFs at once. Progress toward provably guaranteed feasibility of multiple CBFs simultaneously with input constraints is studied in continuous time in <ref type="bibr">[37]</ref>, and such studies for sampled-data CBFs are left to future work.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Spacecraft Simulator Simulations</head><p>The prior subsection validates the methods in Secs. III and IV in a simple simulation, so we now present results from a more detailed spacecraft simulator, specifically the NASA "42" open-source spacecraft attitude control simulator <ref type="bibr">[44]</ref>. Here, rather than random disturbances, the disturbances are representative of disturbances in the orbital environment for an input spacecraft geometry and specified solar and geomagnetic activity indices.</p><p>Specifically, we simulated a 6U CubeSat with the parameters presented in Table <ref type="table">1</ref> in a 500 km altitude circular Earth orbit. Suppose that the spacecraft has a single instrument that must point at a sequence of targets but must avoid the sun by at least 25&#176;(encoded in &#954; 1 ), and a star tracker that must not point at the sun within 45&#176;( encoded in &#954; 2 ) or the moon within 30&#176;(encoded in &#954; 3 ). The angular velocity is constrained by &#951; 4 &#951; &#969; as in Case Study Part xi, where we now use &#981; 1 u 0, so that M alt 2 M 2 8.310 -5 . This change makes U z 4 more conservative than in the prior but makes U &#8745; U z 1 &#8745; U z 2 &#8745; U z 3 &#8745; U z 4 a polytope and thus changes Eq. (48) from a QCQP to a regular QP, which was implemented using the fast Operator Splitting QP solver <ref type="bibr">[45]</ref>. Finally, the code limited the QP solver to only 20 solver iterations to mimic realistic spacecraft computing constraints. For more details and input parameters, the interested reader is referred to the simulation code.</p><p>The instrument and star tracker pointing vectors are shown in Fig. <ref type="figure">11</ref>, the constraint values are shown in Fig. <ref type="figure">12</ref>, and the control inputs are shown in Fig. <ref type="figure">13</ref> using both u zohcbf in Eq. ( <ref type="formula">48</ref>) and u pd in  Eq. (47c). Avideo of the reorientation sequence is linked below. &#8224; &#8224; All constraints and actuator limits were satisfied for the entire pointing sequence using the ZohCBF controller (solid lines in Fig. <ref type="figure">11</ref>), while there were several constraint violations using the nominal controller (dashed lines in Fig. <ref type="figure">11</ref>). We note that three of the targets (green dots in Fig. <ref type="figure">11</ref>) were located very close to the sun vector (i.e., outside the safe set), so the ZohCBF controller prioritized safety over convergence for these targets.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. Conclusions</head><p>We have presented a methodology for ensuring that trajectories of a dynamic system always remain within a specified constraint set in the presence of ZOH sampled-data control inputs, bounded disturbances, and input constraints using extensions of CBF theory. This methodology is generally applicable to constraint functions of relative degree 1 or 2, and was specialized to spacecraft attitude control. Special attention was devoted to decreasing the margins for overshoot in the case of relative-degree-2 constraints, and for the case of a relative-degree-1 kinetic energy constraint specifically. The methodology was then demonstrated in simulation, where it exhibited faster settling times than all compared online controllers (note that path-planning methods were not tested). While the methods in this paper provably achieve all desired safety criteria, the comparison plots show that similar safe reorientations can be achieved with the comparison methods, although only with careful tuning and without proof of safety under these circumstances. The improvement in convergence by the "combined" controller over the original ZohCBF controller show that this approach may be limited in part by the capabilities of the nominal control law, so choosing "optimal" nominal control laws is one area of future work. Additional future work includes the incorporation of momentum-management techniques and measurement-delay considerations, study of more general conditions on the existence of a guaranteed safe control input in the presence of several CBFs simultaneously. where we do not need to break the integral into two parts here because _ &#954;t does not change signs on t k ; &#963;. We then define the function d left &#8758;R &#8805;0 &#215; R &#8805;0 &#8594; R as the simplification of the integral in Eq. (A32) as follows:</p><p>Both Eqs. (A31) and (A32) must apply simultaneously, so we define &#916; 3 below as a maximization of the lesser of d left and d right , subject to the constraints on t s -&#963; in Eqs. (A26) and (A29). Furthermore, the maximizer &#963; of h must occur in the present time step, so &#963;t k &#8712; 0; T, and &#947; must be positive. Let &#964; 1 &#963;t k and &#964; 2 t s -&#963;, and finally define Note that although &#947; is not upper bounded in Eq. (A34), in practice there is a maximum value of &#947; for which the interval r 1 &#947;; r 2 &#947;; &#963;t k is nonempty. Finally, using both bounds (A31) and (A32 In summary, we have shown that 1) when _ &#954;&#963; &lt; 0, no maximizer t s of &#954; can occur, and 2) when _ &#954;&#963; &gt; 0, only one maximizer t s of &#954; can occur and by Eq. (A35) and Lemma 2, &#954;t s &lt; 0, so xt &#8712; Qt for all t &#8712; t k ; t k1 in all cases where _ &#954;&#963; &#8800; 0. &#9633; Proof of Theorem 3: By assumption, &#954;t k &#8804; 0, ht k &#8804; -&#916; 2 &#8804; 0, &#954;t k1 &#8804; -&#948; 2 &#8804; 0, and ht k1 &#8804; -&#916; 2 &#8804; 0. Thus, xt can only exit Q if there is a local maximizer t s of &#954; for t s &#8712; t k ; t k1 . As a result of Lemma 2, it is only possible for &#954;t s &gt; 0 to occur if there also exists a local maximizer &#963; of h for &#963; &#8712; t k ; t k1 such that h&#963; &gt; 0, where it is possible that &#963; t s . Suppose the existence of both t s and &#963;, where neither is necessarily unique. If there exists a maximizer &#963; of h such that _ &#954;&#963; &#8800; 0, then Lemma 4 implies that t s is unique and that &#954;t s &#8804; 0.</p><p>Next, if every maximizer &#963; of h satisfies _ &#954;&#963; 0, then Theorem 2 implies that &#954;t s &#8804; 0 for every t s , where t s &#963;. Finally, if there is one or more maximizers &#963; 1 of h such that _ &#954;&#963; 1 0, and one maximizer &#963; 2 of h such that _ &#954;&#963; 2 &#8800; 0, then by the first paragraph, t s is unique and &#954;t s &#8804; 0, and it follows that &#963; 1 is unique and &#963; 1 t s . That is, the conditions presented so far do not preclude the possibility of the cases described in Lemma 3 and Lemma 4 both occurring in the same time step, but in this case, safety is ensured by Lemma 4 alone. Since &#954;t s &#8804; 0 for every maximizer t s of &#954;, it follows that &#954;t &#8804; 0 for all t &#8712; t k ; t k1 , and thus xt &#8712; Qt for all t &#8712; t k ; t k1 .</p><p>Proof of Theorem 4: First, note that we can upper bound the evolution of _ &#954; and &#954; between time steps as follows:</p><p>Thus, p &#954; in Eq. ( <ref type="formula">27</ref>) is an upper bound on &#954;t k &#964;, and Eq. ( <ref type="formula">A36</ref>) is an upper bound on _ &#954;t k &#964;. Since h in Eq. ( <ref type="formula">13</ref>) is monotonically increasing in both &#954; and _ &#954;, it follows that p h in Eq. ( <ref type="formula">28</ref>) is an upper bound on ht k &#964;. Since t k1 t k T, it follows that Eq. (29a) implies xt k1 &#8712; Q &#948; 2 t k1 and Eq. (29b) implies xt k1 &#8712; H &#916; 2 t k1 , or equivalently xt k1 &#8712; Zt k1 . Since this holds for every k &#8712; N, Theorem 3 implies that xt &#8712; Qt for all t &#8712; T. &#9633; Proof of Theorem 5: First, note that we can upper bound the evolution of &#951; between time steps as follows: It follows that if p &#951; t k ; &#964; &#8804; 0, then &#951;t k &#964; &#8804; 0 and thus xt k &#964; &#8712; Vt k &#964;. Note that p &#951; in Eq. ( <ref type="formula">38</ref>) is a concave upward quadratic in &#964; (since M 2 is assumed to be nonnegative), so if p &#951; t k ; 0 &#951;t k &#8804; 0 and p &#951; t k ; T &#8804; 0, then &#951;t k &#964; &#8804; p &#951; t k ; &#964; &#8804; p &#951; t k ; T &#8804; 0 for all &#964; &#8712; 0; T. Since we assumed xt 0 &#8712; Vt 0 , or equivalently p &#951; t 0 ; 0 &#951;t 0 &#8804; 0, and since Eq. (A38) implies p &#951; t k ; T &#8804; 0 for all k &#8712; N, it follows that &#951;t &#8804; 0 for all t &#8712; T, or equivalently, xt &#8712; Vt for all t &#8712; T. &#9633; Proof of Corollary 1: Similar to Eq. (A38), p alt &#951; t k ; &#964; in Eq. ( <ref type="formula">43</ref>) is an upper bound on &#951;t k &#964;. By Eq. ( <ref type="formula">14</ref>), u is constant between time steps and therefore the quadratic coefficient of p alt &#951; given by &#981; 1 ut k M alt 2 is constant. Because &#981; 1 maps to R &#8805;0 and M alt 2 &#8805; 0, the coefficient &#981; 1 ut k M alt 2 is also nonnegative. Thus, p alt &#951; t k ; &#964; is a concave upward quadratic polynomial in &#964;, so if &#951;t k &#8804; 0 and p alt &#951; t k ; T &#8804; 0, then it follows by the same logic as Theorem 5 that xt &#8712; Vt for all t &#8712; T. &#9633;</p><p>Center for developing and distributing the "42" Spacecraft Simulation platform <ref type="bibr">[44]</ref>.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p>Downloaded by University of Michigan on February 27, 2024 | http://arc.aiaa.org | DOI: 10.2514/1.G007456</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_1"><p>&#167;  All simulation code can be found at https://github.com/jbreeden-um/phdcode/tree/main/2022.&#182; https://youtu.be/EVuyZ-06-1Y. **https://youtu.be/sZ_F4N75kcw.</p></note>
		</body>
		</text>
</TEI>
