#include "pmsm_state.h"
#include "commutators.h"
+#include "controllers.h"
/**
* Index Lost.
this->commutate=0;
this->main_commutator=zero_commutator;
}
+
+/**
+ * Turn on speed regulation.
+ */
+inline void setRegulationSpeed(struct rpi_state* this){
+ this->spd_reg_ena=1;
+ this->pos_reg_ena=0;
+ this->main_controller=spd_pid;
+}
+
+/**
+ * \brief Turn on position regulation
+ */
+inline void setRegulationPos(struct rpi_state* this){
+ this->spd_reg_ena=0;
+ this->pos_reg_ena=1;
+ this->main_controller=pos_pid;
+}
+
+/**
+ * \brief Turn off regulation.
+ */
+inline void setRegulationOff(struct rpi_state* this){
+ this->spd_reg_ena=0;
+ this->pos_reg_ena=0;
+ this->main_controller=zero_controller;
+
+
+}