Renesas H8S/2635 Manual

Busca en linea o descarga Manual para Generadores De Poder Renesas H8S/2635. Renesas H8S/2635 Hardware manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 92
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 0
MASTER’S THESIS
2007:061
MASTER'S THESIS
Motion Control for Mobile Robots
Konrad R. Skup
Luleå University of Technology
Master Thesis, Continuation Courses
Space Science and Technology
Department of Department of Space Science, Kiruna
2007:061 - ISSN: 1653-0187 - ISRN: LTU-PB-EX--07/061--SE
2006:61 PB
Universitetstryckeriet, Luleå
Department of Space Science, Kiruna
Vista de pagina 0
1 2 3 4 5 6 ... 91 92

Indice de contenidos

Pagina 1 - MASTER'S THESIS

MASTER’S THESIS2007:061MASTER'S THESISMotion Control for Mobile Robots Konrad R. SkupLuleå University of TechnologyMaster Thesis, Continuation C

Pagina 2 - DIPLOMA THESIS

9 Servo  shortcut of Servomechanism  a special motor that typically includes a velocity and/or position feedback device. Sinusoidal cur

Pagina 3 - Declaration of authorship:

10 3. Brushless DC motors. 3.1. Overview. A brushless DC motors, very often denoted by shortcut BLDC (BrushLess Direct Current), are po

Pagina 4

11 Fig. 3.2-1. Basic schematics of brushless motor. The basic schematic of a brushless motor is shown on the picture 3.2.1. First of all, brushless

Pagina 5 - Table of Contents:

12 The above presented differences in arrangement change the speed and torque inversely proportional to the factor of: . Of course the arrangement of

Pagina 6

13 Explanation of this figure is quite short and easy. As we know from previous pictures, we consider situation when we have only three

Pagina 7 - 1. Introduction

14 Of course presented in above figure situation due to some non-linearity effects is very hard to realize. The effect of non-linearity can be observa

Pagina 8

15 The small example how the Hall Sensor can be used to read the rotation of the rotor is presented on the figure 3.3-1. Fig. 3.3-1

Pagina 9 - http://en.wikipedia.org

16 At this point small explanation about IRC and its channels should be given. Firstly couple of words about IRC. IRC is just a rotary a

Pagina 10

17 3.5. General work of brushless motor. As we know from the previous sections, to make the brushless motor rotating we need to put on the three wind

Pagina 11 - 3. Brushless DC motors

18 Looking at the above example of discretization on the figure 3.5-1 and thinking little bit, we will find out another very important problem: it is

Pagina 12

CZECH TECHNICAL UNIVERSITY IN PRAGUE FACULTY OF ELECTRICAL ENGINEERING DEPARTMENT OF CONTROL ENGINEERING DIPLOMA THESIS Motion Control for Mobi

Pagina 13

19 Fig. 3.5-2. Position of the motor and reading from HAL sensor. I think it is good idea to explain little bit how we can rotate the motor in desi

Pagina 14

20 Fig. 3.6-1. Brushless motor which was used by me. First of all we calculated the length of phase tables. We assumed that the amplitud

Pagina 15 - 3.3. Hall sensor

21 4. H8S/2638 microcontroller. 4.1. Overview. H8S/2638 is microcomputer unit (MCU) employed by Renesas Technology. In general it is 32-bit architec

Pagina 16 - 3.4. Incremental encoders

22 Fig. 4.1-2. The internal structure of H8S/2638. Fig. 4.1-3. Pins available in H8S/2638.

Pagina 17

23 4.2. PWM description. Pulse Width Modulation (PWM) is a method of a current or voltage signal regulation. It bases on a change of the  wi

Pagina 18

24 Fig. 4.2-2. PWM channel 2 in H8S/2638. PWMOCR1 and PWMOCR2 are used to select which PWM outputs should be enabled and which should be disabled. S

Pagina 19

