Renesas H8S/2635 Manuál

Procházejte online nebo si stáhněte Manuál pro Generátory energie Renesas H8S/2635. Renesas H8S/2635 Hardware manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 92
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 0
1 2 3 4 5 6 ... 91 92

Shrnutí obsahu

Strany 1 - MASTER'S THESIS

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

Strany 2 - DIPLOMA THESIS

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 12

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

Strany 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

Strany 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

Strany 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

Strany 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.

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 26

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

Strany 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

Strany 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:

Strany 29

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 35

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 45 - 5.3.5. PXMC_CON_PID.C

4 Table of Contents: 1. Introduction ...

Strany 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

Strany 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

Strany 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.

Strany 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

Strany 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/

Strany 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

Strany 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

Strany 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, //

Strany 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

Strany 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

Strany 56 - Fig. 6.4-1. Hi_cpu2 board

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

Strany 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

Strany 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

Strany 59

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

Strany 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)

Strany 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

Strany 62

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

Strany 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

Strany 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

Strany 65

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

Strany 66 - 7.1. Introduction

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

Strany 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

Strany 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

Strany 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

Strany 70 - 8. Conclusions

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

Strany 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

Strany 72 - 9. Sources

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

Strany 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

Strany 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

Strany 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

Strany 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.

Strany 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

Strany 78

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

Strany 79

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

Strany 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

Strany 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

Strany 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

Strany 83

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

Strany 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

Strany 85

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

Strany 86 - Appendix B

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

Strany 87 - Protected Slots

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

Strany 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

Strany 89 - Detailed Description

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

Strany 90

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

Strany 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

Strany 92

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

Komentáře k této Příručce

Žádné komentáře