-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further development and rework of the EVCS (Electric Vehicle Charging…
… Station) components (#1263) * Changed small time issues in the keba implementation. Added unknown state in the UI. * Added EvcsPower and therefore a new Filter "RampFilter". Because of that, every ManagedEvcs impl. needs a the current reference of the EvcsPowerComponent, to have the global ramp filter and in the future other things of the EvcsPower Interface. Initial rework of the EvcsCluster. Small format changes. * Wrote new test for the EVCS controller. * changed a testcase in the EvcsController test, to check the changes in the config instead of checking the _Property Channels. * Evcs Cluster: Created a new unit test and changed a few things in the Evcs Cluster components. * EvcsController: Changed code for the disabled charging mode and adapted the tests * EvcsCluster: Changed code for the minimumGuaranteed power that a charging station needs and adapted the tests * Changed the hadling of the maximum Power of an EVCS. It will be used that value of the maximumum for calculation, but the sent charge power will be like before. * General changes for the EnergySession calculation if there's only a total energy value. Adjustments to the ABL implementation * Send also a chargePowerRequest of 0 if charging is disabled * Added logic, to reduce the value calculated from the "maximum allowed discharge power" of the ess, to avoid certain jumps to zero, if the essSoc gets lower. * Added a total energy value in the EVCS Nature (ACTIVE_CONSUMPTION_ENERGY). Set the total energy and session energy depending on one energy value form the chargingstation (depending on the chargingstation we get the total or the session energy). * Rework of the energy calculation. Co-authored-by: Stefan Feilmeier <[email protected]>
- Loading branch information
1 parent
b564862
commit ab3cc8e
Showing
50 changed files
with
2,517 additions
and
860 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
...dge/ess/core/power/DisabledPidFilter.java → ...edge/common/filter/DisabledPidFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
io.openems.edge.common/src/io/openems/edge/common/filter/DisabledRampFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.openems.edge.common.filter; | ||
|
||
/** | ||
* This implementation ignores the Ramp filter and instead just returns the | ||
* unfiltered target value - making sure it is within the allowed minimum and | ||
* maximum limits. It is used when the using Component is configured to disable | ||
* Ramp filter. | ||
*/ | ||
public class DisabledRampFilter extends RampFilter { | ||
|
||
@Override | ||
public int applyRampFilter(int input, int target) { | ||
return this.applyLowHighLimits(target); | ||
} | ||
} |
110 changes: 110 additions & 0 deletions
110
io.openems.edge.common/src/io/openems/edge/common/filter/RampFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
package io.openems.edge.common.filter; | ||
|
||
import io.openems.common.exceptions.OpenemsException; | ||
|
||
/** | ||
* A controller that increases the input by a given increase rate. | ||
*/ | ||
public class RampFilter { | ||
|
||
public static final double DEFAULT_INCREASE_RATE = 0.05; | ||
|
||
private double increasingRate; | ||
|
||
private Integer lowLimit = null; | ||
private Integer highLimit = null; | ||
|
||
/** | ||
* Creates a RampFilter | ||
* | ||
* @param increasingRate the rate of increase | ||
*/ | ||
public RampFilter(double increasingRate) { | ||
this.increasingRate = DEFAULT_INCREASE_RATE; | ||
if (increasingRate > 0 && increasingRate < 1) { | ||
this.increasingRate = increasingRate; | ||
} | ||
} | ||
|
||
/** | ||
* Creates a RampFilter using default values | ||
*/ | ||
public RampFilter() { | ||
this(DEFAULT_INCREASE_RATE); | ||
} | ||
|
||
/** | ||
* Limit the output value. | ||
* | ||
* @param lowLimit lowest allowed output value | ||
* @param highLimit highest allowed output value | ||
*/ | ||
public void setLimits(Integer lowLimit, Integer highLimit) { | ||
if (lowLimit != null && highLimit != null && lowLimit > highLimit) { | ||
throw new IllegalArgumentException( | ||
"Given LowLimit [" + lowLimit + "] is higher than HighLimit [" + highLimit + "]"); | ||
} | ||
this.lowLimit = lowLimit; | ||
this.highLimit = highLimit; | ||
} | ||
|
||
/** | ||
* Apply the filter using the current Channel value as input and the target | ||
* value. | ||
* | ||
* @param input the input value, e.g. the measured Channel value | ||
* @param target the target value | ||
* @return the filtered set-point value | ||
* @throws OpenemsException | ||
*/ | ||
public int applyRampFilter(int input, int target) throws OpenemsException { | ||
|
||
// Pre-process the target value: apply output value limits | ||
target = this.applyLowHighLimits(target); | ||
|
||
// Make sure that there is a highLimit set | ||
if (this.highLimit == null) { | ||
throw new OpenemsException( | ||
"No high limit given in EvcsFilter. Please call setLimits bevore applying the filter."); | ||
} | ||
|
||
// We are already there | ||
if (input == target) { | ||
return target; | ||
} | ||
|
||
// Calculate the next additional power | ||
double additionalPower = this.highLimit * this.increasingRate; | ||
|
||
// Next power | ||
double output = input; | ||
if (input < target) { | ||
// input should increase | ||
output += additionalPower; | ||
output = output > target ? target : output; | ||
} else { | ||
// input should decrease | ||
output -= additionalPower; | ||
output = output < target ? target : output; | ||
} | ||
|
||
// Post-process the output value: convert to integer | ||
return Math.round((float) output); | ||
} | ||
|
||
/** | ||
* Applies the configured PID low and high limits to a value. | ||
* | ||
* @param value the input value | ||
* @return the value within low and high limit | ||
*/ | ||
protected int applyLowHighLimits(int value) { | ||
if (this.lowLimit != null && value < this.lowLimit) { | ||
value = this.lowLimit; | ||
} | ||
if (this.highLimit != null && value > this.highLimit) { | ||
value = this.highLimit; | ||
} | ||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.