]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blobdiff - pmsm-control/test_sw/comp.h
Speed, index and position computations moved to separate file.
[fpga/rpi-motor-control.git] / 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 (file)
index 0000000..d71f066
--- /dev/null
@@ -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*/
+