next up previous contents index
Next: Kalman filters Up: General utilities Previous: Timers

    
PID

The file $VULCAN/src/PID/ defines the class <PID-controller>. The output mn of a PID controller obeys the equation

2#2

where mn is the output of the controller at the nth sampling instant, mR is the reference value at which the control action is initialized, en is the value of the error at the nth sampling instant, Treset is the reset or integral time, kp and kd are the proportional and derivate gains respectively.

The class <PID-controller> has the following public fields:

  (kp           (self <PID-controller>))  // proportional gain
  (kd           (self <PID-controller>))  // derivate gain
  (displacement (self <PID-controller>))  // m_R
  (reset-time   (self <PID-controller>))    
  (max-output   (self <PID-controller>))    
  (min-output   (self <PID-controller>))
In order to use an instance of this class you have to provide values for the public fields above. For example,
(set! mcontroller (mstart (make <PID-controller) kp: 1 kd: 1 reset-time: 0.1
                                                 max-output: 10 min-output:10))
The methods associated with this class are:
 (mstart (self <PID-controller>))
 (update (self <PID-controller>) error)
 (reset (self <PID-controller>))
The method update returns the output of the controller given the current input error. The output is kept always between the maximum and minimum values specified for the controller. In addition, an ``antiwindup'' feature is incorporated in the controller, so that the controller detects when the integral term saturates and stops using the integral term of the controller until the output variable returns to within the control range.


next up previous contents index
Next: Kalman filters Up: General utilities Previous: Timers
Emilio Remolina
2000-10-04