Controle pid da roda » Histórico » Revisão 6
Revisão 5 (Gustavo Claudio Karl Couto, 29/04/2017 21:12 h) → Revisão 6/12 (Gustavo Claudio Karl Couto, 30/04/2017 02:12 h)
h1. Controle pid da roda Tutorial - criando um modelo: https://www.mathworks.com/help/simulink/gs/create-a-simple-model.html Tutorial - modelando um motor: https://www.mathworks.com/videos/modeling-a-dc-motor-68852.html Design pid: http://www.mathworks.com/help/control/pid-controller-design.html frequência do contador do pwm (amostragem do pwm)= 20MHz período da onda do pwm é 1/20kHz pagina 152 e 640 pwm.cpp TIM_TimeBaseStructure.TIM_Prescaler=(SystemCoreClock/20000000)-1; TIM_TimeBaseStructure.TIM_Period=168000000/168000; /roboime-firmware/src/boot/system_stm32f4xx.c System Clock source | PLL (HSE) *----------------------------------------------------------------------------- * SYSCLK(Hz) | 168000000 *----------------------------------------------------------------------------- * HCLK(Hz) | 168000000 *----------------------------------------------------------------------------- * AHB Prescaler | 1 *----------------------------------------------------------------------------- * APB1 Prescaler | 4 *----------------------------------------------------------------------------- * APB2 Prescaler | 2 System Clock source | PLL (HSE) *----------------------------------------------------------------------------- * SYSCLK(Hz) | 168000000 *----------------------------------------------------------------------------- * HCLK(Hz) | 168000000 *----------------------------------------------------------------------------- * AHB Prescaler | 1 *----------------------------------------------------------------------------- * APB1 Prescaler | 4 *----------------------------------------------------------------------------- * APB2 Prescaler | 2 Interrupção do timer de controle do motor a 1k /roboime-firmware/src/control/TimerTime.cpp TIM_TimeBaseStructure.TIM_Prescaler=83; TIM_TimeBaseStructure.TIM_Period=1000; resposta do motor de velocidade 2.5m/s !roboime.PNG!