bætti við prentskipunum til þess að geta plottað step response

This commit is contained in:
2026-10-01 12:42:35 +00:00
parent bf389cd012
commit e39d9e487e
6 changed files with 160 additions and 38 deletions
+11 -1
View File
@@ -9,6 +9,15 @@
class State;
// Gildi úr einni keyrslu á hraðastýringunni, til útprentunar
struct ControlSample
{
double ref_rpm;
double actual_rpm;
double pwm_actual;
};
class MotorController
{
private:
@@ -60,7 +69,8 @@ public:
bool fault_active();
void run_speed_controller();
// Skilar true ef ný mæling var tekin og sample fyllt út
bool run_speed_controller(ControlSample& sample);
void stop_motor();
+8
View File
@@ -3,9 +3,17 @@
#include "state.h"
#include <stdint.h>
class OperationalState : public State
{
private:
static constexpr double SAMPLE_PERIOD_MS = 4.0;
// uint32_t svo teljarinn flæði ekki yfir eftir ~4 mín (eins og uint16_t)
uint32_t sample_count = 0;
public:
void enter() override;