Robot Simulator of the Robotics Group for Self-Organization of Control: PID Class Reference

# PID Class Reference

`#include <pid.h>`

List of all members.

## Public Member Functions
| PID (double KP=100, double KI=2.0, double KD=0.3)
| KP is used as a general koefficient. KI and KD can be tuned without dependence of KP.
void | setKP (double KP)
void | setTargetPosition (double newpos)
double | getTargetPosition ()
double | step (double newsensorval, double time)
| perform one step of the PID controller with cutoff for large forces
double | stepNoCutoff (double newsensorval, double time)
| perform one step of the PID controller without cutoffs used for Center-Servos
double | stepVelocity (double newsensorval, double time)
| perform one step of the PID controller for velocity control.
## Public Attributes
double | position
double | lastposition
double | last2position
double | error
double | lasterror
double | derivative
double | targetposition
double | KP
double | KI
double | KD
double | tau
double | P
double | D
double | I
double | force
double | lasttime

## Constructor & Destructor Documentation

PID | ( | double | KP = `100`,
|  | double | KI = `2.0`,
|  | double | KD = `0.3` |
| ) |  |  |

KP is used as a general koefficient. KI and KD can be tuned without dependence of KP.

## Member Function Documentation

double getTargetPosition | ( |  | ) |

void setKP | ( | double | KP | ) |

void setTargetPosition | ( | double | newpos | ) |

double step | ( | double | newsensorval,
|  | double | time |
| ) |  |  |

perform one step of the PID controller with cutoff for large forces

double stepNoCutoff | ( | double | newsensorval,
|  | double | time |
| ) |  |  |

perform one step of the PID controller without cutoffs used for Center-Servos

double stepVelocity | ( | double | newsensorval,
|  | double | time |
| ) |  |  |

perform one step of the PID controller for velocity control.

Meaning the misfit is in position space but the output is the nominal velocity. The velocity is also limited. such that the maximal velocity cannot be so that the error is overcompenstated in one timestep.

## Member Data Documentation

double D

double derivative

double error

double force

double I

double KD

double KI

double KP

double last2position

double lasterror

double lastposition

double lasttime

double P

double position

double targetposition

double tau

The documentation for this class was generated from the following files:

- pid.h
- pid.cpp