Skip to content

Commit

Permalink
get rid of drop ratio and PID controller
Browse files Browse the repository at this point in the history
  • Loading branch information
DzikuVx committed Apr 26, 2024
1 parent 9f9aa84 commit c50c289
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 159 deletions.
3 changes: 0 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,6 @@ <h2 class="groundstation-telemetry__header" data-i18n="gsTelemetry"></h2>
<div>
<span id="hardware-roundtrip"> </span>
</div>
<div>
<span id="drop-rate"> </span>
</div>
<div>
<span data-i18n="statusbar_arming_flags"></span> <span class="arming-flags">-</span>
</div>
Expand Down
130 changes: 0 additions & 130 deletions js/pid_controller.js

This file was deleted.

1 change: 0 additions & 1 deletion js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ var SerialBackend = (function () {
$('#msp-load').text("MSP load: " + mspQueue.getLoad().toFixed(1));
$('#msp-roundtrip').text("MSP round trip: " + mspQueue.getRoundtrip().toFixed(0));
$('#hardware-roundtrip').text("HW round trip: " + mspQueue.getHardwareRoundtrip().toFixed(0));
$('#drop-rate').text("Drop ratio: " + mspQueue.getDropRatio().toFixed(0) + "%");
}, 100);

interval.add('global_data_refresh', periodicStatusUpdater.run, periodicStatusUpdater.getUpdateInterval(CONFIGURATOR.connection.bitrate), false);
Expand Down
26 changes: 1 addition & 25 deletions js/serial_queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c50c289

Please sign in to comment.