pid_controller.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
33 #ifndef ACADO_TOOLKIT_PID_CONTROLLER_HPP
34 #define ACADO_TOOLKIT_PID_CONTROLLER_HPP
35 
36 
39 
42 
43 
45 
46 
68 {
69  //
70  // PUBLIC MEMBER FUNCTIONS:
71  //
72  public:
73 
76  PIDcontroller( );
77 
85  PIDcontroller( uint _nInputs,
86  uint _nOutputs,
87  double _samplingTime = DEFAULT_SAMPLING_TIME
88  );
89 
95  );
96 
99  virtual ~PIDcontroller( );
100 
106  );
107 
112  virtual ControlLaw* clone( ) const;
113 
114 
122  returnValue setProportionalWeights( const DVector& _pWeights
123  );
124 
132  returnValue setIntegralWeights( const DVector& _iWeights
133  );
134 
142  returnValue setDerivativeWeights( const DVector& _dWeights
143  );
144 
145 
156  virtual returnValue init( double startTime = 0.0,
157  const DVector &x0_ = emptyConstVector,
158  const DVector &p_ = emptyConstVector,
160  );
161 
162 
175  virtual returnValue step( double currentTime,
176  const DVector& _x,
177  const DVector& _p = emptyConstVector,
179  );
180 
181 
186  inline uint getNumInputs( ) const;
187 
192  inline uint getNumOutputs( ) const;
193 
194 
200  virtual uint getNX( ) const;
201 
206  virtual uint getNXA( ) const;
207 
213  virtual uint getNU( ) const;
214 
219  virtual uint getNP( ) const;
220 
225  virtual uint getNW( ) const;
226 
231  virtual uint getNY( ) const;
232 
233 
240  virtual BooleanType isDynamic( ) const;
241 
247  virtual BooleanType isStatic( ) const;
248 
249 
250 
251  //
252  // PROTECTED MEMBER FUNCTIONS:
253  //
254  protected:
255 
265  DVector& output
266  );
267 
268 
269  //
270  // DATA MEMBERS:
271  //
272  protected:
282 };
283 
284 
286 
287 
288 #include <acado/control_law/pid_controller.ipp>
289 
290 
291 #endif // ACADO_TOOLKIT_PID_CONTROLLER_HPP
292 
293 /*
294  * end of file
295  */
uint getNumOutputs() const
virtual BooleanType isStatic() const
virtual returnValue step(double currentTime, const DVector &_x, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)
virtual uint getNXA() const
Provides a time grid consisting of vector-valued optimization variables at each grid point...
virtual uint getNX() const
Allows to pass back messages to the calling function.
returnValue setDerivativeWeights(const DVector &_dWeights)
virtual ~PIDcontroller()
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
returnValue setProportionalWeights(const DVector &_pWeights)
virtual uint getNY() const
returnValue determineControlAction(const DVector &error, DVector &output)
PIDcontroller & operator=(const PIDcontroller &rhs)
virtual uint getNU() const
#define CLOSE_NAMESPACE_ACADO
virtual uint getNP() const
virtual ControlLaw * clone() const
returnValue setIntegralWeights(const DVector &_iWeights)
static const DVector emptyConstVector
Definition: vector.hpp:336
void rhs(const real_t *x, real_t *f)
const double DEFAULT_SAMPLING_TIME
Allows to transform the output of the ControlLaw before passing it to the Process.
virtual returnValue init(double startTime=0.0, const DVector &x0_=emptyConstVector, const DVector &p_=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)
uint getNumInputs() const
#define BEGIN_NAMESPACE_ACADO
virtual BooleanType isDynamic() const
USING_NAMESPACE_ACADO void output(const char *name, const Expression &e)
Implements a PID control law to be used within a Controller.
Base class for interfacing online feedback laws to be used within a Controller.
Definition: control_law.hpp:64
static const VariablesGrid emptyConstVariablesGrid
virtual uint getNW() const


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:59