javaclient2.extra
Class PController

java.lang.Object
  extended by javaclient2.extra.Controller
      extended by javaclient2.extra.PController

public class PController
extends Controller

Proportional controller implementation.

Author:
Radu Bogdan Rusu

Field Summary
protected  double kp
          Proportional constant
 
Fields inherited from class javaclient2.extra.Controller
currE, eSum, goal, lastE
 
Constructor Summary
PController(double Kp)
          Constructor for PController.
 
Method Summary
 double getCommand(double currentOutput)
          Calculate and return the controller's command for the controlled system.
 double getKp()
          Get the current value of the proportional constant.
 void setKp(double newKp)
          Set a new value for the proportional constant.
 
Methods inherited from class javaclient2.extra.Controller
deltaE, setGoal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kp

protected double kp
Proportional constant

Constructor Detail

PController

public PController(double Kp)
Constructor for PController.

Parameters:
Kp - the proportional constant
Method Detail

getCommand

public double getCommand(double currentOutput)
Calculate and return the controller's command for the controlled system.

Parameters:
currentOutput - the current output of the system
Returns:
the new calculated command for the system

getKp

public double getKp()
Get the current value of the proportional constant.

Returns:
Kp as a double

setKp

public void setKp(double newKp)
Set a new value for the proportional constant.

Parameters:
newKp - the new value for Kp