Projeto

Geral

Perfil

Controle pid da roda » Histórico » Versão 6

Gustavo Claudio Karl Couto, 30/04/2017 02:12 h

1 1 Carlos Gabriel Oliveira Freitas
h1. Controle pid da roda
2
3 2 Carlos Gabriel Oliveira Freitas
Tutorial - criando um modelo: https://www.mathworks.com/help/simulink/gs/create-a-simple-model.html
4
5 1 Carlos Gabriel Oliveira Freitas
Tutorial - modelando um motor: https://www.mathworks.com/videos/modeling-a-dc-motor-68852.html
6 3 Carlos Gabriel Oliveira Freitas
7
Design pid: http://www.mathworks.com/help/control/pid-controller-design.html
8 4 Renan Pícoli
9
frequência do contador do pwm (amostragem do pwm)= 20MHz
10
período da onda do pwm é 1/20kHz
11 5 Gustavo Claudio Karl Couto
12
pagina 152 e 640
13
14
pwm.cpp
15
16
	TIM_TimeBaseStructure.TIM_Prescaler=(SystemCoreClock/20000000)-1;
17
	TIM_TimeBaseStructure.TIM_Period=168000000/168000;
18
19
/roboime-firmware/src/boot/system_stm32f4xx.c
20
21
 System Clock source                    | PLL (HSE)
22
  *-----------------------------------------------------------------------------
23
  *        SYSCLK(Hz)                             | 168000000
24
  *-----------------------------------------------------------------------------
25
  *        HCLK(Hz)                               | 168000000
26
  *-----------------------------------------------------------------------------
27
  *        AHB Prescaler                          | 1
28
  *-----------------------------------------------------------------------------
29
  *        APB1 Prescaler                         | 4
30
  *-----------------------------------------------------------------------------
31
  *        APB2 Prescaler                         | 2 System Clock source                    | PLL (HSE)
32
  *-----------------------------------------------------------------------------
33
  *        SYSCLK(Hz)                             | 168000000
34
  *-----------------------------------------------------------------------------
35
  *        HCLK(Hz)                               | 168000000
36
  *-----------------------------------------------------------------------------
37
  *        AHB Prescaler                          | 1
38
  *-----------------------------------------------------------------------------
39
  *        APB1 Prescaler                         | 4
40
  *-----------------------------------------------------------------------------
41
  *        APB2 Prescaler                         | 2
42
43
Interrupção do timer de controle do motor a 1k
44
45
/roboime-firmware/src/control/TimerTime.cpp
46
47
	TIM_TimeBaseStructure.TIM_Prescaler=83;
48
	TIM_TimeBaseStructure.TIM_Period=1000;
49 6 Gustavo Claudio Karl Couto
50
51
resposta do motor de velocidade 2.5m/s
52
!roboime.PNG!