YARP
Yet Another Robot Platform
ControlBoardPid.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #include <yarp/dev/api.h>
11 
12 #ifndef YARP_DEV_CONTROLBOARDPID_H
13 #define YARP_DEV_CONTROLBOARDPID_H
14 
19 namespace yarp{
20  namespace dev{
21  class Pid;
22  }
23 }
24 
29 {
30 public:
31  double kp;
32  double kd;
33  double ki;
34  double max_int;
35  double scale;
36  double max_output;
37  double offset;
38  double stiction_up_val;
40  double kff;
41 
42 public:
46  Pid();
47 
51  ~Pid();
52 
63  Pid(double kp, double kd, double ki, double int_max, double scale, double out_max);
64 
78  Pid(double kp, double kd, double ki,
79  double int_max, double scale, double out_max, double st_up, double st_down, double kff);
80 
86  void setKp(double p);
87 
93  void setKi(double i);
94 
100  void setKd(double d);
101 
107  void setMaxInt(double m);
108 
114  void setScale(double sc);
115 
121  void setMaxOut(double m);
122 
128  void setOffset(double o);
129 
136  void setStictionValues(double up_value, double down_value);
137 
143  void setKff(double Kff);
144 
150  bool operator==(const yarp::dev::Pid &p) const;
151 
156  void clear();
157 };
158 
159 #endif // YARP_DEV_CONTROLBOARDPID_H
Contains the parameters for a PID.
double kd
derivative gain
double scale
scale for the pid output
double offset
pwm offset added to the pid output
double stiction_down_val
down stiction offset added to the pid output
void clear()
Set all pid parameters to zero.
double stiction_up_val
up stiction offset added to the pid output
double max_output
max output
void setKp(double p)
Set proportional gain.
~Pid()
Destructor.
Pid()
Default Constructor.
void setMaxOut(double m)
Set max output value for the pid.
double kff
feedforward gain
void setOffset(double o)
Set offset value for the pid.
void setKi(double i)
Set integrative gain.
double ki
integrative gain
double max_int
saturation threshold for the integrator
void setKff(double Kff)
Set the feedforward gain for the pid.
void setStictionValues(double up_value, double down_value)
Set the two stiction values for the pid.
void setScale(double sc)
Set output scale for the pid.
double kp
proportional gain
bool operator==(const yarp::dev::Pid &p) const
return true if all params are equal
void setKd(double d)
Set derivative gain.
void setMaxInt(double m)
Set max threshold for the integrative part.
The main, catch-all namespace for YARP.
Definition: environment.h:18
#define YARP_dev_API
Definition: api.h:19