static void stop(struct rpi_state* state){
sem_wait(&state->thd_par_sem);
state->commutate=0;
+ state->pos_reg_ena=0;
+ state->spd_reg_ena=0;
+ state->duty=0;
state->pwm1=0;
state->pwm2=0;
state->pwm3=0;
FILE *f;
int r,s;
- f = fopen("logs.txt", "w");
+ f = fopen("logs.log", "w");
if (f == NULL){
printf("Error opening file!\n");
return;
#define PID_P 0.3
-#define PID_P_S 0.9 /*2.3 kmita*/ /*1.4 vhodne jen pro P regulator*/
+#define PID_P_S 0.8 /*2.3 kmita*/ /*1.4 vhodne jen pro P regulator*/
#define PID_I_S 0.01
#define PRIOR_KERN 50
}
rps.logs[0][rps.log_col]=(int)rps.tf_count;
rps.logs[1][rps.log_col]=(int)rps.spi_dat->pozice;
+
rps.logs[2][rps.log_col]=(int)rps.pwm1;
rps.logs[3][rps.log_col]=(int)rps.pwm2;
rps.logs[4][rps.log_col]=(int)rps.pwm3;
+ rps.logs[5][rps.log_col]=rps.duty;
+
+ rps.logs[6][rps.log_col]=rps.desired_spd;
+ rps.logs[7][rps.log_col]=rps.speed;
+
+ rps.logs[8][rps.log_col]=(int)(rps.spi_dat->ch1/rps.spi_dat->adc_m_count);
+ rps.logs[9][rps.log_col]=(int)(rps.spi_dat->ch2/rps.spi_dat->adc_m_count);
+ rps.logs[10][rps.log_col]=(int)(rps.spi_dat->ch0/rps.spi_dat->adc_m_count);
rps.log_col++;
/*