pid_controller.hpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00033 #ifndef ACADO_TOOLKIT_PID_CONTROLLER_HPP
00034 #define ACADO_TOOLKIT_PID_CONTROLLER_HPP
00035 
00036 
00037 #include <acado/utils/acado_utils.hpp>
00038 #include <acado/function/function.hpp>
00039 
00040 #include <acado/control_law/control_law.hpp>
00041 #include <acado/control_law/clipping_functionality.hpp>
00042 
00043 
00044 BEGIN_NAMESPACE_ACADO
00045 
00046 
00067 class PIDcontroller : public ControlLaw, public ClippingFunctionality
00068 {
00069         //
00070         // PUBLIC MEMBER FUNCTIONS:
00071         //
00072         public:
00073 
00076                 PIDcontroller( );
00077 
00085                 PIDcontroller(  uint _nInputs,
00086                                                 uint _nOutputs,
00087                                                 double _samplingTime = DEFAULT_SAMPLING_TIME
00088                                                 );
00089 
00094                 PIDcontroller(  const PIDcontroller& rhs
00095                                                 );
00096 
00099                 virtual ~PIDcontroller( );
00100 
00105                 PIDcontroller& operator=(       const PIDcontroller& rhs
00106                                                                         );
00107 
00112                 virtual ControlLaw* clone( ) const;
00113 
00114 
00122                 returnValue setProportionalWeights(     const DVector& _pWeights
00123                                                                                         );
00124 
00132                 returnValue setIntegralWeights(         const DVector& _iWeights
00133                                                                                         );
00134 
00142                 returnValue setDerivativeWeights(       const DVector& _dWeights
00143                                                                                         );
00144 
00145 
00156                 virtual returnValue init(       double startTime = 0.0,
00157                                                                         const DVector &x0_ = emptyConstVector,
00158                                                                         const DVector &p_ = emptyConstVector,
00159                                                                         const VariablesGrid& _yRef = emptyConstVariablesGrid
00160                                                                         );
00161 
00162 
00175                 virtual returnValue step(       double currentTime,
00176                                                                         const DVector& _x,
00177                                                                         const DVector& _p = emptyConstVector,
00178                                                                         const VariablesGrid& _yRef = emptyConstVariablesGrid
00179                                                                         );
00180 
00181 
00186                 inline uint getNumInputs( ) const;
00187 
00192                 inline uint getNumOutputs( ) const;
00193 
00194 
00200                 virtual uint getNX( ) const;
00201 
00206                 virtual uint getNXA( ) const;
00207 
00213                 virtual uint getNU( ) const;
00214 
00219                 virtual uint getNP( ) const;
00220 
00225                 virtual uint getNW( ) const;
00226 
00231                 virtual uint getNY( ) const;
00232 
00233 
00240                 virtual BooleanType isDynamic( ) const;
00241 
00247                 virtual BooleanType isStatic( ) const;
00248 
00249 
00250 
00251         //
00252         // PROTECTED MEMBER FUNCTIONS:
00253         //
00254         protected:
00255 
00264                 returnValue determineControlAction(     const DVector& error,
00265                                                                                         DVector& output
00266                                                                                         );
00267 
00268 
00269         //
00270         // DATA MEMBERS:
00271         //
00272         protected:
00273                 uint nInputs;                                   
00274                 uint nOutputs;                                  
00276                 DVector pWeights;                               
00277                 DVector iWeights;                               
00278                 DVector dWeights;                               
00280                 DVector iValue;                                 
00281                 DVector lastError;                              
00282 };
00283 
00284 
00285 CLOSE_NAMESPACE_ACADO
00286 
00287 
00288 #include <acado/control_law/pid_controller.ipp>
00289 
00290 
00291 #endif  // ACADO_TOOLKIT_PID_CONTROLLER_HPP
00292 
00293 /*
00294  *      end of file
00295  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:38:41