25 After short description of all registers we can shortly explain how PWM works inside H8S/2638. So, at the beginning, user has to select which PWM h

Pagina 20

26 In the case of second channel, the situation is little bit different. This is due to the differences in the architecture of the microcontroller. We

Pagina 21

27 Independent interrupt vector address has big advantage, because in this case we don't have to worry about identification of the source. All in

Pagina 22 - 4. H8S/2638 microcontroller

28 Channels 0 and 3 are almost identical. This means both of them have the same interrupt sources, the same number of general and

Pagina 23

2 Declaration of authorship: I declare, that I wrote this diploma thesis myself only with the help of the literature, on-line materials, projects an

Pagina 24 - 4.2. PWM description

29 In the following lines, I'm not going to go into details about several registers which are need to be set up properly, but I'll try

Pagina 25

30 5. PXMC library. 5.1. Introduction. PXMC is portable library to control various types of motors. Its main task or aim is to allow

Pagina 26

31 platform. Secondly, developer must have at least some basic experience with motors and microcontrollers. This is due to the fact, that

Pagina 27 - 4.3. Interrupts description

32 5.2. Preparation of the programming environment. In this subsection I'll shortly present how to prepare programming environment for PXMC unde

Pagina 28

33 When the configuration will be finished, we write in standard way: make and then make install. As the result we will get binary file called:

Pagina 29

34 Fig. 5.3.1-1. The structure of PXMC library. Fig. 5.3.1-2. Files with dependencies in PXMC library.

Pagina 30

35 5.3.2. General work of PXMC. Before we go into descriptions of several files, which belong to PXMC library, we need to get some information how P

Pagina 31 - 5. PXMC library

36 here definitions of all flags and definitions of the most functions which can be accessed from PXMC. Now, lets try to look little bit more into de

Pagina 32

37 PXMS_CQF_b states whether the command queue is full or not. If it is full we can't give any new command. This flag is still not implemented an

Pagina 33

38 If we want to check whether some flag is set or not, we need to check pxms_flg. This is a bit field where the flags are stored in

Pagina 34 - 5.3. Overview

3 Abstract This diploma thesis is focused on brushless DC motors, how they work and how to control them using phase tables. It de

Pagina 35

39 The advantage of the above equation is that it gives possibility to operate with help of fixed point arithmetic, which increases controller

Pagina 36 - 5.3.3. PXMC.H

40 pxms_md This field stores the maximal difference between actual and required position. If the difference will be greater than this value, then erro

Pagina 37

41 pxms_ptvang This value is an angle between rotor and direction of magnetic field. The optimal value for steeper motors is 0o and for brushless moto

Pagina 38

42 In the following lines I will describe shortly configuration flags for a motor described by pxms_state structure. All these flags are available i

Pagina 39

43 First one, *ptr is used to store information about speed and power sent to the output. The*buff is used mainly to store a profile of speed generato

Pagina 40

