]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blobdiff - pmsm-control/test_sw/pmsm_state.h
Added speed regulation.
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / pmsm_state.h
index b50b25010aeb1edbbd46ba520b96904f48928482..3cd648fc42db361aaeedea92bab877e4e52597f5 100644 (file)
@@ -4,6 +4,10 @@
 #include <stdint.h>
 #include <semaphore.h>
 
+#define OLD_POS_NUM    50
+#define MAX_DUTY       170
+#define MAX_SPEED      (7*OLD_POS_NUM)
+
 struct rpi_in;
 
 struct rpi_state{
@@ -20,7 +24,9 @@ struct rpi_state{
 
        int duty;                       /* duty cycle of pwm */
        int desired_pos;                /* desired position */
+       int old_pos[OLD_POS_NUM];       /* old  positions */
        int desired_spd;                /* desired speed */
+       int speed;
 
        char commutate;                 /* zapina prepocet duty na jednotlive pwm */
        char pos_reg_ena;               /* position regulation enable */