PID.controller: PID controller, which generates ouptput based on the error

Description Usage Arguments

View source: R/HelpfullFunctions.R

Description

PID controller, which generates ouptput based on the error

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
PID.controller(
  err.vec,
  Kp,
  Ki,
  Kd,
  Kp.db = 1,
  Kp.disc = 0.75,
  Ki.db = Inf,
  Kd.db = 1,
  Kd.disc = 0.75,
  Ki.disc = 0.75
)

Arguments

err.vec

A vector with the error terms (discrepancies of the result and the value)

Kp

Factor measuring how strong we want to turn based on proportial gain

Ki

Factor measuring how strong we want to turn based on integral gain

Kd

Factor measuring how strong we want to turn based on derivative gain

Kp.db

How many data points should be used to calculate the proportional effect? By default the standard procedure is used, e.g. only the last data point. If there is a lot of noise in the environment it might be prudent to use a higher number.

Kp.disc

When calculating the proportional effect based on multiple data.points with Kp.db it might be sensible to weight more recent data points higher. This parameter determines the discount factor.

Ki.db

How many data points should be used to calculate the integral? By default the standard procedure is used, e.g. all data points. If there are strong changes in the environment it might be prudent to use a lower number.

Kd.db

How many data points should be used to calculate the derivative? By default the standard procedure is used, e.g. the change between the last two data points. If there is a lot of noise one might want to use a higher number of points.

Kd.disc

When calculating the derivative based on multiple data.points with Kd.db it might be sensible to weight more recent changes higher. This parameter determines the discount factor to determine the weights of former changes.

Ki.disc

When calculating the integral based on multiple data.points with Kp.db it might be sensible to weight more recent data points higher. This parameter determines the discount factor.


MartinKies/RLR documentation built on Dec. 24, 2019, 10:02 p.m.