| поискавой системы для электроныых деталей |
|
AN3254 датащи(PDF) 17 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3254 датащи(HTML) 17 Page - STMicroelectronics |
|
17 / 24 page ![]() AN3254 Converting readings into measured values Doc ID 17783 Rev 1 17/24 This also means that the STPMC1 energy counters hold a very small energy value (in the example above, when LSB represents 15.258 µWh, the whole register stores 16 Wh), and further energy integration must be performed inside the application. To accomplish this task, the procedure below should be followed. Because all energy counters rollover in approximately 1 s when they are integrating maximal power, the reading must be done frequently enough. It is suggested to read the registers at least 32 times per second. For each energy type, a variable e should be allocated, having the following structure (below is the variable definition for an ST7 microcontroller): typedef struct energ { unsigned long old; /* previous energy value - 32 bits */ unsigned int quot; /* quant/16 - 16 bits */ signed int quant; /* new - old, measure of power - 16 bits */ signed long frac; /* fractional part of energy integrator - 32 bits */ signed long integ; /* integer part of energy integrator - 32 bits */ } ENERG; The application should keep the previous value of each energy counter in order to evaluate the difference of readings, from which also a direction of energy flow can be obtained. This value should be stored in e → old before a reading. After the reading, the new energy register reading should be stored in e → new. To calculate consummated energy the software should implement a 32-bit integrator. The suggested integrator is two stages, with e → frac and e→ integ 32-bit signed integer variables. Into e → frac is added the value e→ quant, obtained as the difference between e → old and e → new energy values; then the e→ old value should be rewritten with the e→ new value in order to enable a correct e → quant computation next time. When e → frac collects a certain amount of energy, let’s say 10 Wh for active energy (corresponding to a certain threshold value according to KP), e→ integ should change for 1 bit and the e → frac should change by the threshold value. In this way, e → frac stores 0.01 KWh, after which e→ integ is increased by one, and the e→ integ variable holds accumulated energy of which the least significant bit represents 10 Wh. Considering an active energy meter where P = 64000 imp/kWh, for a step of 0.01 KWh = 10 Wh, as each bit of e → quant represents K P Wh (it is the same resolution of the internal energy counter, because e → quant is calculated as a difference of two energy counter values), the threshold value is 10/KP = 10/15.258*2 06 = 0xA0021. In a microcontroller based application, a high priority timer interrupt should be set to perform measuring tasks every 1/512 s. Within this interrupt service 16 different subtasks could be established in order to break the whole meter task into 16 shorter consecutive subtasks (reading of device register, checking the data read, and, if ok, computing the value of e → quant). In this way, the main program and other interrupt services are not blocked for more than a few 100 us every 2 ms, and the meter task is completed in 16 steps - that is in 1/32 s. |
|
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |