{"id":335,"date":"2012-02-06T10:21:28","date_gmt":"2012-02-06T15:21:28","guid":{"rendered":"http:\/\/fll-freak.com\/blog\/?p=335"},"modified":"2025-04-21T00:54:36","modified_gmt":"2025-04-21T04:54:36","slug":"ade7763-part-7-mystery-of-the-swapped-vi","status":"publish","type":"post","link":"https:\/\/fll-freak.com\/blog\/?p=335","title":{"rendered":"ADE7763 Part-7 (Mystery of the swapped VI)"},"content":{"rendered":"<p>In my last port I alluded to the mysterious swapping of the voltage and current channel. When I read the Vrms and Irms channels under various loads, it is the voltage channel that changes significantly and not the current. I beat my head against the wall and found not reason for this issue.<\/p>\n<p>I had considered that the SWAP bit was set in the mode register but repeated reads of the mode register indicate that the bit is not set. I even double checked by decoding the data on the SPI bus thinking perhaps I still and an interface issue.<\/p>\n<p>I do believe that at one time it worked. I have notes that show changing current and not voltage. A lot has happened since that test. The SPI interface was changed to bit bang using direct port manipulation rather than using digitalReadWrite routines. I also implemented the zero crossing interrupt and the read of the RMS values inside the ISR.<\/p>\n<p>I also have noticed that the phase of the voltage and current seems to swap on a daily basis. A few days ago, the phase was reversed and I swapped the direction of the CT around to fix. And yesterday I had to swap it again to get them back into phase. This seems to be very strange behavior and I wonder if it is related to the VI swap?<\/p>\n<p>I also did some research and realized that the Arduino does have a hardware based SPI interface. This should be much faster than my bot bang approach and I will switch over shortly. If I can minimize the SPI time, I might just be able to sample waveform data at the slowest rate. This will go on the back burner till I solve the swap issue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last port I alluded to the mysterious swapping of the voltage and current channel. When I read the Vrms and Irms channels under various loads, it is the voltage channel that changes significantly and not the current. I &hellip; <a href=\"https:\/\/fll-freak.com\/blog\/?p=335\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[],"class_list":["post-335","post","type-post","status-publish","format-standard","hentry","category-home-power-monitor","category-projects"],"_links":{"self":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335"}],"version-history":[{"count":2,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions"}],"predecessor-version":[{"id":337,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions\/337"}],"wp:attachment":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}