Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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
00253
00254 protected:
00255
00264 returnValue determineControlAction( const DVector& error,
00265 DVector& output
00266 );
00267
00268
00269
00270
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
00295