Michael Thomas Flanagan's Java Scientific Library

Prop Class:      Proportional Controller

     

Last update: 8 November 2009                                                                                                                              Main Page of Michael Thomas Flanagan's Java Scientific Library

This class contains the constructor to create an instance of a Proportional Gain (P) controller and the methods to use this in both continuous time and discrete control simulations.
The proportional controller may be described by the Equation 1:

where i(t) is the input to the controller, o(t) is the output and kp is the proportional gain.
This is a subclass of the superclass BlackBox

import directive: import flanagan.control.Prop;

SUMMARY OF CONSTRUCTORS AND METHODS

METHODS FOUND ONLY IN THE SUBCLASS Prop

Constructors   public Prop()
  public Prop(double kp)
Set up the controller Set the P gains public void setKp(double kp)
Get the P gains public double getKp()

METHODS INHERITED FROM THE SUPERCLASS BlackBox

Deep Copy   public Prop copy()
Overridden
public Object clone()
Overridden
s-domain transfer function Get the numerator degree public int getSnumerDeg()
Not overridden
Get the numerator polynomial public ComplexPoly getSnumer()
Not overridden
Get the denominator degree public int getSdenomDeg()
Not overridden
Get the denominator polynomial public ComplexPoly getSdenom()
Not overridden
Set the value of the Laplace s variable public void setS(Complex sValue)
Not overridden
public void setS(double sReal, double sImag)
Not overridden
public void setS(double sImag)
Not overridden
Get the Laplace s value public Complex getS()
Not overridden
Set the input in the s-domain public void setInputS(Complex input)
Not overridden
Get the input in the s-domain public Complex getInputS()
Not overridden
Get the output in the s-domain public Complex getOutputS()
Overridden
public Complex getOutputS(Complex sValue, Complex input)
Overridden
Dead Time
(transportation time)
Set the dead time public void setDeadtime(double deadTime)
Not overridden
public void setDeadtime(double deadTime, double padeOrder)
Not overridden
Get the dead time public double getDeadtime()
Not overridden
Set the Pade order public void setPadeOrder(double padeorder)
Not overridden
Get the Pade order public void setPadeOrder(double padeorder)
Not overridden
Continuous time domain
(uses the s-domain transfer function)
Plot step input transient public void stepInput(double finaltime)
Overridden
public void stepInput(double mag, double finaltime)
Overridden
Plot ramp input transient public void rampInput(double finaltime)
Overridden
public void rampInput(double mag, double finaltime)
Overridden
public void rampInput(int order, double finaltime)
Overridden
public void rampInput(double mag, int order, double finaltime)
Overridden
z-domain transfer function Map s-transfer function into the z-domain public void zTransform()
Overridden
public void zTransform(double deltaT)
Overridden
Get the numerator degree public int getZnumerDeg()
Not overridden
Get the numerator polynomial public ComplexPoly getZnumer()
Not overridden
Get the denominator degree public int getZdenomDeg()
Not overridden
Get the denominator polynomial public ComplexPoly getZdenom()
Not overridden
Set the value of the z variable public void setZ(Complex zValue)
Not overridden
public void setZ(double zReal, double zImag)
Not overridden
Get the z value public Complex getZ()
Not overridden
Sampled signal Set the sampling length public void setSampleLdength(int samplelength)
Not overridden
Get the sampling length public int getSampleLength()
Not overridden
Set the sampling period public void setDeltaT(double deltaT)
Not overridden
Get the sampling period public double getDeltaT()
Not overridden
Set the sampling frequency public void setSampFreq(double sfreq)
Not overridden
Get the sampling frequency public double getSampFreq()
Not overridden
Set the sampled input and time public void setInputT(double time, double input)
Not overridden
Get the current value of the time public double getCurrentTime()
Not overridden
Get the array of times public double[] getTime()
Not overridden
Get the current value of the input public double getCurrentInputT()
Not overridden
Get the array of the inputs public double[] getInputT()
Not overridden
Calculate the current value of the output public double calcOutputT()
Overridden
public double calcOutputT(double time, double input) Overridden
Get the current value of the output public double getCurrentOutputT()
Not overridden
Get the array of the outputs public double getOutputT()
Not overridden
General methods Reset all inputs, outputs and times to zero public void resetZero()
Not overridden
Set the name of the black box public void setName(String name)
Not overridden
Get the name of the black box public String getName()
Not overridden



CONSTRUCTORS

public Prop()
public Prop(double kp)
Usage:                      Prop pg = new Prop();
This constructor creates a new instance of Prop with the proportional gainkp, initialised to unity. It also calculates and stores the s-domain transfer function numerator polynomial and denominator polynomial.
Usage:                      Prop pg = new Prop(kp);
This construcror creates a new instance of Prop with the proportional gain, kp, initialised to the double passed in the argument list, e.g. to kp in the above usage. It also calculates and stores the s-domain transfer function numerator polynomial and denominator polynomial.



SET UP THE PROPORTIONAL GAIN CONTROLLER

SET THE PROPORTIONAL GAIN
public void setKp(double kp)
Usage:                      pg.setKp(kp);
Resets the proportional gain, kp, to the value in the double passed in the argument list, e.g. to kp in the above usage. It also recalculates and stores the s-domain transfer function numerator polynomial and denominator polynomial.





GET THE PROPORTIONAL GAIN
public double getKp()
Usage:                      kp = pg.getKp();
Returns the proportional gain, kp.





GET THE OUTPUT IN THE SAMPLED TIME DOMAIN
public Complex getOutputT()
public Complex getOutputT(double time, Complex input)
Usage:                      output = pg.getOutputT();
Returns the output for a stored sampled input, time and sampling period, deltaT. This method overrides the BlackBox method getOutputT().

Usage:                      output = pg.getOutputT(svalue, input);
Returns the output for a given sampled input and time. The sampling period, deltaT, is calculated using the previous sampling time. This method overloads the BlackBox method getOutputT().



OTHER CLASSES USED BY THIS CLASS

This class is a subclass of BlackBox which uses the following classes in this library:
Prop also calls directly:

This page was prepared by Dr Michael Thomas Flanagan