bætti við prentskipunum til þess að geta plottað step response
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user