X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/rpi-motor-control.git/blobdiff_plain/b98f70ee3eed3af0cbbc9d5869ac1e7626534ef4..34c6632a92d19c06bbdef9dcc4eb754b21ade81d:/pmsm-control/test_sw/controllers.h diff --git a/pmsm-control/test_sw/controllers.h b/pmsm-control/test_sw/controllers.h new file mode 100644 index 0000000..520745e --- /dev/null +++ b/pmsm-control/test_sw/controllers.h @@ -0,0 +1,38 @@ +/** + * \brief + * Speed and position regulators. + * \author Martin Prudek + * \file controllers.h + * + */ +#ifndef CONTROLLERS +#define CONTROLLERS + +#include "pmsm_state.h" /*pmsm state*/ +#include "rp_spi.h" /*spi struct*/ + +#define PID_P 0.3 + +/* RL-tool results from first order system approx */ +/* P=0.16 I=13,4/freq=0.013 */ +/* Hodnoty upraveny podle skutecnych vysledku */ +/* P=0.8 I=0.01 */ + +#define PID_P_S 0.16 /*2.3 kmita*/ /*1.4 vhodne jen pro P regulator*/ +#define PID_I_S 0.0134 + +/** + * \brief + * Very simple position P regulator. + * Now only with P-part so that the error doesnt go to zero. + */ +void pos_pid(struct rpi_state* state); + +/** + * \brief + * Very simple PI speed regulator. + */ +void spd_pid(struct rpi_state* state); + + +#endif /*CONTROLLERS*/