| Electronic Components Datasheet Search |
|
AN1113 Datasheet(PDF) 8 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1113 Datasheet(HTML) 8 Page - STMicroelectronics |
|
8 / 18 page ![]() Figure 9 . Main view end of this application note contains the whole assembler code generated by the compiler. Let us discuss about the main program. " Int_AD_on" and "init" blocks in fig. 9 are used to initialize global variables and interrupts mask (only AD Int is enabled). The two following blocks start the converter and wait for the results of the conversion. After that, the converter values are stored in the variable called "speed, "torque", "current" and a new Interrupt mask is enabled (only Ext Int). Block " V200_duty" loads the Triac counter with a default value and the block "PWM_start" allows the Tri- ac peripheral to run. At this time it is already possible to see a PWM wave on pin 24 of ST52x301. Since pin 27 reads a time period related to the speed it is necessary to perform a mathematical inver- sion to achieve the frequency. Just to simplify, a complementation of the period byte will be made in- stead of the inversion. In this way, an error will be introduced in the spin frequency calculation. If a more accurate precision is requested, an alternative method to implement the inversion is to use a fuzzy im- plementation of the function 1/T. The block "L298_EN_on" enables the bridge driver. The Block " complemnt" performs the above task. Following the loop, a new value of the speed Ref " torque_ref" and "current" are read. The block "max_research" catches the maximum value of the cur- rent during a turn of the shaft. This loop is performed until the condition "tmp>=2" is false. Variable tmp is used to create a time inertia in the fuzzy control. "Tmp" is incremented each time the Ext-Interrupt routi- ne is executed (each 1/3 turn of the shaft) and this implies a real time control in about one turn of the shaft. Block " calc_err" performs error calculation as "error = speed - ref - speed ", error variable is sent to the fuzzy input, Fuzzy block " fuzzy controller" produces the incremental value "delta_DC". Next figure shows the content of the 5 mathematics blocks. In the second, "delta_DC" is added (or sub- tract, if negative) to the current duty-cycle before to refresh Triac counter. The operators If .. then are in- troduced to avoid overflow or underflow in the counter registers during the control. Key point in the program is the Ext_Int routine (fig. 11). This task performs the period measurement of ® AN1113 - APPLICATION NOTE 8/18 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |