Skip to content

Commit

Permalink
First Stable Test
Browse files Browse the repository at this point in the history
  • Loading branch information
marl0rd committed Jun 24, 2014
1 parent 7aff945 commit 50f8e17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/main/java/gui/GuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class GuiController extends AnchorPane {

// ********** Fields **********//
private ConicalTankProcess conicalTank;
private FirstOrderSystem process;
private PIController controller;
private PITuning piTuning;
private FirstOrderSystem process;
private PIController controller;
private PITuning piTuning;
private Loop loop;

@FXML private TextField heightSetPointTextField;
Expand Down Expand Up @@ -108,7 +108,7 @@ private void registerListeners() {

preferencesMenuItem.setOnAction(value -> showPreferences());

// Loop refresh
// The loop inform about new values, so they are displayed in the gui:
loop.timeStampProperty().addListener(updateGui);
}

Expand Down
11 changes: 4 additions & 7 deletions src/main/java/process/ConicalTankProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,12 @@ protected void invalidated() {

// ********** Methods **********//
private void recalculate(){
double k = (Math.pow(RADIUS, 2) * Math.PI ) / (Math.pow(HEIGHT, 2));

double alpha = ((9/2) *
(OBSTRUCTION * Math.pow(HEIGHT,2) * Math.sqrt(2*GRAVITY) * Math.pow(heightOperationPoint.get(), -5/2)) /
(2 * Math.PI * Math.pow(RADIUS,2))) -
((6 * Math.pow(HEIGHT,2) * inflowOperationPoint.get() * Math.pow(heightOperationPoint.get(),-3)) /
(Math.PI * Math.pow(RADIUS,2)));
double alpha = ((3 * OBSTRUCTION * Math.sqrt(2*GRAVITY) * Math.pow(getHeightOperationPoint(),-5/2)) / (2 * k)) -
((2 * getInflowOperationPoint() * Math.pow(getHeightOperationPoint(), -3)) / (k));

double beta = (3 * Math.pow(HEIGHT,2) * Math.pow(heightOperationPoint.get(),-2)) /
(Math.PI * Math.pow(RADIUS,2));
double beta = Math.pow(getHeightOperationPoint(), -2) / k;

transferFunction.setGain(beta / alpha);
transferFunction.setTau(1 / alpha);
Expand Down

0 comments on commit 50f8e17

Please sign in to comment.