Apparatus and methods for multi-channel metering
Abstract
This record has no abstract on file.
Term
0.1 yearsto projected expiry
Projected expiry 15 November 2026, counted from filing; an application has no term until it is granted.
- Priority
- Filed
- Published
- Today
- Projected expiry
1 claim: 1 independent, 0 dependent
- 1ZASTRZEŻENIA PATENTOWE 1. Urządzenie do wielokanałowego pomiaru elektryczności, zawierające:głowicę pomiarową (140) znajdującą się po wtórnej stronie transformatora (110), przy czym głowica pomiarowa komunikuje się z transponderem (210) znajdującym się po pierwotnej stronie transformatora służącego do transmisji danych i odbioru danych z transpondera za pośrednictwem komunikacji liniami zasilającymi, przy czym transponder jest zdatny do transmisji danych i odbioru danych z umieszczonego zdalnie komputera;znamienne tym, że: głowica pomiarowa jest zdatna do oddzielnego pomiaru zużycia elektryczności dla każdej ze zbioru linii konsumentów elektryczności;i urządzenie zawiera ponadto: jeden lub większą liczbę modułów do sterowania obciążeniem (240) komunikujących się z głowicą pomiarową i zdatnych do aktywacji przyłączania oraz odłączania każdego ze zbioru przekaźników, przy czym każdy ze zbioru przekaźników odpowiada jednej ze zbioru linii konsumentów elektryczności;i skrzynkę zawierającą głowicę pomiarową, moduł do sterowania obciążeniem i przekaźniki. 2. Urządzenie według zastrz. 1, zawierające ponadto detektor naruszenia komunikujący się z głowicą pomiarową (140). 3. Urządzenie według zastrz. 2, w którym detektor naruszenia zawiera światło i powierzchnię odbijającą, i w którym głowica pomiarowa jest zdatna do zlecania jednemu lub większej liczbie modułów do sterowania obciążeniem (240) odłączenia wszystkich linii konsumenckich jeżeli detektor naruszenia dostarczy powiadomienie o tym, że nie zostało wykryte odbicie światła przez powierzchnię odbijającą. 4. Urządzenie według zastrz. 2, w którym detektor naruszenia zawiera detektor światła otaczającego wpadającego do skrzynki. 5. Urządzenie według zastrz. 1, w którym skrzynka jest zainstalowana na słupie elektrycznym. 6. Urządzenie według zastrz. 1, zawierające ponadto środki do porównywania energii transformatora z całkowitą energią zużywaną przez linie konsumenckie. 7. Urządzenie według zastrz. 1, zawierające ponadto środki do detekcji przepływu napięcia odwrotnego w liniach konsumenckich. 8. Urządzenie według zastrz. 1, zawierające ponadto pamięć odczytywaną komputerowo komunikującą się z głowicą pomiarową (140) i licznik komunikujący się z głowicą pomiarową, przy czym licznik odpowiada linii konsumenckiej i jest zdatny do odliczania ilości energii przechowywanej w pamięci, a głowica pomiarowa jest zdatna do wysyłania sygnału odłączenia do odpowiedniego modułu do sterowania obciążeniem (240) w celu odłączenia linii konsumenckiej gdy licznik osiągnie wartość zero. 9. Urządzenie według zastrz. 1, zawierające ponadto pamięć odczytywaną komputerowo, komunikującą się z głowicą pomiarową (140), przy czym pamięć jest zdatna do przechowywania limitu obciążenia dla linii konsumenckiej, a głowica pomiarowa jest zdatna do wysyłania sygnału odłączenia do odpowiedniego modułu do sterowania obciążeniem w celu odłączenia linii konsumenckiej gdy limit obciążenia zostanie przekroczony. 10. Urządzenie według zastrz. 1, zawierające ponadto pamięć odczytywaną komputerowo komunikującą się z głowicą pomiarową (140), przy czym pamięć jest zdatna do przechowywania limitu zużycia dla linii konsumenckiej, a głowica pomiarowa jest zdatna do wysyłania sygnału odłączenia do odpowiedniego EP 1 960 932 B1 modułu do sterowania obciążeniem w celu odłączenia linii konsumenckiej gdy limit zużycia zostanie przekroczony. 11. Urządzenie według zastrz. 1, w którym transponder (210) jest zdatny do komunikacji z umieszczonym zdalnie komputerem za pośrednictwem linii średniego napięcia. 12. Urządzenie według zastrz. 1, zawierające ponadto jednostkę wyświetlacza komunikującą się z głowicą pomiarową (140) i zdatną do wyświetlania danych odbieranych z głowicy pomiarowej. 13. Urządzenie według zastrz. 12, w którym jednostka wyświetlacza jest zdatna do wyświetlania informacji dotyczących zużycia energii przez konsumenta. 14. Urządzenie według zastrz. 12, w którym jednostka wyświetlacza jest zdatna do wyświetlania ostrzeżeń dotyczących zużycia energii przez konsumenta lub podejrzenia kradzieży energii. 15. Urządzenie według zastrz. 12, w którym jednostka wyświetlacza jest zdatna do przesyłania do głowicy pomiarowej informacji wprowadzonych przez konsumenta. 16. Urządzenie według zastrz. 1, w którym transponder (210) jest zdatny do raportowania danych do umieszczonego zdalnie komputera za pośrednictwem linii telefonicznej. 17. Urządzenie według zastrz. 1, w którym głowica pomiarowa (140) jest zdatna do pomiaru elektryczności dostarczanej do głowicy pomiarowej. 18. Urządzenie według zastrz. 1, w którym głowica pomiarowa (140) jest zdatna do transmisji danych bezpośrednio do transpondera (210) z częstotliwością w zakresie 10-25 kHz. 19. Urządzenie według zastrz. 1, w którym głowica pomiarowa (140) jest zdatna do transmisji danych bezpośrednio do transpondera (210) z częstotliwościami odpowiadającymi nieparzystej połowie składowych harmonicznych częstotliwości linii. 20. Urządzenie według zastrz. 1, w którym skrzynka jest zainstalowana na słupie elektrycznym nad linią średniego napięcia. EP 1 960 932 B1 FIG.1 NAPIĘCIE ŚREDNIE DO ODBIORCÓW NAPIĘCIE NISKIE fazy : 1 2 3 STRAZN K ENERG Z MINISZAFKĄ PRZEKŁADNIK PRĄDOWY CT) □ TRANSFORMATOR ROZDZIELCZY EP 1 960 932 B1 EP 1 960 932 B1 FIG.3A EP 1 960 932 B1 EP 1 960 932 B1 7~7 EP 1 960 932 B1 FMMT3904 EP 1 960 932 B1 FIG.3A-4 EP 1 960 932 B1 FIG.3A-5 EP 1 960 932 B1 FIG.3A-6 EP 1 960 932 B1 POTWPE FIG.3A-7 EP 1 960 932 B1 FIG.3A-8 EP 1 960 932 B1 FIG.3A-9 EP 1 960 932 B1 FIG.3A-10 EP 1 960 932 B1 FIG.3A-11 EP 1 960 932 B1 EP 1 960 932 B1 EP 1 960 932 B1 EP 1 960 932 B1 EP 1 960 932 B1 EP 1 960 932 B1 EP 1 960 932 B1 EP 1 960 932 B1 ó $ EP 1 960 932 B1 V V $ V V D[00:15] FIG.3B-8 EP 1 960 932 B1 EP 1 960 932 B1 EP 1 960 932 B1 1Ν4148 EP 1 960 932 B1 EP 1 960 932 B1 FIG.4D EP 1 960 932 B1 ΊΝ4148 EP 1 960 932 B1 FIG.4F EP 1 960 932 B1 FIG.4G EP 1 960 932 B1 1Ν4148 EP 1 960 932 B1 FIG.4I 100 EP 1 960 932 B1 FIG.4J 101 EP 1 960 932 B1 1Ν4148 102 EP 1 960 932 B1 103 EP 1 960 932 B1 104 EP 1 960 932 B1 105 EP 1 960 932 B1 Γ~ +5V FIG.5B 106 EP 1 960 932 B1 302-5161Κ 107 EP 1 960 932 B1 " n s;o - 8HWU c5 FIG.5D 108 EP 1 960 932 B1 FIG.5E 109 EP 1 960 932 B1 ΒΑπ ΕΞ 110 EP 1 960 932 B1 cvo FIG.5G 111 EP 1 960 932 B1 112 EP 1 960 932 B1 Ο νι 113 EP 1 960 932 B1 CD Ó LL 114 EP 1 960 932 B1 115 EP 1 960 932 B1 116 EP 1 960 932 B1 117 EP 1 960 932 B1 118 EP 1 960 932 B1 119 EP 1 960 932 B1 120 EP 1 960 932 B1 121 EP 1 960 932 B1 122 EP 1 960 932 B1 123 EP 1 960 932 B1 124 EP 1 960 932 B1 125 EP 1 960 932 B1 126 EP 1 960 932 B1 127 EP 1 960 932 B1 128 EP 1 960 932 B1 129 EP 1 960 932 B1 130 EP 1 960 932 B1 131 EP 1 960 932 B1 132 EP 1 960 932 B1 47/xF/16V FIG.6S 133 EP 1 960 932 B1 134 EP 1 960 932 B1 FIG.6U 135 EP 1 960 932 B1 136 EP 1 960 932 B1 137 EP 1 960 932 B1 C0NS_1XS_TH1G0V 138 EP 1 960 932 B1 FIG.7A-3 139 EP 1 960 932 B1 'i- Q_ tra Cl. -—i*: · —;£: a tn a tn FIG.7A-4 o oj ro xi- io io i~~ oo CM K) Tt· Lf CO I— OO cn -— T— -— -r— 7— r— ·.— +12V OOOOOOOOOOOOOOOOOO 140 EP 1 960 932 B1 141 EP 1 960 932 B1 +12V 142 EP 1 960 932 B1 143 EP 1 960 932 B1 144 EP 1 960 932 B1 145 EP 1 960 932 B1 146 EP 1 960 932 B1 147 EP 1 960 932 B1 148 EP 1 960 932 B1 149 EP 1 960 932 B1 FIG.8A-1 150 EP 1 960 932 B1 +5VA +5VA FIG.8A-2 151 EP 1 960 932 B1 FIG.8A-3 Ζ Λ3 152 EP 1 960 932 B1 153 EP 1 960 932 B1 154 EP 1 960 932 B1 DL5817 DL5817 FIG.8B-1 155 EP 1 960 932 B1 LP2985IM5—5.0 156 EP 1 960 932 B1 157 EP 1 960 932 B1 LP2985IM5-5.0 Μ" I 0Q Ο LL 158 EP 1 960 932 B1 co ώ or z Tf T o O lit o . Ό Ό “3 LU § _l O O § Ξ) 159 EP 1 960 932 B1 160 EP 1 960 932 B1 161 EP 1 960 932 B1 162 EP 1 960 932 B1 163 EP 1 960 932 B1 164 EP 1 960 932 B1 165 EP 1 960 932 B1 166 EP 1 960 932 B1 167 EP 1 960 932 B1 168 EP 1 960 932 B1 169 EP 1 960 932 B1 170 EP 1 960 932 B1 ZŁĄCZE MĘSKIE WYJŚCIE DO PŁYTKI RJ FAZA-A WYJŚCIE DO PŁYTKI RJ FAZA-B FIG.8D-1 2X12 □ +U 2X12 ZŁĄCZE MĘSKIE VREF □ +U VREF OR171 EP 1 960 932 B1 172 EP 1 960 932 B1 173 EP 1 960 932 B1 WYJŚCIE DO PŁYTKI RJ FAZA-C OD PŁYTKI WYŚWIETLACZA HDR-1X5 VREF ΓΖ DIR- □ +υ 2X12 V V ZŁĄCZE MĘSKIE FIG.8D-4 FIG.8D-5 174 EP 1 960 932 B1 175 EP 1 960 932 B1 176 EP 1 960 932 B1 FIG.9A-2 177 EP 1 960 932 B1 FIG.9A-3 178 EP 1 960 932 B1 VREF-AI FIG.9A-4 179 EP 1 960 932 B1 FIG.9A-5 180 EP 1 960 932 B1 VREF-A VREF-A 181 EP 1 960 932 B1 182 EP 1 960 932 B1 ι σ Ó DIR+A 183 EP 1 960 932 B1 184 EP 1 960 932 B1 185 EP 1 960 932 B1 186 EP 1 960 932 B1 an+1 FIG.9B-2 187 EP 1 960 932 B1 FIG.9B-3 188 EP 1 960 932 B1 VREF-B1 ICD FIG.9B-4 189 EP 1 960 932 B1 FIG.9B-5 190 EP 1 960 932 B1 191 EP 1 960 932 B1 192 EP 1 960 932 B1 193 EP 1 960 932 B1 VREF-B VREF ~ B 194 EP 1 960 932 B1 195 EP 1 960 932 B1 196 EP 1 960 932 B1 οη+ Ο FIG.9C-2 197 EP 1 960 932 B1 FIG.9C-3 198 EP 1 960 932 B1 VREF-C O FIG.9C-4 199 EP 1 960 932 B1 FIG.9C-5 200 EP 1 960 932 B1 VREF-C · VREF-C 201 EP 1 960 932 B1 202 EP 1 960 932 B1 203 EP 1 960 932 B1 VREF—C VREF-C 204 EP 1 960 932 B1 205 EP 1 960 932 B1 206 EP 1 960 932 B1 STRONA K3 ODBIORCY O o ó UL 207 EP 1 960 932 B1 208 EP 1 960 932 B1 ZAWIAS LISTWOWY 209 EP 1 960 932 B1 ο Ο FIG.1 LU £ Ο Η LLJ X Ο Ν ΟΤ Ο_ 210 EP 1 960 932 B1 211 EP 1 960 932 B1 FIG.15A FIG.15B 212 EP 1 960 932 B1 213 EP 1 960 932 B1 214 EP 1 960 932 B1 215 EP 1 960 932 B1 1 uiinnn rr*· ŚRUBA m— FIG.19 ŚRUBA MONTAŻOWA BEZ ŁBA F G UCHWYT PRZEKAŹNIK CEWKA. PRZEKŁADKA DYSTANSUJĄCA ŚRUBA 216 EP 1 960 932 B1 217 EP 1 960 932 B1 ŚRUBA SAMOGWINTUJĄCA F1G.21B DNO DWUKOMPONENTOWEJ SKRZYNK PRZEKAZN KOWEJ ZESTAW MONTAŻOWY PRZEKAŹNIKA X 2 ŚRUBA SAMOGWINTUJĄCA POKRYWA DWUKOMPONENTOWEJ SKRZYNKI PRZEKAŹNIKOWEJ 218 EP 1 960 932 B1 219 EP 1 960 932 B1 DNO TROJKOMPONENTOWEJ FIG.21D SKRZYNK PRZEKAZN KOWEJ POKRYWA TROJKOMPONENTOWEJ SKRZYNKI PRZEKAŹNIKOWEJ ŚRUBA SAMOGWINTUJĄCA (X 4) ZESTAW MONTAŻOWY PRZEKAŹNIKA X3 TRÓJKOMPONENTOWA PRZEKAŹNIKOWA PŁYTKA DRUKOWANA ŚRUBA SAMOGWINTUJĄCA X 4 220 EP 1 960 932 B1 221 EP 1 960 932 B1 SKRZYNKA KONTROLNA 1 OBUDOWY LUZ/NEUTRALNY LISTWA PRZEJŚCIOWA B ŚRUBA PŁYTK PRZEWÓD WSPÓLNY DRUKOWANEJ PŁYTY GŁÓWNEJ (PŁYTY GŁÓWNEJ) PŁYTA GŁOWNA ŚRUBA (PŁYTKA DRUKOWANA) UCHWYT SZYNA A MATERAŁ SZYNA B IZOLACYJNY SZYNA C DYSTANS B (DLA PLASTIKOWEJ ŚRUBA ŁĄCZĄCA SZYNĘ Z PLASTIKOWĄ OBUDOWĄ MATERIAŁ PRZEKAŹNIKÓW PRZEKAŹNIKÓW IZOLACYJNY UCHWYT WSPÓLNY PROSTOPADŁY WSPÓLNY MATERAŁ FIG 23 ZOLACYJNY C SKRZYNKA KONTROLNA 2 DWUKOMPONENTOWA SKRZYNKA PRZEKAŹNIKOWA TROJKOMPONENTOWA SKRZYNKA PRZEKAŹNIKOWA LISTWA PRZEJŚCIOWA A/C ŚRUBA LISTWY PRZEJŚCIOWEJ ODSTĘPNIK PŁYTA GŁÓWNA Χ24- CAUL LISTWA PRZEJŚCIOWA A/C PLASTIKOWA SKRZYNKA PRZYJMUJĄCA (PLASTIKOWA OBUDOWA PRZEKAŹNIKÓW) DYSTANS PRZEKAŹNIK - CAUL NA ZESTAW 222 EP 1 960 932 B1 FIG. 24 ŚRUBA X4 ŚRUBA DYSTANSOWA DYSTANS A (X8) TULEJA IZOLUJĄCA DYSTANS A ŚRUBĘ (X8) ZMONTOWAN ZESTAW.PRZEKAŹNIKÓW DYSTANS Β X8 STRAŻNIKA ENERGII MATERIAŁ IZOLACYJNY C TULEJA OSŁANIAJ ACA Χ12 SKRZYNKA KONTROLNA (X2) SAMOGWINTUJĄCA ŚRUBA DO ZMONTOWANEJ PLASTIKOWEJ OBUDOWY PRZEKAŹNIKÓW (X8) TULEJA KABLA DOMOWEGO (Χ12) TUL JA IZOLUJĄCA ŚRUBĘ NAKRĘTKA X4 TULEJA KABLA ZASILAJĄCEGO OBUDOWA DOLNA 223 EP 1 960 932 B1 224 EP 1 960 932 B1 CPU PCB203 CD CN O LL 225 EP 1 960 932 B1 +3.3VA ZZ} 226 EP 1 960 932 B1 FIG.26A-2 227 EP 1 960 932 B1 74VHC595MTCX FIG.26A-3 228 EP 1 960 932 B1 ο Σ ogno FIG.26A-4 MC56F8014 229 EP 1 960 932 B1 MIERNIK I PCB203 ω CD CN o LL 230 EP 1 960 932 B1 STEWARD 2000ohms FIG.26B-1 231 EP 1 960 932 B1 IC/74HC4051/TSSOP16 FIG.26B-2 232 EP 1 960 932 B1 25ΡΡΜ 34.0Κ . . ,-Τ- ~~1 +3.3VA 233 EP 1 960 932 B1 ΜΒ25 STEWARD 2000ohms FIG.26B-4 234 EP 1 960 932 B1 IC/74HC4051/TSS0P16 FIG.26B-5 235 EP 1 960 932 B1 O +3.3VA 236 EP 1 960 932 B1 MIERNIK V PCB203 ω co CM Ó LL 237 EP 1 960 932 B1 NFO 1— 1 - 1 FIG.26C-1 adc-refo 238 EP 1 960 932 B1 Α08608 239 EP 1 960 932 B1 +3.3ΑΟ 240 EP 1 960 932 B1 ED ł : 71 U20-D 241 EP 1 960 932 B1 ŻEŃSKIE ZŁĄCZE KRAWĘDZIOWE 20 PIN 242 EP 1 960 932 B1 ledtot ledb leda 243 EP 1 960 932 B1 EG24 MIERNIK OSTRZOWY PCB203 LU CO CN Ó LU C180 244 EP 1 960 932 B1 CD ł vco J co or O CN I UL CO CN Ó LL 245 EP 1 960 932 B1 246 EP 1 960 932 B1 EG24 MIERNIK OSTRZOWY PCB203 O co CM o LL 247 EP 1 960 932 B1 248 EP 1 960 932 B1 | +3.3VA 249 EP 1 960 932 B1 250 EP 1 960 932 B1 cn S . Li. ADC-REFl FIG.26G-4 251 EP 1 960 932 B1 EG24 MIERNIK OSTRZOWY PCB203 FIG.26H 252 EP 1 960 932 B1 253 EP 1 960 932 B1 254 EP 1 960 932 B1 255 EP 1 960 932 B1 256 EP 1 960 932 B1 ZŁĄCZA DO OSTRZY PCB234 FIG.28B 257 EP 1 960 932 B1 POPRZECZKA ALUMINIOWA MONTOWANA W TYM OBSZARZE § O 258 EP 1 960 932 B1 259 EP 1 960 932 B1 260 EP 1 960 932 B1 261 EP 1 960 932 B1 262 EP 1 960 932 B1 263 EP 1 960 932 B1 264 EP 1 960 932 B1 265 EP 1 960 932 B1 266 EP 1 960 932 B1 JEDNOSTKA ZASILANIA SCH201-1 ω CN Ó LL 267 EP 1 960 932 B1 14A-10R-16 σ CN ώ 268 EP 1 960 932 B1 ΜΒΤ35200ΜΤ1 FIG.29A-2 269 EP 1 960 932 B1 FIG.29A270 EP 1 960 932 B1 PLC SCH210-1 CQ ω CM Ó LL 271 EP 1 960 932 B1 249Κ 249Κ 249Κ 249Κ ι 0Q σ CM Ó LL 272 EP 1 960 932 B1 CJ+u 273 EP 1 960 932 B1 ZŁĄCZE DO PŁYTY CPU 274 EP 1 960 932 B1 PCB230 ZASILANIE O ó LL 275 EP 1 960 932 B1 +V IS +5.5VDC 276 EP 1 960 932 B1 277 EP 1 960 932 B1 PŁYTA PC 1/0 PCB230-1 O o co Ó LL 278 EP 1 960 932 B1 HCPLj-2630 FIG.30C-1 279 EP 1 960 932 B1 280 EP 1 960 932 B1 XMIT_CLK_OUT FIG.30C-3 281 EP 1 960 932 B1 rOOd/MOS Old 282 EP 1 960 932 B1 PŁYTA PC 1/0 PCB230-1 Q O ω O LL 283 EP 1 960 932 B1 ιαχιιηο 284 EP 1 960 932 B1 285 EP 1 960 932 B1 FIG.30D-3 286 EP 1 960 932 B1 WYJŚCIE PRZEKAŹNIKA PCB230 LU O CO Ó LL 287 EP 1 960 932 B1 +3.3V 288 EP 1 960 932 B1 CD I z Ό O -N LU N OL CL FIG.30E-2 +νιθ 289 EP 1 960 932 B1 FIG.30E-3 290 EP 1 960 932 B1 GP10 PCB230 LL O CO Ó LL 291 EP 1 960 932 B1 FIG.30F-1 - |iGND 292 EP 1 960 932 B1 ZŁĄCZE SZYNY QLC PIC 12C PCB230 O o o LL 293 EP 1 960 932 B1 g cr, SCXO 294 EP 1 960 932 B1 FIG.30G-2 295 EP 1 960 932 B1 PGNDO 296 EP 1 960 932 B1 297 EP 1 960 932 B1 CPU SCH202-3 FIG.31A 298 EP 1 960 932 B1 299 EP 1 960 932 B1 +3.3V ▲ CO oo 122 FIG.31A-2 300 EP 1 960 932 B1 301 EP 1 960 932 B1 302 EP 1 960 932 B1 303 EP 1 960 932 B1 ra ra Z"SSA ra 304 EP 1 960 932 B1 305 EP 1 960 932 B1 306 EP 1 960 932 B1 JEDNOSTKA ZASILANIA SCH202-3 CO ω Ó LL 307 EP 1 960 932 B1 LP2992ILD-3.3 308 EP 1 960 932 B1 LP2992ILD-1-5 309 EP 1 960 932 B1 ro κ LP2992ILD-3.3 310 EP 1 960 932 B1 311 EP 1 960 932 B1 312 EP 1 960 932 B1 313 EP 1 960 932 B1 314 EP 1 960 932 B1 315 EP 1 960 932 B1 316 EP 1 960 932 B1 317 EP 1 960 932 B1 RTC/TAMPER TEMP/RESET PCB202-3 r— ω O LL 318 EP 1 960 932 B1 OCZEKIWANIE NA OSTATECZNE PODŁĄCZENIE FIG.31D-1 319 EP 1 960 932 B1 320 EP 1 960 932 B1 ε-αιεου ,— - I αΝ90 321 EP 1 960 932 B1 322 EP 1 960 932 B1 323 EP 1 960 932 B1 324 EP 1 960 932 B1 PAMIĘĆ SDRAM SCH202-3 FIG.31F 325 EP 1 960 932 B1 D[0:31] A[0:23] —-DQM[0:3]SD_A10 I - 326 EP 1 960 932 B1 327 EP 1 960 932 B1 DIFF AMPS PCB202-3 O co ώ LL 328 EP 1 960 932 B1 329 EP 1 960 932 B1 I VB_OUT_D 330 EP 1 960 932 B1 GQ CO ADC.REF O 331 EP 1 960 932 B1 FIG.31G-4 332 EP 1 960 932 B1 α'ΐηο ολ t 333 EP 1 960 932 B1 MIERNIK I PCB202-3 FIG.31H 334 EP 1 960 932 B1 335 EP 1 960 932 B1 IC/74HC4051/TSSOP16 336 EP 1 960 932 B1 +3.3Α 337 EP 1 960 932 B1 STEWARD , , Λ 2000ohms FIG. 31Η -4 338 EP 1 960 932 B1 IC/74HC4051/TSSOP16 FIG.31H-5 339 EP 1 960 932 B1 C3 +3.3A 340 EP 1 960 932 B1 FIG.31 H-7 341 EP 1 960 932 B1 FIG.31H-8 342 EP 1 960 932 B1 343 EP 1 960 932 B1 MIERNIK V SCH202-3 FIG.31I 344 EP 1 960 932 B1 FIG.311-1 345 EP 1 960 932 B1 346 EP 1 960 932 B1 +3.3ΑΟ 347 EP 1 960 932 B1 FIG.311-4 348 EP 1 960 932 B1 25ΡΡΜ 34.0Κ 349 EP 1 960 932 B1 PLC RCV PCB202-3 350 EP 1 960 932 B1 TETA 120+ BIEGUN CEWKI FIG.31J-1 351 EP 1 960 932 B1 FIG.31J-2 VC£+ i 352 EP 1 960 932 B1 KĄTTETA 100 353 EP 1 960 932 B1 FIG.31J-4 354 EP 1 960 932 B1 FIG.31J-5 355 EP 1 960 932 B1 356 EP 1 960 932 B1 357 EP 1 960 932 B1 358 EP 1 960 932 B1 359 EP 1 960 932 B1 360 EP 1 960 932 B1 361 EP 1 960 932 B1 AG.31M-2 362 EP 1 960 932 B1 U21-A 363 EP 1 960 932 B1 οολ ΞΞ3 364 EP 1 960 932 B1 03Λ£'£+ θ 365 EP 1 960 932 B1 PLC SCH202-3 FIG.31Ν 366 EP 1 960 932 B1 367 EP 1 960 932 B1 368 EP 1 960 932 B1 369 EP 1 960 932 B1 370 EP 1 960 932 B1 371 EP 1 960 932 B1 +1.5V +3.3V ZŁĄCZEBDM F1G.31P 372 EP 1 960 932 B1 JA+I Όΐε'ΟΗ 373 EP 1 960 932 B1 DGND I OĘ R/W TAMPER_LEDJSEC COIWST vęo ΓΞ CS1 _ D[O:31] \D16 \017 \D18 \019 \D2O \O2l \D22 \D23 \D24 \D25 \D26 \D27 \D28 kD29 A[0:23] \p30 D31 +vaCZZ ZŁĄCZE TESTOWE HDR_2X13 ZŁĄCZE MĘSKIE +3.3V DACKO OROÓ adcjaloe DSP_SCIK DSP_SPI_CŚ1 SDO DSP_SPI_CS1 PLCRH PLCRL SGND D10 D10 / D11 D12 D12 D28 25 D13 D13 / D14 D15 015 / 3v Σ +3 _ CLKOUT TESTCS 2X20-RA FIG.31R-1 ZŁĄCZE MĘSKIE FIG.31R-2 374 EP 1 960 932 B1 ZŁĄCZE DO PŁYTY WE/WY FIG.32 375 EP 1 960 932 B1 CIĄG DALSZY NA RYS. 33A-2 +3.3REF C~ 376 EP 1 960 932 B1 FIG.33A-2 377 EP 1 960 932 B1 +υ Ξ 378 EP 1 960 932 B1 O C_ CS LO CS OZNACZ PV/PN NA SINKSCREEN es Q_ co CL N Q llt QC 2 »£ ig — O cl ZD CL co oo to CS» CS CO CS co ct: 379 EP 1 960 932 B1 U95P2O IC/M25P20/SOB Ό LLT CL O co co ó LL 380 EP 1 960 932 B1 381 EP 1 960 932 B1 OCZEKIWANIE NA OSTATECZNE PODŁĄCZENIE F1G.33E-1 382 EP 1 960 932 B1 RTC/TEMP/TAMPER/RESET PCB202—3 383 EP 1 960 932 B1 WZMACNIACZY RÓŻNICOWYCH FIG.33F-1 384 EP 1 960 932 B1 FIG.33F-2 385 EP 1 960 932 B1 FIG.33G-1 386 EP 1 960 932 B1 fe 470 pF CN O CN O m o_ oi LU CN I o co co ó “Y~ N V ω o co S? K. O N 387 EP 1 960 932 B1 5-οί cm ο ο X ro ιο co az • ‘Λ Ol Ol PO 9oo Qro cm 2- °° q- oo tT rX CM CM co CM U_ pO C SP O oro Q£ "·— CM ΛΛΛ/ CM O QCM oz CM 2000ohms FIG.33G-3 388 EP 1 960 932 B1 25ΡΡΜ 34.0Κ 389 EP 1 960 932 B1 θ +3.3Α ι-f-CZ +3.3A 390 EP 1 960 932 B1 391 EP 1 960 932 B1 FIG.33H-2 Ν V ω ι -J co co Ss Ωί O Ν 392 EP 1 960 932 B1 393 EP 1 960 932 B1 ADC_REF 394 EP 1 960 932 B1 395 EP 1 960 932 B1 396 EP 1 960 932 B1 PORT OPTYCZNY 397 EP 1 960 932 B1 398 EP 1 960 932 B1 BEZPOŚREDNIE DAC DLA MULTIPLEKSACH PRZEŁĄCZNIKÓW WYJŚCIA TESTOWE LED o FIG.3 CO LU N CL CL rQ 399 EP 1 960 932 B1 400 EP 1 960 932 B1 401 EP 1 960 932 B1 402 EP 1 960 932 B1 403 EP 1 960 932 B1 404 EP 1 960 932 B1 ODPOWIEDŹ CZĘSTOTLIWOŚCIOWA FILTRA W FAZIE 405 EP 1 960 932 B1 406 EP 1 960 932 B1 407 EP 1 960 932 B1 ODPOWIEDŹ CZĘSTOTLIWOŚCIOWA FILTRA W FAZIE 408 EP 1 960 932 B1 CS CN FFT RAMKA 1 FFT RAMKA 2..... FFT RAMKA N CS CS cs CN só LL 409 EP 1 960 932 B1 ODNOŚNIKI CYTOWANE W OPISIE Poniższa lista odnośników cytowanych przez zgłaszającego ma na celu wyłącznie pomoc dla czytającego i nie stanowi części dokumentu patentu europejskiego. Pomimo, że dołożono największej staranności przy jej tworzeniu, nie można wykluczyć błędów lub przeoczeń i EUP nie ponosi żadnej odpowiedzialności w tym względzie. Dokumenty patentowe cytowane w opisie 410
1,319 paragraphs in 30 sections, as filed
[0001] This application claims priority to U.S. Provisional Application No. 60 / 737,580, filed November 15, 2005, U.S. Provisional Application No. 60 / 739,375, filed November 23, 2005, and U.S. Provisional Application No. 60 / 813,901, filed June 15, 2006, and is partial continuation of US Patent Application No. 11 / 431.849, filed May 9, 2006, which is separated from US Patent Application No. 11 / 030,417, filed January 6, 2005 (now US Patent No. 7,054,770), which is separated from US Patent Application No. 09 / 795,838, filed February 28, 2001 (currently US Patent No. 6,947,854).
[0002] US 5696501 relates to an electric measuring device and related method. The device has a common node and a number of electrical measuring devices connected to the node. Measuring devices measure power consumption and transmit a signal to the node. The node calculates the power consumed and stores the results in a register.
[0003] EP 1379012 relates to an automated and integrated measuring procedure for reading and transferring the obtained digital data to a remote computer system and the device intended therefor. The device measures power, gas and water consumption, processes the measured data and transmits the data to the substation of the supply company.
[0004] US 2005/0137813 relates to a system and method for directly monitoring and calculating energy consumption. The system has a measuring device connected to the power line and a transponder connected to the measuring device. The transponder receives and transmits data from and to the measuring device via a power line and receives and transmits data from and to a remote computer.
Background and substance [0005] According to the invention there is provided a device for multi-channel electricity measurement as described in claim 1.
[0006] One embodiment of the present invention includes a measuring device that is associated with meters from the Quadlogic ASIC family (see US Patent No. 6,947,854 and US Patent Application Publication No. 20,060,036,388). In particular, this embodiment (hereinafter referred to as the "Energy Guardian" for convenience) is a multi-channel meter that is preferably capable of performing many of the functions of the aforementioned family of meters and furthermore provides the abovementioned improvements, features and components.
[0007] Used in at least one embodiment, MiniCloset is a 24-channel measuring device that measures electricity consumption for up to 24 single-phase consumers, 12 two-phase consumers or 8 three-phase consumers. Preferably, one or more Load Control Modules (LCM) are connected to the MiniCloset, discussed below.
[0008] The Energy Guard preferably includes a MiniCloset measuring head module and two LCMs mounted in a steel box. Relays that allow remote disconnection and reconnection of electricity consumers are also mounted in the box, along with current transformers. See FIG. 1.
[0009] Once installed, the electricity supply line to the electricity consumer is output from the main electricity supplier, passed through an Energy Guard device and led directly to the consumer's home. The construction and use of the Energy Guard will be clear to the skilled person after reviewing the following description and related figures. Source code is provided in the attached Annex.
[0011] The Energy Guard meters are preferably capable of providing:
(A) Remote disconnection / reconnection: The meter supports full duplex (bidirectional) communication via power line communication ("PLC") and can be equipped with remotely operated relays (60 amp, 100 amp or 200 amp) allowing remote disconnection and reconnecting electricity users.
(B) Theft Prevention: The system is designed with three specific features to prevent theft. First, the Energy Guard device is preferably installed on an electric pole above the medium voltage lines, making it difficult for consumers to access and manipulate. Secondly, since there are no additional signal cables in the system (ie all communication occurs along the power line), any serious communication cable damage is immediately detected. This means that if the communication cable is cut, the service is cut off, which is easily seen. The third anti-theft feature is that the meter can be used to measure transformer energy to confirm total measurements for individual customers. Discrepancies may indicate energy theft.
(C) Violation Detection: The Energy Guard preferably provides two modes of optical violation detection. Each unit contains light that reflects off a small mirror type sticker. The absence of this reflected light indicates that the box has been opened. Detection of this will automatically disconnect all customers being measured using the Energy Guard unit. In addition, if the Energy Guard enclosure is opened and the surrounding light enters it, this will also automatically disconnect all customers being measured using the Energy Guard unit. These two violation detection modes operate continuously and change many times per second for maximum security.
(D) Reverse voltage detection: In some cases, the supply company may disconnect the energy to an individual customer and the customer will be able to receive energy from an alternative source. If the plant restored the connection under these conditions, the measuring equipment and / or distribution system could be damaged. The Energy Guard is preferably capable of detecting such abnormal conditions. The Energy Guard can detect any voltage that returns to open disconnection with lines connected to the clients' property. If voltage is detected, the Energy Guard firmware will automatically prevent reconnection.
(E) Prepayments: Prepayments for energy can be made by phone, electronic transaction or in person. The quantity of kWh purchased is transmitted to the meter and stored in its memory. The meter will count down energy showing how much available energy is left to reach zero and disconnect. As long as the consumer continues to buy energy, the service will not be cut off and the supply company will have a daily activity report.
(F) Load Limitation: As an alternative to disconnection for non-payment or as part of a prepayment system, an Energy Guard meter may allow the supplier to remotely limit the supplied power at a set level, causing disconnection when the load is exceeded. if
As the consumer exceeds this load and is disconnected, he can reset the button on the optional remote display unit to restore the load, as long as the connected load is less than the set limit. Alternatively, customers can call the electricity provider hotline to restore the service. This feature allows electricity suppliers to provide electricity for critical systems, for example even in the absence of payment by the customer.
(G) Limiting monthly consumption: Some consumers benefit from subsidized rates and are offered maximum monthly consumption. The Energy Guard firmware allows power to be cut off when a certain level of consumption is reached. However, this type of program is best implemented if advanced consumer notification is provided. This can be achieved either by means of a display at home, thanks to which a message or series of messages notifies consumers that their consumption level is approaching the expected monthly consumption. Alternatively (or in combination), you can design temporary service interruptions as the limit approaches, energy is disconnected for longer periods to notify residents. These planned service interruptions act as a warning to consumers about the impending limit so that they have time to change consumer habits.
(H) Meter approval: The integrated system module is preferably replaceable. This allows easy laboratory re-attestation of the meter accuracy in the event of a billing question by the customer.
(I) Working benefits in use: The Energy Guard has built-in numerous event logs and diagnostic functions, providing service technicians with extensive data for commissioning and troubleshooting of electrical and communication systems. Parameters not related to invoicing include: amps, volts, temperature, harmonic content factor, instantaneous watts, wages and volt amps, V2 hrs, 12 hrs, power factor and phase angle.
[0012] These and other features will be apparent to those skilled in the art after reviewing the attached descriptions, program code, and diagrams.
[0013] In one aspect, the invention includes a device for measuring electricity consumption, comprising: means for remote disconnection via power line communications; means for detecting theft of electricity; violation detection means; and reverse voltage detection means.
[0014] According to another embodiment, the invention includes a multi-channel electricity measurement device comprising: (a) a measuring head capable of measuring electricity consumption for numerous electricity consumer lines; (b) a transponder communicating with the measuring head and capable of transmitting data received from the measuring head via power line communication to a remote computer and for transmitting data received via communication with power lines from a remote computer to the measuring head; and (c) a load control module communicating with the measuring head and capable of activating the connection and disconnection of each set of relays, each set of relays corresponding to one of the set of electricity consumer lines.
[0015] In various embodiments: (1) the device further includes a violation detector communicating with the measuring head; (2) the violation detector includes light and a reflecting surface
And the measuring head is suitable for commissioning the load control module to disconnect all consumer lines if the violation detector provides notification that no reflection of light by the reflecting surface has been detected; (3) the device further includes a box containing a measuring head, a load control module and relays, and wherein the violation detector includes a surrounding light detector penetrating into the box; (4) the device further includes a box containing a measuring head, a load control module and relays, and in which the box is installed on an electric pole; (5) the device further includes means for comparing the transformer energy with the total energy consumed by consumer lines; (6) the device further includes means for detecting reverse voltage flow in consumer lines; (7) the device furthermore includes a computer readable memory communicating with the measuring head and a meter communicating with the measuring head, the meter corresponding to the consumer line and is capable of counting the amount of energy stored in the memory and the measuring head is capable of sending a disconnection signal to the module to control the load to disconnect the consumer line when the counter reaches zero; (8) the device further includes a computer readable memory communicating with the measuring head, the memory being capable of storing a load line for the consumer line, and the measuring head being capable of sending a disconnection signal to the load control module to disconnect the consumer line when the load limit is disconnected will be exceeded; (9) the device further includes a computer readable memory communicating with the measuring head, wherein the memory is capable of storing the consumption line for the consumer line and the measuring head is capable of sending a disconnection signal to the load control module to disconnect the consumer line when the consumption limit will be exceeded; (10) the transponder is capable of communicating with a remote computer via a medium voltage line; (11) the device further comprises a display unit communicating with the measuring head and capable of displaying data received from the measuring head; (12) the display unit is capable of displaying information regarding energy consumption by the consumer; (13) the display unit is capable of displaying warnings regarding energy consumption by the consumer or suspected energy theft; and (14) the display unit is used to transmit information input by the consumer to the measuring head.
Brief description of the drawings [0016]
FIG. 1 is a block / connection diagram showing a combination of preferred embodiments.
FIG. 2 is a block diagram showing the physical configuration of the preferred embodiments.
FIG. 3A-3B are diagrams of the preferred CPU board for the Scanned Transponder and MiniCloset device.
FIG. 4 is a diagram of the preferred power source for the Scanned Transponder.
FIG. 5 is a diagram of the preferred power source for the MiniCloset device.
FIG. 6 is a diagram of a preferred printed circuit board for returning current information from a transformer to a MiniCloset measuring head.
FIG. 7A-7C are diagrams of a preferred Load Control Module PCB.
FIG. 8A-8D are diagrams of a preferred power board that provides optical detection of side effects.
EP 1 960 932 B1
FIG. 9A-9C are diagrams of the preferred Energy Guard connection board.
FIG. 10 is a diagram of a control printed circuit board used to provide control of relays.
FIG. 11 is a schematic of the preferred Energy Guard base assembly.
FIG. 12 and 13 are diagrams of preferred phase busbars and their construction.
FIG. 14 is a diagram showing the construction and assembly of the zero strip frame.
FIG. 15 shows preferred transition strips; FIG. 16 shows the preferred placement of transition strips.
FIG. 17 and [18] show the preferred design of the receiving module.
FIG. 19 shows a preferred integrated current detection and relay module. FIG. 20 is an exploded view of the preferred integrated current detection module and relays.
FIG. 21 shows exploded views of preferred measurement modules.
FIG. 22 shows the measurement modules placed in the EG [Energy Guard] assembly
Energy Guard] and receiving module.
FIG. 23 is an exploded view of a preferred embodiment of the Energy Guard. FIG. 24 is an exploded view of the preferred EG assembly and base assembly.
FIG. 25 shows a preferred EG system.
FIG. 26 and 27 are preferred diagrams of the measurement module.
FIG. 28 shows the preferred diagrams for a back plate.
FIG. 29 shows preferred power board diagrams.
FIG. 30 shows preferred I / O expansion board diagrams.
FIG. 31 shows preferred CPU board diagrams.
FIG. 32 shows preferred diagrams for a control module.
FIG. 33 shows preferred diagrams of measuring and power circuits for a consumer display module; FIG. 34 depicts preferred CDM display board diagrams.
FIG. 35 is a block diagram of a preferred analog front-end measurement system. FIG. 36 and 37 show preferred DSP implementations.
FIG. 38 illustrates the beneficial features of frequency and response to a phase filter pulse.
FIG. 39 illustrates the introduction of PLC signals with an odd half of harmonics by 60 Hz. FIG. 40 shows 12 possible ways to go beyond the phase of the FFT frame received by the meter with the FFT frame transposed by scanning.
FIG. 41 illustrates advantageous FIR filter specifications.
FIG. 42 shows voltage and current resulting from favorable FFT.
Detailed Description of Preferred Embodiments [0017] In one embodiment, the Energy Guard measurement device includes MiniCloset (i.e., a measurement device for measuring multiple consumer lines); Scanned Transponder; one or more relays capable of disconnecting the service from selected consumers; Load Control Module; and optical means for detecting adverse effects.
[0018] The MiniCloset and Scanned Transponder cited herein are very similar to those described in US Patent No. 6,947,854. This means that although they have been improved over time, their functions and structures relating to this description can be considered the same as those described in the above patent.
[0019] One aspect of the invention involves utilizing the existing multi-channel measurement function found in MiniCloset and adding remote connection and disconnection via a PLC. The provision of such additional functionality required the addition of new hardware and software. The equipment added includes the Load Control Module (LCM) and connection / disconnection relays. A set of auxiliary circuits has been added to route signal routes to and from the meter's main processor - the MiniCloset5 Measuring Head. Software add-ons include code modules that communicate with the added hardware as described in the following tables.
[0021] FIG. 1 is a block diagram of connections from a preferred embodiment. Medium voltage lines A, B, C, and N (zero) supply Distribution Transformer 110. Low voltage lines connect (via current transformers 120) Distribution Transformer 110 with the Energy Guard unit 140. The Energy Guard unit 140 monitors the current transformers 120 and supplies single-phase Consumer lines 1-24.
[0022] FIG. 2 is a block diagram of the preferred structure of the Energy Guard unit 140.
[0023] The scanned Transponder 210 is the preferred data collector for the unit 140, it can be located outside or inside the MiniCloset device and can also be the main data collector for more than one MiniCloset device. The scanned Transponder 210 preferably: (a) checks the data (each communication preferably begins with the verification of the identity of the clock and meter to ensure data integrity); (b) collects data (it periodically collects a block of data from each meter unit, each block containing previously accumulated meter readings, interval readings and event records); (c) stores data (preferably, the data is stored in non-volatile memory for a specified period of time (e.g. 40 days)); and (d) reports data (via PLC, telephone modem, RS-232 connection or other means).
[0024] The slide plate 280 includes a Minicloset measuring head and a load control module 240 that provides control signals for activating the relays. All electronics are preferably supplied from a 250 power source. Back plate assembly 270 contains a plurality (e.g. 24) Current Transformers and relays - grouped in this example as three sets of 8 CT [Current Transformers] and relays . Consumer cables are routed through CTs and connected to the circuit on consumer property 290. Remotely located Scanned Transponder 210 gains access to the Energy Guard measuring head and communicates bidirectionally using communication on the power line carrier.
[0025] The signal flow shown in FIG. 1 and 2 are preferably obtained by implementing various software code modules that work simultaneously to enable remote connection / disconnection capability in the Minicloset device. These program modules, presented in the Annex below, are:
<td>Code Module</td><td>Location</td><td>Function</td>
<td>Icm.def and pic.def</td><td>Control module load</td><td>Starting connection and disconnecting relays.</td>
<td>pulse.c and pulse.h</td><td>Measuring head</td><td>Establishing communication with LCM.</td>
<td>picend.def and picvars.def</td><td>Measuring head</td><td>Providing control signals to LCM.</td>
<td>pulselink.def and pulseoutm.c</td><td>Measuring head</td><td>Provides LCM pulses to use for connecting and disconnecting relays.</td>
EP 1 960 932 B1 [0026] FIG. 3-10 are diagrams of preferred components as described below. Preferred connect / disconnect relays are the K850 series relays, but those skilled in the art will recognize that other relays can be used without departing from the scope of the invention.
<td>Figure</td><td>Scheme</td><td>Detail</td>
<td> 3</td><td>PCB 107D</td><td>Scanned Transponder CPU board and MiniCloset device</td>
<td> 4</td><td>PCB 135C</td><td>Power Source for the Scanned Transponder.</td>
<td> 5</td><td>PCB 144C</td><td>Power Source for the MiniCloset device.</td>
<td> 6</td><td>PCB 146C</td><td>This board returns information from the Current Transformer back to the head MiniCloset measuring device.</td>
<td> 7</td><td>PCB 160A</td><td>Board for Load Control Module.</td>
<td> 8</td><td>PCB 170</td><td>EG power board that adds optical detection of side effects.</td>
<td> 9</td><td>PCB 171</td><td>EG connection plate. Board with routing for signal routing.</td>
<td> 10</td><td>PCB 172</td><td>Control circuit board for controlling Relays.</td>
[0027] In another embodiment, the implementation of the Energy Guard uses the architecture similarity of traditional chopper panels to a multi-channel measurement environment. In the chopper panel, electricity is supplied to the panel and distributed to various consumer circuits via choppers that provide the ability to connect or disconnect consumer circuits.
[0028] In the MiniCloset / Energy Guard device, numerous current transformers measure current in consumer circuits and return this data back to the central processing unit, where the measurement quantities are calculated. However, MiniCloset / Energy Guard has some key differences to the chopper panel. For example, while the choppers are near the consumer's property, an Energy Guard is usually installed near the supply transformer. The advantages offered by this alternative embodiment will be apparent to those skilled in the art. For example, this embodiment offers improved dimensions and overall size compared to the above discussed embodiments. Space is always a limitation when adding hardware to existing electrical installations. This version of the Energy Guard ("EG") with favorable dimensions of 28 "X 22" X 11 "provides the main advantage in situations of space restrictions.
[0029] The following description includes preferred construction details, detailed schematics and software descriptions. As in the above discussed embodiments, this embodiment is used to provide remote disconnection / reconnection operations, prevent theft, detect misuse, reverse voltage detection, prepay and load reduction, and perform meter attestation.
[0030] Constructional details of the preferred EG [0031] In this embodiment, the basic components of EG are:
1. Energy Watch Basics Team
EP 1 960 932 B1
2. Energy Guard team
a. Phase Busbars and Zero Strips
b. Transition Strips
c. Receiving Module
3. Energy Guard Measuring Modules
a. Measuring Modules
i. Integrated Current Detection Modules and Relays
4. Electronic Components of the Energy Guard a. PCB 203
b. PCB 204
c. PCB 234
d. PCB 235
e. PCB 202
f. PCB 210
g. PCB 230
h. PCB 206
EG Base Assembly [0032] The EG base comprises a housing bottom with screws and retaining washers as a locking mechanism for the upper EG cover, which is connected on one side by means of sling hinges. See FIG. 11. The bottom of the enclosure provides routing for consumer cables.
EG - Phase Busbars assembly [0033] Three aluminum phase busbars are facing the center of the Energy Guard assembly and staggered. See FIG. 12 and 13. This ensures connection with consumer measuring modules by using transition strips. A stepped busbar arrangement is shown in FIG. 13. Busbars are marked in black.
Zero Strips [0034] EG preferably includes 4 zero strips that form the frame for the EG assembly, whereby a path for zero current is provided. This is shown in FIG. 14. The protrusion on the crossbar ensures neutral current from the transformer of the distribution company. Also, there are 2 neutral strips on the motherboard that transfer neutral current to the control module.
Transition Strips [0035] Transition strips complete the mechanical and electrical connection between consumer measuring modules and phase busbars. See FIG. 15. Transition bars for phase A and C are shown in FIG. 15A; transition strips for phase B are shown in FIG. 15B. FIG. 16 shows transition strips marked in black.
Receiving Module [0036] The receiving module is preferably made of plastic and mechanically adopts measuring modules that can be easily fitted into the EG unit. Each EG has 4 receiving modules, which are combined with each other and can contain either 12 two-phase measuring modules or 8 three-phase. See FIG. 17. The receiving module also provides a mechanical path for the motherboard's zero strip that connects to the control module. See FIG. 18.
Consumer Measuring Modules
EP 1 960 932 B1 [0037] Preferred consumer measuring modules provide the measurements required to measure the consumption of a single-phase, two-phase or three-phase customer. A single module acts as a complete stand-alone meter that can be tested and evaluated as a separate measurement unit. Each module preferably includes an integrated current and relay detection module and electronic measuring components, and provides a connection between the consumer circuit and phase busbars. FIG. 19 shows a preferred integrated current detection and relay module. FIG. 20 is an exploded view of the preferred integrated current detection module and relays.
[0038] FIG. 21 shows exploded views of preferred measurement modules. FIG. 22 shows the measuring modules (marked in black) located in the EG frame assembly and the receiving module.
[0039] FIG. 23 is an exploded view of the Energy Guard, and FIG. 24 is an exploded view of the preferred EG Assembly and EG Basics Assembly.
Electronics [0040] The Control Module boxes preferably contain various PCBs that work simultaneously to collect measurement data from individual measurement modules and communicate on power lines to transmit this data to a host device, such as a Scanned Transponder ("ST").
[0041] FIG. 25 illustrates the preferred Energy Guard system for this embodiment. Each consumer line has a corresponding Measurement Module (PCB 203 and PCB 204, discussed below) (diagrams shown in FIGS. 26 and 27).
[0042] The back plate 2510 shown in FIG. 25 (PCB 234; see FIGURE 28 for a structure diagram) is a common bus that carries signals within the EG. There are two types of possible communication on the Back Board 2510 to enable data transfer from the 2520 Control Module to individual PCB 203 Measuring Modules. This can be achieved either by using the I2C 2-cable option or 1-cable serial option.
[0043] The Control Module 2520 includes a Power Board (PCB 210; see FIGURE 29 for a schematic), which is a power supply board that also has built-in PLC transceiver circuits. The Power Board supplies power to the CPU board and electronic circuit board components 203. The 2520 Control Module also includes an I / O Expansion Board (PCB 230; see FIG. thirty in terms of schematic), which is a board with several I / O extension options that allow communication from the Measurement Modules to the CPU board.
[0044] The Control Module 2520 also includes a CPU Board (PCB 202; see FIGURE 31 for a schematic) that has a built-in Digital Signal Processing (DSP) processor.
[0045] Finally, the Control Module 2520 includes a routing board (PCB 235; see FIGURE 32 for a schematic) with paths and a bushing without any electronic components embedded.
[0046] Each Consumer Display Module (CDM) 2530 is installed in the client's property and can communicate in two directions with the EG installed on the distribution transformer serving the given consumer. Two-way PLC allows communication between the consumer and the supplier on low voltage lines and enables the supplier to send the consumer regular information, warnings, special information about interruptions in supply, etc. [0047] Each CDM 2530 contains the selected combination of measurement and power source together with PLC circuits on the same board (PCB 240; see FIGURE 33 for a schematic). Each CDM also preferably has 99
EP 1 960 932 B1 digital display board (PCB 220; see FIGURE 34 for a schematic). This display communicates with EG and presents consumption information, warnings, notes and other messages from the supplier.
Equipment Implementation [0048] In one embodiment, the Energy Guard has the Fast Fourier Transform (FFT) implemented on the PLC communication signal on both ST and meter, and performs detailed harmonic analysis for measurement purposes. This chapter discusses the implementation scheme of the Measuring Modules, communication with the Control Modules and the PLC communication of the Control Module with the remotely placed Scanned Transponder.
[0049] Control Module 2520 includes a power source and PLC circuits (PCB 210; see FIGS. 25 and 29); I / O extension (PCB 230; see FIG. 30) and a CPU board called Meter D (PCB 202; see FIG. 31). The power source supplies power to the D meter and I / O extension, and includes PLC transceiver circuits. PCB 235 provides route routing and throughput between different boards.
[0050] The Measuring Module can have two versions: 2-phase or 3-phase. The 2-phase version can be programmed by the software to act as a single 2-phase meter or two 1-phase meters. The 2-phase version includes a B2 meter (PCB 203 schematically shown in FIG. 26), while the 3-phase version includes a B3 meter (PCB 204 schematically shown in FIG. 27). Meter B acts as a slave device to the meter D in the 2520 Control Module. The D and B meters can communicate via the serial ASCII protocol. Different B meters are interconnected via BPB 2510 to 2520, which provides power, J Hz standard and serial communication for the D meter. A preferred DSP motor for the B meter is the Freescale 56F8014VFAE chip. The preferred microprocessor used to implement the CPU on the D meter is that of the ColdFire Integrated Microprocessor family, MCF5207. The use of a specific processor is determined by the requirements of RAM and Flash dictated by the meter version. A separate power source and LCD board complete the electronic part of the D meter as a product. In addition to performing the function of the main device relative to B meters, the D meter is also a 3-phase meter and it measures the total output power of the transformer on which the EG is installed. As part of the anti-theft feature, this total value is compared to the total consumption reported by various B meters.
± kWh.
Total transformer output power [0051] The components of the signal streams are as follows:
B2: Two voltage channels, two current channels and no Power Line Carrier Channel (PLC).
B3: Three voltage channels, three current channels and no PLC Channel.
D: Three voltage channels, three current channels and one PLC channel.
[0052] Each stream has an associated circuit for performing analogue amplification and anti-aliasing.
[0053] Characteristic for the D meter is the preferred implementation of:
• Phase Locked Loop (PLL) to block sampling of signal streams for many incoming A / C lines (synchronous sampling per power line).
• Voltage Controlled Oscillator (VCO - Controlled Oscillator) at 90-100 MHz controlled by DSP processor via two PWM modules directly controlling the system clock, thanks to which DSP becomes coherent with PLL.
• a synchronous phase detector that responds only to the fundamental component of the incoming line frequency wave and not to its harmonic components.
• Options for performing FSK and PSK modulation schemes.
[0054] Each measurement and communication channel preferably includes analog front-end circuits followed by signal processing. For analog circuits, a unique anti-aliasing filter with constant gain is assigned, which ensures tracking of the first order temperature, which eliminates the need to re-calibrate meters when temperature changes occur. This will be discussed below, followed by a description of the preferred implementation of signal processing.
Voltage and Current Analog Signal Chain [0055] An analog front-end system for voltage (current) channels includes voltage (current) sensing elements and an adjustable attenuator behind which the anti-aliasing filter is located. The attenuator reduces the level of the incoming signal in such a way that there is no restriction behind the anti-aliasing filter. The constant gain anti-aliasing filter returns the signal to its full value at the input to the Analog-to-Digital Converter (ADC). In the case of measurement, the anti-aliasing filter cuts off frequencies above 5 kHz. The input data is then provided to the ADC, which is part of the DSP. See FIG. 35, which is a block diagram of the preferred analog front-end measurement system.
[0056] While a typical implementation would include a Programmable Gain Amplifier (PGA) followed by a low gain anti-aliasing filter, in the present embodiment an adjustable attenuator followed by a filter is implemented with high constant gain. In addition, the implementation of both anti-aliasing filters on a single chip is the same as using the same Quad Op Amps with 25 ppm resistors and NPO / COG capacitors. This unique implementation by pairing anti-aliasing filters ensures that the phase shifts occurring in both voltage and current channels are completely identical and therefore the accuracy of the power calculations (provided by the product V and I) is not impaired. This provides means for both V and I channels to track temperature changes up to the first row without recalibrating the meter.
[0057] In contrast, when using PGA together with a low gain filter, the phase shift in the V and I signals cannot be monitored due to the temperature. This is because the phase shift introduced by PGA is a gain function.
PLC Voltage, Current and Digital Signal Chain [0058] FIG. 36 is a block diagram of PCB 202; the functions of each block will be obvious to specialists. FIG. 36 presents a favorable implementation for DSP.
[0059] This embodiment preferably uses PLL to block sampling of signal streams for multiple incoming A / C line frequencies. In the above-discussed embodiment, sampling is asynchronous to the power line. In the D meter, there is a 90-100 MHz VCO, which is controlled by a DSP motor via two PWM modules. VCO directly manages the DSP chip clock (deactivating the internal PLL) in such a way that DSP becomes an integral part of the PLL. Locking the DSP system clock relative to the power line makes it easy to match the sampling to the power line waveform. The phase detector should operate to respond only to the fundamental component of the incoming 60 Hz wave, not to its harmonics. FIG. 37 is a diagram of a favorable implementation on DSP.
[0060] The BIOS DSP or voluntary context switching code provides three stacks, each for background, PLC communication and serial communication. The small micro [processor] communicates with DSP using the I2C controller. The circuit integrated with MSP430F2002 measures power sources, tamper detection port, battery temperature and voltage. The tasks of MSP430F2002 include:
i. maintaining RTC;
ii. battery voltage measurement;
iii. temperature measurement;
iv. + U power source measurement;
v. DSP reset in case of reduced energy supply;
vi. providing an additional alarm circuit; and vii. providing a 1-second reference to move to DSP for a time reference for measuring a 1-second reference to a system clock originating from VCO.
D Meter PLC Communication Signal Chain [0061] A typical installation consists of many EG and ST communicating on power lines. Gauge
D communicates in both directions with the Scanned Transponder remotely located via a distribution transformer. To enable this, this embodiment uses the 10-25 kHz band for PLC communication. The PLC signal is sampled at approximately 240 kHz (212 * 60), synchronously with the voltage on the line, and then a finite impulse response (FIR) filter is used to decimate the data. The preferred FIR specifications are listed below:
10-25 kHz band
<td colspan="2">Number of Counts</td><td> 65</td>
<td>blanking attenuation</td><td>bandwidth</td><td>71,23dB</td>
<td>Upper frequency pass</td><td>bandwidth</td><td>25kHz</td>
<td>Lower frequency attenuation</td><td>bandwidth</td><td>35kHz</td>
<td>Sampled at</td><td></td><td> 60 * 4096</td>
<td>End of sampling</td><td></td><td> 30* 2048</td>
[0062] See FIG. 38 to view the favorable response of the phase filter to the frequencies and characteristics of the impulse responses.
[0063] After decimation up to 60 kHz (2<sup>11</sup> * 30), decimated data is subjected to 2048-point FFT. The data transfer rate is therefore determined as 30 baud depending on the choice of FIR filters. Each FFT produces two bits approximately every 66 msec. when using FIR in the 10-25 kHz band for communication via distribution transformers.
[0064] To circumvent the communication problem in the presence of noise on the line, in the present embodiment it is preferred to implement a unique technique for clear and reliable communication. This is achieved by introducing PLC signals at frequencies that cover the odd half of the harmonics of the frequency lines (60 Hz). This is discussed below for an embodiment using the typical noise spectrum occurring on AC lines in the 12 -12.2 kHz range.
EP 1 960 932 B1 FIG. 39 illustrates the introduction of PLC signals with an odd half of harmonics by 60 Hz. Because the FFT is calculated every 30 Hz and the harmonics are separated by 60 Hz, the data bits are in the range corresponding to 201.5th and 202.5th 60 Hz harmonic in 60 Hz. 39. The algorithm considers these two frequency ranges and compares the signal amplitude in both to determine 1 or 0. This FSK scheme uses two frequencies and gives a data rate of 30 baud. Alternatively, you can implement QFSK, which uses 4 frequencies, for 60 bauds.
[0066] When passing through transformers, both ST and D meters preferably calculate FFT on PLC and data signals every 30 Hz in the range of 10-25 kHZ. Because Phase Coupling Loops (PLL) implemented in both ST and meter D are blocked for lines, data frames are also synchronized with the line frequency (60 Hz). However, data frames may have phase shifts due to:
1. various transformer configurations that may occur on the path between the ST and the meter (delta-Wye, etc.); and
2. phase shift caused by the fact that STs are locked in a certain phase, while single- and multi-phase meters can be powered by other phases.
[0067] The signal-to-noise ratio (SNR) is maximum when the meter data frame and the ST data frames are almost perfectly matched. From the meter's point of view, this requires receiving a PLC signal from all possible STs that it can "hear", decoding the signal, searching for SNRs by comparing data frames and then sending a response to the ST, which gives maximum SNR. FIG. 40 shows 12 possible ways out of phase of the FFT frame received by the meter with the FFT ST frame. The dashed lines correspond to 30 degrees of rotation due to the delta transformer in the signal path between the ST and the meter.
[0068] Furthermore, since data frames are available every 30 Hz on a 60 Hz line, there are two possibilities corresponding to 2 possible phases obtained by dividing 60 Hz by 2. Thus there are 24 ways to incorrectly match meter data frames to ST data frames.
[0069] Each ST frame has an odd integer number of carrier frequency cycles. Because the preferred modulation scheme is Frequency Shift Keying (FSK), if there are n cycles to transmit bit 1, bit 0 is transmitted using n + 2 carrier frequency cycles. For the meter, it is crucial to recognize its own 60 Hz cycles so that it is able to decode its own data bits that are available every 1 / 30th of a second.
[0070] If the meter D decodes signals with incorrectly matched data frames, there is energy that decomposes into adjacent frequencies (separated odd half). If the signal level that falls into the "adjacent" frequency range is lower than the noise level, the signal may be decoded correctly. However, if the spread exceeds the noise level, the ability to distinguish between 1 and 0 decreases and as a result the overall SNR decreases, resulting in a decoding error. Summarizing:
a. If the frames are incorrectly matched, the data bits become unreadable and SNR decreases.
b. When the frequency changes and there are incorrectly matched data frames, there is a substantial amount of energy that scatters into adjacent FFT intervals, which results in colliding with other STs in the system that communicate using frequencies in these specific intervals.
[0071] After determining the clock offset corresponding to the highest SNR, the meter locks until a significant change in the SNR ratio, which the meter registers, in which case the process is repeated.
Implementation of Measurement in Meter D and B using FFT [0072] While versions of Meter B and Meter D perform a measurement, Meter D is also responsible for collecting measurement information from various B meters via PCB 234. Each data stream in the meters has a related circuit for analogue amplification and anti-aliasing. Each section of the analog front-end device has an adjustable attenuator controlled by a higher level code. The data stream is tested at 60 kHz (2<sup>10</sup> * 60), then the FIR filter is used to decimate the data stream up to ~ 15 kHz (2<sup>8</sup> * 60). Preferred filter specifications are shown in the table below and in FIG. 41.
<td colspan="2">Number of Counts</td><td> 29</td>
<td>blanking attenuation</td><td>bandwidth</td><td>80,453dB</td>
<td>Upper frequency pass</td><td>bandwidth</td><td>3kHz</td>
<td>Lower frequency attenuation</td><td>bandwidth</td><td>12kHz</td>
[0073] Since only data up to 3 kHz are of interest, it is preferable to use a gain drop of 3-12 kHz at a sampling rate of ~ 15kHZ during FIR decimation. Frequencies from 0-3 kHz or 12-15 kHz are mapped to 0-3 kHZ. The real part of FFT is calculated to obtain 2 data streams, which can be further divided into 4 data streams: Real and Imaginary Voltage and Real and Imaginary Current. This is achieved by adding and subtracting positive and negative mirror frequencies for the real and imaginary parts respectively. Since the aliased signal in the 12-15 kHz range falls below 80 dB, accuracy is achieved using the FIR filter discussed above. Alternatively, the 256-point composite FFT can be calculated at each phase of the decimated data stream. This gives 2 pairs of data streams: the real part, which is voltage, and the imaginary part, which is current. This approach requires a complex 256-point FFT every 16.667 milliseconds. [0074] The results of calculating any FFT are the voltage and current shown in FIG. 42, where the notation Vm, n denotes the mth harmonic component of the number of the nth cycle. For example, V11 and I11 correspond to the fundamental component of the first cycle and V21 and I21 correspond to the first harmonic component of the first cycle, etc., as shown in FIG 42, which shows FFT frames for voltage, indicating harmonics. [0075] The real and imaginary parts of the harmonic component of any k-th cycle are given as:
= Re (^) + IIM (K '<sub>t</sub>);<sub>in</sub> = 1 ... M [0076] The imaginary part of the voltage is a measure of the lack of synchronization between the PLL and the frequency of the lines. To calculate the measured values, the calculations are carried out in the time domain. In the time domain, the FFT function gives you the flexibility to calculate measured values using only the basic one
EP 1 960 932 B1 or with regard to harmonics. When using the complex form of the voltage obtained from FFT, the measured values are calculated as:
Ρ-7 * 7 * <sup>r</sup> tnk tr.k
W = Re (P) - Re (iJ) * Re (/ ") + Im (U) * W-) Var = Im (P) = Re (/"<sub>t</sub>) * Im ^) -Re (FJ) * hn (/ ^) PowerFactor -W / P [0077] However, in the formulas above, when harmonics are included (Vmk & Imk; m = 1 ... M, k = 1 ... n), all measurement quantities include results for harmonics. On the other hand, when only the basic component (Vlk & Ilk) was used, all calculated quantities represent only the input from 60 Hz. By way of example, we have presented calculations where only the fundamental component was used to perform the calculations. Of all FFT data frames, only Vl and Il were used. The following values were calculated for a given set of N frames and line frequencies<sup>f</sup>line<sup>:</sup> kWh = 52 [Re (K,<sub>1</sub>) * Re (Z<sub>11</sub>) + Im (F<sub>at</sub>) * Tm (7,<sub>and</sub>)]*UNTIL<sub>and</sub> * 10 i = l
N kVAr = £ [Rfi (/ ,,) * Im (r ,,) - Re (r<sub>at</sub>) * bn (Ai)] * Af, * 10 "r = l
ΑΕ4Α = ΣΚ | * | / "| * Δ /, * 1Ο"; Δί = V<sub>f</sub> '/ J h
N , ™ = ΣΚ \ * δ>.
i — l A / <sub>fc</sub> pft = zki * δα (= 1 [0078] The power shift factor is shown as:
<img file="PL1960932T4_D0001.tif" />
where W and VA include only the basic components and VAl = VlRMS * IlRMS; where
<img file="PL1960932T4_D0002.tif" />
I, RMS &
<img file="PL1960932T4_D0003.tif" />
for N cycles.
[0079] This flexibility allowing either to include or exclude harmonic components when calculating the measurement quantities translates into a significant improvement over the possibilities offered by the above described embodiment. Another feature offered by this embodiment is the calculation of the Harmonic Content Index (THD). THD is a measure of harmonic distortion that occurs and is defined as the ratio of the sum of the powers of all harmonics to the power of the fundamental component. For the nth cycle, it was rated as:
EP 1 960 932 B1
<img file="PL1960932T4_D0004.tif" />
Vmm (Imm) means the mth harmonic component of the nth cycle obtained from FFT, where
<img file="PL1960932T4_D0005.tif" />
Consumer Display Module [0080] The consumer display module is installed in the consumer's property, it communicates with the Energy Guard near the transformer and includes: PCB 240, power source and PLC circuit assembly (see FIG. 33); and PCB 220, LCD display (see FIG. 34). In one embodiment, the consumer display unit installed at the consumer's residence is a two-way PLC unit that communicates with EG. For example, not only the supplier can send messages, but also the consumer can request verification of consumption using EG installed on the pole. ANNEX [0081]
EP 1 960 932 B1
LCM.DEF; QLC LCM (Load Control Module) program for PIC I6C63A;
include 'C: \ pictools \ 16c63a.inc'; include 'C: \ pictools \ 16c63.tnc';
; Configuration bits
FUSES BODEN OFF; Brown-out reset disabled FUSES _CP_OFF; No codka protect
FUSES _PWRTE_OFF; Disable power-up timer FUSES _WDT_ON; Watchdog Timer Enabled
FUSES _RC_OSC; OscillatoT = RC
<td colspan="3">; Parameter Equates program</td>
<td>Software_type equ</td><td> 7</td><td>; Which PIC program is this7; 7 = LCM program</td>
<td>Software_version equ</td><td> 2</td><td>; Version #</td>
<td>LCM_base_addr equ</td><td> 16</td><td>; Address of first LCM</td>
<td>Ram_start equ</td><td>020h</td><td>; Beginning of available RAM</td>
<td>RESET_VECTOR</td><td>equ</td><td>0; Location of reset vector</td>
<td>ROM_start equ</td><td>OOSh</td><td>; first available program location</td>
<td>Num_start_bits equ</td><td> 12</td><td>; Number of start bits</td>
Port definitions
<td>comm_port</td><td>equ</td><td colspan="2">PORT</td>
<td>data_out</td><td>equ</td><td> 3</td><td></td>
<td>data_in</td><td>equ</td><td> 4</td><td></td>
<td>clock_in</td><td>equ</td><td>S</td><td></td>
<td>ctl_porteąu</td><td colspan="2">PORT</td><td> •</td>
<td>driver_enable</td><td>equ</td><td> 0</td><td>; output bit to tum on the drivers</td>
<td>Driver_enable_</td><td>mask</td><td>equ</td><td>1 «driver_enable</td>
Initialization vaiues for I / O ports
<td>init_TRlSA</td><td>equ</td><td>001lOOOOb</td><td>; Data direction for port A</td>
<td>init__TRlSB</td><td>equ</td><td>oooh</td><td>; B port data direction - all ports output</td>
<td>init_TRISC</td><td>equ</td><td>oooh</td><td>; C port data direction - all out</td>
ReadlRISC equ Olfh; C port data direction for jumperread - 0-4 ίη
Init_comm_port_value equ 1 «data_out + Driver_enabile mask option reg val equ 1000111 lb; Option register init value; bit 7 = 1: Port B pullups disabled; bit 6 = 0: Int on falling edge; bit 5 = 0: Timer 0 uses inst clock; · Bit 4 = 0: Timer 0 counts on rising edge; bit 3 = 1: Prescaler used by WDT; bit 2.0.0 = 11 kPrescaler divide by 128; ΝΟΤΈ - intemipts and timer 0 are not used by this piogram
<td>ms_preset equ ></td><td> 700</td><td colspan="2">; Time set for millisecond delay</td>
<td>; RAM locations</td><td></td><td></td><td></td>
<td>ORG Ram_</td><td>start</td><td></td><td></td>
<td>Reg. Status</td><td>for</td><td> 4</td><td>; status register</td>
<td>ORG</td><td>Status,</td><td>reg</td><td></td>
<td>Status_MSB</td><td>for</td><td> 1</td><td></td>
<td>Clk_timeout_flag</td><td>equ</td><td> 7</td><td>; Timeout waiting for comm clock edge</td>
<td>bad_reset_flag</td><td>equ</td><td> 6</td><td>; Non-POR, non-WDT reset encountered</td>
<td>POR_flag</td><td>equ</td><td> 5</td><td>; Power-on reset detected</td>
<td>WDT_reset_flag</td><td></td><td>equ</td><td>4; WDT reset, not from sleep</td>
<td>StatusLSB</td><td>for</td><td> 1</td><td></td>
<td>CPU reset_flag</td><td>equ</td><td> 7</td><td></td>
<td colspan="2">N eed_param_refresh_fiag</td><td>equ</td><td> 6</td>
<td>Parity_err_flag</td><td>equ</td><td> 5</td><td></td>
<td>G iobal_cmd_timer</td><td>for</td><td> 1</td><td></td>
<td>Jumper__state</td><td>for</td><td> 1</td><td>; current state of input jumpers</td>
<td>Parameter_reg</td><td>for</td><td> 4</td><td>; Communication parameters</td>
<td></td><td>org</td><td colspan="2">Parameterreg</td>
<td></td><td>for</td><td> 1</td><td> 9</td>
<td></td><td>for</td><td> 2</td><td> 9</td>
<td></td><td>for</td><td> 1</td><td> 9</td>
Fast communication variables
<td>Comm_state</td><td>for</td><td> 1</td><td>; Stored State of fast comm uart</td>
<td>Wstate</td><td>for</td><td> 1</td><td>; Stored state of fast comm word handler</td>
<td>Comm_b it_count</td><td></td><td>for</td><td>l; Bit counter for fast comm</td>
<td>Comm_buffer</td><td>for</td><td> 1</td><td>; fast comm word buffer</td>
EP 1 960 932 B1
<td>Work_addr</td><td>for</td><td> 1</td><td>; Address read from jumpers</td>
<td>temp</td><td>for</td><td> 1</td><td>; temporary register</td>
<td>Tpar</td><td>for</td><td> 1</td><td>; TTansverse parity</td>
<td>word_count</td><td>for</td><td> 1</td><td>; Counter for sending and receiving 5-bit words</td>
<td>Command</td><td></td><td>for</td><td>1; Command received over comm link<sub>r</sub></td>
<td>Register ID</td><td>for</td><td> 1</td><td>; Register specified in comm command</td>
<td>PIC_addr</td><td>for</td><td> 1</td><td>; Address of this PIC chip</td>
<td>Commbuf</td><td>for</td><td> 5</td><td>; Communication buffer</td>
<td>Inputhold</td><td>for</td><td> 1</td><td>; Tribute to register for comm rcv value</td>
<td>Output_bit_reg</td><td>for</td><td> 4</td><td>; Tribute to register for output bit mask</td>
<td>Flags</td><td>for</td><td> 1</td><td>; Program control flags</td>
<td>Clk_wait_flag</td><td>equ</td><td> 7</td><td>; indicates which clock edge we are waiting for</td>
<td>Global_cmd__flag</td><td></td><td>equ</td><td>6; Processing global command</td>
<td>scratch</td><td>for</td><td> 1</td><td>; Work register</td>
<td>Timeoutctr</td><td>for</td><td> 2</td><td>; Counter for pulse duration</td>
<td>millisecs</td><td>for</td><td> 1</td><td>; Counter for pulse duration milliseconds</td>
<td>Clk_timeout_ctr</td><td></td><td>for</td><td>2; counter for clock timeout</td>
<td>NPR_timer</td><td>for</td><td> 2</td><td>; counter for need parameter refresh</td>
ORG OaOh
Bank 1 RAM locations
IF $ - 1 and OlOOh crror - RAM overflow ENDIF
<td>ORG jmp</td><td>RESET_VECTOR start</td><td>; Jump to first program location</td>
<td colspan="2">Start of program space</td><td></td>
<td>ORG</td><td>ROM_start</td><td></td>
<td colspan="2">Initialization</td><td></td>
<td>setb JNB clrb JNB setb jmp</td><td colspan="2">RPO; point to upper register bank NOT_POR, got_POR; Power on reset, set flags RPO; point to RAM bank 0 NOT_TO, WDT_reset; Watchdog reset MSB.bad_reset_flag status; Indicate unknown reset condition Do_initialize</td>
EP 1 960 932 B1
WDT_reset setb jmp got_POR clrb mov clr
Do_initialize mov: clr_loop ćlr inc jz mov and jnz add
jmp
Init State
Status_MSB. WDT_resetJlag do_initialize
RPO; point to RAM bank 0
StatusI «PORflag; Set POR flag Status_LSB
FSR, # Ram_start + 2; Point past status flags
INDF
FSR lnit_state
W, FSR
In, # 7fH: clr_loop
FSR, # 20h: clr_loop; Clear RAM location; Increment pointer; If zero, done; get pointer; look at 7 LSB's; Not end of segment, continue; Point to next segment; Not last segment, continue machina setb setb mov mov mov
Status_LSB .CPU_reset_flag StatusJ.SB .Need_param_refresh Jlag comm_port, # Init_comm__port_value Comm_state, # Edge_wait Comm_bit_count, # Nurn_start_bits; Indicate CPU reset; Indicate parameter refresh needed; initialize comm port State; Initialize fast comm State clr clr jmp
PORTB
PORTC
Mainjoop; start running main program; Comm Receive routines
Edgejwait mov setb dec jz jb jmp
See_edge_one jnb mov mov jmp
Rcv_stop mov mov jnb jmp
Rcv_bits clc iOPTION.floption reg val comm_port.data_out Comm_bit_count See_edge_one Input_hoid.data_in, Set_edge_wait Comm ret; Initialize Watchdog timer; Set option reg; send a 1; decrement bit count; if zero, looking for a 1; Looking for 0, reset bit count if 1; done
Input_hold.data_in, Set_edge_wait; looking for 1, reset if 0 Wstate, # Rcv_addr; First word is address
Tpar, # 0lfh; Init parity
Rcv next word
Comm_state, # Edge_wait
Comm_bit_count, # Num_startJbits; Preset State to wait for edge Input_hold.dataJn, Parity_error; stop bit must be 1 Cmd_exec; Done, process received buffer copy.
EP 1 960 932 B1
<td>snb</td><td>Input_hold.data_in</td>
<td>SETC</td><td></td>
<td>rl</td><td>Commbuffer</td>
<td>jmp</td><td>Rcv_word_handler</td>
Comm Transmit routines
<td colspan="2">Send_edge dec</td><td rowspan="2">Comm_bit_count : Ofle comm__port.data_out Comm_ret comm_port.data_out Do_xmit_word</td>
<td>:They</td><td>j clrb jmp setb jmp</td>
<td colspan="2">Send bits</td><td></td>
<td></td><td>rl</td><td>Comm_buffer</td>
<td></td><td>jc</td><td>:they</td>
<td></td><td>clrb</td><td>comm_port.data_out</td>
<td></td><td>jmp</td><td>: check</td>
<td>:they</td><td></td><td></td>
<td></td><td>setb</td><td>comm_port.data_out</td>
<td>: check</td><td></td><td></td>
<td></td><td>jmp</td><td>Xmit_word_handler</td>
... input bit ...
... to carry shift buffer
Check for complete word; decrement bit count; if zero, send a 1; send a 0; send a 1; put xmit bit into cany; send a '0'; send a '1'; Comm receiye word handler routines
Rcv_word_handler
<td>djnz</td><td>Comm_bit_count, Comm_rct</td><td>; If word not complete, continue</td>
<td>and</td><td>Comm_buffer, # 03fh</td><td>; only 6 bits</td>
<td>clc</td><td></td><td></td>
<td>mov</td><td>In »Comm_buffer</td><td>; get 5 MSBs of received word</td>
<td>inches</td><td>paritylookup</td><td></td>
<td>xor</td><td>W Comm_buffer</td><td>; compare with receiyed word</td>
<td>jnz</td><td>Parity_error</td><td></td>
<td>rr</td><td>Commbuffer</td><td></td>
<td>and</td><td>Comm_buffer, # 01 fh</td><td>; extract 5-bit yalue</td>
<td>xor</td><td>Tpar, Comro buffer</td><td>; calculate total parity</td>
<td>mov</td><td>PCLATH, WRcv_addK</td><td></td>
<td>mov</td><td>W Wstate</td><td></td>
<td>J<sup>m</sup>P</td><td>IN</td><td>; Execute word handler routine</td>
Rcv addr
See_if_us
<td>clrb</td><td colspan="2">Flags.GIobaI_cmd_flag; Clear global command flag</td>
<td>mov</td><td>W, Comm buffer</td><td>; Get receiyed address</td>
<td>mov</td><td>PIC addr, W</td><td>; save it</td>
<td>xor</td><td>W # LFH</td><td>; is it global command</td>
<td>jnz</td><td>See_if_us</td><td>; No, check for address match</td>
<td>setb</td><td>Flags Global_cmd_flag</td><td>; Set global command flag</td>
<td>jmp</td><td>Its_us</td><td>; process rest of command</td>
EP 1 960 932 B1
<td>mov</td><td>! PORTC, # read_TRJSC</td><td>; Switch C port bit 0-4 to input</td>
<td>clrb</td><td>ctl_port. dri ver_enabl e</td><td>; Disable output drivers, enable jumper read</td>
<td>mov</td><td>temp, # 9</td><td></td>
<td>: loop</td><td></td><td></td>
<td>djnz</td><td>temp: loop</td><td>; Wait at least 20 uSec</td>
<td>mov</td><td>W / PORTC</td><td>; Get ioverse of jumpers in W</td>
<td>mov</td><td>Work_addr, The</td><td>; Save jumper value</td>
<td>setb</td><td>ctl_port.driver enable</td><td>; Enable output drivers</td>
<td>mov</td><td>! PORTC, # init_TRJSC</td><td>; Restore C port status</td>
<td>mov</td><td colspan="2">Jumper_state, Work_addr; Save jumper State</td>
<td>and</td><td>Work addr, # 03h</td><td>; Ignore all but 2 LSBs</td>
<td>add</td><td colspan="2">Work_addr, # LCM_base_addr; Add base offset</td>
<td>CJNE</td><td colspan="2">Work_addr, PIC__addr, Set_edge_wait</td>
<td>Its_us</td><td></td><td></td>
<td>mov</td><td>Wstate, # Rcv_cmd</td><td>; point to next routine</td>
jmp Rcv_next_word Rcv_cmd
<td>mov</td><td>Command Commbuffer</td><td>; save command</td>
<td>JNB</td><td>Command.4, Comm get fast</td><td>; Fast read command, skip Reg ID</td>
<td>mov</td><td>Back. # Rcv reg ID</td><td>; point to next routine</td>
jmp Rcv_next_word Comm Ret fast
<td>mov jmp</td><td>Wstate, # Rcv_tpar Rcv_next_word</td><td>; point to next routine</td>
<td>Rcv reg ID mov</td><td>register_ID, Conim_buffer</td><td>; save register number</td>
<td>mov</td><td>In State, # Rcv_tpar</td><td>; point to next routine</td>
<td>JNB</td><td>Command.3, Rcv_next_word</td><td>; If no value, done</td>
<td>mov</td><td>word_count, # 7</td><td>; Init word count</td>
<td>mov</td><td>Wstate, # Rcv_valu e</td><td>; point to next routine</td>
<td>jmp</td><td>Rcv_next_word</td><td></td>
<td>Rcv value</td><td></td><td></td>
<td>rl</td><td>Commbuffer</td><td></td>
<td>rl</td><td>Commbuffer</td><td></td>
<td>rl</td><td>Comm_buffer</td><td>; Shift rcvd bits to MSBs</td>
<td>mov</td><td>Comm_bit_count, # 5</td><td>; shift 5 bits</td>
<td>.shift loop</td><td></td><td></td>
<td>rl</td><td>Comm_buffer</td><td></td>
<td>rl</td><td>Commbuf + 4</td><td></td>
<td>rl</td><td>Comm_buf + 3</td><td></td>
<td>rl</td><td>Comm_buf + 2</td><td></td>
<td>rl</td><td>Comm_buf + 1</td><td></td>
<td>τ!</td><td>Comm_buf</td><td>; Shift a bit from Comm_buf to comm_buf</td>
<td>djnz</td><td>Comm_bit_count,: shift_loop</td><td></td>
<td>djnz</td><td>word_count, Rcv_next_word</td><td>; any mora words?</td>
<td>tnov</td><td>Wstate, # Rcv_tpar</td><td>; point to next routine</td>
<td>jmp</td><td>Rcv_next_word</td><td></td>
<td>Rcv__tpar</td><td></td><td></td>
<td>mov</td><td>W.Tpar</td><td>; Get result of parity calculations</td>
<td>jnz</td><td>Parityenor</td><td>; If not 0, parity error</td>
<td>jmp</td><td>Set_rcv_stop</td><td>; set up to receive stop bit</td>
EP 1 960 932 B1 and
; Comm transmit word handler routines
Xmit_word_handler djnz CommJn't_count, Comm_ret; If word not complete, continue
Do_xmit_word
<td>mov</td><td>PCLATH, # $ <</td><td></td>
<td>mov</td><td>W Wstate</td><td></td>
<td>jmp</td><td>IN</td><td>; Execute word handler routine</td>
Send addr
<td>mov mov jmp</td><td>Wstate, # Send cmd> W, PIC_addr Send_next_word</td><td>; point to next word routine; get address</td>
<td>Send_cmd</td><td></td><td></td>
<td>mov</td><td>Wstate, # Send_value></td><td>; point to send value</td>
<td>JNB</td><td>Command .4, V alue__is__next</td><td>; Is it fast read command?</td>
<td>mov</td><td>Wstate, # Send_reg_ID></td><td>; point to next word routine</td>
<td>Value_is_next</td><td></td><td></td>
<td>mov</td><td>W Command</td><td>; get command</td>
<td>jmp</td><td>Send_nextword</td><td></td>
<td>Send reg ID</td><td></td><td></td>
<td>mov</td><td>In state, # Send_value></td><td>; point to next word routine</td>
<td>. mov</td><td>W Register_lD</td><td>; get Register ID</td>
<td>jmp</td><td>Send_next_word</td><td></td>
<td>Send_value</td><td></td><td></td>
<td>mov</td><td>Wstate, # nextValue></td><td>; point to next word routine</td>
<td>mov</td><td>Word_count, # 7</td><td>; va1ue is 7 words long</td>
Next_value mov Comm_bit_count, # 5: loop rl comm_buf + 4 rl comm_buf + 3 rl Comm_buf + 2 rl Comm_buf + 1 rl Comm_buf ri Comm_bufFer djnz Comm_bit_count,: loop mov W, Comm_buffer djnz word_count, Sendpai_word_word
mov W, Comm_buffer jmp Send_next_word
Send_Tpar mov Wstate, # Send_stop mov W.Tpar; Get 5-bit word; if not last word, all set; send parity next; point to next word routine; get transvcrse parity
EP 1 960 932 B1 jmp Send_next_word Send_stop jmp Set_edge_wait; Go back to receive fashion; Process received buffer org lOOh
Gmd_exec
Process_cmd cjbe Command, # 7h, Fast_register_read; is it fast read7 Command, # 1 Oh, read_register; is it read register command?
cje Command, # 18h, write_register; is it write register?
cje Command, # 19h, reset_statusJłits; is it reset status?
jmp Cmd_process_done
Fast_register_read
<td>mov</td><td>registerJD, command</td><td>; Register number is same as command codę</td>
<td>Read_register</td><td></td><td></td>
<td>mov</td><td>W # 27</td><td></td>
<td>mov</td><td>W-W register__TD</td><td>; Get index of register to read</td>
<td>JNC</td><td>Cmd_process_done</td><td>; if negative, not a valid register</td>
<td>mov</td><td>Temp, The</td><td>; saveindex</td>
<td>ItlOV</td><td>PCLATH, # $ <</td><td>; set up High-order PC bits</td>
<td>mov</td><td>In, Temp</td><td>; get index</td>
<td>jmp</td><td>In the PC +</td><td></td>
<td>jmp</td><td>cpy_output_reg</td><td></td>
<td>jmp</td><td>cpy_reg_28</td><td></td>
<td>jmp</td><td>cpy reg 29</td><td></td>
<td>jmp</td><td>cpy__reg ^ 30</td><td></td>
<td>Cpy_reg_31</td><td></td><td>; Reg 31 = Status register</td>
<td>mov</td><td>Comm buf, Status reg</td><td></td>
<td>mov</td><td colspan="2">Commbuf + 1, Status_reg + 1</td>
<td>mov</td><td colspan="2">Comm_buf + 2, Status_reg + 2</td>
<td>mov</td><td colspan="2">Comm_buf + 3 + 3 Status_reg</td>
<td>jmp</td><td>Setup_reply</td><td></td>
<td>Cpy_reg_30</td><td></td><td>; Reg 30 = Serial number</td>
<td>inches</td><td>semo</td><td></td>
<td>mov</td><td>comm_buf + 3, W</td><td></td>
<td>inches</td><td>semo + 1</td><td></td>
<td>mov</td><td>comm_buf + 2, W</td><td></td>
<td>inches</td><td>semo + 2</td><td></td>
<td>mov</td><td>comtn_buf + 1, W.</td><td></td>
<td>inches</td><td>semo + 3</td><td></td>
<td>mov</td><td>comm_buf, The</td><td></td>
<td>jmp</td><td>Setup_reply</td><td></td>
<td>Cpy_reg_29</td><td></td><td>; Reg 29 = Software type and version</td>
<td>mov</td><td colspan="2">Comm_buf, # Software_type</td>
<td>mov</td><td colspan="2">Comm buf + l, # Software version</td>
<td>mov</td><td>Comm_buf + 2, # 0</td><td></td>
<td>mov</td><td>Comm_buf + 3, # 0</td><td>; Send Software type and version</td>
EP 1 960 932 B1 jmp Setup_reply
Cpy__reg_2S mov mov mov mov jmp; Reg 28 = Parameter reg Comm_buf, Parameter_reg Comm_buf + 1, Parameter_reg + 1 Comm_buf + 2, Parameter_reg + 2 Comm_buf + 3, Parameter_reg + 3 Setup_reply
Cpy_output_reg; Reg 27 = Output State roov Comm_buf, Output_bit_reg inov Comm_buf + I, Output_bit_reg + l mov Comm_buf + 2, Output_bit_reg + 2 mov Comm_bufł'3, Output_bit_reg + '3 jmp Setup_reply
Write_register mov bits: loop rl rl rl rl rl djnz cjne mov mov mov mov clrb jmp
Comm_bit_count, # 5 comm_buf + 4 comm_buf + 3 comm_buf + 2 comm_buf + I commbuf
Comm_bit_count,: loop
Register_ID, # 28, See_write_output_reg
Parameter_reg, Comm_buf
Parameter_reg + 1, Comm_buf + 1 Parameter_regt-2, Comtn_buf + 2 Parameter_reg + 3, Comm_buf + 3 Status_LSB.Need_param_refresh_flag Cpy reg 28; need to shift buffer by 5; Not reg 28, see if output reg; Copy received data to reg; Reset need parameter refresh flag; send contents back in reply
See_write_output_reg
<td>CJNE</td><td>Register_ED, # 27, Cmdjprocess_done</td><td>; if not output reg, ignore</td>
<td>mov</td><td>Output_bit_reg, Comm_buf</td><td></td>
<td>mov</td><td>Outpu t_bit_reg- (1, Comm_buf + 1</td><td></td>
<td>mov</td><td>Outputbit_reg + 2, 2 + Comm_buf</td><td></td>
<td>mov</td><td>Output_bit_reg + 3 + 3 Comm_buf</td><td>; Copy received data to reg</td>
<td>inches</td><td>Updatejoutputs</td><td></td>
<td>jmp</td><td>Cpy_outpirt_reg</td><td>; send contents back in reply</td>
Reset_status_bits mov Comm_bit_count, # 5 bits: loop rl commJwf + 4 rl comm_buf + 3 rl comm_buft-2 rl comm_buf + l rl comm_buf djnz Comm_bit_count,: loop mov W, / Comm_bufbl and Status_reg + 1, W
From mov wyComm_buf; need to shift buffer by 5; get byte; Clear bits; get MSB
EP 1 960 932 B1 and mov jmp
Setup_reply jb rnov mov and or sz setb
Status_reg, In Register_tD, # 31 Cpy_reg_31
MSB mov mov mov mov jmp
F lags .G lobal__cmd_flag, Set_edge_wait
W Status_LSB
Comm_buf + 4, W
W # 01fh
W Status_MSB
Commbuf + 4.7
Tpar, LFH #
Comm_state, # Send_edge
Wstate, #Send_addr
Comm_bit_count, # Num_start_bits Comm ret; Clear bits; indicate status reg in reply; If it was giobal, don't reply; Get LSB status; preset stored flags; Tumoff3 MSBs; Combine 5 LSbs with Status_MSB; If any other flag bits set, indicate in; Initialize parity word; Go to send_edge state; Point to next routine *, Init number of bits
Cmd_pracess_done jmp Set_edge_wait; No reply needed, done; Exit routines for comm
Parity_error setb status_LSB.Parity_err_flag Set_edge_wait mov Comm_state, # Edge_wait mov Comm_bit_count, # Num_start_bits jmp Comm_ret
Set_send_reply mov Comm_state, # Send__edge mov Comm_bit_count, # Num_start_bits jmp Comm_ret; Indicate parity error; Go to edge wait state; Init number of bits; Go to send edge state
Rcv_next_word mov Coram_state, # Rcv_bits mov Comm_bit_count, # 6 jmp Comm_ret
Send next word; set up to receive 6-bit word
<td>and</td><td>W # 01fh</td>
<td>ΧΟΓ</td><td>Tpar, The</td>
<td>inches</td><td>parity_lookup</td>
<td>mov</td><td>Comm_buffer, The</td>
<td>rl</td><td>Comm_buffer</td>
<td>rl</td><td>Comm_buffer</td>
<td>mov</td><td>Com m_state, # Send_bits</td>
<td>mov</td><td>Comm_bit_count, # 6</td>
<td>jmp</td><td>Commjet</td>
<td>Set_rcv_stop</td><td></td>
; only 5 bits; update parity calculation; Save word with parity (6 bits); move to MSbs; set up to send 6-bit word
EP 1 960 932 B1
<td>mov</td><td>Comm State, # Rcv_jstop</td>
<td>jmp</td><td>Comm_ret</td>
<td>ORG</td><td>200h</td>
<td>Semo</td><td></td>
<td>; retw</td><td>05ah, 092h, 05fh, 000h</td>
<td>; retw</td><td>0flh, 0FFH, 0FFH, 01fti</td>
<td>for</td><td> 4</td>
<td>ret</td><td></td>
; point to next routine; Retums 6-bit va! Ue corresponding to passed 5-bit value with odd parity »
parity_lookup mov Temp, W; Save index mov PCLATH, #: table <; Set up high-order bits mov W, Temp; get index jmp pc + in: table
9,61,62 rep
1,2,4,7,8,11,13,14,16,19,21,22,25,26,28,31,32,35,37,38,41,42,44,47,49,50,52,55,56,5
Sets output bits according to received data
Comm_buf = Pulse duration in milliseconds
0: Continuous output (infinite duration)
1-255: Set output State for specified duration
After duration is over, tum all outputs off
Comm_buf + 1 [3] = Bit map of output States - MSB first bits 23-18: Unused bits 17-0: Outputs 18-1
Update_outputs
<td>mov</td><td>W, Comm buf + 3</td><td>. ; get lsbs</td>
<td>and</td><td>W, # 03h</td><td>; only need 2 bits</td>
<td>mov</td><td>Temp, The</td><td></td>
<td>add</td><td>Temp, W.</td><td>; Shift into bits 1 and 2 (XI and X2)</td>
<td>mov</td><td>The PORTA</td><td>; Get present status of port A pins</td>
<td>and</td><td>W # 0f9h</td><td>; elear output control bits</td>
<td>or</td><td>In, Temp</td><td>; Set desired output State</td>
<td>mov</td><td>PORTA, W</td><td>; output new value</td>
<td>rr</td><td>comm_buf + l</td><td></td>
<td>rr</td><td>comm_buf + 2</td><td></td>
<td>rr</td><td>comm_buf + 3</td><td></td>
<td>IT</td><td>comm_buftl</td><td></td>
<td>rr</td><td>comm_buf + 2</td><td></td>
<td>rr</td><td>comm_buf + 3</td><td>; shift buffer left 2 bits</td>
<td>mov</td><td>PORTB, comm_buf + 2</td><td></td>
<td>mov</td><td>PORTC, comm buf + 3</td><td></td>
<td>mov</td><td>• PORTA, # init_TR! SA</td><td></td>
EP 1 960 932 B1 mov mov mov jz msjoop mov mov: loop djnz djnz djnz and clr ³r done_oulput_ ret! PORTB, # init TRJSB! PORTC, # init_TRJSC Millisecs, CommJ> uf done_output_set; first byte is pulse duration
Timeout_ctr, # ms_preset <Timeout_ctr + 1, // ms_preset>
Timeout_ctr + 1loop Timeout_ctr,: loop Millisecs, msjoop PORTA, # 0f9h PORTB PORTC; delay for pulse duration; tum offXl and X2; tum off other outputs set
Main Program start
Mainjoop mov mov mov mov clr
c.lrb
Clkwaitjoop djnz clr djnz djnz jb flag cleared setb jmp
Clkcont jb jb mov setb jmp jnb djnz djnz setb: cont, mov mov jmp
Comm_ret jmp: Iow: high? PORTA, # Init_TRISA; Initialize port A direction 1PORTB, # Init_TRISB; Initialize port B direction! PORTC, # Init_TRISC; Init port C direction C! K timeout_ctr, # 12; preset ...
; ... clock timeout counter; Indicate waiting for clock Iow
ClkJimeout_ctri-1 FI ags .Clk_waitJflag scratch, Clk_cont WDT
Clk timeout_ctr + 1, Clk_cont
ClkJimeout_ctr, Clk_cont
Status_MSB.PORJIag, got JOR; Ignore clock timeout until POR
Status_MSB.ClkJimeout_flag; Indicate timeout on comm clock dojnitialize
Comm_port.clockjn,: high; clock high
FIags.Clk_wait_flag, Clkwaitjoop
InpiitJiold, Comm_port; Save Data port value
Flags. C) k_wait_flag; Indicate waiting for clock high
Clkwaitjoop
Flags.Clk_waitJlag, Clkwaitjoop
NPR timer + l,: cont; Dec LSB of need parm timer
NPRjimer,: cont; Dec MSB
StatusJxSB.Need_param_refreshJlag; set flag every 64k clocks; Watchdog reset
PCLATH, # 0
W Comm_state
IN..
Mainjoop; Set up high-order bits for routines in page 0; get vector; Execute comm state machine
EP 1 960 932 B1
PIC.DEF
Z * include file for serial communication with PIC chips * Z #pragma switch (ALL, FREQ) switch (PIC_serial status) {~ case sending bits: case sending st5 bits:
#ifdefVATEST out_bit_value = (PICxmitBuf.bits.hufLong [0] and 0x80000000)! = 0; Z * out bit value = MSB * Z
PICxmifBuf.bits.bufLong [0] = P! CxmitBuf.bits.bufLong [0] «1; if (PICxmitBuf.bits.bufLong [l] and 0x80000000)
PICxmitBuf.bits.bufLong [i] ++;
PICxmitBuf.bits.bufLong [l] = PICxmitBuf.bits.bufLong [l) «l; if (PICxmitBuf.bits.bufLong [2] and 0x80000000)
PICxmitBuf.bits.bufLong [l] ++;
PICxmilBuf.bits.bufLong [2] = PICxmitBuf.bits.bufLong [2] «1; Z * Shift 96-bit buffer * / ffelse out_bit_value = 0;
shift LSB ptr = andPICxmitBuf.bits.bufByte [12]; / * point past least significant woTd of 96-bit register * / asm ("MOYE.L _shift_LSB_ptr, AO", Z * Get pointer to buffer, elear carry * Z
<td colspan="3">"ROXL.W - (A0)", '' ROXL.W - (A0) ",</td>
<td></td><td>"ROXL.W" ROXL.W "ROXL.W" ROXL.W</td><td>- (A0) " - (A0) " - (AO) " - (A0) ", -</td>
<td>*FROM</td><td>"ROXL.W</td><td>out bit value '</td>
Z * rotate left and decrement pointer * ZZ * rotate left and decrement pointer * ZZ * rotate left and decrement pointer * ZZ * rotate left and decrement pointer * ZZ * rotate left and decrement pointer * ZZ * 96 bits have been shifted, MSB is in carry
Z * Put MSB in out_bit_value * Z); · "Endif break;
case do_send_cmd: bit_count = NUM_START_BITS-1; PIC_serial_status = sending_start; out_bit_value = 0;
break;
case doPlCstart: bit_count = 3 * BITS_PER_SEC; out_bit_value = l;
PIC_serial_status = sending PIC start; break;
case sending_start: out_bit_value = 0; break;
EP 1 960 932 B1 case sending stop: case sending start. AND:
out_bit_value = 1; break;
default:
out_bit_vaiue = 1;
} if (out_bit_value) fsl004.io.pulse0ut20ff = 1;
else fsl004.io.pulse0ut20ff = 0; / * Send bit out * / in__bit_value = fs 1004.io.pulseln 1 State; / * Get rcvd bit val ue * / fsl004.iD.puiseOutlOff = 1; / * Send clock rising edge * / switch (PIC__serial_status) {
case waiting for start; if (in_bit_value = 0) zero_count + -t-; else ..
{if (zero_count = (NUM_START_BITS-I)) {
.PIC_5erial_status = rcving bits; bit_count ~ PICrcvBuf.bitCount +1;
} else zero count = 0;
} "Break;
case rcving_bits:
#ifdefV ATTEST
PICrcvBuf.bits.bufLong [0] = PICrcvBuf.bits.bufLong [0] «1; if (PłCrcvBuf.bits.bufLong [l) and 0x80000000)
PICrcvBuf.bits.bufLong | O] ++; .
PICrcvBuf.bits.bufLong [l] = PICrcvBuf.bits.bufLong [l] «1; if (PlCrcvBuf.bits.bufLong [2] and 0x80000000)
PlCrcvBuf.bits.bufLong [1] ++;
PICrcvBuf.bits.bufLong [2] = (PICrcvBuf.bits.bufLong [2] «1) + in_bit_value;
else //
<img file="PL1960932T4_D0006.tif" />
EP 1 960 932 B1);
PICrcvBuf.bits.bufByte [ll] = (PICrcvBuf.bits.bufByte [ll] and Oxfe) | in_bit_value; / * add in receiyed bit ♦ / #endif break;
default: -.
{ }
} · If (—bit_count <= O) {switch (PIC_serial_status) {'case rcving_bits:
PIC_seriaI_status = rcvine stop;
bit_count = 1;
break;
case sending_bits:
PlC_serial_status = sending stop; bit_count = 1; .
break; case sending_stop:
if (PlCxinitBuf.PIC_addr = GLOBAL_PIC_ADDR)
PIC_serial_status = idle;
else and <sup>;</sup>
PIC__seriaI_status = waiting for start; bit_count = PlC_wait_limit; zero_count = 0;
} break;
case sending PIC start:
PIC_serial_status = idle; break;
case sending start:
PIC_serial_status - sending_start_l; bit_count - 1;
break;
case sending start ł:
PIC_serial_status = sending bits; bit_count ~ PICxmitBuf.bitCount; break;
case waiting for start:
PICrcyBuf.flags | = rcv_timeout_flag | rcv_data_ready_flag;
PIC_seriaI_status = idle; break;
case rcving stop: if, (in_bit_value = 0)
PICrcyBuf.flags | = rcv_bad_length_flag;
PJC_serial_status = idle;
PICrcyBuf.flags | = rcv_data_ready_flag; bit_count = 1;
EP 1 960 932 B1
PULSE.C / 'include "mtrlink.def'
Z * // include "flash.def '* / #define PSTRUJDEFINED // include" pulselink.deff // include "pulse.h"
// include "ufloat.h"
// include "log.h"
// include "alarm.h"
// include "copymem.h"
// include "plcctrl.h"
// include <stdio.h>
// ifdef fakeMC5.
#undef NUMPH. // definc NUMPH 24 // endif / * definc WDT flags for the PIC communication routine * / #pragma region ("ram = WDTF! ags") short int WDTpulseSec;
// pragma region ("ram = ram") // pragma region ("data = secondBack") void (* puIseSecondp) (void) = pulseSecond; // pragma region ("data = data") #iihdef IS_MC5 // pragma region ("data = everySubsecond") // ifdef 1S_RSM void (* pulseSubsecp) (void) = pulseSubsecond; // else void (* pulseSubsecp) (void) = puIseService; // endif // pragma. region ("data = date") // endif.
break; // pragma region ("data = powerUp") default: void (* pulseStartupp) (void) = puIseStartup;
PlC_serial_status = idle; // pragma region ("data = data")} // pragma region ("data = dayBack") void (* pulseDaypXvoid) = pulseDay;
// pragma switch (ALL, NOFREQ) // pragma region ("data = data")
EP 1 960 932 B1 / * elear out PIC * / void pulseColdstart (), t '
X int i;
for (i = 0; i <num_PICs; iH ~) if (PlC_statusfi] .software_type == 3)
- and
PIC_status [i] .clear_puIse_regs = TRUE; PIC_status [i], get_status = TRUE;
}. elear state - SEND_GLOBAL_CLR;
} "·· void pulseStartup (void)
and int i;
, '/ ifndef ISRSM int work_PIC_addr;
tfendif # ifdefIS_MC5 'int work_num_pulses;
#endif #ifdefV ATEST '* test !!!!! * / temp_command = SYSTEM_CONTROL; temp reg ID = 0; .
temp_command_data = READ_ENCODER_JD; temp_flags = rcv_data_ready_flag;
tfendif for (i = 0; (! dont_clear_PIC_stats) andand (i <(2 * NUMPH)); i ++) {
pulseData [i] .error_cnt = 0; pu lseData [i] .ID_field [0] = 0; pulscData [i] .reading »0; i for (i = 0; i <MAX_PICS; i ++)
- PIC_status [i] .PIC_addr = 0;
hold_num_pulse_ctrs = releaseCodep-> option.numPulseCounters; if (hold__num_pulse_ctrs> NUMPH) nurn_pulse_ctrs = NUMPH; else num_pulse_ctrs = hold_num_pulse_ctrs; numJMCs = I;
// ifdcf IS_MC5. PlC_status [Oj.PIC_addr = MCS_MUX_P1C_ADDR; / * If MC5, add PDM PIC (s) to PIC table * /
EP 1 960 932 B1 if (int_configltmessg.configLTM [PULSEl] .accum) {
work_num_pulses = num_pulsectrs; workJPICJaddr = 0; .
while (work_num_j> ulses> 0) {
PIC_status [num_PICs + - +]. PIC_addr = workJPIC_addrH-; / * Pulse counters for Q13 + /.
work_num_pulses - = 4;
} · Ł
. if (int_configltmessg.configLTM [PULSE2] .accum) {- · work_num_pulscs = num_j) ulse_ctrs;
work_PIC_addr = 6;
while (work_num_pulses> 0) (
and
PlC_status [num_PiCs ++ l.PIC_addr = work_PIC_addi4-f-; / * Pulse counters for Q14 "/ ~ work_num_pulses - = 4;
} }
num_LCMs = releaseCodep-> option.LCM_flags and 0x03; work_PIC_addr = LCMBASEADDR; for (i = 0; i <num_LCMs; iH-) {
PIC_status [num_PICs ++]. PIC_addr = work_PIC addr ++; / * LCM's * /} "#else // ifdef IS_STS
PIC status [0], PIC_addr = ST5_MUX_PIC__ADDR; / ♦ If ST5, add mux to PIC table * / ATM_work - releaseCodep-> option.couplers_mask; work_PIC__addr = ATM_BASE_ADDR; for (i = 0; i <4; i ++) {
if ((ATMwork and 0x08)! = 0) {/ * Bit is set in mask, add ATM PIC to table * /
PJC_status [num_PICs-tf). Pie_addr = work_PIC_addr;
} work_P! C_ad d r ++;
ATMwork = ATMwork «1; ł #else if (num__pulse_ctrs = 0) num_PICs = 0;
// endif ί / endif, for (i = 0; i <MAX_PICS; i ++) {/ * Build PIC table * / • PIC_siatus [i] .get_semo = TRUE;
PIC_status [i] .get_version = TRUE;
PIC_status [i] .get__status = FALSE; .
PIC_status [i] .reset_status = FALSE;
PlC_status [!]. Update_parameter = FALSE;
EP 1 960 932 B1 if (! Dont_clear__PIC_stats) {
PIC_status [i] .PIC_reset_count = 0;
PIC_status [i) .comm_error_count = 0;
PlC_status [i] .PIC_data_err_count = O;
PIC_status [i] .software_type = 0;
PlC_status [i] .softwareversion = 0;
PIC_status [i] .serial_number = 0;
}
PIC_status [i] .curr_puIse_reg - O;
# ifdeflS_MC5.
if (PIC_status [i] PlC_addr> = ST5_MUX_PIC_ADDR) PIC_status [i] .repIy_wait_limit = DIRECT_PIC_WAIT_LIMIT;
eise
PIC_status [i] .reply_wait_limit = BUFFEREDPICJWAITLIMIT;
else //
PlC_status [i], reply_wait_limit = DIRECT_PIC_WAITLIMIT;
#endif if (PIC_status [i] .PIC_addr <= MAX_PULSE_PIC_ADDR) PlC_status [i] .num_pulse_regs = PULSES_PER_PIC;
· else
PIC_status [i] .num__pulse_regs = 0;
>
current_PJC_index = 0; rcv_PJC_index = 0; if (dont_clear_PIC_stats). dont_clear_PIC_stats = FALSE; / * Clear flag * / else {
PICjbad_addr__count = 0;
PICrcvBuf.flags = 0;
PICJserialstatus = do_PIC_start;
. PIC_cIk State = clk_low; 'l * Initialize serial comm variables · /} ~ clear_state = NOGLOB AL_SEND;
pulseOutMode = releaseCode.option.picMode; / * for compatibility with old codę * / if (startup.coldStart) {
pulseColdstartO;
>
>
EP 1 960 932 B1
<img file="PL1960932T4_D0007.tif" />
void pulseDayO.
{dor> t_clear_PIC_stats = TRUE; / * Tell pulseStartup not to elear error counts * / rebuild_timer = REBUILD_DELAY; / * Set up for delayed table rebuild * / void pulseSecondO {
# ifndefISST5 pulseService ();
#endif if (Comm_background flags.do_rebuild) {~ pulseStartupO;
Commbackgroundflags.dorebuild = FALSE;
} .
.. if (Comm_background_flags.do_alann). {putAIanm (andPIC_aIarm, 4);
Comm_background_flags.do_alarm = FALSE;
} / * set_PLC_relays fiinction * / / * Called from PLC routines to request update of * / / * PLC port multiplexer PIC chip on STS power board * /; flfdefIS_ST5 votd set_ELC_relays (int xmitReIay, int rcvRelay) f
- while (MUX_control.active_flag || MUX_control.requestflag) {
ccwait ();
}
MUX_control.xniit_mask = xmitRelay;
MUX_control.rcvmask = rcvRelay;
MUX_control.done_flag = FALSE;
MUX_control.request_flag - TRUE;
if ((MUX_control.xmit_mask! = MUX_control.last_xmit_niask) || (MUX_control.rcv_mask! = MUX_control.last_rcv_mask)) {'while (! MUX_control.done_flag andand! (MUX_control.active flag andand (Pitscrial) ccwaitO;
} }
}
EP 1 960 932 B1 // endif void pulseService (void) <
BOOLEAN need__pulse_read, copy_rcvd_data, rcv_buf_err;
# ifdefIS_MC5
BOOLEAN got_verJ3, got_ver_3__3;
int j;
unsigned char * work_charjptr, unsigned long work__bit_mask;
// endif. int \ vork__pulse_index; phaccum accumXfer;
- int i;
if (num_PICs = 0)
PIC_serial_status = idle;
if (PIC serialstatus - idle) {
if (IWDTpulseSec)
WDTpulseSec = l; / * Tell WDT controller that we areOK * /}
if (hold_num_pulse_ctrs! = releaseCodep-> option.numPulseCounters) {/ * hdwr -n has changed * / dont_cIearJPIC_stats = FALSE;
rebuild_timer = 1; / * Force immediate table rebuild * /}
. if ((PlC_serial_status = idle) andand (rebuild_timer 1 = 0) andand (—rebuiid_timer = 0)) {
Comm_background_flags.do_rebuild = TRUE;
} else if ((PlC serial ^ status = idle) andand (num_PICs! = 0) andand (pulseOutMode! = PIC_MC_SERIAL) andand (! Comm_backgronnd_flags.do_rebuild)) / * Serial processing enabled? ♦ / {
if (PICrcyBuf.flags and rcv_data_ready_flag) {/ * Process received message * /
PICrcyBuf.flags and = ~ rcv_data_ready_flag;
EP 1 960 932 B1 rcvbuf_err =! Decode_rcv_buffer ();
if ((PlC_comm_mon.control_flags and RCV DATA_RDY) = 0) {'
PICJcomm_mon.rcv_buf = PICrcvBuf,
PIC_comm_mon.control_flags [= RCV DATA_RDY;
} "
if ((ext_comm.control_flags and CPY_RCV_DATA)! = 0) f
t ext_comm.rcv_buf = PICrcvBuf; · Ext_comm.control_flags and = ~ CPY_RCV_DATA; ext_comm.control_flags) = RCV_DATARDY;
} # ifdef IS_ST5 if (ATM_control.active_flag) {
ATM_control.result_flags = PlCrcvBuf.flags; if (rcv_bufjerr) {
if (ATM_control.state! = WATT_ALIGN) {
ATM_control.error_flag = TRUE;
ATM_controJ.active_flag - FALSE;
• ATM_control.done__flag = TRUE;
} .
} else {·.
switch (ATM controkstate) {'case DO_P RESET:
ATM__control.xmit_Ievel - PlCrcvBuf.command_data »24; ATM_controkcoupler_level = (PJCrcvBuf.command_data »16) and 0x0ff; ATM_control.active_flag = FALSE;
} break;
case SET_AL1GN:
{
ATM_control. state = WAIT_ALIGN;
> break;
case WAITALIGN:
{
ATM_control.optimum_cap codę = PICrcvBuf.command_data and ATNi_RC_CAP_MASK; ~
ATM_controkoptimum_reading - PICrcvBuf.command_data »16; ATM_controkresult__flags | = (PICrcvBuf.comniand_data and 0xe000);
/ * Copy flags from reply * /. if ((ATM_control.result_flags and 0xc000)! = 0) {Z * Analog levels out of rank * Z
ATM_control.error_flag - TRUE;
}
EP 1 960 932 B1 if (ATM_control, optimum_reading <ATM MINREADING) {'
ATM_control.result_flags | = 0x1000; / * lndicate reading too Iow * / ATM_control.error_flag = TRUE;
}
ATM_controI.active_flag = FALSE;
break;
case DO_PLC_SET:
case DO_ATMJDISCONNECT:
{
ATM_controI.active_flag- = FALSE;
} break;
default:
{
ATM_control.active_flag ™ FALSE;
ATM_control.error_flag = TRUE;
} break;
}}. '· · If (! ATM_control.active_flag)
ATM_contTol.done_flag = TRUE;
} if (MUX_control.active_flag) {
MUX_control.resuIt_flags - PICrcyBuf.flags; if (rcv_buf_err) {
MUX_control.error_flag = TRUE;
MUXcontrol.last_xmitniask = 0;
MUX_contTol.last_rcv_mask = 0;
} else {
MUX_control.last_xmit_mask = PICrcvBuf.command_data and Oxff; MUX_control.last_rcv_mask = (PICrcvBuf.command_data »8) and Oxff; }
MUX_control.active_flag = FALSE;
MUX coatrol.done flag = TRUE;
} “* "
#endif if (rcv_buf_err) and
tfifdef IS_ST5 if f! ATM__control.active_flag [| (ATM__control.state! = WAIT_ALIGN)) #endif {
last_comm_err_flag = PICrcyBuf.flags;
copymem (sizeof (PICbitBuf), (char *) (andHo) drcvBuf), (char *) (andPICrcyBuf));
if ((PICrcyBuf.flags and rcv_bad_addr_flag)! = 0)
EP 1 960 932 B1 {/ * past end of valid PICs, address error * /
PIC_bad_addr_count ++;
set_PIC_alarm (PIC_adderr_O, PICrcvBuf.P! C_addr, (PICxmitBuf.PIC_addr «8) + PICxinitBuf.command);
} else {/ * PIC address was valid, but comm failed * /
PIC_status [rcv_PIC_index] .comm_error_count ++; if (PIC_status [rcv_PlC index] .comm error_count> 2) {'~. set_PIC_alarm (PIC_coraerr_O, Pię_status [rcv_PIC_index]. PIC_addr, • PICrcvBuf.flags);
} / * Lost contact with PIC, read serial number and software version * /. PIC_status [rcv_PIC_index] .get_semo = TRUE;
PIC_status [rcv PIC_index] .get_version = TRUE;
} }
else {/ * Valid message received * / if ((PICrcvBuf.command = READ_REGISTER) andand (PICrcvBuf.regJD STATUS_REG)) {
process_status_bits ();
And else if (PTCrcvBuf.command = SYSTEMCONTROL) and if (P (CrcvBuf'.reg_ID = STATUS_REG) {/ * Response frome reset status bits cmd * /
PlC_status [rcv_PICJndex] .reset_status - FALSE; processstatusbitsO;
} / «Ifdef 1S_MC5 else if ((PIC_statusLrcv_PIC_index] .software_type = 4) andand ((PIC_starus [rcv_PIC_jndex]. Ballast cmd data and OxffffOOOO) =
READ_ENCODERJD)) ~ "{/ * response from encoder read ID comd * / work_pulse_index = (PlCrcvBuf.PIC_addr * PULSES_PER_PIC) +
PICrcyBaf.reg ID;
i = (PlC_status [rcv_PIC_index] .last_cmd_data and ΟχΟΟΟΟΠΟΟ) »S; work_char_ptr = (unsigned char *) andPICrcvBuf.command_data; for (j = 0; j <4; j ++) ·. · {
if ((* work_char_ptr = 0) || (i> = IDFIELDLENGTH)) {·.
j = 10; / * indicate end of message found * 7} · else {pulseData [work_pulse_index] .TDbuffer [i] = * work_char_ptr; i ++;
work._char_ptrH-;
EP 1 960 932 B1 if (j> 5) {/ * found end of ID field from remote encoder '/ for (i = 0; i <ID_FIELD LENGTH; iH-) {~ pulseData [work_pulse_index]. ED_field [i] pulseData [work_jiu! se_index) .ID_bufFer [i]; . .
puIseData [work_pulse_index] .ID_buffer [i] = 0;
} · }
Ί
J}
else if ((PlCrcvĘuf.command = READREGISTER) andand (PICrcvBuf.regJD = ERROR_REG)) {.
if (PIC_status [rcv_PIC_index] .software_type = 4) {/ * Remote encoder interface module * / work_pulsejndex = (PlCrcvBuf.PIC_addr * PULSES_PER_P1C) +; PlCrcvBuf.command_data »24);
if (work_pulse__index <(2 * NUMPH)) {
pulseData [work_pulse_index] .error_cnt-H; for (i = 0; i <ID_FIELD_LENGTH;
nulseData [work_pulseJndex] .ID_buffer (iH-] = 0); .
' } }
f / endif else if (((PICrcvBuf.command. WR1TE_REG1STER) andand (PICrcvBuf.reg_iD PARMREG)) •
PIC_status [rcv_PlC_index) .update_parameter = FALSE;
} else if ((PlCrcvBuf.command = READ_REGISTER) andand (PICrcvBuf.reg_ID = VERSJREG)) {
PIC_status (rcv_PIC_index) .get_version = FALSE; PIC_status [ncv__PiC_index) .software_lype = (PICrcvBuf.command_data and OxffOOOOOO) »24;
: PiC_status [rcv_PlC_index], software_version = (PlCrcvBuf.command_data and ΟχΟΟΏΌΟΟΟ) »16; PIC_status [rcv_PIC_index] .loop_rate = (PICrcvBuf, command_jdata and ΟχΟΟΟΟΏΌΟ) »8;
} else if ((PICrcvBuf.command ~ READ_REGISTER) andand (PICrcvBuf.reg_ID == SERNO_REG)) *
PIC_status [rcv_PIC_index] .get_semo = FALSE;
PIC_status [rcv_PIC_index] .serial_number = PICrcvBuf.command_data;
} ... · .else if ({(PlCrcvBuf.command = READ REGISTER) | 1 (PlCrcv8uf.command <-
MAX_FAST_READ)) "'andand (PlCrcvBuf.regJD <= MAX_PULSE_R £ G)) {/ * Pulse reading' / work pulsc index» (PlCrcvBuf.PIC_addr * .PULSES PER P1C) +
PICrcvBuf.reg ID;
EP 1 960 932 B1 if (work_pulsejndex <(NUMPH * 2)) {· pulseData [work_pu! Se_index] .reading - PlCrcvBuf.command_data; copy_rcvd_data = FALSE; · · · · If (PlC status [rcv PIC_index] .get_version) t '"}
else if (PIC_status [rcv_PIC_index] .software_type = 4) {/ * Remote encoder interface module * / • copy_rcvd_data = TRUE; · '. '· • accumXfer.low = pulseData [wofkjpulse_index] .reading;
ł else if (PIC_status [rcv_PICJindex] .software_type = 3) {/ * Remote pulse counter module ♦ /, copy_rcvd_data = TRUE;
if (! PIC_jstatus [rcv_Index_index] .get_semo) {
sprintf {{char *) pulseData [work_pulse_index) .ID_field,<sup>,,</sup>S% 08tdP% d '', PIC_status [rov ~ Pięjndex] .serial_number,
PICrcvBuf.reg_lD);
} if (reIeaseCode.option.countEveiyEdge) {
accumXfer.low = pulseData [work_pulse_index] .reading;
} else and
accumXfer.low = pulseData [work_pulse_indcx] .reading »1;
}} ·. accumXfer.higb = OL;
#ifndefV ATTEST.
if (copy_rcvd_data) {
# ifhdefIS_MC5.
/ * It is an RSM or ST5, so mapping for pulse 1 thru 4 is M1Q13, MIQ14, M2Q13, M2Q14 * /. .
ph [0] [work_putse_index / 2] [(work_pulse_indexand 0x01)? PULSE2: PULSE1] .accum = ph [1] [work_pulse_index / 2] [(work_pulse_indexand0x0 1)? PULSE2: PULSE 1 l.accum = accumXfer;
i / else ..
/ * It is an MC5, so mapping for pulse 1 Lhru 48 is M1Q13..M24Q13,
M1Q14..M24Q14 · / ph [0] [work_pulse_jndcx% NUMPH] [(work_pulse_index / NUMPH)? PULSE2: PULSEl] .accu m =
EP 1 960 932 B1 ph [l] [work_puIse_index% NUMPH] [(workjulse__index / NUMPH)? PULSE2: PULSEl] .accu m =.
accumXfer;
r / endif.
'} tfendif}
} if ((PICrcvBuf.flags and (PIC_error_flag (PIC_invaIid_data_flag))! ~ 0). PIC_status [rcv__PIC_index] .getjstatus = TRUE;., -.
if ((PICrcvBuf.flags and PIC_need_refresh_flag)! = 0)
PIC_status [rcv_PIC__index} .update_parameter = TRUE;
/ * check status flags * / zi
Decide what command to send * /
PlCxmitBuf. flags = 0;
/ iifhdef IS_ST5: / * MC5 or RSM, check for cold-start processing to elear pulse registers * / if (clearjstate = SEND__GLOBAL_CLR). {/ * Cold start, send global clr * /
PICxmitBuf.PIC_addr = GLOBAL_PIC_ADDR;
PICxmitBuf.command = CLEAR_PULSE_REGISTERS; format_xmit<sub>—</sub>buffer ();
clear_siate - SENDINGGLOBALCLR;
PIC_serial_status = do_sendjcmd; / * Start UART * /. } 'else if (clear_state = SENDING_GLOBAL CLR).
{'clear_state = GLOBAL_CLR_SENT;
} i / else / * ST5, check for ATM (Automatic Tuning Module) operations * / if (ATM_controlrequest flag) {'
ATM_control.request_flag = FALSE;
ATM_control.error_flag = FALSE;
ATM_c °<sup>n</sup>trol.aciive_flag - TRUE;
ATM_control.state = ATM_DONE;
PlCxmitBuf.PlC_addr = ATM_control.ATM_number + ATM_BASE_ADDR;
switch (ATM_controI.operation) {· case SETPREALIGN
EP 1 960 932 B1
PlCxmitBuf. command = WRITEREGISTER;
PICxmitBuf.reg_ID - OUTPUTREG;
PICxmitBuf.command_data = ATM_control.start_cap_code and ATM_RC_CAT_MASK; '' ''
PICxmitBuf.command_data | = ATM_PRESET_CODE;
ATM_control .State = DO_PRESET; break;
case DO AL1GN:
. PICxmitBuf.command = WR1TE_REGISTER;
PICxmitBuf.reg._ID = CONTROL_REG; . if (ATM_eontrol.start_cap_code> ATM_control.end_cap_code)
ATM_controi.end_cap_code = ATM control.start cap_code;
PICxmitBnf.command data = ATM control.startcapcode and ATM_RC_CAP_MASK; .
PICxmitBuf.command_data = (PICxmitBuf.command_data «12) | (ATM_controł.end_cap_code and ATM_RC_CAP_MASK) [(ATM_MEAS_TIME «24);
ATM_control.state = SET_ALIGN;
ATM_control.align_timer - ATM_control.end_cap_code ATM_control.start_cap_code;
ATM_control.align_tiiner * = ((ATM_DISC_TiME + ATM_MEAS_T1ME + 4) * (1.25 162.5)); ~
ATM_control.align_timer + = 13; / * Time in 1/64 sec to wait beforechecking result * / / * Number of steps * time per step + 25% + .2 second * / break;
case SET NORMAL_PLC:
PICxmi7Buf.comma.nd = WRITE_REGISTER;
PlCxmitBuf.reg_H> = OUTPUTREG;
PICxmixBuf.command_data = ATM_co.ntrol.optimum_cap_code and ATM_RĆ_CAP_MASK;
PlCxmitBuf.command_data {= ATM_PLC_CODE;
ATM_control.State - DOPLCSET; break;
case DISCONNECT_COUPLER:
PICxmitBuf.command = WRITEREGISTER;
PlCxmitBuf.rcgJD = OUTPUTREG;
PlCxmitBuf.command__data = ATM_contro! X> ptiinum_cap_code and ATM_RC_CAP_MASK;
PICxmitBuf.command_data | = ATM_DISC_CODE; .
ATM_control .State - DO_ATM_DISCONNECT; break;
default:
case READ_XMIT_LEVEL:
. ATM_control.error_flag = TRUE; ATM_control.done_flag = TRUE; ATM_control.active_flag - FALSE; break;
}
EP 1 960 932 B1 if (ATM__confrol.active_flag) and.
^ ^ Nmit format bufferO;
PIC_wait_limit = DIRECT_P1C_WAIT_LIMIT,
PIC_seriaI_status = do_send_cmd; / * Start UART * /)
( } .
elseif (ATM_control.active_flag). · '{
if ((ATM_control.State! = WAIT_ALIGN) || (—ATM_control.aJign_timer <= 0)) {
ATM_control.error_flag = TRUE;
ATM_control.done_flag = TRUE;
ATM_control.active_flag = FALSE;
else {/ ♦ poll ATM for auto-tune end * /
PICxmitBuf.command = 0;
{format_xmit_buffer);
PICjwaitJimit = DIRECT_PIC_WAITLIMIT;
PIC_serial_status = do_send_cmd; / * Start UART * /}
} else if (MUX_control.request_flag) (
MUX_control.request_flag - FALSE;
MUX__control.error_flag - FALSE; if ((pulseOutMode - P1C_ST_SERIAL)) t
PlCxmitBuf.bils.bufByte [O] = ((MUX_control.rcv_mask and 0x03) «S) | ((MUX_control.xmit_mask and 0x7 f) »2);
PICxmitBuf.bits.bufByte [l] = ((MUX_control.xmit_mask and 0x03) «6); bit_count = 11;
PIC_serial_status = sending stS bits; / * Start UART * / MUX_eontral.last_xmit_mask = MtJX_control.xmit_rnask; MUX_corrtrol.lasf_rcv_mask = MUX_control.rcv_mask; MUX__control.done_flag = TRUE;
.} else {
MUX_control.active_flag = TRUE;
PICxmitBuf.PIC_addr = ST5_MUX_PIC_ADDR;
PlCxmitB trust command = WRITEREGISTER;
PlCxrnitBuf.reg_LD = OUTPUT_REG;
PlCxmi £ Buf.command_data = (MUX_controI.rcv_jnask «8) + MUX_control -xm it_mask;
format_xm it_bufferQ;
PlC_wait_limit = DIRECT_TIC_WA1T_LIMIT;
PlC_seriaLstatus = do_send_cmd; / *. Start UART * / 45
EP 1 960 932 B1 // endif else if ((ext_comm.control__flags and (XMTT_DATA_RDY | XMIT_REQUEST)) =. (XM1T_DATA__RDY) XMIT_REQUEST)) {, / * Send command for extemal routine * /
PICxmitBuf = ext__comm.xmit_buf;
ext_comm.control_flags and = -XMIT_REQUEST;
ext_comm.control_flags [= CPY_RCV_DATA; .
/ * Look up correct PlC_status index for reuested PIC * / for (i = 0; ((i <MAX_PlCS) andand (PlC_status [i] .PlC_addr! = PICxmitBuf.PlC_addr));
i ++);
if (i <num_PICs) {
PlC_status [i] .last_cmd_data = PICxmitBuf.command_data;
PlC_status [t] .last_command = PICxmitBuf.command;
} // ifdef 1S_MC5 if (ext_comni.xmit_buf.PIC_addr <ST5_MUX_PIC ADDR)
PIC_waitJimit = BUFFERED_PIC_WAIT_LIMiT; else // endif
PIC .waitjimit - D1RECT_P1C_WAIT_LIM1T; format_? aiiit_bufferO;
PlC_scrial_status = do_send_cmd; / * Start U ART * /}
else if ((((ext_comm.control_flags and SUPPRESS_NORMAL_COMM) - 0) // ifdef ISST5 andand (—ST5_PIC _delay_ctr <= 0)) and
ST5_PlC_delay_ctr = ST5_PIC_DELAY; / * Slow down routine Communications in Ihe ST5 * / // else)
{// endif
PICxmitBuf.PTC_addr = PIC_status [current__PlC_index] .PlC_addr; need_pulse_read = TRUE; / * Set defaults * / // ifdef IS_ST5 if ((pulseOutMode = P1C_ST_SERIAL) andand (PlCxmitBuf.PlC addr = ST5_MUX_PIC_ADDR)) {· "
} else
EP 1 960 932 B1 #endif if (PIC_status [current_PlC_index] .force_pulse_read andand (! PlC_status [current PiC_index] .get_version) andand (PIC_status [current_PIC_index] .PIC_addr <ST5 MUX_PIC_ADDR)) [~ PIC_IC_siat
} 'else. · · (
PIC_status [current_PiC_index] .force_pulse_read = TRUE;
#ifhdef IS_ST5 if (PIC_status [cuTrent_PIC_index] .clear_pulse_regs andand (clearjstate = GLOBAL_CLR_SENT)) {/ * Global elear sent, get status * / need_pulse__read - FALSE;
PICxmilBuf.command = READ_REGISTER;
PICxmitBuf.reg_ID = STATUS_REG; format_xmit bufferO;
else // endif if (PIC_status [current_PlC__index] .get_version) {. need_pulse_read = FALSE;
PICxmitBuf.corr.mand - READ_REGISTER;
PlCxmitBuf.reg_ID = VERS_REG; format_xmit_bufferO;
} else if (PIC_status [current_PlC_index] .get_semo) {
need_pulse_read = FALSE;
PICxmitBuf.command = READREG1STER;
PICxmitBuf.reg_ID. = SERNO_REG; format_xm it_buffer ();
}. else if (PlC_status [current_Five_index] .update_parameter) {
PICxmitBuf.coramand = WR1TEREG1STER; if (PlC_status [current_Pię_index] .software_type = 3) {/ * Pulse ctr * / / * Pulse ctr parameters: * / / * Power-On sample installment:, 42 / sec * / / * Power-off sample installment: 1 / sec * / / * Days to count if rcving pulses: * / / *. RSM: 5 days · / / ♦ PDM: 35 days ♦ / / * Days to count if no pulses rcvd: * / / * RSM: 1 day * / / 'PDM: 3 days. ♦ /. / * on RSM, the 2 Isbs of * /
EP 1 960 932 B1! Oad_shedjmask [0] are sent to * / / * the PIC output bits * / // ifdef JS_RSM
PICxmitBuf.command_data = 0x01150507 and (load_shed_state [0] | Oxfffffffc);
else //
PICxmitBuf.command_data = 0x0115230d;
// endif}.
// ifdef IS_MC5 else if (PIC_status [current_PIC__index] .software_type = 4) {l * Remote encoder reader ♦ /
PICxmitBuf.command_data = READJENCODERJPARM; if ((releaseCodep-> option.couplers_mask and 0x01) = 0) {/ * If mask bit 0 is 0, no touch-pad compatibility * /
PICxmitBuf.commandjdata and = 0xfTO0fflf;
} }
else if (PIC_status [currentJPICJndex] .software_type == 5) {/ * MC5 mux * z got_ver_3 = got_ver_3_3 = FALSE;
for (i-0; i <num_PICs; i ++) {
if (PIC_status [i] .get_version) i.
got_ver_3 = TRUE; got_ver_3 _3 = TRUE;
} else if (PIC_status [i) .software_type = 3) • {got_ver_3 = TRUE; .
if (PIC_status [i] .sofhvare_version = 3) got_ver_3_3 = TRUE;
}} if (got_ver_3) {
if (got_ver_3_3 andand ((releaseCodep- <Option.couplers_mask and 0x02)! = 0)) and PlCxmitBuf.command_data = 0x0c007000; / ♦ 32 bps, periodic wake-up ♦ />
else <
PlCxmitBuf.command_data = 0x0c007080; / * 32 bps, no wake-up * /
J ·}
else
PICxmitBuf.command ~ _data = 0x02030080; / * 205 bps, no wake-up * / ł
// endif // ifdcf IS_ST5
EP 1 960 932 B1 else if. (PIC_status [current_PiC_index] .software_type = 8) {/ * Auto tune module * /
PICxmitBuf.command data = 0x020300001 (ATM_DISC_TLME «8) | · (ATMJR.C_XMIT_ON» 8) j ATM_NUM_CAP_BITS;
Z * xmit offset = 2, cplr offset = 3, * Z
Z * relay delay = ATM_DISC_TIME, Xmit mask = ATM_RC_XMJT_ON, * / Z * number of capacitor relays = ATM NUM_ CAP_BITS * /} "else if (PIC_status [current_PIC index) .software_type = 6) {~ / * ST5 mux * /
PICxmitBuf.commanddata = 0x00000000;
} · // endif else if (PIC_status [current_PlC_index] .software_type = 7) {/ * Load Control Module * / '· PICxmitBuf.command_data = 0x00000000;
} else {
PlC__status [current_PIC_index] .update_parameter = FALSE;
/ * unknown software type, cancel command * Z ·}.
if (PIC_status [current_PIC index] .update_jparameter) {'need_pulse_read = FALSE;
PICxmitBuf.reg_ID = PARM_REG; form at_xmi t_buffer ();
} and · else if (PIC_status [current_PIC_index] .reset_status) {need_pulse_read = FALSE;
PICxmitBuf.command = SYSTEM_CONTROL;
PlCxmitBuf.command_data =.
(PIC_status [current_Pię_index] .status_reg_value and Oxffbf); PICxmitBuf.command_data = PICxmitBuf.command_data «16; / * Move status bits to MSb * s * /
PICxmilBuf.rcg_ID = STATUS REG; tormat_xm it_bu ffer ();
else if (PIC_status [current_PlC_index] .get status) {"need_pulse_read = FALSE;
PlCxmrtBuf.command = READREGISTER;
PICxmitBuf.reg ID = STATUS_REG; format_xmit_bufferQ;
} # ifdefIS_MC5 if (need_pulse_read andand (PlC_status [cunren.t_PIC_inQex] .soflware_type = 4)) need_pulse_read = FALSE;
PICxmitBuf.command = SYSTEM_CONTROL;
EP 1 960 932 B1 if (++ piC_status [current__PIC_index], curr_ID_reg <sup>> R =</sup> PULSES_PER_PIC) PlC_status [current_PIC_index] .curr_ID_reg = 0;
• f (((((PIC_status (current_PIC_index] .PIC_addr * PULSES_PER_PIC) +
PIC_statusicurreiit_PIC_index] .curr_ID_reg)% 24)> = num_pulse_ctrs)
PIC_status [ciirrent_PIC_index] .curT_ID_reg = O;
PlCxmitBuf.reg_ID = Five_status [cnrrent_PlC_index) .curr_ID_reg; work_pulse_index = (Friday_status [current_PIC_index] .PIC_addr *
PULSES_PER_PIC) + PlCxmitBuf.reg_lD;
for (i = 0; i <lD_FIELD_LENGTH; i ++) {· if (pulseData [work_pulse_index]. ID_buffer [i] = 0) ii = IDFIELDLENGTH,>
if0 <0) i
j = 0; ·.
} else if (j> (ID_FIELD_LENGTH-4 ')) ij = IDJFIELDJLENGTH-4;
}
PICxmitBuf.command_data = KEADENCODEK.1D | (j «8) ;; format_xmit_bufferO;
} £ endif if (need_pulse_read) {
# ifdefIS_MC5 if (PIC_status [current_PIC_index] .software_type = 7) i = PIC status [current PIC_index]. PIC addr - LCM BASE ADDR; / * get
LCM # * / work_bit_mask = (load_shed_state [0] »(9 * i)) and 0x000001ff; PICxmitBuf.command_data = 0; for (i = 0; i <9; i ++). .
{if ((work_hit_mask and 0x100)! - 0)
PICxmitBuf.command_data = (PICxmitBuf.command_data «2) + 1; / * lsb tums relay on * / else.
PICxmitBuf.command_data = (PICxmitBuf.command__data «2) + 2; / * msb tums relay on * / work_bit_mask = work_bit_mask «1;
PICxmitBuf.command_data | = 0x32000000; / * Set pulse time = 50 mS * /
EP 1 960 932 B1
PlCxmitBuf.command = WRITE REGISTER;
PlCxmitBuf.reg_ID = OUTPUT_REG; format_xniit_bufferO;
need_pulse read = FALSE;
else // endif if (PIC_status [current__PIC_index) .num_pulse_regs = 0). {'// ifindef IS_ST5
PICxmitBuf.command = REALjREGi STER;
. . PICxmitBuf.reg_ED = VERS_REG;
fbrmat_xmit_buffer (); need_pulse_read = FALSE;
// endif}
else {
// ifdef 1S_MC5 if (((((PIC_status [current_PIC_index) .PIC_addr * PULSES_PER_PIC) + PlC_status (current_PTC_index] .curr_pulse_reg)% 24)> = num_pulse_ctrs)
PIC_status [current_PIC_index] .curr_pulse_reg = 0;
tfendif if (PIC_status [currentJPIC_indexJ.curr_pulse_reg <= MAX_FAST_READ) PICxmitBuf.command = PIC_status [current_PIC_jndex] .curr_pulse_reg;
else
- PICxmitBuf. command = READREGISTER;
PICxmilBuf.regLD = PIC_status [current_PIC_index] .curr<sub>at</sub>jjulse_reg;
> format_xmit_buffer ();
need_pulse_read = FALSE;
. if (++ PIC_status [current_PIC_index] .curr_pulse_reg> = PIC_status [current_PlC_index] .num_pulse_regs) {
. PIC status [ourrent_PlC index] .curr_pulse_reg = O;
// ifdef IS_RSM ~ "
PJC_starus [currenlPlCindex] .updateparameter = TRUE;
// endif}
and
PIC_status [current_PIC_index] .last_cmd__data = PICxmilBuf.command_data; PIC_status [current_PIC_index) .last_command = PICxmitBuf.command; PIC_wait_limit = PTC_status [current_PICindex] .reply_wait_limit; rcv_PIC_index = current_PIC_index;
if (++ current_PIC_index = num_PICs) current_PICindex = 0;
if (! need_pulse_read)
PIC_serial_statu $. = Do_send_cmd; / * Start U ART * /
EP 1 960 932 B1}
}} _ // ifdef IS_RSM 7 * In RSM, generate serial stream from subseconds * / void pulseSubsecond (void) {
if (num_PICs! = 0) ί.
if (PIC_cIk_state = clk_high) {'/ * Falling edge, just set clock Iow * / fsl004.io.pulse0utl0ff = 0;
PIC_clk_state = clk_low;
} else {
PIC_clk_state = clk_high;
rfinclude '' pic.def / * Do PIC serial comm on clock rising edge * / #endif void process_status_bits (void) f
and * unsigned int workjpulse_index, work_status_bits; PIC_status [rcv_PiC_index] .get_status = FALSE;
PIC__status [rcv_PIC_index] .status_reg_value = PICrcvBuf.command_data »16;
PIC sratusrrcy PIC index ~ | .time sińce global = (PICrcvBuf.command_data »8) and
OxfT;
if (PIC status [rcv PIC mdex ~ | .status reg yalue! = 0) {·
PIC_status [rcv_PIC_index] .reset_status = TRUE; .
if ((PIC_status [rcv_PIC_index] .status reg yalue and Gx8fl0) 1 = 0) {~
PIC_status [rcv_PIC_index] .PIC_data_err_count ++; / * PIC detected bad data * / set_PIC_alarm (PIC_flags_O, PIC_status [rcv_PIC_index]. PIC_addr,
PIC statusfrcy PIC index ~ | .status reg yalue): work_status_bits = (PIC_status [PIC ijidex] .status_reg_ value »8) and 0x0f; work_pulse_index = PIC_status [rcv_PIC_index]. PIC_addr * PULSES_PER_PIC; while (work status_bits> 0) i ~ if (work_status_bits and 0x01) pulseData [work_pulse_index] .error_cnt ++;
EP 1 960 932 B1 \ vork_statusbits = work_status_bits »1; work_pulse_index-t +;
}) ·. . '· If (((PIC statusfrcy PIC index1.status reg value and 0x20)! = 0) andand' PlC_status [rcv_PIC_index], clear_pulse_regs) {· '.
PlCjstatus [rcv_PIC_index] .comm_error_count + -F-; / * PIC detected comm parity err.
if (PIC_status [rcv_PTC_index] .comm__error_count> 2) {
set_PIC_a1arm (PIC_comerr_0, PIC_status [rcv_PIC_index]. PIC_addr, PICrcvBuf.flags | 0x0800);
} .
} if ((PIC_status [rcv_PICindex], status reg yalue and 0x3080)! = 0) {
PlC_status [rcv_PIC_indexJ.PIC_reset_count ++; / * PIC was reset * / if (PIC_status [rcv_PIC_index] .PIC_resetcount> 1) ({
set_PIC_alamn (PlCreset_O, Pię_status [rcv_FICJndex] .PIC_addr.
PIC_status [rcv_PIC_index] .status_reg_vaIue);
}
- } } .
if (PICstatusfrc v_PIC_index] .clear_puJse_regs andand (clear_state = GLOBAL_CLR_SENT)) {.
PIC_status [rcv_PIC_index] .clcar_pulse_regs = FALSE;
if ((((PIC statusfrcy PIC index] .status reg vaiue and OxOf)! = OxOf) andand (PlC_status [rcv_PIC_index] .software_type - 3)) {
PlC_status [rcv_PIC__index] .PIC_data_err_count ++; / * Clear and failed * / set_PIC_alarm (PIC__flags_O<sub>s</sub>PIC_status [rcv_PIC_index] .PIC__addr.
PIC statusfrcy PIC index1.status reg yalue);
} - · · }
else if ((((PIC statusfrcy PIC. index ~ l.status reg value and 0x0f)! = O) andand ((PIC statusfrcy PIC index1 .status reg yalue and OxflO) = 0)) {
PIC_status [rcv_PICJndex] .PIC_data_err_count + - 1000; / * Spurious clr cmd * / set_PIC_alarm (PIC_flags_0, PIC_status [rcv_PIC_index3.PIC_addr,
PIC statusfrcy PIC index1.status reg yalue);
} yoid set_PIC_alarm (alarmcodes pass_a! arm_codes, int pass_PIC_addr, unsigned int pass_alarm_data) (
and if (! Comm_background_flags.do_alann) {
PIC_aIarm.alarm_codes = pass_alann_codes + pass_PIC_addr;
EP 1 960 932 B1
PIC_alarm.ack = passalarmdata ·,
Comm_background_flags.dojalarm = TRUE;
) Ł
unsigned char workTpar;
BOOLEAN decode_rcv_buffer (void) ί
int i;
unsigned int worklnt; workTpar = Oxlf; 'if (PICrcvBuf.flags ~ 0) {
work_P! C_addr = Get5Q; if (PJCrcvBuf.flags - 0)
PICrcvBuf.PIC_addr - work_PIC_addr; / * Valid address received * / PTCrcvBuf.command = Get5Q; if (PICrcvBuf.command> 0x0f)
PJCrcvBuf.reg · ID = Get5Q; else.
PlCrcvBuf.regID = PICrcvBuf.eommand;
PICrcvBuf.command_data = 0; for (i = 0; i <6; if +).
PICrcvBuf.comroand_data = (PICrcvBuf.comniand_data «5) + Get5 (); worklnt = Get5 ();
. PICrcvBuf.command_data = (PICrcvBuf.command_data «2) + (worklnt» 3);
.. PICrcvBuf.flags | = worklnt and 0x07;
worklnt = Get5O; if (workTpar! = 0)
PICrcvBuf.flags | = rcv_tpar_error_flag;
} / * Look up correct PIC_status index for data in rcv buffer * / for (i = 0; ((i <MAX_PICS) andand (PJC_status [i] .PIC_addr! = PICrcvBuf.PIC_addr)); i ++); if (i> = num__PICs)
PICrevBuf.flags) = rcv_bad addr_fiag; / * past end of valid PICs, address error * / if (i = rMAX_PięS). rcv_P! C_index = 0;
else.
rcv_PJC_index = i;
ifdef V ATEST «if VATEST = 1.
PlCrcvBuf. command = temp_command;
PICrcvBuf.reg_ID = temp reg ID;
PICrcvBuf.command_data = tempjcommand_data;
PJCrcvBuf. flags = temp__flags;
«Endif« endif
Retum ((PiCrcvBuf.flags and ~ (PlC_error_fIag | PlCneedrefresh_f1ag | PIC_invałid_data_flag)) - O};
void format_xinit_buffer (void) f
int ij, ShiftCount;
unsigned int Worklnt; unsigned long WorkData;
PICxmitB uf. BitCount = 6;
PICxmitBuf.bits.bufLong [0] = 0;
PlCxmitBuf.bits.bufLóng [l] - 0; .
PICxiriitBuf.bits.bufLong [2] = 0; / * Clear xroit bit buffer * / worfcTpar = 0x 1 f; / * Init ializa Tpar * /
Stuff6 (PlCxmitBuf.PIC_addr);
Stuff6 (PICxmitBuf.cominand); if (PICxmitBuf.conunand> 0x0f)
Stuff6 (PICxm itBuf.rcg IDY, if (PiCxinitBuf.command 0x17) {
WorkData - PICxmitBuf.command_data;
ShiftCour.t = 32; for (i = 0, i <7; Hl ·) r.
Worklnt = 0;
-for Q = 0y <5y ++) {
Worklnt = Worklnt «1; if (WorkData and 0x80000000)
Worklnt + = 1;
WorkData = WorkData «1; if (—SbiflCount == 0) (.
Worklnt = (Worklnt «3) + (PICxmitBuf.flags and 0x07); - j = 5; ..
Ϊ ·
Stuff6 (Worklnt);
··}
}. }
Stuff6 (workTpar); . . ·, / * Buffer set, set up UART control * /
PlCrevBuf.bhCoujit = 66;
if ((PIC_comrn_mon.controi_f! ags and XMJT_DATA_RDY) = "0) and
PIC _comm_mon.xmit_buf = PlCxmilBuf;
PIC comm mon.cGntrol Jlags [= XMIT_DATA RDY;
EP 1 960 932 B1
PICrcyBuff.flags = 0;
PlCrcvBuf.PIC_addr = PICxmitBuf.PIC_addr; / * preset address of remote PIC * /}
unsigned int Get5 (void) {
int byte_index, bit_index;
unsigned int work_result;
work_result = 0; if ((PICrcyBuf.flags and ~ (PIC_error_flag | PIC need_refresh_flag | PlC_invaIid_data_flag)) - 0) {"byte_index = 96 - PTCrevBuf.bitCount; bit_index = byte_jndex and 0x07; byte_index» 3 byte_index »byte_index»
work_result = (PICrcvBuf.bits.bufByte [byte_Łndex] «8) + PICrcvBuf.bits.bufByte [byte_index + l];
work_result = work_result »(10 - bit_index); work_result and = 0x3f, if (parity6 [work_result »1]! = work_result) {
. work_result = 0;
PICrcyBuf.flags | = rcv_parity_err_flag;
else {· workresult = workresult »1; workTpar<sup>Λ</sup>= work_result;
PICrcvBuf.bitCount - = 6; if (PICrcvBuf.bitCount <0)
PICrcyBuf.flags] = rcv_bad_length_flag;
} }
return (work_result);
} void Stuffć (int pass_data) and int byte_index, bit_index;
workTpar passdata;
byte_index = PICxmitBuf.bitCount »3;
bit_index = PICxmitBuf.bitCount and 0x07;
pass_data - parity6 [pass_data] "(10 - bit_index);
PlCxmitBuf.bits.bufByte [byte_index] | = pass_data >> 8;
PICxmitBuf.bits.bufByte [byte_index + l] | = passjdata and Oxff;
PlCxmitBuf.bitCount + = 6;
>
EP 1 960 932 B1
PULSE.H / * * /
Sifndef BOOLEANJDEFINED // define BOOLEANJ> EFINED typedef int BOOLEAN;
#endif / * subsecond processing for pulse ccunters * / void pulseSubsecond (yoid);
/ * Daily PIC table rebuild * / void pulseDay (void);
/ * Main PIC communication routine * / void puIseService (void);
f * PIC comm routine - once-per-second codę * / yoid pulseSecond (void);
/ * Subroutines for PIC communication * / void Stuff6 (int pass_data); yoid format_Xfnit_bufTer (void);
BOOLEAN decode_rcv_buffer (void); void process_status_bits (void); unsigned int Get5 (void);
void set_PIC_alarm (alarmcodes pass_alarm_type, int pass_PIC_addr,.
unsigned int pass_alarm_data);
/ * Startup codę for PIC communication * / void pulseStartup (void);
/ * Routine to elear pulse registers after cold start * / void pulseCo! Dstart (void);
/ * defined in pt.c * / #deftne RELAY_A 0 // define RELAYJB 1 void pulseOut (int picNbrjnt relayNbr.int ONoff); void ptEveryMinute (void); void ptEverySecond (void); void set_PLC_relays (int xmitRelay, int rcyRelay);
EP 1 960 932 B1
PICEND.DEF / * include file at end of mtrsamp to control MC and ST pic chips from mtrsamp interrupt * / # ifdefIS_MC5 if (<sub>P</sub>uIseOutMode == PICMC_SERIAL) {
asm ("MOVE.L # Ox80400E, AO");
asm C AND.W # 0xFCFF, (A0) "); / * Clear clock and data ports * / #endif #ifdef ISJST5 asm (" MOVE.L # 0x804OOE, A0 ");
asm ("AND.W #OxFEFF, (AO)"); / * Insert clock falling edge * / if (PIC_serial_status = sending st5 bits) {
asm ("NOP ''); asm (" NOP "); asmC NOP"); asmC NOP "); asm (" NOP "); asmC NOP"); asm ("NOP ''); asm (" NOP "); asm (" NOP "); asm (" 'NOP "); asm ("NOP"); asm ("NOP");
asmC NOP "); «Asm (" MOVE.L # 0x804O0E, AD ");
asm ("OR.W # 0x0100, (A0)"); / * If sending bits, activate clock * / #endif
PICVAR $ .DEF / * local variables to control MC and ST pic chips from mtrsamp interrupt ineter / c / lib / picvars.def * / unsigned long bitOneFlag;
EP 1 960 932 B1
PULSELINK.DEF / * determine if variables are extemal or defined here * / // undef ref // ifdef PSTRU_DEFINED // define ref // else // define ref extem // endif #if (NUMPH> 6) // define IS_MC5 # else // ifdef MAX_SCAN_METERS // defme IS_ST5 #else // define IS_RSM #endif // endif / * Values for hdwr -p (pulseOutMode) * / // define STANDARD_PIC_COMM 0 #if 0 / * remove these equates from mtrlink.def * / // define PIC PULSE SERIAL 1 // defme PIC_MC_SERIAL 2 // define PIC_ST_SERIAL 3 // endif / * then uncomment them here * / / * #define VATEST 1 * / // ifdef VATEST / fundef IS_MC5 // undef IS_RSM // undef 1S_ST5 // define IS_RSM // undef NUMPH // define NUMPH 3 // undef MAX_SCAN_METERS // endif / * Uncomment for water meters (Oakville Hydro) * / // define READ_ENCODERJDD 0x49ff0000 // define READENCODERPARM 0x0312500c / * Uncomment for gas meters (Sonix) // define READ ENCODERJD Ox49feO389
EP 1 960 932 B1
- '/ define READENCODERPARM 0x0300500c * / // define ID_FIF, LD_LENGTH 13 // define PULSESJPERPIC 4 // ifdef ISMC5 // define BITS_ PER_SEC 822 // define MAX_PICS 16 // else # ifdefIS_ST5 ł / defme B1TS_PER_SEC 942 5 define MAX_PICS 5 // else // define BITS_PER_SEC 32 // define MAX_PICS 1 // endif // endif // define DIRECT_PIC_WAIT_LIMIT 24 tfdefine BUFFEREDJ> IC_WAIT_LIMIT 10 * BITS_PER_SEC // define NUM_START_BITS 12 // ifdef 1S_ST5 // define REBUILDDAY define REBU1LD_DELAY 1000 // endif typedef struct {unsigned long serial_number; unsigned long last_cmd_data;
unsigned char unsigned char unsigned char unsigned char unsigned int unsigned char unsigned char unsigned char unsigned char currlDreg;
unsigned char last_command;
PIC_addr; software_type; software_version; loop_rate; status reg yalue; time sińce global; num_pulse_regs; curr_pulse_reg;
unsigned int unsigned int unsigned int unsigned int unsigned unsigned unsigned unsigned unsigned reply_wait_Iimit;
P IC_data_err_count; PIC_reset_count; comm_error_eount; force_pulse_read: 1;
get_semo get_version get_status reset status: i; : 1; : 1; 1;
EP 1 960 932 B1 unsigned update_parameter; 1;
unsigned clear_pulse_regs; 1;
}
PICstatust;
typedef enum {sending bits, sending st5 bits.
rcving_bits, doPICstart, sending_PIC_start, do_send_cmd, sending_start, sending start 1, sending stop, waiting for start. rcving_stop, tdle}
PIC_s_stat_t;
typedef enum {
SET_PRE_AJLIGN,
DOALIGN,
SET_NORMAL_PLC,
DISCONNECTJCOUPLER,
READ "XMIT_LEVEL
ATM_op_t;
typedef enum {
DO_PRESET,
DO_PLC_SET,
SET_ALIGN,
WAIT_ALIGN,
DO_ATM_D1SCONNECT,
ATMDONE}
ATM_state_t;
typedef structf unsigned char PIC_addr; unsigned char command; unsigned char reg .ID; unsigned long commandjdata;
unsigned int flags;
int bitCount;
union {unsigned long bufLong [3];
. unsigned char bufByte [12];
EP 1 960 932 B1; bits;
)
PICbitBuf; '
ZHfndef BOOLEAN_DEFINED
Zfdefine BOOLEAN_DEFINED typedef int BOOLEAN;
#endif
Z * Definition of bits in Flags field of PIC comm buffers * Z
Z * ΝΟΤΕ- Top 4 bits (OxfOOO) reserved for use by ATM codę * Z #define rcv_bad_addr_flag 0x0100 #define rcv tpar_error_flag 0x0080 #define rcv_data_ready_flag 0x0040 #define rcv_bad_length_flag 0x0040
Wdefine rcv_timeout_flag 0x0010 #define rcv_parity_err_flag 0x0008 #define PlC_error_flag 0x0004 #define PIC_need_refressi_flag 0x0002 #define PIC_invalid_data_flag 0x0001
Z * Command codes for PIC communication * Z #define MAX_FAST_READ 0x07 fcdefme CLEAR_PULSE_REGISTERS 0x08 fldefine READ_REGISTER 0x10 #define WRITE_REGISTER 0x18 #define SYSTEM_CONTROL 0x19 / * Register DD codes for PIC communication * / fldefine EREG_RUL_REGE_REG 27 #define PARM_REG 28
ZZdefine VERS_REG 29 #define SERNO REG 30 #define STATUS_REG 31 / * Special-purpose PIC addresses * / #defme GLOBAL_P1C_ADDR 31 tfdefine MC5_MUX "PIC_ADDR 30 '#define ST5_MXJX_PIC_ADDR 29 tfdef_ADMADM LCM 20 Z * Fi rst ATM is at address 20 * Z tfdefine MAX_PULSE_PIC_ADDR 15 / * pulse couters are from 0 to 15 * / / * Bit usage in the ATM relay control word * t
EP 1 960 932 B1 #define ATM_RC_XMITON 0x00008000 #define ATM_RC_MEAS_XMIT 0x00004000 #define ATM_RC_MEAS_CPLR 0x00002000 #define ATM_RCJRESJ5HORTED 0x00001000
<img file="PL1960932T4_D0008.tif" />
#define ATM_MEAS_T1ME 20L / * mSec to wait between cap change and ADC reading * / #define ATM_D1SC_TIME 20L / * mSec to wait before switching cap relays * / #define ATM_MIN_READING 0x0038 / * If reading at end of autotune less than this, fail * / / * Equates for ST5 comm * / #define ST5_P1C_DELAY 66 #pragma region ("ram = rain") ref unsigned short current_PIC_jndex, rcv_PIC_index;
ref PlC_status_t PIC__status [MAX_PICS];
struct {unsigned long reading; int error_cnt;
unsigned char ID_field (TD_FIELD_LENGTH]; unsigned char ID_buffer [ID_FlELD_LENGTH];
} ref pulseData [2 * NUMPH];
struct {
PICbitBuf xmit_buf;
PI Cb andB uf rcv_buf;
int control_flags;
} ref ext_comm, PIC_comm_nion;
struct {
ATM_op_t operation; unsigned int ATM_number;
ATM_state_t State; unsigned request_flag: 1;
unsigned done_flag: 1;
unsigned error_flag: 1;
unsigned active_flag: 1;
unsigned int start_cap_code; unsigned int end_cap_code; unsigned int optimum_cap_code;
EP 1 960 932 B1 unsigned int optimumjreading; unsigned int xmit_level; unsigned int couplerjevel; unsigned int result_flags; long int align_timer;
} ref ATM control;
struct {unsigned unsigned unsigned unsigned unsigned int unsigned int unsigned int unsigned int unsigned int request_flag: 1; daduflag: 1; ERROR_FLAG; 1; active_flag: 1; xmit_mask; rcv_mask; resuhjftags; lastjcmitjnask; last rcvmask;
} ref MUX_control;
struct {unsigned do_jebuild: 1;
unsigned milking: 1;
} ref Comm_background_flags;
/ * Bit definitions in ext_buf.control_flags * / // define SUPPRESS NORMAL COMM 0x0001 ffdefme XM1T_REQUEST #define CPY_RCV_DATA rcv_buf * / #define RCVDATARDY rcv_buf * / #define ΧΜΤΤ DATA RDY
0x0002 / * Extemal routine requests send of xmit_buf * / 0x0004 / * Extemal cmd was sent, copy rcvd buffer to 0x0008 / * Got reply from extemal cmd, reply is in
0x0010 / * xmit_buf has copy of last cmd sent * ł ref PICbitBuf ref PIC_s stat t ref unsigned int ref unsigned int ref unsigned int ref unsigned int ref unsigned int ref unsigned int ref unsigned int ref unsigned int ref unsigned int ref unsigned char ref unsigned char ref unsigned int ref unsigned int ref unsigned int ref BOOLEAN ref int ref unsigned int ref alarmstr
PICxmitBuf, PICrcvBuf, HoIdrcvBuf; PICserialstatus; num_PICs; numLCMs; rebuild_timer;
ATM_work; work_PIC_addr, num_pulsc_ctrs; hold_num_pulse_ctrs; bit_count;
out_bit_value;
* shift_LSB_ptr, in_bit_value;
PlCjwaitJinriit; zero_count;
Iast_comm_err_flag; dontcIearPICstats;
ST5_PIC_delay_ctr;
PIC_bad_addr_count;
PIC alarm;
#ifd<sub>e</sub>fVATEST
EP 1 960 932 B1 / * U test !! * / ref int tef int reflong ref int / ♦ test !!!! ♦ / #endif temp_command;
temp_reg_IE>;
temp_command_data;
temp_flags;
refenum {clk_high clk_Iow}
PIC_clk_state;
ref enum {
NO_GLOBAL_SEND,
SENDGLOBALCER,
SENDING_GLOBAL_CLR,
GLOBAL_CLR_SENT clear_state;
/ * Old equates maintained for compatibility * / #if 0 tfdefine RELAY_A_BIT 1 #define RELAYBBIT 2 tfdefine IDLE 0 tfdefme TX 1 #define RX 2 #defme DATA_READY 3 #defme WAKE 4
- # define PIC_RESET 5 tfdefine WAKE_COVNT_RELOAD (64 * 4) / * Four Seconds ♦ / #define RESET_COUNT_RELOAD 10 / * 1/4 Seconds * / #defme RELAY_A OFF CMD 5 / * active Iow trigger * / ffdefine RELAY_A_ONFFC / fdefine RELAY_B_ON_CMD 6 #define CLEAR_ACC_CMD 8/12 CMD fdefine SUBACC ffdefine ECHOCMD 14 #define SLEEP_CMD 15 #define PULSE_SER1AL_COM_MAX 15 ffdefine WAKECMD 16 #define RESETCMD 17 ffdefine PULSE COM_NUM 18 #define NO_PULSE_BIT_DATA OxFFFFFFFF ffdefine RELAY_CMD_MTN 4 ffdefine RELA Y_CMD_ΜΑΧ 7 ffendif
EP 1 960 932 B1
Contents30
57 members in 13 offices
Priority claims17
| Document | Office | Kind | Date |
|---|---|---|---|
| 73758005 | United States of America | P | |
| 73758005 | United States of America | P | |
| 73937505 | United States of America | P | |
| 73937505 | United States of America | P | |
| 43184906 | United States of America | A | |
| 43184906 | United States of America | A | |
| 81390106 | United States of America | P | |
| 81390106 | United States of America | P | |
| 06849894 | European Patent Office (EPO) | A | |
| 2006044762 | United States of America | W | |
| 2006044762 | United States of America | W | |
| EP20060849894 | – | – | – |
| US20050737580P | – | – | – |
| US20050739375P | – | – | – |
| US20060431849 | – | – | – |
| US20060813901P | – | – | – |
| WO2006US44762 | – | – | – |
Members57
| Document | Office | Kind | |
|---|---|---|---|
| CA2401579A1 | Canada | A1 | |
| CA2661730A1 | Canada | A1 | |
| CA2818672A1 | Canada | A1 | |
| WO0165823A1 | World Intellectual Property Organization (WIPO) | A1 | |
| AU4188701A | Australia | A | |
| EP1260090A1 | European Patent Office (EPO) | A1 | |
| WO0165823A9 | World Intellectual Property Organization (WIPO) | A9 | |
| US2003158677A1 | United States of America | A1 | |
| EP1260090A4 | European Patent Office (EPO) | A4 | |
| US2005137813A1 | United States of America | A1 | |
| US6947854B2 | United States of America | B2 | |
| US7054770B2 | United States of America | B2 | |
| US2006259254A1 | United States of America | A1 | |
| CA2527068A1 | Canada | A1 | |
| CA2567955A1 | Canada | A1 | |
| CA2630862A1 | Canada | A1 | |
| WO2007062232A2 | World Intellectual Property Organization (WIPO) | A2 | |
| US2007150237A1 | United States of America | A1 | |
| IL151406A | Israel | A | |
| US2007194949A1 | United States of America | A1 | |
| WO2007094837A2 | World Intellectual Property Organization (WIPO) | A2 | |
| AR057593A1 | Argentina | A1 | |
| AR057930A1 | Argentina | A1 | |
| CL2006003252A1 | Chile | A1 | |
| WO2007094837A3 | World Intellectual Property Organization (WIPO) | A3 | |
| EP1955161A2 | European Patent Office (EPO) | A2 | |
| EP1960932A2 | European Patent Office (EPO) | A2 | |
| IL180435A | Israel | A | |
| WO2007062232A3 | World Intellectual Property Organization (WIPO) | A3 | |
| CN101351803A | China | A | |
| US2009099801A9 | United States of America | A9 | |
| US2009132096A1 | United States of America | A1 | |
| US7539581B2 | United States of America | B2 | |
| CN101496301A | China | A | |
| CA2401579C | Canada | C | |
| US7596459B2 | United States of America | B2 | |
| US2010156664A1 | United States of America | A1 | |
| US2010213766A1 | United States of America | A1 | |
| CN101351803B | China | B | |
| BRPI0618932A2 | Brazil | A2 | |
| US8026628B2 | United States of America | B2 | |
| US8090549B2 | United States of America | B2 | |
| US2012019297A1 | United States of America | A1 | |
| US2012022814A1 | United States of America | A1 | |
| EP1960932A4 | European Patent Office (EPO) | A4 | |
| US8417471B2 | United States of America | B2 | |
| US8452555B2 | United States of America | B2 | |
| CA2527068C | Canada | C | |
| CA2661730C | Canada | C | |
| EP1260090B1 | European Patent Office (EPO) | B1 | |
| EP1260090B8 | European Patent Office (EPO) | B8 | |
| DK1260090T3 | Denmark | T3 | |
| ES2441617T3 | Spain | T3 | |
| EP1960932B1 | European Patent Office (EPO) | B1 | |
| ES2554499T3 | Spain | T3 | |
| PL1960932T3 | Poland | T3 | |
| PL1960932T4This record | Poland | T4 |
Numbers
- Publication, DOCDB
- 1960932
- Publication, EPODOC
- PL1960932T
- Application
- 849894
- Application, DOCDB
- 06849894
- Application, EPODOC
- PL20060849894T
Titles2
- English
- APPARATUS AND METHODS FOR MULTI-CHANNEL METERING
- Polish
- URZĄDZENIE I SPOSOBY DO WIELOKANAŁOWEGO POMIARU
Classification
- CPC, 9
- G01R22/066
- G01R22/063
- Y04S40/121
- H04Q9/00
- H04Q2209/30
- H04Q2209/60
- Y02E60/00
- H02J13/1311
- H02J13/333
- IPC, 5
- G06F19 00
- G01D4 00
- G01R22 00
- H02J13 00
- H04Q9 00