Projeto

Geral

Perfil

Controle pid da roda » Histórico » Revisão 5

Revisão 4 (Renan Pícoli, 29/04/2017 20:49 h) → Revisão 5/12 (Gustavo Claudio Karl Couto, 29/04/2017 21: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;