X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/rpi-motor-control.git/blobdiff_plain/9650ac29cdffe74d39e64da32a34384dcd9db72f..85772a932e99215c8c86d92feb203ee928df0e5f:/pmsm-control/test_sw/pmsm_state.h diff --git a/pmsm-control/test_sw/pmsm_state.h b/pmsm-control/test_sw/pmsm_state.h index e028201..3cd648f 100644 --- a/pmsm-control/test_sw/pmsm_state.h +++ b/pmsm-control/test_sw/pmsm_state.h @@ -4,6 +4,10 @@ #include #include +#define OLD_POS_NUM 50 +#define MAX_DUTY 170 +#define MAX_SPEED (7*OLD_POS_NUM) + struct rpi_in; struct rpi_state{ @@ -20,8 +24,9 @@ struct rpi_state{ int duty; /* duty cycle of pwm */ int desired_pos; /* desired position */ - int old_pos; /* one cycle old 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 */