Abstract:
A method generates trajectories for motor controlled actuators subject to dynamics, acceleration and velocity constraints. The method solves a constrained optimal control problem with dynamics, acceleration, and velocity constraints. The motor control problem is formulated as an optimal control problem using an energy cost function which is based on numerical optimization results. A solution to the two-point boundary value problem (TBVP) for the unconstrained case of the optimal control problem is obtained. The energy efficient motor control trajectory generation solver is designed for real time energy efficient trajectory generation. The solver converts a difficult multi-point boundary value problem (MBVP) associated with the state and acceleration constrained optimal control problem into an iterative solution for the TBVPs with updated boundary conditions.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to generally controlling electric motors, and more particularly generating trajectories for motor controlled actuators subject to dynamics, acceleration and velocity constraints. 
       BACKGROUND OF INVENTION 
       [0002]    Motion control systems are used in number of positioning applications, e.g., single-axis positioning, and multiple-axis positioning. For example, a simple single-axis positioning motion control system generally includes sensors, controller, amplifier, and actuator motor. The actuator follows a predetermined trajectory subject to state and control constraints, i.e., dynamics, acceleration, velocity. The trajectory of the actuator can be designed to reduce vibration induced by the motor. 
         [0003]    For two motor control cases,  FIGS. 1A-1C  and  2 A- 2 C show optimal prior art time profiles for position, velocity, and control input, respectively. In the first case, an acceleration constraint is always active, while in the second case, the velocity constraint is saturated in a coasting part of the velocity profile, and the acceleration constraints are active in the other parts of the velocity profile. It is clear that when the control is optimized for minimize time, the control input contains significant large transitions, which are energy inefficient. 
         [0004]    Although minimal time motor controllers generate the fastest trajectory for each motion, for a complex processes, minimal time controller may not help improve the overal productivity if a bottleneck of production is due to other slower processes, such as material processing. For example, there is no advantage in rapidly moving a work piece to a next state using excessive energy, if the piece is not going to be manipulated until later. 
         [0005]    For such systems, minimal time controllers are not only unnecessary, but also inefficient because the controllers are not energy optimal. Furthermore, the efficiency of a plant depends not only on productivity, but also on other costs, such as energy consumption. The maximum efficiency is usually generated with certain trade-off between productivity and energy consumption. Therefore, strictly minimal time controllers, although useful in certain cases, do not increase efficiency in general, and minimizing energy consumption by relaxing time constraints should be considered for optimal motor control. 
         [0006]    Optimal Control Theory 
         [0007]    Optimal control deals with the problem of finding a control law for a system such that a certain optimality criterion is achieved. The control problem includes a cost function of state and control variables. An optimal control has to satisfy a set of differential equations describing paths of the control variables that minimize the cost function. 
         [0008]    Pontryagin&#39;s minimal principle for optimal control theory determines the best possible control for taking a dynamical system from one state to another, especially in the presence of constraints on the state or control inputs. The optimal control theory provides a systematic way for determining the optimal solution to the problem of minimizing certain cost functions, such as time and energy, subject to various constraints, including dynamics constraint, boundary conditions (BC), state constraint, control constraint, and path constraint. Therefore, the energy efficient motor control problem can be addressed as an optimal control problem. 
         [0009]    The optimal control can be obtained by solving a two-point boundary value problem (TBVP), or a multi-point boundary value problem (MBVP) if the optimal solution contains multiple segments. This usually happens when control or state constraints are active. For the minimal time motor control problem, the optimal solution can be obtained analytically. Such an analytic solution forms the basis of many minimal time motor controllers. 
         [0010]    However, for an energy saving optimal control problem, the corresponding TBVP and MBVP are difficult to solve, and no analytic solution is readily available. The existing indirect methods for solving the TBVP and MBVP, including single shooting method (SSM) and multiple shooting method (MSM), are computationally complex for real-time motion control applications. Besides, the convergence of those methods are generally not guaranteed, and rely on an initial guess of certain key parameters in the methods. Hence, due to the computation complexity issue and the reliability issue, the existing methods for solving TBVP and MBVP are difficult to be applied for real-time energy efficient trajectory generation in motor control applications. 
         [0011]    The direct transcription method (direct method), provides an alternative way for solving optimal control problems. Similar to shooting methods, the convergence of the direct method is not guaranteed. A comprehensive evaluation of current direct methods, including a pseudo-spectral method and a mesh refinement method, shows that the direct method cannot provide motor control in real-time. 
         [0012]    Thus, the known methods are insufficient in terms of computation efficiency and reliability for the real-time application of energy saving motor control. Due to these difficulties, there is a need for a method to generate energy efficient reference trajectories for motor control. Such a method should be computationally efficient for real-time motor control applications, and should be reliable. It is also desirable that such a method provides the capability to adjust the trade-off between execution time and energy saving for different applications. 
       SUMMARY OF INVENTION 
       [0013]    The embodiments of the present invention provide methods for generating trajectories for motor controlled actuators subject to dynamics, acceleration and velocity constraints. The method considers the energy consumption of a motor motion control system due to resistive loss of the motor, and mechanical work. The motor motion control trajectory generation problem is formulated as an optimal control problem with different constraints comprising dynamic, acceleration, and velocity constraints. 
         [0014]    The invention uses an analytic solution of an unconstrained case of motor control to search for the optimal solution of the constrained cases using an iterative process. Using optimal control terminologies, such an approach corresponds to solving a multi-point boundary value problem (MBVP) by iteratively solving a two-point boundary value problems (TBVP) until a termination condition is reached. For example, the termination condition is that all constraints on the solution, such as velocity and acceleration, are satisfied. Because the evaluation of analytic solutions is computationally efficient, the MBVP problem can be solved quickly. Special methods are provided to ensure that the iterative process is guaranteed to converge to the optimal solution. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0015]      FIGS. 1A-1C  are graphs of prior art time optimal motor control position, velocity, and control input profiles, respectively, for a case without velocity saturation; 
           [0016]      FIGS. 2A-2C  are graphs of prior art time optimal motor control position, velocity, and control input profile, respectively, for a case with velocity saturation; 
           [0017]      FIG. 3  is a flow chart of a method for generating trajectory of a motor controlled actuators subject to acceleration and velocity constraints according to embodiments of the invention; 
           [0018]      FIG. 4  is a graph of a velocity profile when the acceleration constraint is saturated according to embodiments of the invention; 
           [0019]      FIG. 5  is a graph of two subsequent updates of switching time estimations for acceleration constraints according to embodiments of the invention; 
           [0020]      FIG. 6  is a flowchart of a method for generating trajectory of a motor controlled actuators subject to an acceleration constraint according to embodiments of the invention; 
           [0021]      FIG. 7  is a graph of switching times of an energy optimal speed profile when the speed and the acceleration constraints are active according to embodiments of the invention; 
           [0022]      FIG. 8  is a flowchart of a method for generating trajectory of a motor controlled actuators subject to a velocity constraint according to embodiments of the invention; 
           [0023]      FIG. 9  is a graph of a partial equivalence between two different optimal control problems when a velocity constraint is active in an optimal velocity solution according to embodiments of the invention; 
           [0024]      FIG. 10A-10C  are graphs of energy efficient motor control position, velocity, and control input profiles, respectively, for a case without active acceleration or velocity constraint according to embodiments of the invention; 
           [0025]      FIG. 11A-11C  are graphs of energy efficient motor control position, velocity, and control input profiles, respectively, for a case with active acceleration constraint but without active velocity constraint according to embodiments of the invention; and 
           [0026]      FIG. 12A-12C  are graphs of energy efficient motor control position, velocity, and control input profiles, respectively, for a case with active acceleration and velocity constraints according to embodiments of the invention. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0027]      FIG. 3  shows a method for generating trajectories for motor controlled actuators subject to dynamics, acceleration and velocity constraints according to embodiments of our invention. 
         [0028]    The method can be performed in a processor  300  connected to a memory and input/output interfaces as known in the art. The method considers energy consumption of a motor motion control system due to resistive loss of the motor, and mechanical work. Although the example motor is rotational, other motors, such as linear motors can also be used with the invention. 
         [0029]    Step  310  initializes all data for solving a two-point boundary value problem (TBVP), including parameters for a motor model and a positioning task. The data are input to the method  310 . 
         [0030]    Step  320  solves the TBVP using the data and an analytical solver for unconstrained motor optimal control subject to the boundary conditions, as described in greater detail below. 
         [0031]    Step  330  identifies any violations of an acceleration constraint, and if true, then step  370  updates the boundary conditions, and iterates beginning at step  320 . 
         [0032]    Step  340  identifies any violations of a velocity constraint, and if true, then step  360  updates the boundary conditions, and iterates beginning at step  320 . velocity constraint is violated to update the BC and repeat step  320 . 
         [0033]    Otherwise, step  350  sets the trajectory of the actuator  390  of the motor  38  to the solution of the TBVP if the acceleration constraint and the velocity constraint are satisfied. 
         [0034]    Energy Efficient Motor Control Problem with an Optimal Control Formulation 
         [0035]    The lumped inertia of a load and a motor is I, and a torque constant of the motor is K t . We define d=  d /I, and b=k t /I, where  d  is a viscous friction coefficient,  c  is Coulomb friction. An angular position of the motor is x, and an angular velocity v is the time derivitive of x. The input current to the motor is u. The motor dynamics are 
         [0000]        {dot over (x)}=v,   (1)
 
         [0000]        {dot over (v)}=−dv−c+bu.   (2)
 
         [0036]    The motion for the motor satisfies the velocity and acceleration constraints, which are 
         [0000]        v≦v   max ,  (3)
 
         [0000]        A   min   ≦−dv−c+bu≦A   max ,  (4)
 
         [0000]    where v max  is maximum allowable velocity, A min  and A max  are bounds on system acceleration with 
         [0000]        A   min &lt;0 and  A   max &gt;0. 
         [0037]    The energy consumption of the motor is affected by many factors such copper loss (heat produced by electrical currents in the motor windings), iron loss (magnetic energy dissipated when the magnetic field is applied to the stator core of the motor), and mechanical work (friction in the motor). An instantaneous power of the motor consider these factors is 
         [0000]        P ( v,u )= Ru   2   +K   h   |v∥u|   γ   +K   s   |u|+K   t   vu,   (5)
 
         [0000]    where R is the resistance of the motor, K h  are hysteresis losses, γ is a constant for the hysteresis loss, K s  is a constant related to the switching loss, and K t  is a torque ratio. When P is negative, the motor becomes a generator converting mechanical work into electricity by braking. This electricity is dissipated. Hence, the total energy consumption of a motor during a time period [o, t f ] is 
         [0000]        E=∫   0   t     f     Q ( v ( t ), u ( t )) dt,   (6)
       where Q(v(t),u(t)) is the power function given by       
 
         [0000]        Q ( v ( t ), u ( t ))=max{0 ,P ( v,u )}. 
         [0039]    The minimal energy motor control is given by the solution to the following optimal control problem: 
       Problem 1. Minimal Energy Motor Control 
       [0040]    
       
         
           
             
               
                 min 
                 u 
               
                
               
                   
               
                
               E 
             
             = 
             
               
                 ∫ 
                 0 
                 
                   t 
                   f 
                 
               
                
               
                 
                   Q 
                    
                   
                     ( 
                     
                       v 
                       , 
                       u 
                     
                     ) 
                   
                 
                  
                 
                    
                   t 
                 
               
             
           
         
       
       
         
           
             
               
                 s 
                 . 
                 t 
                 . 
                 
                     
                 
                  
                 
                   x 
                   . 
                 
               
               = 
               v 
             
             , 
             
               
 
             
              
             
               
                 v 
                 . 
               
               = 
               
                 
                   - 
                   dv 
                 
                 - 
                 c 
                 + 
                 bu 
               
             
             , 
             
               
 
             
              
             
               v 
               ≤ 
               
                 v 
                 max 
               
             
             , 
             
               
 
             
              
             
               
                 A 
                 min 
               
               ≤ 
               
                 
                   - 
                   dv 
                 
                 - 
                 c 
                 + 
                 bu 
               
               ≤ 
               
                 A 
                 max 
               
             
             , 
             
               
 
             
              
             
               
                 x 
                  
                 
                   ( 
                   0 
                   ) 
                 
               
               = 
               0 
             
             , 
             
               
                 x 
                  
                 
                   ( 
                   
                     t 
                     f 
                   
                   ) 
                 
               
               = 
               
                 x 
                 f 
               
             
             , 
             
               
 
             
              
             
               
                 v 
                  
                 
                   ( 
                   0 
                   ) 
                 
               
               = 
               0 
             
             , 
             
               
                 v 
                  
                 
                   ( 
                   
                     t 
                     f 
                   
                   ) 
                 
               
               = 
               
                 
                   v 
                   f 
                 
                 . 
               
             
           
         
       
     
         [0041]    The BC can be different for different cases such that x(0) and v(0) are not necessarily zero. However, they are set as zeros to simplify the notation. Because the positive rotational direction of the motor can be arbitrarily assigned, without loss of generality, it is assumed that x f &gt;0. 
         [0042]    Cost Function Simplification 
         [0043]    The optimal control problem, such as Problem 1, can be solved faster with the appropriate simplified cost function. A method for cost function simplification is described below. 
         [0044]    Problem 1 with power function of Eqn. (5) is first solved via a numerical optimization using a density function based mesh refinement process. A total of sixty-four cases with different execution time (or, final time) t f  and final position x f  were solved. The contribution of different terms in (5) are analyzed. 
         [0045]    Specifically, the following quantities 
         [0000]    
       
         
           
             
               
                 1 
                 E 
               
                
               
                 
                   ∫ 
                   Γ 
                 
                  
                 
                   R 
                    
                   
                       
                   
                    
                   
                     u 
                     2 
                   
                    
                   
                      
                     t 
                   
                 
               
             
             , 
             
               
                 1 
                 E 
               
                
               
                 
                   ∫ 
                   Γ 
                 
                  
                 
                   
                     K 
                     h 
                   
                    
                   
                      
                     
                       x 
                       2 
                     
                      
                   
                    
                   
                     
                        
                       u 
                        
                     
                     γ 
                   
                    
                   
                      
                     t 
                   
                 
               
             
             , 
             
               
                 1 
                 E 
               
                
               
                 
                   ∫ 
                   Γ 
                 
                  
                 
                   
                     K 
                     s 
                   
                    
                   
                      
                     u 
                      
                   
                    
                   
                      
                     t 
                   
                 
               
             
             , 
             
               
                 1 
                 E 
               
                
               
                 
                   ∫ 
                   Γ 
                 
                  
                 
                   
                      
                     
                       
                         K 
                         t 
                       
                        
                       
                         x 
                         2 
                       
                        
                       u 
                     
                      
                   
                    
                   
                      
                     t 
                   
                 
               
             
           
         
       
     
         [0000]    are determined for all test cases and compared. The result shows that the copper loss term r u   2  dominates the other terms when the average velocity of the position transit, i.e., x f /t f , is small. When x f /t f  is large, the mechanical work term K t vu dominates the others. This indicates that a simplified cost function including the copper loss and the mechanical work of the motor is a good approximation of the original cost function with the power determined by Eqn. (5). 
         [0046]    To evaluate the optimality of the result using the simplified cost function, the following power functions are used to determine the optimal trajectory via numerical optimization: 
         [0000]        Q   A ( x,u )= Ru   2   K   h   |x   2   ∥u|   γ   +K   s   |u|+K   t   x   2   u,    
         [0000]        Q   B ( x,u )= Ru   2   K   h   |x   2   ∥u|+K   s   |u|+K   t   x   2   u,    
         [0000]        Q   C ( x,u )= Ru   2   +K   s   |u|+K   t   x   2   u,    
         [0000]        Q   D ( x,u )= Ru   2   +K   t   x   2   u,    
         [0000]        Q   E ( x,u )= Ru   2 , 
         [0000]        Q   F ( x,u )=max{0 ,Ru   2   +K   t   x   2   u}.    
         [0047]    The baseline cost 
         [0000]        J   b   =[J   b1   , . . . ,J   b64 ] 
         [0000]    is used for comparing the loss of optimality when simplified power functions are used for optimization. This baseline cost is obtained by solving Problem 1 with the actual power function Q(v, u) using the numerical optimization approach for all 64 cases. The adaptive mesh scheme is applied for better accuracy. With each of the power functions Q A  to Q F , Problem 1 is also solved via numerical optimization for all 64 cases. 
         [0048]    The relative cost error for the i th  case is estimated by 
         [0000]    
       
         
           
             
               
                 Δ 
                  
                 
                     
                 
                  
                 
                   
                     J 
                     _ 
                   
                   i 
                 
               
               = 
               
                 
                   
                     J 
                     i 
                   
                   - 
                   
                     J 
                     bi 
                   
                 
                 
                   J 
                   bi 
                 
               
             
             , 
           
         
       
     
         [0000]    and for each cost function, the vector of relative cost error Δ  J , the computation time T cpu , and the final position error e f  for all 64 cases are evaluated using the L 1  norm, which gives an average measure, and an L ∞  norm, which describes the worst case. 
         [0000]    
       
         
               
             
               
               
               
               
               
               
               
             
               
               
               
               
               
               
               
             
           
               
                 TABLE 1 
               
             
             
               
                   
               
               
                 Numerical result comparison with different power 
               
               
                 functions for cost function simplification 
               
             
          
           
               
                 Power 
                 ∥Δ  J ∥ 1   
                 ∥Δ  J ∥ ∞   
                 ∥T cpu ∥ 1   
                 ∥T cpu ∥ ∞   
                 ∥e f ∥ 1   
                 ∥e f ∥ ∞   
               
               
                   
               
             
          
           
               
                 Q A   
                 0.61% 
                 1.5% 
                 3.0 s 
                 5.2 s 
                 0.14% 
                 0.60% 
               
               
                 Q B   
                 0.54% 
                 1.3% 
                 2.8 s 
                 5.4 s 
                 0.15% 
                 0.66% 
               
               
                 Q C   
                 1.0% 
                 2.6% 
                 2.4 s 
                 4.6 s 
                 0.15% 
                 0.52% 
               
               
                 Q D   
                 1.9% 
                 4.2% 
                 1.6 s 
                 4.8 s 
                 0.08% 
                 0.42% 
               
               
                 Q E   
                 2.8% 
                 7.1% 
                 1.6 s 
                 5.1 s 
                 0.06% 
                 0.15% 
               
               
                 Q F   
                 0.28% 
                 1.6% 
                 3.8 s 
                 5.4 s 
                 0.14% 
                 0.56% 
               
               
                   
               
             
          
         
       
     
         [0049]    According to the numerical optimization result listed in Table 1, the numerical optimization approach using direct transcription takes 1.6 to 5.6 seconds to solve the problem, which is too slow for real time motor control applications. 
         [0050]    Therefore, power functions used to solve Problem 1 analytically are more suitable for applications. Such power functions include Q D  and Q E . Because the power function Q D  provides acceptable optimality as compared to the true cost function, and can be solved analytically, it is used to determine the energy consumption cost function as 
         [0000]        E=∫   0   t     f     Q   D ( v,u ) dt=∫   0   t     f   ( Ru   2   +K   t   vu ) dt.   (7)
 
         [0051]    Analytic Solution to the TBVP for the Unconstrained Case 
         [0052]    In this section we present the analytical solution to Problem 1 using the simplified cost function (7) without velocity and acceleration constraints. The optimal solution for this case is given by the following problem: 
         [0053]    Problem 2. Unconstrained Minimal Energy Motor Control with Simplified Cost Function 
         [0054]    A description of the problem to minimize the energy can be formulated as follow: 
         [0000]    
       
         
           
             
               
                 min 
                 u 
               
                
               
                   
               
                
               E 
             
             = 
             
               
                 ∫ 
                 0 
                 
                   t 
                   f 
                 
               
                
               
                 
                   ( 
                   
                     
                       R 
                        
                       
                           
                       
                        
                       
                         u 
                         2 
                       
                     
                     + 
                     
                       
                         K 
                         t 
                       
                        
                       v 
                        
                       
                           
                       
                        
                       u 
                     
                   
                   ) 
                 
                  
                 
                    
                   t 
                 
               
             
           
         
       
       
         
           
             
               
                 s 
                 . 
                 t 
                 . 
                 
                     
                 
                  
                 
                   x 
                   . 
                 
               
               = 
               v 
             
             , 
             
               
 
             
              
             
               
                 v 
                 . 
               
               = 
               
                 
                   - 
                   dv 
                 
                 - 
                 c 
                 + 
                 bu 
               
             
             , 
             
               
 
             
              
             
               
                 x 
                  
                 
                   ( 
                   0 
                   ) 
                 
               
               = 
               0 
             
             , 
             
               
                 x 
                  
                 
                   ( 
                   
                     t 
                     f 
                   
                   ) 
                 
               
               = 
               
                 x 
                 f 
               
             
             , 
             
               
 
             
              
             
               
                 v 
                  
                 
                   ( 
                   0 
                   ) 
                 
               
               = 
               0 
             
             , 
             
               
                 v 
                  
                 
                   ( 
                   
                     t 
                     f 
                   
                   ) 
                 
               
               = 
               
                 
                   v 
                   f 
                 
                 . 
               
             
           
         
       
     
         [0055]    Problem 2 is a linear system optimal control problem with quadratic cost, therefore, it can be solved analytically. The Hamiltonian for Problem 2 is given by 
         [0000]        H=Ru   2   +K   t   vu+λ   x   v+λ   v (− dv+bu−c ),
 
         [0000]    where λ x  and λ v  are the co-states for x and v dynamics, respectively. According to optimal control theory, the dynamics of the co-states are 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         λ 
                         . 
                       
                       x 
                     
                     = 
                     
                       
                         - 
                         
                           
                             ∂ 
                             H 
                           
                           
                             ∂ 
                             x 
                           
                         
                       
                       = 
                       0 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       λ 
                       . 
                     
                     v 
                   
                   = 
                   
                     
                       - 
                       
                         
                           ∂ 
                           H 
                         
                         
                           ∂ 
                           v 
                         
                       
                     
                     = 
                     
                       
                         d 
                          
                         
                             
                         
                          
                         
                           λ 
                           v 
                         
                       
                       - 
                       
                         
                           K 
                           t 
                         
                          
                         u 
                       
                       - 
                       
                         
                           λ 
                           x 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0056]    Note that λ x  is constant according to Eqn. (8). The optimal control u* is determined from the first-order optimality condition ∂H/∂u=0. which yields 
         [0000]    
       
         
           
             
               
                 
                   
                     u 
                     * 
                   
                   = 
                   
                     
                       
                         - 
                         
                           
                             K 
                             t 
                           
                           
                             2 
                              
                             R 
                           
                         
                       
                        
                       v 
                     
                     - 
                     
                       
                         b 
                         
                           2 
                            
                           R 
                         
                       
                        
                       
                         
                           λ 
                           v 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
         [0057]    Bringing the expression of optimal control in Eqn. (10) into Eqns. (8-9), we have the following Two-point Boundary Value Problem (TBVP) 
         [0058]    Two-Point Boundary Value Problem (TBVP) for Unconstrained Motor Control 
         [0059]    The TBVP can be formulated as: 
         [0000]    
       
         
           
             
               
                 x 
                 . 
               
               = 
               v 
             
             , 
             
               
 
             
              
             
               
                 v 
                 . 
               
               = 
               
                 
                   
                     - 
                     
                       ( 
                       
                         d 
                         + 
                         
                           
                             bK 
                             t 
                           
                           
                             2 
                              
                             R 
                           
                         
                       
                       ) 
                     
                   
                    
                   v 
                 
                 - 
                 
                   
                     
                       b 
                       2 
                     
                     
                       2 
                        
                       R 
                     
                   
                    
                   
                     λ 
                     v 
                   
                 
                 - 
                 c 
               
             
             , 
             
               
 
             
              
             
               
                 
                   λ 
                   . 
                 
                 v 
               
               = 
               
                 
                   - 
                   
                     
                       ∂ 
                       H 
                     
                     
                       ∂ 
                       v 
                     
                   
                 
                 = 
                 
                   
                     d 
                      
                     
                         
                     
                      
                     
                       λ 
                       v 
                     
                   
                   - 
                   
                     
                       K 
                       t 
                     
                      
                     u 
                   
                   - 
                   
                     λ 
                     x 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    with unknown parameter λ x  and boundary conditions 
         [0000]        x (0)=0 , X ( t   f )= x   f , 
         [0000]        v (0)=0 , v ( t   f )=0, λ v (0) and λ v ( t   f ) free.
 
         [0060]    Let 
         [0000]    
       
         
           
             
               
                 A 
                 1 
               
               = 
               
                 - 
                 
                   ( 
                   
                     d 
                     + 
                     
                       
                         bK 
                         t 
                       
                       
                         2 
                          
                         R 
                       
                     
                   
                   ) 
                 
               
             
             , 
             
               
 
             
              
             
               
                 A 
                 2 
               
               = 
               
                 - 
                 
                   
                     b 
                     2 
                   
                   
                     2 
                      
                     R 
                   
                 
               
             
             , 
             
               
 
             
              
             
               
                 A 
                 3 
               
               = 
               
                 
                   K 
                   t 
                   2 
                 
                 
                   2 
                    
                   R 
                 
               
             
             , 
           
         
       
     
         [0000]    and define 
         [0000]    
       
         
           
             
               A 
               = 
               
                 [ 
                 
                   
                     
                       0 
                     
                     
                       1 
                     
                     
                       0 
                     
                   
                   
                     
                       0 
                     
                     
                       
                         A 
                         1 
                       
                     
                     
                       
                         A 
                         2 
                       
                     
                   
                   
                     
                       0 
                     
                     
                       
                         A 
                         3 
                       
                     
                     
                       
                         - 
                         
                           A 
                           1 
                         
                       
                     
                   
                 
                 ] 
               
             
             , 
             
               
 
             
              
             
               B 
               = 
               
                 [ 
                 
                   
                     
                       0 
                     
                   
                   
                     
                       
                         - 
                         c 
                       
                     
                   
                   
                     
                       
                         - 
                         
                           λ 
                           x 
                         
                       
                     
                   
                 
                 ] 
               
             
             , 
             . 
           
         
       
     
         [0061]    Then the differential equations in the TPBV can be written more compactly as 
         [0000]    
       
         
           
             
               
                 
                   
                     [ 
                     
                       
                         
                           
                             x 
                             . 
                           
                         
                       
                       
                         
                           
                             v 
                             . 
                           
                         
                       
                       
                         
                           
                             
                               λ 
                               . 
                             
                             v 
                           
                         
                       
                     
                     ] 
                   
                   = 
                   
                     
                       A 
                        
                       
                         [ 
                         
                           
                             
                               x 
                             
                           
                           
                             
                               v 
                             
                           
                           
                             
                               
                                 λ 
                                 v 
                               
                             
                           
                         
                         ] 
                       
                     
                     + 
                     B 
                   
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
           
         
       
     
         [0062]    The solution to linear system (11) is given by 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           [ 
                           
                             
                               
                                 
                                   x 
                                    
                                   
                                     ( 
                                     t 
                                     ) 
                                   
                                 
                               
                             
                             
                               
                                 
                                   v 
                                    
                                   
                                     ( 
                                     t 
                                     ) 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     λ 
                                     v 
                                   
                                    
                                   
                                     ( 
                                     t 
                                     ) 
                                   
                                 
                               
                             
                           
                           ] 
                         
                         = 
                         
                           
                             
                                
                               At 
                             
                              
                             
                               [ 
                               
                                 
                                   
                                     
                                       x 
                                        
                                       
                                         ( 
                                         0 
                                         ) 
                                       
                                     
                                   
                                 
                                 
                                   
                                     
                                       v 
                                        
                                       
                                         ( 
                                         0 
                                         ) 
                                       
                                     
                                   
                                 
                                 
                                   
                                     
                                       
                                         λ 
                                         v 
                                       
                                        
                                       
                                         ( 
                                         0 
                                         ) 
                                       
                                     
                                   
                                 
                               
                               ] 
                             
                           
                           + 
                           
                             
                                
                               At 
                             
                              
                             
                               
                                 ∫ 
                                 0 
                                 t 
                               
                                
                               
                                 
                                    
                                   
                                     - 
                                     Aτ 
                                   
                                 
                                  
                                 B 
                                  
                                 
                                    
                                   τ 
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           = 
                           
                             
                               M 
                                
                               
                                 
                                   ( 
                                   t 
                                   ) 
                                 
                                  
                                 
                                   [ 
                                   
                                     
                                       
                                         
                                           x 
                                            
                                           
                                             ( 
                                             0 
                                             ) 
                                           
                                         
                                       
                                     
                                     
                                       
                                         
                                           v 
                                            
                                           
                                             ( 
                                             0 
                                             ) 
                                           
                                         
                                       
                                     
                                     
                                       
                                         
                                           
                                             λ 
                                             v 
                                           
                                            
                                           
                                             ( 
                                             0 
                                             ) 
                                           
                                         
                                       
                                     
                                   
                                   ] 
                                 
                               
                             
                             + 
                             
                               
                                 G 
                                  
                                 
                                   ( 
                                   t 
                                   ) 
                                 
                               
                                
                               B 
                             
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
         [0063]    where M(t)=e At ε           3×3 , and G(t)ε           3×3  is given by 
         [0000]        G ( t )= e   At ∫ 0   t   e   −Aτ   dτ.  
 
         [0064]    The BC of the TBVP satisfies Eqn. (12) with t=t f   
         [0000]    
       
         
           
             
               
                 
                   
                     
                       [ 
                       
                         
                           
                             
                               x 
                               f 
                             
                           
                         
                         
                           
                             
                               v 
                               f 
                             
                           
                         
                         
                           
                             
                               λ 
                               vf 
                             
                           
                         
                       
                       ] 
                     
                     = 
                     
                       
                         
                           M 
                            
                           
                             ( 
                             
                               t 
                               f 
                             
                             ) 
                           
                         
                          
                         
                           [ 
                           
                             
                               
                                 
                                   x 
                                   0 
                                 
                               
                             
                             
                               
                                 
                                   v 
                                   0 
                                 
                               
                             
                             
                               
                                 
                                   λ 
                                   v0 
                                 
                               
                             
                           
                           ] 
                         
                       
                       + 
                       
                         
                           G 
                            
                           
                             ( 
                             
                               t 
                               f 
                             
                             ) 
                           
                         
                          
                         B 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
         [0000]    from which the unknowns 
         [0000]      λ v     0   , λ v     f   , and λ x  
 
         [0000]    can be solved. After these unknowns are solved, the optimal state and co-state histories can be determined from Eqn. (12), and the optimal control is given by Eqn. (10). 
         [0065]    Method for Solving the MBVP with Active Acceleration Constraint 
         [0066]    Next we describe a method for determining the optimal solution to Problem 2 subject to acceleration constraints. 
         [0067]    Problem 3. Acceleration Constrained Minimal Energy Motor Control with Simplified Cost Function 
         [0000]    
       
         
           
             
               
                 min 
                 u 
               
                
               
                   
               
                
               E 
             
             = 
             
               
                 ∫ 
                 0 
                 
                   t 
                   f 
                 
               
                
               
                 
                   ( 
                   
                     
                       Ru 
                       2 
                     
                     + 
                     
                       
                         K 
                         t 
                       
                        
                       vu 
                     
                   
                   ) 
                 
                  
                 
                    
                   t 
                 
               
             
           
         
       
       
         
           
             
               
                 s 
                 . 
                 t 
                 . 
                 
                   
                       
                   
                    
                   
                       
                   
                 
                  
                 
                   x 
                   . 
                 
               
               = 
               v 
             
             , 
             
               
 
             
              
             
               
                 v 
                 . 
               
               = 
               
                 
                   - 
                   dv 
                 
                 - 
                 c 
                 + 
                 bu 
               
             
             , 
             
               
 
             
              
             
               
                 A 
                 min 
               
               ≤ 
               
                 
                   - 
                   dv 
                 
                 - 
                 c 
                 + 
                 bu 
               
               ≤ 
               
                 A 
                 max 
               
             
             , 
             
               
 
             
              
             
               
                 x 
                  
                 
                   ( 
                   0 
                   ) 
                 
               
               = 
               0 
             
             , 
             
               
                 x 
                  
                 
                   ( 
                   
                     t 
                     f 
                   
                   ) 
                 
               
               = 
               
                 x 
                 f 
               
             
             , 
             
               
 
             
              
             
               
                 v 
                  
                 
                   ( 
                   0 
                   ) 
                 
               
               = 
               0 
             
             , 
             
               
                 v 
                  
                 
                   ( 
                   
                     t 
                     
                       f 
                        
                       
                           
                       
                     
                   
                   ) 
                 
               
               = 
               
                 
                   v 
                   f 
                 
                 . 
               
             
           
         
       
     
         [0000]    In the above description, the term A min ≦−dv−c+bu≦A max  is the acceleration constraint  320 . 
         [0068]    The analytical result for the TBVP indicate that the control solution to Problem 2 is positive at the beginning for accelerating the motor, then negative for deceleration. {dot over (v)} is larger around t=0 and t=t f . For a given final position x f  when the final time t f  is large enough, the acceleration constraints are not activated. As t f  decreases, it requires faster acceleration at the beginning and deceleration at the end such that the motor move over the same distance within a shorter time. When t f  is small enough, the acceleration constraints can be activated around t=o and t=t f . 
         [0069]    When the acceleration constraints are activated, the optimal solution exhibits a three phase structure: maximum acceleration, unconstrained optimal solution (analytical solution), and minimal deceleration. In the first and third phases, the position and velocity of the motor are determined explicitly by 
         [0000]    
       
         
           
             
               
                 
                   v 
                   l 
                 
                  
                 
                   ( 
                   t 
                   ) 
                 
               
               = 
               
                 
                   A 
                   max 
                 
                  
                 t 
               
             
             , 
             
               
 
             
              
             
               
                 
                   x 
                   l 
                 
                  
                 
                   ( 
                   t 
                   ) 
                 
               
               = 
               
                 
                   1 
                   2 
                 
                  
                 
                   A 
                   max 
                 
                  
                 
                   t 
                   2 
                 
               
             
             , 
             
               
 
             
              
             
               
                 
                   v 
                   r 
                 
                  
                 
                   ( 
                   t 
                   ) 
                 
               
               = 
               
                 
                   A 
                   min 
                 
                  
                 
                   ( 
                   
                     t 
                     - 
                     
                       t 
                       f 
                     
                   
                   ) 
                 
               
             
             , 
             
               
 
             
              
             
               
                 
                   x 
                   l 
                 
                  
                 
                   ( 
                   t 
                   ) 
                 
               
               = 
               
                 
                   x 
                   f 
                 
                 + 
                 
                   
                     1 
                     2 
                   
                    
                   
                     
                       
                         
                           A 
                           min 
                         
                          
                         
                           ( 
                           
                             t 
                             - 
                             
                               t 
                               f 
                             
                           
                           ) 
                         
                       
                       2 
                     
                     . 
                   
                 
               
             
           
         
       
     
         [0070]    In the second phase, because the acceleration constraints are inactive, the optimal solution during this phase is given by the analytic solution to Problem 2 with BC 
         [0000]        x   m ( t   1 *)= x   l ( t   1 *),  v   m ( t   1 *)= v   l ( t   1 *),  x   m ( t   2 *)= x   r ( t   2 *),  v   m ( t   2 *)= v   r ( t   2 *), 
         [0000]    where t 1 * and t 2 * are the optimal switching times from an acceleration constrained arc ({dot over (v)}=A max ) to an unconstrained arc, and from an unconstrained arc to a deceleration constrained arc ({dot over (v)}=A min ), respectively, and x m  and v m  are the optimal position and velocity solution for the second phase. 
         [0071]      FIG. 4  shows the optimal velocity solution with a tangential condition  401  on the analytical solution. 
         [0072]    The optimal control u* for Problem 2 is continuous according to the optimal control theory. This further implies that the derivative of the optimal velocity is continuous. Hence, the junction conditions at the optimal switching times 
         [0000]        t   1 * and  t   2 * 
         [0000]    are described by two tangent conditions 
         [0000]        {dot over (v)}   l ( t   1 *)={dot over (v)} m ( t   1 *), {dot over (v)} r ( t   2 *)={dot over (v)} m ( t   2 *) 
         [0073]    Therefore, the solution to the acceleration constrained energy optimal motor control problem is determined from the following system of equations which form the MBVP: 
         [0000]    
       
         
           
             
               
                 [ 
                 
                   
                     
                       
                         
                           x 
                           m 
                         
                          
                         
                           ( 
                           
                             t 
                             2 
                             * 
                           
                           ) 
                         
                       
                     
                   
                   
                     
                       
                         
                           v 
                           m 
                         
                          
                         
                           ( 
                           
                             t 
                             2 
                             * 
                           
                           ) 
                         
                       
                     
                   
                   
                     
                       
                         
                           λ 
                           v 
                         
                          
                         
                           ( 
                           
                             t 
                             2 
                             * 
                           
                           ) 
                         
                       
                     
                   
                 
                 ] 
               
               = 
               
                 
                   
                     M 
                      
                     
                       ( 
                       
                         
                           t 
                           2 
                           * 
                         
                         - 
                         
                           t 
                           1 
                           * 
                         
                       
                       ) 
                     
                   
                    
                   
                     [ 
                     
                       
                         
                           
                             
                               x 
                               m 
                             
                              
                             
                               ( 
                               
                                 t 
                                 1 
                                 * 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               v 
                               m 
                             
                              
                             
                               ( 
                               
                                 t 
                                 1 
                                 * 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               λ 
                               v 
                             
                              
                             
                               ( 
                               
                                 t 
                                 1 
                                 * 
                               
                               ) 
                             
                           
                         
                       
                     
                     ] 
                   
                 
                 + 
                 
                   
                     G 
                      
                     
                       ( 
                       
                         
                           t 
                           2 
                           * 
                         
                         - 
                         
                           t 
                           1 
                           * 
                         
                       
                       ) 
                     
                   
                    
                   
                     [ 
                     
                       
                         
                           0 
                         
                       
                       
                         
                           
                             - 
                             c 
                           
                         
                       
                       
                         
                           
                             - 
                             
                               λ 
                               x 
                             
                           
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
             
                 
             
              
             
               
                 
                   
                     v 
                     . 
                   
                   m 
                 
                  
                 
                   ( 
                   
                     t 
                     1 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   
                     [ 
                     
                       0 
                        
                       
                           
                       
                        
                       1 
                        
                       
                           
                       
                        
                       0 
                     
                     ] 
                   
                    
                   
                     ( 
                     
                       
                         
                           AM 
                            
                           
                             ( 
                             0 
                             ) 
                           
                         
                          
                         
                           [ 
                           
                             
                               
                                 
                                   
                                     x 
                                     m 
                                   
                                    
                                   
                                     ( 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     ) 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     v 
                                     m 
                                   
                                    
                                   
                                     ( 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     ) 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     λ 
                                     v 
                                   
                                    
                                   
                                     ( 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                           ] 
                         
                       
                       + 
                       
                         
                           G 
                            
                           
                             ( 
                             0 
                             ) 
                           
                         
                          
                         
                           [ 
                           
                             
                               
                                 0 
                               
                             
                             
                               
                                 
                                   - 
                                   c 
                                 
                               
                             
                             
                               
                                 
                                   - 
                                   
                                     λ 
                                     x 
                                   
                                 
                               
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                 
                 - 
                 c 
               
             
             , 
             
               
 
             
              
             
               
                 
                   
                     v 
                     . 
                   
                   m 
                 
                  
                 
                   ( 
                   
                     t 
                     2 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   
                     [ 
                     
                       0 
                        
                       
                           
                       
                        
                       1 
                        
                       
                           
                       
                        
                       0 
                     
                     ] 
                   
                    
                   
                     ( 
                     
                       
                         
                           AM 
                            
                           
                             ( 
                             
                               
                                 t 
                                 2 
                                 * 
                               
                               - 
                               
                                 t 
                                 1 
                                 * 
                               
                             
                             ) 
                           
                         
                          
                         
                           [ 
                           
                             
                               
                                 
                                   x 
                                    
                                   
                                     ( 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     ) 
                                   
                                 
                               
                             
                             
                               
                                 
                                   v 
                                    
                                   
                                     ( 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     ) 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     λ 
                                     v 
                                   
                                    
                                   
                                     ( 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                           ] 
                         
                       
                       + 
                       
                         
                           G 
                            
                           
                             ( 
                             
                               
                                 t 
                                 2 
                                 * 
                               
                               - 
                               
                                 t 
                                 1 
                                 * 
                               
                             
                             ) 
                           
                         
                          
                         
                           [ 
                           
                             
                               
                                 0 
                               
                             
                             
                               
                                 
                                   - 
                                   c 
                                 
                               
                             
                             
                               
                                 
                                   - 
                                   
                                     λ 
                                     x 
                                   
                                 
                               
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                 
                 - 
                 c 
               
             
             , 
             
               
 
             
              
             
               
                 
                   
                     v 
                     . 
                   
                   1 
                 
                  
                 
                   ( 
                   
                     t 
                     1 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   
                     v 
                     . 
                   
                   m 
                 
                  
                 
                   ( 
                   
                     t 
                     1 
                     * 
                   
                   ) 
                 
               
             
             , 
             
               
 
             
              
             
               
                 
                   
                     v 
                     . 
                   
                   r 
                 
                  
                 
                   ( 
                   
                     t 
                     2 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   
                     v 
                     . 
                   
                   m 
                 
                  
                 
                   ( 
                   
                     t 
                     2 
                     * 
                   
                   ) 
                 
               
             
             , 
             
               
 
             
              
             
               
                 
                   v 
                   m 
                 
                  
                 
                   ( 
                   
                     t 
                     1 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   v 
                   1 
                 
                  
                 
                   ( 
                   
                     t 
                     1 
                     * 
                   
                   ) 
                 
               
             
             , 
             
               
 
             
              
             
               
                 
                   v 
                   m 
                 
                  
                 
                   ( 
                   
                     t 
                     2 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   v 
                   r 
                 
                  
                 
                   ( 
                   
                     t 
                     2 
                     * 
                   
                   ) 
                 
               
             
             , 
             
               
 
             
              
             
               
                 
                   x 
                   l 
                 
                  
                 
                   ( 
                   
                     t 
                     1 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   x 
                   m 
                 
                  
                 
                   ( 
                   
                     t 
                     1 
                     * 
                   
                   ) 
                 
               
             
             , 
             
               
 
             
              
             
               
                 
                   x 
                   r 
                 
                  
                 
                   ( 
                   
                     t 
                     2 
                     * 
                   
                   ) 
                 
               
               = 
               
                 
                   
                     x 
                     m 
                   
                    
                   
                     ( 
                     
                       t 
                       2 
                       * 
                     
                     ) 
                   
                 
                 . 
               
             
           
         
       
     
         [0074]    The analytic expression for the first and third phases of optimal solution has been applied in the above MBVP for simplification, hence the BC for these phases are automatically satisfied. There are a total of nine equations and nine unknowns 
         [0000]      λ x   ,t   1   *,t   2   *,x   m ( t   1 *), v   m ( t   1 *),λ v ( t   1 *), x   m ( t   2 *), v   m ( t   2 *),λ v ( t   2 *),
 
         [0000]    therefore the MBVP is solvable. However, the whole system is nonlinear and no analytic solution can be found for the MBVP. Besides, there is no guarantee that the current numerical method can solve this problem. Solving such a system of equations is also time-consuming. 
         [0075]    Because velocity and reliability are crucial for the real-time application of optimal motor control, we describe a method for solving Problem 3. The optimal switching times t 1 * and t 2 * are solved by identifying the optimal velocity profiles v k  for an unconstrained minimal energy control problems. 
         [0076]      FIG. 5  shows the updates at times t a     k′   , t b     k′   , which are approximations of t 1 * and t 2 *, and the unconstrained optimal velocity profiles v k    501   
         [0077]      FIG. 6  shows the method steps detailed in the table below. 
         [0078]    This method is presented by flow chart  FIG. 6 . The detailed description can be found in Table 2, and the parameters in Table 3. 
         [0079]    The steps in  FIG. 6  are described in detail in Table 2 below: 
       Detailed Description Step 
       [0000]    
       
           610  Initialize the solver for Problem 3 by setting e k =1, where 0ε&lt;&lt;1 is the tolerance parameter deciding the accuracy of the final solution. Let k=1, and choose k max , which limits the total number of iterations in the solver. Choose the switch time for acceleration constraints t a     k   =0 and t b     k   =0. 
           620  Determine whether the stopping criteria is met. If e k &lt;ε, let t 1 *=t a     k   , t 2 *=t b     k   , and go to step S6. Otherwise go to step S3. 
           630  Set up the BC for the analytic solver with x o =x t (t a     k   ), v 0 =v t (t a     k   ) at the initial time t=0, and x f =x τ (t b     k   ), v f =v τ (t b     k   ) at the final time t=t b     k   −t a     k   . 
           640  Solve the TBVP using the specified BC set up in S3. Specifically, solve equation (13) for unknown parameters λ v (t a     k   ), λ v (t b     k   ), and λ x . The matrices in (13) are determined using the problem data. 
           650  Update the switch time by solving equations 
       
     
         [0000]        {dot over (v)} ( t   a     k+1   )= A   max , {dot over (v)}( t   b     k+1   )= A   min .       For t a     k+1    and t b     k+1   . These equations are solved using a standard Newton&#39;s method with updated bounds on the switching time. Determine the error as e k+1 =|t a     k+1   −t a     k   |+|t b     k+1   −t b     k   |.         660  Determine the optimal solution as     
         [0000]    
       
         
           
             
               
                 x 
                 * 
               
                
               
                 ( 
                 t 
                 ) 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         
                           
                             
                               x 
                               l 
                             
                              
                             
                               ( 
                               t 
                               ) 
                             
                           
                           , 
                         
                       
                       
                         
                           
                             t 
                             ∈ 
                             
                               [ 
                               
                                 0 
                                 , 
                                 
                                   t 
                                   1 
                                   * 
                                 
                               
                               ] 
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           
                             x 
                              
                             
                               ( 
                               
                                 t 
                                 - 
                                 
                                   t 
                                   1 
                                   * 
                                 
                               
                               ) 
                             
                           
                           , 
                         
                       
                       
                         
                           
                             t 
                             ∈ 
                             
                               [ 
                               
                                 
                                   t 
                                   1 
                                   * 
                                 
                                 , 
                                 
                                   t 
                                   2 
                                   * 
                                 
                               
                               ] 
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           
                             x 
                             r 
                           
                            
                           
                             ( 
                             t 
                             ) 
                           
                         
                       
                       
                         
                           t 
                           ∈ 
                           
                             
                               [ 
                               
                                 
                                   t 
                                   2 
                                   * 
                                 
                                 , 
                                 
                                   t 
                                   f 
                                 
                               
                               ] 
                             
                             . 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       v 
                       * 
                     
                      
                     
                       ( 
                       t 
                       ) 
                     
                   
                 
                 = 
                 
                   { 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   v 
                                   l 
                                 
                                  
                                 
                                   ( 
                                   t 
                                   ) 
                                 
                               
                               , 
                             
                           
                           
                             
                               
                                 t 
                                 ∈ 
                                 
                                   [ 
                                   
                                     0 
                                     , 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                   
                                   ] 
                                 
                               
                               , 
                             
                           
                         
                         
                           
                             
                               
                                 v 
                                  
                                 
                                   ( 
                                   
                                     t 
                                     - 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                   
                                   ) 
                                 
                               
                               , 
                             
                           
                           
                             
                               
                                 t 
                                 ∈ 
                                 
                                   [ 
                                   
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     , 
                                     
                                       t 
                                       2 
                                       * 
                                     
                                   
                                   ] 
                                 
                               
                               , 
                             
                           
                         
                         
                           
                             
                               
                                 v 
                                 r 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                           
                           
                             
                               t 
                               ∈ 
                               
                                 
                                   [ 
                                   
                                     
                                       t 
                                       2 
                                       * 
                                     
                                     , 
                                     
                                       t 
                                       f 
                                     
                                   
                                   ] 
                                 
                                 . 
                               
                             
                           
                         
                       
                        
                       
                         
 
                       
                        
                       
                         
                           u 
                           * 
                         
                          
                         
                           ( 
                           t 
                           ) 
                         
                       
                     
                     = 
                     
                       { 
                       
                         
                           
                             
                               
                                 
                                   ( 
                                   
                                     
                                       A 
                                       max 
                                     
                                     + 
                                     
                                       
                                         dv 
                                         l 
                                       
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     + 
                                     c 
                                   
                                   ) 
                                 
                                 / 
                                 b 
                               
                               , 
                             
                           
                           
                             
                               
                                 t 
                                 ∈ 
                                 
                                   [ 
                                   
                                     0 
                                     , 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                   
                                   ] 
                                 
                               
                               , 
                             
                           
                         
                         
                           
                             
                               
                                 u 
                                  
                                 
                                   ( 
                                   
                                     t 
                                     - 
                                     
                                       t 
                                       1 
                                       * 
                                     
                                   
                                   ) 
                                 
                               
                               , 
                             
                           
                           
                             
                               
                                 t 
                                 ∈ 
                                 
                                   [ 
                                   
                                     
                                       t 
                                       1 
                                       * 
                                     
                                     , 
                                     
                                       t 
                                       2 
                                       * 
                                     
                                   
                                   ] 
                                 
                               
                               , 
                             
                           
                         
                         
                           
                             
                               
                                 
                                   ( 
                                   
                                     
                                       A 
                                       min 
                                     
                                     + 
                                     
                                       
                                         dv 
                                         r 
                                       
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     + 
                                     c 
                                   
                                   ) 
                                 
                                 / 
                                 b 
                               
                               , 
                             
                           
                           
                             
                               t 
                               ∈ 
                               
                                 
                                   [ 
                                   
                                     
                                       t 
                                       2 
                                       * 
                                     
                                     , 
                                     
                                       t 
                                       f 
                                     
                                   
                                   ] 
                                 
                                 . 
                               
                             
                           
                         
                       
                     
                   
                 
               
             
           
         
       
       
         
           
             Where (x,v,u) is the optimal solution to the TBVP as given by equation (12). 
           
         
       
     
         [0000]    
       
         
               
             
               
               
             
           
               
                 TABLE 3 
               
             
             
               
                   
               
               
                 Detailed description of parameters in flow charts 
               
             
          
           
               
                 label 
                 Detailed description of the parameters 
               
               
                   
               
               
                 P1 
                 P1 plus includes e k , k, t a     k    and t b     k   . 
               
               
                   
                 e k  is the switch time error of the k-th iteration; 
               
               
                   
                 k is the number of iterations; 
               
               
                   
                 t a     k    and t b     k    are the approximated switch time corresponding to t 1 * 
               
               
                   
                 and t 2 *. 
               
               
                 P2 
                 If k = 1, then P2 is identical to P1. Otherwise, P2 includes P1 plus 
               
               
                   
                 λ v (t a     k   ), λ v (t b     k   ), λ x . 
               
               
                 P3 
                 P3 includes P1 plus the BC for the analytic solver (TBVP solver), 
               
               
                   
                 which include the initial time t a     k   , the final time t b     k   , and x(t a     k   ) = 
               
               
                   
                 x 1 (t a     k   ), x(t b     k   ) = x r (t b     k   ), v(t a     k   ) = v 1 (t a     k   ), 
               
               
                   
                 v(t b     k   ) = v r (t b     k   ). 
               
               
                 P4 
                 P4 includes t a     k   , t b     k   , λ v (t a     k   ), λ v (t b     k   ), λ x , k, x(t a     k   ), 
               
               
                   
                 x(t b     k   ), v(t a     k   ), v(t b     k   ). 
               
               
                 P5 
                 P5 includes t 1 *, t 2 *, λ v (t 1 *), λ v (t 2 *), λ x , x(t 1 *), x(t 2 *), v(t 1 *), 
               
               
                   
                 v(t 2 *). 
               
               
                   
                 Note that t 1 * = 0 and t 2 * = t f  if the acceleration constraints are 
               
               
                   
                 satisfied. 
               
               
                 P6 
                 P6 includes η i , i, δ i . 
               
               
                   
                 η i  is the error related to the accuracy of the solution. 
               
               
                   
                 i is the number of iterations. 
               
               
                   
                 δ i  is an approximation of the velocity constraint saturation time 
               
               
                   
                 t 4 *-t 3 *. 
               
               
                 P7 
                 P7 includes {δ i }, i, x(0), x(τ f ), v(0), v(τ f ), τ f . P7 also includes {η i } 
               
               
                   
                 when i &gt; 1. 
               
               
                 P8 
                 P8 includes P7 plus λ v (0), λ v (τ f ), λ x . 
               
               
                 P9 
                 P9 includes {δ i }, {η i }, i. 
               
               
                 P10 
                 P10 includes x(0), x(τ f ), v(0), v(τ f ), τ f . 
               
               
                 P11 
                 P11 includes Δ t *, x(0), x(t f -Δ t *), v(0), v(t f -Δ t *), λ v (0), λ v (t f -Δ t *), 
               
               
                   
                 λ x . 
               
               
                 P12 
                 P12 includes ({tilde over (x)}*(t), {tilde over (v)}*(t), ũ*(t)), t ∈ [0, t f -Δ t *], which is the optimal 
               
               
                   
                 solution to Problem 1 without the state constraint v ≦ v max , with 
               
               
                   
                 final position x f -Δ t *v max , and final time t f -Δ t *. 
               
               
                   
               
             
          
         
       
     
         [0088]    The above method above is guaranteed to generate the optimal solution for the acceleration constrained energy optimal motor control problem. 
         [0089]    Method for Solving the MBVP with Active Velocity Constraint Next, we describe a method for solving the energy optimal motor control problem when the velocity constraint is active.  FIG. 7  shows different types of arcs in the optimal trajectory subject to acceleration constraints. Specifically,  710  is a acceleration constrained arc,  720  is an unconstrained arc,  730  is a speed constrained arc, and  740  is a deceleration constrained arc. 
         [0090]    As shown in  FIG. 7 , when the velocity constraint is active in the optimal solution, the optimal velocity profile contains two switching times including t 3 * and t 4 *. At t 3 *, the optimal velocity profile switches from unconstrained arc to v=v max , while at t 4 * the optimal velocity profile switches from v=v max  back to unconstrained arc. 
         [0091]    Similar to the acceleration constrained case, the optimal control approach for solving the velocity constrained case also leads to a MBVP, which is even more complicated and difficult to solve than that of the acceleration constrained case. Hence, we provide a method for solving the velocity constrained energy optimal motor control problem. 
         [0092]    Let (x*, v*, u*) be the optimal solution to Problem 1 with final position x f  and final time t f . Suppose the state constraint v≦v max  is active on the interval [t 3 *,t 4 *], such that v≦v ma  if and only if tε[t 3 *,t 4 *], where t 3 * and t 4 * are the optimal switch time entering and exiting the state constraint. Let Δ t *=t 4 *−t 3 *, and let ({tilde over (x)}*, {tilde over (v)}*, ũ*) be the optimal solution to Problem 3 with final position x f −Δ t *v max , and final time t f −Δ t *. Then (x*, v*,u*) and ({tilde over (x)}*, {tilde over (v)}*, ũ*) are related by 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             
                               
                                 x 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   x 
                                   ~ 
                                 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 v 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   v 
                                   ~ 
                                 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                           
                           , 
                           
                             t 
                             ∈ 
                             
                               [ 
                               
                                 0 
                                 , 
                                 
                                   t 
                                   3 
                                   * 
                                 
                               
                               ) 
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 u 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   u 
                                   ~ 
                                 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                           
                           , 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   14 
                   ) 
                 
               
             
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             
                               
                                 x 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   
                                     x 
                                     ~ 
                                   
                                   * 
                                 
                                  
                                 
                                   ( 
                                   
                                     t 
                                     3 
                                     * 
                                   
                                   ) 
                                 
                               
                               + 
                               
                                 
                                   v 
                                   max 
                                 
                                  
                                 
                                   ( 
                                   
                                     t 
                                     - 
                                     
                                       t 
                                       3 
                                       * 
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 v 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               v 
                               max 
                             
                           
                           , 
                           t 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 u 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   dv 
                                   max 
                                 
                                 + 
                                 c 
                               
                               b 
                             
                           
                           , 
                           
                             t 
                             ∈ 
                             
                               [ 
                               
                                 
                                   t 
                                   3 
                                   * 
                                 
                                 , 
                                 
                                   t 
                                   4 
                                   * 
                                 
                               
                               ] 
                             
                           
                           , 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   15 
                   ) 
                 
               
             
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             
                               
                                 x 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   
                                     x 
                                     ~ 
                                   
                                   * 
                                 
                                  
                                 
                                   ( 
                                   
                                     t 
                                     - 
                                     
                                       Δ 
                                       t 
                                       * 
                                     
                                   
                                   ) 
                                 
                               
                               + 
                               
                                 
                                   Δ 
                                   t 
                                   * 
                                 
                                  
                                 
                                   v 
                                   max 
                                 
                               
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 v 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   v 
                                   ~ 
                                 
                                 * 
                               
                                
                               
                                 ( 
                                 
                                   t 
                                   - 
                                   
                                     Δ 
                                     t 
                                     * 
                                   
                                 
                                 ) 
                               
                             
                           
                           , 
                           
                             t 
                             ∈ 
                             
                               [ 
                               
                                 
                                   t 
                                   4 
                                   * 
                                 
                                 , 
                                 
                                   t 
                                   f 
                                 
                               
                               ] 
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 u 
                                 * 
                               
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                             = 
                             
                               
                                 
                                   u 
                                   ~ 
                                 
                                 * 
                               
                                
                               
                                 ( 
                                 
                                   t 
                                   - 
                                   
                                     Δ 
                                     t 
                                     * 
                                   
                                 
                                 ) 
                               
                             
                           
                           , 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   16 
                   ) 
                 
               
             
           
         
       
     
         [0093]    Hence, if Δ t * is determined, then ({tilde over (x)}*, {tilde over (v)}*, ũ*) can be solved, from which (x*, v*, u*) can be determined using Eqns. (14-16). 
         [0094]    The value Δ t * is decided from the condition that 
         [0000]      max t   {tilde over (v)} *( t )= v   max , 
         [0000]      or, equivalently, 
         [0000]        {tilde over (v)}* ( t )| {tilde over ({dot over (v)}(t)=0   =v   max . 
         [0095]      FIG. 8  shows the steps of the optimal solution for Problem 1. The partial equivalence between the two optimal velocity profiles v* and {tilde over (v)}* are shown in  FIG. 9 . 
         [0096]    The steps in  FIG. 8  are described in detail below: 
         [0097]    Detailed Description Step
     800  Initialize the solver by setting η i =1, where 0&lt;ε&lt;&lt;1 is the tolerance parameter deciding the accuracy of the final solution, Let i=1 and δ i =0.     805  Solve Problem 3 with initial time 0, final time τ f =t f −δ i  and BC x o =0, v 0 =0, x(τ 1 )=x f −δ i v max , v(τ f )=0.     810  Solve the equation {dot over (v)}(t s )=0 for t s ε[t 1 *,t 2 *] using the standard Newton&#39;s method. Then max t  {tilde over (v)}(t)=v(t s ). η i =v(t s )−v max .     815  If η i ≦0, then the velocity constraint is not violated, the optimal solution is found, goto step S6. Otherwise, the velocity constraint is violated, then let i=i+1, and go to step S11,     820  If i=2, make a guess δ i ε(0,t f ) of the velocity constraint saturation time. A reasonable guess would be   
 
         [0000]    
       
         
           
             
               δ 
               i 
             
             = 
             
               
                 
                   
                     A 
                     min 
                   
                   
                     2 
                      
                     
                       ( 
                       
                         
                           A 
                           min 
                         
                         - 
                         
                           A 
                           max 
                         
                       
                     
                   
                 
                  
                 
                   [ 
                   
                     
                       t 
                       f 
                     
                     - 
                     
                       
                         
                           t 
                           f 
                           2 
                         
                         + 
                         
                           2 
                            
                           
                             ( 
                             
                               
                                 
                                   A 
                                   max 
                                 
                                 - 
                                 
                                   A 
                                   min 
                                 
                               
                               
                                 
                                   A 
                                   max 
                                 
                                  
                                 
                                   A 
                                   min 
                                 
                               
                             
                             ) 
                           
                            
                           
                             χ 
                             f 
                           
                         
                       
                     
                   
                   ] 
                 
               
               . 
             
           
         
       
     
         [0000]    Otherwise, update δ i  using the Newton&#39;s method as 
         [0000]    
       
         
           
             
               
                 δ 
                 i 
               
               = 
               
                 
                   δ 
                   
                     i 
                     - 
                     1 
                   
                 
                 - 
                 
                   
                     
                       ( 
                       
                         
                           
                             η 
                             
                               i 
                               - 
                               1 
                             
                           
                           - 
                           
                             η 
                             
                               i 
                               - 
                               2 
                             
                           
                         
                         
                           
                             δ 
                             
                               i 
                               - 
                               1 
                             
                           
                           - 
                           
                             δ 
                             
                               i 
                               - 
                               2 
                             
                           
                         
                       
                       ) 
                     
                     
                       - 
                       1 
                     
                   
                    
                   
                     η 
                     
                       i 
                       - 
                       1 
                     
                   
                 
               
             
             , 
           
         
       
       
           825  Set up the BC x(0)=0, v(0)=0 at the initial time t=0, and x(τ f )=x f −δ i v max , v(τ f ) 0 at the final time τ f =t f −δ i . 
           830  Solve Problem 3 with the BC specified in S12. 
           835  If |η i |&lt;ε, then the specified tolerance is met, go to S15. Otherwise, let i=i+1, and go to step S11. 
           840  Specify the velocity saturation time in the optimal solution with Δ t *=δ i . The corresponding BC for Problem 3 would be x(0)=0, v(0)=0 at the initial time t=0, and x(τ f )=x f −Δ t *v max , v(τ f )=0 at the final time t=τ t =t f −Δ t *. 
           845  Recover the trajectory of Problem 1 with simplified cost function from the optimal solution of Problem 3 as described by equations (14), (15), and (16). 
       
     
         [0108]    Optimal Solutions 
         [0109]    The optimal solution for three representative cases given by the disclosed method are shown in  FIGS. 10A-10C ,  11 A- 11 C, and  12 A- 12 C. It is clear that our method fully addresses the acceleration and velocity constraints such that the optimal solutions found by the disclosed method do not violate any constraints. 
         [0110]    Using our method, it takes less than 40 ms to find the optimal solution for each test case. The average computation time is 7.2 ms, which is fast enough for real time energy saving motor control applications. 
         [0111]    Although the invention has been described by way of examples of preferred embodiments, it is to be understood that various other adaptations and modifications may be made within the spirit and scope of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention.