diff --git a/Robotito/include/control.h b/Robotito/include/control.h index 29116c8de8f2027871a75859109db3ed2cb4f2a6..b50ac9db54ede946f8e8ade9f044f08a2936b99d 100644 --- a/Robotito/include/control.h +++ b/Robotito/include/control.h @@ -45,18 +45,10 @@ #define TICS_TO_RAD_S RAD_PER_TICK/OMNI_ODOM_CTRL_TIMER -/*Procedimiento de Ziegler-Nichols: - 1- Variar la constante Kp desde 0 hasta registrar oscilaciones oscilaciones estables y consistentes - Registramos: Periodo de oscilacion Tu = 0,1666666667 y Ku = 0.26, donde Ku = Kp@ocilaciones - 2- Suponiendo que trabajremos con un PI entonces se deben fijar: - a- Kp = 0.45 * Ku - b- Ki = 0.54 * Ku / Tu -*/ - -#define KP 0.15 // -#define KI 0.08 //0.05 -#define KD 0.00 -#define KF MAX_SPEED_POWER/MAX_SPEED_TICS + +#define KP 0.3 // Proportional component of the PID +#define KI 0.6 // Integral component of the PID +#define KD 0.001 // Differential component of the PID typedef struct { diff --git a/Robotito/src/main.c b/Robotito/src/main.c index 8a8340e1bd6824312fac665d5b12eeb8f6e80d5b..aa3ead8b29ab2fa793fa20089011164c67231e99 100644 --- a/Robotito/src/main.c +++ b/Robotito/src/main.c @@ -76,7 +76,7 @@ static void init_uart(void) }; uart_param_config(UART_NUM, &uart_config); - uart_set_pin(UART_NUM, 5, 4, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); + uart_set_pin(UART_NUM, 0, 4, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); uart_driver_install(UART_NUM, 1024, 1024, 5, &uart_queue, 0); xTaskCreate(uart_task, "uart_task", TASK_MEMORY, NULL, 5, NULL); @@ -88,7 +88,7 @@ void app_main(void) printf("Configuring Initial Parameters of mcpwm...\n"); omni_init(); omni_set_enable(true); - while (1) { - vTaskDelay( 300000/ portTICK_RATE_MS); + while (1) { + vTaskDelay( portMAX_DELAY); } } \ No newline at end of file