]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blob - pmsm-control/test_sw/controllers.h
Merge remote-tracking branch 'rtime/master'
[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 /* PID_P_S              0.16 */
22
23 #define PID_P_S         0.08            /*2.3 kmita*/ /*1.4 vhodne jen pro P regulator*/
24 #define PID_I_S         0.0134
25
26 /**
27  * \brief No regulation.
28  */
29 inline void zero_controller(struct rpi_state*);
30
31 /**
32  * \brief
33  * Very simple position P regulator.
34  * Now only with P-part so that the error doesnt go to zero.
35  */
36 void pos_pid(struct rpi_state*);
37
38 /**
39  * \brief
40  * Very simple PI speed regulator.
41  */
42 void spd_pid(struct rpi_state*);
43
44
45 #endif /*CONTROLLERS*/