YARP
Yet Another Robot Platform
ControlBoardPid.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <yarp/dev/api.h>
8
9#ifndef YARP_DEV_CONTROLBOARDPID_H
10#define YARP_DEV_CONTROLBOARDPID_H
11
16namespace yarp::dev {
17class Pid;
18}
19
24{
25public:
26 double kp;
27 double kd;
28 double ki;
29 double max_int;
30 double scale;
31 double max_output;
32 double offset;
35 double kff;
36
37public:
41 Pid();
42
47
58 Pid(double kp, double kd, double ki, double int_max, double scale, double out_max);
59
73 Pid(double kp, double kd, double ki,
74 double int_max, double scale, double out_max, double st_up, double st_down, double kff);
75
81 void setKp(double p);
82
88 void setKi(double i);
89
95 void setKd(double d);
96
102 void setMaxInt(double m);
103
109 void setScale(double sc);
110
116 void setMaxOut(double m);
117
123 void setOffset(double o);
124
131 void setStictionValues(double up_value, double down_value);
132
138 void setKff(double Kff);
139
145 bool operator==(const yarp::dev::Pid &p) const;
146
151 void clear();
152};
153
154#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.
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18