X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/rpi-motor-control.git/blobdiff_plain/b4d468f4be4d8e91bbd775b5b37f0ae431ae6648..48407cad35d152771ac1a86652dae3eede6741a2:/pmsm-control/test_sw/comp.h diff --git a/pmsm-control/test_sw/comp.h b/pmsm-control/test_sw/comp.h new file mode 100644 index 0000000..d71f066 --- /dev/null +++ b/pmsm-control/test_sw/comp.h @@ -0,0 +1,37 @@ +/** + * \brief + * Computatations of position, index, speed. + * + */ +#ifndef COMP +#define COMP + +struct rpi_in; +struct rpi_state; + +/** + * \brief + * Substact initial position. + */ +void substractOffset(struct rpi_in* data, struct rpi_in* offset); + +/** + * \brief + * Computation of distance to index. + * + * K dispozici je 12-bit index, to umoznuje ulozit 4096 ruznych bodu + * Je nutne vyjadrit 1999 bodu proti i posmeru h.r. od indexu - + * to je 3999 bodu + * =>12 bitu je dostacujicich, pokud nikdy nedojde ke ztrate + * signalu indexu + */ +void comIndDist(struct rpi_state*); + +/* + * \brief + * Computates speed. + */ +void compSpeed(struct rpi_state*); + +#endif /*COMP*/ +