Notaði fyrrum p_controller og bætti við virtual pi_controller

This commit is contained in:
2026-09-30 18:59:51 +00:00
parent 48f2d1aa43
commit d9ded44895
7 changed files with 59 additions and 17 deletions
+9 -5
View File
@@ -8,7 +8,8 @@ MotorController::MotorController(
RotaryEncoderDriver& encoder,
MotorDriver& motor,
//P_controller& controller,
PI_controller& controller;
//PI_controller& controller;
Controller& controller,
State& initialization,
State& operational,
State& stopped
@@ -59,6 +60,8 @@ void MotorController::transition_to(State& new_state)
current_state = &new_state;
current_state->set_context(this);
current_state->enter();
}
@@ -131,6 +134,11 @@ bool MotorController::fault_active()
return motor.fault_active();
}
void MotorController::reset_controller()
{
controller.reset();
}
void MotorController::led_on()
{
led.set_hi();
@@ -142,7 +150,3 @@ void MotorController::led_off()
led.set_lo();
}
void MotorController::reset_controller()
{
controller.reset();
}