44 pxmc_state_t *pxmc_main_arr[] = {&mcsLeft}; pxmc_state_list_t pxmc_main_list = { pxml_arr:pxmc_main_arr, pxml_cnt:(sizeof(pxmc_main_arr)/sizeo

Pagina 41

45 Fig. 5.3.5-1. General structure of PID controller. PID used by PXMC can be seen on figure 5.3.2-1. The efficiency and performance of PID control

Pagina 42

46 pxmc_dbg_gnr This function is seen from outside of the PXMC library and in fact it prepares all necessary elements for storing the speed ge

Pagina 43 - Fig. 5.3.3-4. Configuration

47 pxmc_trp_gend Changes request position to new factor, what should finalize the use of trapezoid generator. This function is temporarily not

Pagina 44 - Fig. 5.3.3-5. Error flags

48 5.3.10. PXMC_HH_BASIC.C At begin of the description of this file, it should be clearly mentioned that this file has couple of mistakes and probab

Pagina 45 - 5.3.5. PXMC_CON_PID.C

4 Table of Contents: 1. Introduction ...

Pagina 46 - 5.3.6. PXMC_DEB.C

49 In this subsection I will present only constants for run time phase table generation which are defined in pxmc_internal.h. All functions which pred

Pagina 47 - 5.3.8. PXMC_GEN_SPDTRP.C

50 them during compilation or linking. Exactly the same situation was with H8S/2638 which I used. Name of pole Short description pxmc_ptvang_deg2irc

Pagina 48 - 5.3.9. PXMC_HH.C

51 Fig. 5.3.13-3. Phase tables generated with pxmc_init_ptable_sin3fup. Fig. 5.3.13-4. Phase tables generated with pxmc_init_ptable_trapez.

Pagina 49 - 5.3.12. PXMC_INTERNAL.H

52 bldctest for hi_cpu2 board we can also call function: pxmc_set_default_functions(pxmc_state_t *mcs, pxmc_motor_kind_e motor). The first parameter i

Pagina 50 - 5.3.13. PXMC_PTABLE.C

53 6. Adding Board Support Package (BSP) for BLDC on H8S/2638. 6.1. Introduction. As was mentioned in section 5.1, the basic aim of PXMC library is/

Pagina 51

54 Another improvement is that we decided to create one standard for all compilations. In other words, now always when we compile PXMC we get two libr

Pagina 52

55 6.4. Work with hi_cpu2 board. During getting experience with PXMC library I got one of the tasks to make hi_cpu2 board working with br

Pagina 53

56 const unsigned char eurobot_bdc_hal_pos_table[8]= { [0]=0xff, [5]=0, //1 0 1 = 5 [1]=1, //0 0 1 = 1 [3]=2, //0 1 1 = 3 [2]=3, //0 1 0 = 2 [6]=4, //

Pagina 54 - 6.1. Introduction

57 pxms_me:PWM_MAX<<8, //6144 pxms_ptirc:bldc_ptirc, // IRC count per phase table pxms_ptper:bldc_ptper, // Number of periods per table pxms_pt

Pagina 55 - PXMS_E_POWER_STA GE

58 interupt_dbg* A/a. This routine is called in debug mode to store some debug information about the motor. The pointer to debug function is stored in

Pagina 56 - Fig. 6.4-1. Hi_cpu2 board

5 7. Testing and documentation of the code. ...65 7.1. Introduction...

Pagina 57

59 Last two files: Makefile and Makefile.omk have descriptions of the rules for compilation and are used by make command. In Makefile.omk we should li

Pagina 58

60 The general idea is that, if we know the speeds of the wheels  we can read it from PXMC  then we can calculate the difference in speed between tw

Pagina 59

61 table in an element shown by hall value the number 1 and so on, till we rotate the motor by 360o. 

Pagina 60 - 6.5. Work with Eurobot

62 snd=strchr(snd,':')+1; int whichIDX=atoi(snd); if(whichIDX<0) { pwm1 = (((unsigned long)pwm1*(unsigned int)ene)

Pagina 61 - Fig. 6.6-1. HalDetector

63 Now I will write couple of words about HalDetector. After uploading the driver with above function and compilation of the main program

Pagina 62

64 int writeport(int fd, char *chars); int readport(int fd, char *result); int getbaud(int fd); int allocateMemory(); int deallocateMemory(); int open

Pagina 63

65 7. Testing and documentation of the code. 7.1. Introduction. The testing and debugging of the code were not easy tasks. This was mostly due to th

Pagina 64

66 int cmd_do_something(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) { printf("Hello world!\n"); return 0; } Then we create

Pagina 65

67 7.3. Documentation. Documentation for bldctest.c and for bldc.c was generated automatically with help of script written in Perl, call

Pagina 66 - 7.1. Introduction

68 'funcname()' - function '$ENVVAR' - environmental variable '&struct_name' - name of a structure (up to two words

Pagina 67

6 1. Introduction Motors are widely used in many aspects of our life. They serve in different trivial tasks like rotation of wheels in toys

Pagina 68 - 7.3. Documentation

69 8. Conclusions. The general conclusions from my work are not simple task, so I think the best would be if I present my own opinion about every par

Pagina 69

70 without having a contact with the authors, could very easy learn and test different properties of PXMC. It would also allow for better understandin

Pagina 70 - 8. Conclusions

71 9. Sources. (1) Renesans Technology -       URL: http://docum

Pagina 71 - Connected brushless motor

72 Appendix A Here is presented the whole documentation for the PXMC source code files, which were created during my work on this thesis. All of belo

Pagina 72 - 9. Sources

73 Function unsigned char hal_read (struct pxmc_state * mcs) Arguments mcs Motion controller state information Description This function reads and

Pagina 73 - Appendix A

74 Function bool pxmc_set_default_functions (pxmc_state_t * mcs, pxmc_motor_kind_e motor) Arguments mcs Motion controller state information motor

Pagina 74 - Function

75 Function void interupt_controller_and_output () Arguments Description The function is used to call pxms_do_con and pxms_do_out functions for all m

Pagina 75

76 Function void index_mark_isr_2 ( void) Arguments void no arguments Description This interrupt routine works in exactly the same way as index_mar

Pagina 76

77 Function void init_irc ( void) Arguments void no arguments Description This function sets up TPU for index mark detection for 1st and 2nd motor.

Pagina 77

78 Function void init_irq ( void) Arguments void no arguments Description This function set up IRQ interrupt, by putting index_mark_isr to the inte

Pagina 78

7 Finally, even the best software and libraries are useless without good documentation and examples how to use them. Because of that, late

Pagina 79

79 Function int tpu_irc_ap2hw (struct pxmc_state * mcs) Arguments mcs Motion controller state information Description The function updates pxms_pto

Pagina 80

80 A.3 The documentation for brushless.c: Function int cmd_do_quit (cmd_io_t * cmd_io, const struct cmd_des * des, char * * param) Arguments Descri

Pagina 81

81 Function int cmd_do_setindex (cmd_io_t * cmd_io, const struct cmd_des * des, char * * param) Arguments Description It is implementation of setinde

Pagina 82

82 Function int cmd_do_nopxmc (cmd_io_t * cmd_io, const struct cmd_des * des, char * * param) Arguments Description It is implementation of nopxmc c

Pagina 83

83 Function int switchLedsOn () Arguments Description This function switches on all led on the board. Function void unhandled_exception ( void) Ar

Pagina 84

84 Function int main () Arguments Description This function is a main function of the program. It initializes pxmc, and than in a constant loop it ex

Pagina 85

85 Appendix B Here is presented the whole documentation for the HalDetector source code files. This documentation was created with Doxygen program an

Pagina 86 - Appendix B

86 QLabel * textLabel2 Label with "Baud rate" text. QTextEdit * textEdit1 TextEdit field where appear results of scanning. QLineE

Pagina 87 - Protected Slots

87 void aboutMenuFileClicked () Function called after Help->About menu click. Private Member Functions int initport (int fd) Initializes giv

Pagina 88 - Private Attributes

88 short * ph1 Pointer to 1st phase table. short * ph2 Pointer to 2nd phase table. short * ph3 Pointer to 3rd phase table. bool working

Pagina 89 - Detailed Description

8 2. Terminology and abbreviations. Below are presented the most important terms and abbreviations which are later used in this document

Pagina 90

89 void Form1::startButtonClicked () [protected, slot] Function called after "Start" button click. Start button clicked. According to sele

Pagina 91

90 int Form1::writeport (int fd, char * chars) [private] Write given string to a device. Function writes a string to device pointed by fd descripto

Pagina 92

91 int Form1::openDevice () [private] Open given device. Function opens device given in deviceLineEdit1 text line and assigns the fd pointer. Retu

Comentarios a estos manuales

Sin comentarios