]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blob - pmsm-control/test_sw/controllers.h
5b241489317a950b0e471ed72d983fc8aa924f6a
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / controllers.h
1 /**
2  * \brief
3  * Speed and position regulators.
4  * \author Martin Prudek
5  * \file controllers.h
6  *
7  */
8 #ifndef CONTROLLERS
9 #define CONTROLLERS
10
11 #include "pmsm_state.h" /*pmsm state*/
12 #include "rp_spi.h"     /*spi struct*/
13
14 #define PID_P           0.3
15
16 /*      RL-tool results from first order system approx  */
17 /*      P=0.16 I=13,4/freq=0.013                        */
18 /*      Hodnoty upraveny podle skutecnych vysledku      */
19 /*      P=0.8   I=0.01                                  */
20
21 #define PID_P_S         0.16            /*2.3 kmita*/ /*1.4 vhodne jen pro P regulator*/
22 #define PID_I_S         0.0134
23
24 /**
25  * \brief No regulation.
26  */
27 inline void zero_controller(struct rpi_state*);
28
29 /**
30  * \brief
31  * Very simple position P regulator.
32  * Now only with P-part so that the error doesnt go to zero.
33  */
34 void pos_pid(struct rpi_state*);
35
36 /**
37  * \brief
38  * Very simple PI speed regulator.
39  */
40 void spd_pid(struct rpi_state*);
41
42
43 #endif /*CONTROLLERS*/