mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 11:29:53 +03:00
get rid of drop ratio and PID controller
This commit is contained in:
parent
9f9aa84170
commit
c50c28919b
4 changed files with 1 additions and 159 deletions
|
@ -3,7 +3,6 @@
|
|||
const CONFIGURATOR = require('./data_storage');
|
||||
const MSPCodes = require('./msp/MSPCodes');
|
||||
const SimpleSmoothFilter = require('./simple_smooth_filter');
|
||||
const PidController = require('./pid_controller');
|
||||
const eventFrequencyAnalyzer = require('./eventFrequencyAnalyzer');
|
||||
const mspDeduplicationQueue = require('./msp/mspDeduplicationQueue');
|
||||
|
||||
|
@ -28,29 +27,9 @@ var mspQueue = function () {
|
|||
|
||||
privateScope.currentLoad = 0;
|
||||
|
||||
/**
|
||||
* PID controller used to perform throttling
|
||||
* @type {PidController}
|
||||
*/
|
||||
privateScope.loadPidController = new PidController();
|
||||
privateScope.loadPidController.setTarget(privateScope.targetLoad);
|
||||
privateScope.loadPidController.setOutput(0, 99, 0);
|
||||
privateScope.loadPidController.setGains(5, 6, 3);
|
||||
privateScope.loadPidController.setItermLimit(0, 90);
|
||||
|
||||
privateScope.dropRatio = 0;
|
||||
|
||||
privateScope.removeCallback = null;
|
||||
privateScope.putCallback = null;
|
||||
|
||||
publicScope.computeDropRatio = function () {
|
||||
privateScope.dropRatio = privateScope.loadPidController.run(publicScope.getLoad());
|
||||
};
|
||||
|
||||
publicScope.getDropRatio = function () {
|
||||
return privateScope.dropRatio;
|
||||
};
|
||||
|
||||
privateScope.queue = [];
|
||||
|
||||
privateScope.softLock = false;
|
||||
|
@ -229,12 +208,10 @@ var mspQueue = function () {
|
|||
*/
|
||||
publicScope.put = function (mspRequest) {
|
||||
|
||||
console.log('Received message ', mspRequest.code);
|
||||
|
||||
const isMessageInQueue = mspDeduplicationQueue.check(mspRequest.code);
|
||||
|
||||
if (isMessageInQueue) {
|
||||
console.log('Message already in queue: ' + mspRequest.code);
|
||||
eventFrequencyAnalyzer.put('MSP Duplicate ' + mspRequest.code);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -286,7 +263,6 @@ var mspQueue = function () {
|
|||
|
||||
publicScope.balancer = function () {
|
||||
privateScope.currentLoad = privateScope.loadFilter.get();
|
||||
publicScope.computeDropRatio();
|
||||
|
||||
/*
|
||||
* Also, check if port lock if hanging. Free is so
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue