Sunday, December 30, 2018

Have You Ever Thought About Tire Inflation?

Well, neither had I. At least not much more than topping of a tire once in a while. However, I got new rear tires on my big tractor and after a while of just sitting, one of the tires was very low. Getting the new tires was an interesting experience. Those things weight a lot and I didn't want to spend hours trying to break the bead and leverage the tire off using long tire irons, so I just called in a mobile tire service and let them do it for me.

They came out in a big truck with a crane installed in the middle of it. They didn't even have to remove the wheels from the tractor; they simply pulled the tires off of it and put the new ones on. I sat in a lawn chair and watched. That's the 21st century way to get tractor tires changed.

Anyway, the brand new tire was flat and I had to air it up. I grabbed my trusty tire inflator and about ten minutes later I was still messing with it. I have a pretty good compressor, but putting air in a tire as big as the ones on my tractor through a hole a little more than an eighth of an inch was going to take some time. Plus, holding it up to the valve stem was getting tiring. You all must have either owned or used one of these over the years:

I had another one to try out that I picked up at Tractor Supply a few months back, so I gave it a try and it didn't work much better.

The little assembly that was supposed to hold the hose on the valve either leaked or popped off each time I tried to use it.  I did eventually get it to fill the tire, but it was an experience that I didn't want to repeat.

Off to Amazon I went and found an inflator that had many good reviews and looked like it could do the job because it was substantially better made than the one I had. There were rave reviews that indicated that it would tell me the tire pressure as I filled the tire, it filled fast, was accurate, all the hype one should have learned to expect and disregard. I ordered it. When it came in, I drove the tractor (with a flat naturally) in front of the garage and tried the new device out.

Although the clip on part that should hold it to the tire worked better, it leaked if moved even a little bit in any direction. Since the valve stem was on the inside of the wheel that meant I had to lean over the tire and hold it in place. All was not lost though, it had a screw on fitting that could actually be put on the valve and would allow me to relax a little bit while filling the tire. But I couldn't figure out how to hook it to the inflator hose.

I used this inflator to fill the tire, but it wasn't a very satisfactory experience since, even though the clip on was better, I still had to make sure it stayed straight on the tire.

I went looking for another one based on about $40 spent so far and several hours direct experience and ordered this one.

It had exactly the same valve assembly as the last one with exactly the same screw on adapter, but this one had a hose that I could use the screw on with. I installed the 'hands free' adapter and hooked it up. No leaks and I didn't have to hold the hose totally straight to use it. The problem with this one was the same as all the others I had to lean over the tire to hold the stupid lever that released the air.

Fishing around my drawers of junk I found a piece of velcro (you can see it above) that I could wrap around the valve to hold it open so the tire would fill unattended. I was totally set up now. I could attach the fitting, fill the tire while checking fluids and such, then put everything away for later. Of course the eventual goal was to get the leak fixed, but I hadn't been able to find where it was.

I did notice a few things I want to share about these simple devices that don't work as well as they should. First, these days it's actually getting harder to find inflators that aren't digital. They all tout how wonderful they are because they are 'easy to read'. That is a simple lie not only will the batteries be dead when you need it, you can only see the numbers when they are oriented correctly. And, who the heck cares about a half pound resolution in a tire's pressure? As soon as you disconnect the device and the air warms up a bit whatever reading you had will change. My bet is that the accuracy is around ten percent or so and a digital reading just isn't necessary. It will also save you time, money and frustration with an old fashioned analog gauge.

None of them read the pressure of the tire, they all read the hose pressure. Think about it, it's a hose transferring air, the only pressure it actually can read is the pressure in the hose. That's neither the compressor pressure nor the tire pressure. This all means that you have to stop the flow of air to actually get a reading. I checked it every couple minutes (yes minutes) to see how it was going. Usually, I over inflated it and had to drop it down to the right pressure by hand, but that didn't take too long.

The high end devices cost from $25 up to over a hundred and they're all basically the exact same device with different names stuck on the outside. Take a look:

Lastly, don't believe the comments and advertising. If you have big tanks or tires to fill, get a screw on adapter and use it. It won't speed things up much, but you won't be holding the hose a certain way to keep it working while having to hold the lever down.

Heck, the first inflator I tried that had been my buddy for years and years would have worked with the adapter and I would have saved roughly fifty bucks and weeks of frustration.

Oh, I finally did find the leak. After washing the tire down six times with soapy water and turning it slowly in the sun and finding nothing, I was under the tractor working on a simple drain valve and happened to think that I hadn't checked the valve on the tire. The valves on the tractor are all on the inside to prevent rocks from ripping them off and they are a bit hard to check. Sure enough, the valve was not tight in the wheel and leaked. A few minutes with some soapy water and a wrench and the problem was fixed.

So, learn from my mistakes.

Saturday, July 14, 2018

Thermostats, Location, Location, Location

When I was researching supercooling as a way of limiting my power bill I kept getting readings and such that just didn't make sense. One side of my house was comfortable, the other ... not so much. Sure it was the sunny side this time of year, but it has really good windows and good curtains. The only two major problem areas were a couple of windows that faced directly into the after noon sun.

I fixed those years ago with reflective insulation that I put in for the summer and (sometimes) take out for the winter. It's easy to work with and will last forever if I just give them a little attention every once in a while. I wandered around the room and noticed that the interior walls were about 2 degrees warmer than the rest of the house and there was heat getting in through the foundation.

The sun bearing down on the exposed slab foundation would heat up the concrete slab and transmit heat inside the house. That's something that might go unnoticed if I had carpeting, but the tile felt warmer as you approached the wall.

So, basically, it was like any other house on the sunny side. Why was my AC running all the time and having little impact on that room?

A little background: I have a house shaped like an "L" and two AC units. The one on the north is a 3 ton and the one on the south is a 5 ton. Both of them going could cool the house, but when they cycle, it doesn't seem to handle it. I had two thermostats that were located by the AC 'experts' that did my house and were in the top middle of the price range. I replaced them with highly programmable thermostats that were in the high range of prices. These wouldn't do the job of handling peak periods well, so I got a high priced "learning' version. It was crap.

The learning thermostats only learn what the programmer wants them to learn, and it was great at anticipating my needs. It decided I liked the AC on at 07:00 and off at night ... exactly the opposite of what I wanted. They tried to predict what temperature I wanted the house at and must have been born in Nova Scotia because they wanted to keep it at around 65F.

I sent those things back before the 30 day refund period was up. What a waste.

Then, I built my own <link>; I could control them any way I wanted to. Over the years I tried recirculating the air around the house with them, experimented with differing hysteresis curves, used various smoothing algorithms on the temperature readings, etc. Basically, I tried everything I could think of to get the environment the way I wanted it.

Nothing worked very well. I would still wake up with the bedroom running around 85F at night.

But, during my experimenting with supercooling the house (look at the posts on supercooling by using the contents search on the top right of the page) I noticed a whole bunch of things that really shouldn't be happening. First the south AC unit was short cycling. Short cycling is where the AC comes on and then shuts off in seconds or minutes. This is NOT a good thing.

Cycling like this can radically shorten the lifetime of any motor driven device. It causes undue wear on the bearings to be jammed up by the quick start of the motors. It can cause fan blades to slip and that scores the shaft. The air start up can loosen vents and cause rattles. Basically all the things that destroy devices like this. This behavior can also cause a room to be too cold and then too hot within minutes.

The very most expensive AC units start slow and ramp up to speed, they will run slowly to keep the air moving, they even open and close vents based on the need for cooling in a particular area. But, I'm not Bill Gates; these things are way out of my price range.

So, I started looking for the cause of this situation on my south AC. TLDR (too long didn't read) the thermostat was in the wrong place. The thermostat was in a hallway like most of the thermostats in the world close to an overhead air return for the AC. Over half the air for the house went through that return. The temperature would drop rapidly in that location when the AC turned on and cause shut off in a matter of a couple of minutes. Then it would rise rapidly back up because it was only the breeze that cooled it off and repeat the cycle.

Another factor was that I run in and out of the garage a lot. Each time warm air would hit the thermostat and cause the same problem. Add to that the garage is on the other side of the wall and it doesn't have AC. When it heated up, the wall was warmer than the air in the house; cycle started all over again. Obviously, the thermostat had to be moved to get better performance.

Based on this research, I modified the house code to save the activity of the two AC units and looked at them for a day to see how bad it was. It was pretty bad. Here's a chart of my findings on the first day for the south AC unit:

The tall vertical stripes are when the compressor was running, and the jagged line down the middle was the temperature the thermostat was reading. Each shaded long vertical strip is the compressor chewing up power and wearing itself out. Here's a closeup of a couple of them from the middle of the chart:

The stair steps in the temperature is due to the granularity of my recording the data. I only mess with one degree changes, so it comes out like this. So, you can easily tell that the hysteresis is three degrees and it takes very little time to overcome that with the AC unit essentially blowing down the hallway from all the rooms. Similarly, the temperature will shoot back up in a similar fashion because that short a cooling interval doesn't really cool anything except the air the it is blowing around. The gap in the middle is because the cumulative impact of a series of cooling cycles finally does cool things down a little.

When I looked at the North thermostat, it was a different set of environmental factors that added up to a different problem. This thermostat was in a short hallway outside the master bedroom (my room darn it) while the AC unit was venting into that room. There were also a couple of vents that dumped air into the rest of the house to aid there as well. When I looked at it, it looked like this:

Same things on the graph, compressor run period and temperature recorded by the thermostat. Notice the compressor runs a lot even though the temperature isn't changing? Part of that problem is that the thermostat isn't really looking at the AC activity, it's looking at a completely different area. The rest of the problem is that the two vents into the rest of the house are letting almost a great a volume of air get out there as it allows inside MY ROOM.

Fine ! I gotta move the thermostats, but where the heck am I going to put them? Also, it's a real pain to move a thermostat. I don't have a real attic, it's an area that is totally filled with insulation about two feet tall. I really, really don't want to go up there --- ever. I could carve out the wall and move the thermostat and then patch up the wall. That's equally unlikely to happen. Instead I experimented with really long hysteresis values. I was up to 10 degrees at one point. That solution was not satisfactory. I also tried running the fan longer to make sure the air got moved. That didn't work well either; it actually made the problem worse.

Then, I thought about it a bit. I had these temperature sensors <link> all over the house, why couldn't I just use them instead of the temperature sensor inside the thermostat? There wasn't a single reason why not except I would have to change some code in a few places. I took all the code out of the south thermostat related to reading temperature and reorganized it a bit. Now, it would receive the temperature forwarded by the house controller from any of the temperature sensors around the house.  I chose a room where the sensor was on an inside wall away from any breeze from the AC directly. The sensor gets air circulation, it just wasn't directly in the cool air path.

Now, I was ready to test the newly modified south thermostat. The one that was banging the compressor to death with short cycles. Let's see what this accomplished:

Now, that's more like it. Granted, it was a stormy day and not our usual 100+ temperatures, but look, it wasn't short cycling any more. There are long periods of AC activity and the temperature rises slowly instead of a few seconds at a time. This may look like I'm actually using more power, but I'm not. It's actually about the same because the gaps are longer as well. the big thing was that I wasn't tearing the guts out of my AC.

I did the same thing with similar results to the North AC, except I also closed off the vents to the rest of the house. Now my bedroom cools down pretty quickly and stays that way for a while.

Notice that it isn't on all the stinking time blowing air where it isn't needed? The big gap is the 'demand' period where the AC isn't allowed to run 15:00 to 20:00. After the down time, it kicked on and recovered a little after midnight.

The beauty of this is that I can build a couple of temperature sensors specifically for the AC units and put them anywhere I want. If I want priority in the bedroom, put the sensor by the bed. If I want it for the shower, put it just outside; you get the idea. Basically, this is a priority system now that allows me to carry the priority anywhere I want.

I hereby copyright this idea !! Anyone is welcome to do anything similar; heck steal my code if you want, but you commercial shark guys out there better get permission to use this. It's real annoying when you find your code, stolen right off the site and only perfunctorily changed in a book that sells for $35 a copy at a book store. I'm looking for new ideas and find my old ones on the shelf...sigh. I have found my code and ideas all over the web and almost every single time it's attributed; that makes me feel good. When someone is selling it, not so much. This stuff is supposed to be free dog gone it.

Anyway, the jury is still out on this idea. I need to watch it over time and see if there are problems with the devices talking to each other, getting out of hand unexpectedly, actually working the same way over time. That kind of thing. One thing I did notice though is that a web only version where there is no control station nearby sucks. It's really nice to be able to lower or raise the temperature by pushing a button on the wall instead of starting up a browser and working through pages to get to it. Now, this could be a cheap tablet, and old phone, or something like that if you want to get fancy, but a nearby control is nice. I like buttons.

Also, it's a good thing to have a display that shows everything is working OK. I'm currently using the display on the thermostats, but it could be anything that you can see when wandering aimlessly around the house looking for the car keys. This also helps with the, "It's too hot." comments. You can point to the thermostat and show them that it's only 80 and not hot at all. Folk visiting from the East do this all the time.

Another thing I learned is that AC 'experts' are not to be trusted. These things were professionally installed and came highly recommended. They put one thermostat outside the room it was needed in and the other in a breezy hallway next to the air intake and a garage door. In retrospect, I may be to blame somewhat for not asking enough questions, but these were experts hired for their knowledge and experience. I don't have a suggestion on how to handle this problem except to get two or three experts to present proposals and pick their brains. If you are Bill Gates and can afford to do that kind of thing. I even blogged about the unreliability of 'experts' a couple of times; my experiences are not good with them. Of course, now that I can put the temperature sensor anywhere I want, it doesn't matter as much.

See what happens when you start automating your house? Ideas may come slowly, but actually doing them is entirely possible.

Oh, this is another post that will attract attention from the spammers. If you post advertising in a comment, it will be quietly deleted. Usually the same day. So, don't bother advertising your AC repair company here.

Tuesday, July 10, 2018

Local Power Politics: APS, AZCC and Things to Think About...Continued

No, this isn't turning into a political blog, although, it would be fun, but this relates directly to my continuing annoyance with my power company Arizona Public Service. I have a few previous posts about how poorly (in my opinion) it's run and how they are using the power of the dollars we pay in rate fees to control local politics and raise rates. In the last post about this <link> I specifically mentioned a particular rate increase that is being contested right now. I'll leave the long description of that item to the reader; simply check out the link I just left you.

What I want to recap here is one particular item that is turning out to be fun. Briefly, an APS customer, Stacey Champion, is petitioning to have the latest rate increase revisited. She contends, and I agree with her, that APS dealt improperly in their presentation of data and impact of the rate increase. A lot of people are behind her in this effort, and two individuals have joined directly in the proceedings to help out and also get some of their own particular opinions aired.

Naturally, this is becoming an interesting problem for the members of our regulatory commission, Arizona Corporation Commission. Basically, the AZCC is the equivalent of a Public Utility Commission in other states. They have commissioners that vote to control rate increases and act in the public's behalf. Many contend that APS owns some of the commissioners, and it's hard to deny when millions of dollars have been spent by APS on political campaigns locally.

So, this particular 'Docket' is a hot button right now since some of the commissioners are up for reelection in November.
Now, to the fun part. One of the commissioners Tom Forese sent a note to the people handling the Docket asking for the inclusion of 'Staff':

Dear Commissioners and Interested Parties,
I would like to request that Staff participate in the matter of Stacey Champion, et al vs. Arizona Public Service. Staff was a party to the rate case, and Staffs [sic] participation will assist me in making my final decision. 
I would like Staff to respond by close of business June 29, 2018.
My first question was who is this 'Staff' person? Is there a Joe Staff that works there or what? Well, it turns out that 'Staff' is the commission's legal staff. Forese is actually trying to inject more lawyers into the mess. These lawyers are the same ones that worked on the previous Docket that is being contested right now.
'Staff' replied with another note:

Because this proceeding has been underway since mid-February 2018, Staff respectfully requests that a procedural conference be scheduled at the earliest possible date to discuss Staffs participation in this case and to consider this proposed procedural schedule to accommodate Staffs involvement 

I only quoted the last paragraph because the rest of it is legalese, and you can see it all by following the link above. Below this is a strawman schedule that is proposed so the lawyers can get all their poop in one sock and not look like a bunch of dweebs.

Notice that the lawyers ask for a conference. In this case it means that a judge presides, and all the folk directly involved have to attend and have their lawyers there. It's really a hearing; you know how lawyers love a hearing. The administrative judge involved, Jane L. Rodda called for a conference (hearing) to be held on July 11th to discuss this and other matters.

OK, this sounds a little weird on the surface. The commissioners have not attended any of the hearings so far, and have had little obvious involvement. This has been between normal folk and APS's plethora of lawyers. Now, one of the commissioners, actually the chairman of the commission, wants to inject lawyers to tell him what is going on. Initially, I wondered, "Why hasn't he been following this already?"

Turns out that I wasn't the only one wondering this. Warren Woodward, one of the normal folk that is also directly involved in this with Stacey Champion filed a letter contesting 'Staff' involvement. This is the really fun part and I'm going to include most of it below:

Warren Woodward, Intervenor in this proceeding, strongly objects to the suggestion put forth by Staff on June 29, 2018, that a procedural conference be scheduled in this case to discuss Staffs participation in this case. 
1) This matter can be handled on paper. There is no need to waste the Parties' time at a conference.  
2) The time to apply for intervention passed on May ll, 2018. Staff missed the boat.  
3) By virtue of signing the APS rate case Settlement Agreement, Staff is biased in favor of the rate hike established in ACC Decision 76295, and Staff cannot be expected 1 to be impartial in this case. To wit, Section 40.6 of the Settlement Agreement:  
  • The Signing Parties shall make reasonable and good faith efforts necessary to obtain a Commission order approving this Agreement. The Signing Parties shall support and defend this Agreement before the Commission. Subject to subsection 40.5, if the Commission adopts an order approving all material terms of the Agreement, the Signing Parties will support and defend the Commission's order before any court or regulatory agency in which it may be at issue. 
4) If commissioner Forese, who suggested Staffs involvement in order to assist his decision making, wants to better understand the issues in this case, then he can read the docket, including all the APS customer complaints, both in this docket and in docket E-01345A-16-0036. There is also nothing stopping commissioner Forese from sitting in at the hearing and paying attention, something he neglected to do during the APS rate case in which these unjust and unreasonable rates (that are the subject of this proceeding and for which Forese voted) were spawn.  
5) In light of all the foregoing, there is really nothing to discuss. Staffs request for a procedural conference, and Staffs intervention in this case, should be denied.

Is this AWESOME or what? Woodward stepped up and actually said what should have been said:

This herd of lawyers has not been paying attention to this because it seemingly wasn't important, therefore they want to extend the schedule of the hearings and actions. Probably past the election so it doesn't interfere with the sitting commissioners campaign for reelection.

That the herd also cannot be neutral, or even in favor of the public's interest because they signed off on the rate increase and promised not only to not object, but also to "support and defend" it. Including them will add lawyers that are required to support APS in this matter.

The Chairman of the Commission himself isn't tracking it and doesn't want to go to the effort of catching up so he wants the lawyers to do it for him.

I'm going to add something to this that wasn't directly mentioned. More lawyers means that the normal folk that are trying to get this reheard will have to spend more money answering the new lawyer's questions. More time will mean more expense and delays so this falls further behind in people's minds. We all know that more lawyers always cost more money, and APS doesn't care at all. They are guaranteed a reasonable profit by the regulating body regardless of how badly they run their business.

One other thing, how could a section like 40.5 quoted by Woodward above ever have been signed? The parties to this 'settlement' were the solar industry, other power companies and such. My Lord, it also included Walmart and Sun City for crying out loud. There's a paragraph in there that says they will defend it?


And it's really there. I found it on page 31 about half way down the page <link>. If you want to see all the documents and interactions look here <link>, but it's really, really boring.

OMG!, do we have the best regulatory body that money can buy or what?

Thursday, July 5, 2018

PZEM-016: Another Chinese Power Monitor

I really like the PZEM-004 that I picked up just to see what it could do <link>, in fact I built the monitor and control system for my water heater with it <link>. This thing has really taught me a lot about water heaters and how much money my solar water heater actually saves me.

That led me to look at other devices available from China that could actually help out around the house. Well, the same manufacturer makes a different model, the PZEM-016 that does much the same, but even better for my purposes. This one does the measurements for me, but also has an RS485 serial interface so I can watch more than one of them.

OF COURSE I took it apart:

It's built extremely similarly to the 004 model I already wrote about. The big difference, of course, is that this one doesn't have any display. That's OK, I'll take care of that part. But first I have to actually talk to the darn thing. I've already worked with RS485 using an arduino when I put together my pool controller <link>, so it isn't too strange, but it still intimidates me a bit.

I dug around in my boxes of left over pieces and found an adapter to go from TTL serial to RS485 and combined it with an arduino and started working on getting it going.

Naturally, it was a pain in the bottom to talk to the device. I emailed the manufacturer when I first ordered the devices (yes, I got five of them) for as much documentation as they could provide. They sent me a manual that was actually pretty easy to read and understand. In it they said that the device was Modbus compatible, and that really impressed me. If you look up Modbus, it is an industrial protocol for machines. It can control a large number of devices in an industrial setting and should have code that I can leverage to get this working.

Right ! Things never ever work out that easily. I did find protocol libraries that I could use on the arduino, but have you ever looked at Modbus? I thought the documents for ZigBee were obtuse, these are where ZigBee learned how to do it.

Frankly, I chucked the idea of using a Modbus library down the tubes pretty quickly in favor of a much simpler approach. When I looked at the messages that the PZEM 016 actually used, there were only a few of them and the responses were pretty much canned and easy to work with. I just sat down and put together a message to read the data from the device and sent it to see what happened.

No, it didn't work first try. No, it didn't answer on the second or third try either. One has to understand that if you don't get the message exactly right, you'll never get a response from the device. In my case, I was messing up the checksum. Fortunately, in the last couple of years there have been many sample checksum implementations and online calculators implemented. I tried a couple with my data and hard coded the actual message I needed to send, that actually got me a response.

Then I spend a couple of afternoons working the kinks out of getting the response and using the checksum to validate the message. Once I could send and receive a single message reliably, I was ready to start adding code. Naturally, it encountered problems. It seems that short messages would cause checksum problems ... sometimes. So much for the idea that a computer does the same thing each time. I worked at this for quite a while without resolution. Here's a couple of screenshots of the arduino serial interface. The first one is using a message that requires a short response and the second is a longer message. The interesting thing is the accumulators I stuck in the code to count the checksum errors.

The short response has 34 checksum errors out of 100 tries while the second longer response has only one out of 100. Same code and timing in both cases...sigh.

For the rest of my experiments I used messages that required a long response. Eventually, I implemented code to handle reading the values from the device, changing the address of the device, resetting the energy (kWh) accumulator on the device, etc. I actually had it working pretty well.

Then I outfoxed myself and decided to modify the code to handle more than one device on a single pair of wires. This was actually easier than I thought it would be. The idea is that each device on an RS485 line has a different address, and you address the one you want to control or receive values from. In theory I could have several of these being read by a single arduino and monitor a lot of things around the house.

But, that would mean unique addresses and unusual delays and strange things happening. Gritting my teeth to the point of pain, I dug into it.

One of the initial problems I ran into was not knowing what would be coming after I sent a request out on the line. Sure, it should be predictable, but it never works out that way. When one does a serial read, you can get back something that is expected and just follow the bytes until you reach the end. We've all seen this: a protocol has a leading byte to tell you the beginning of the response, then a length to tell you how many bytes are to follow. You simply get the length and then read until the rest of them come in.

Suppose that is the last byte you see though. Or suppose there's a burst of noise on the twisted pair and you get about a thousand more? Obviously you can't rely on a length in the incoming characters until you can verify the integrity of the message by reading the checksum way out there at the end of the message. Let's make this problem even nastier, RS485 lines can ring. That means that you can get strange interference on the line that will mess up any message that is running around on it. You have to allow for settling times and such after messages fly around.

The problems are not insurmountable though, industry uses these protocols and devices every day. If they can make them work, I can get them to work well enough for my place. And, I think I did. Here's the code I came up with to read a message coming in:

int getit(){
  memset(rxbuf, 0, sizeof(rxbuf));
  int i = 0;
  if (digitalRead(debugPin)==LOW)
    Serial.println(F("Data from port:"));
  unsigned long startTime = millis();
  unsigned long lastChar;
  boolean startchecking = false;

  while(millis() - startTime < readTimeout){
    if(pMon.available() > 0){
      if (digitalRead(debugPin) == LOW){
      lastChar = millis();
      startchecking = true;
    if (startchecking && millis() - lastChar > 4)
  if(i == 0){
    if (digitalRead(debugPin == LOW))
  if (digitalRead(debugPin) == LOW)
  uint16_t calcCrc = makeCrc(rxbuf, i-2);
  uint16_t rxcrc = word(rxbuf[i-2], rxbuf[i-1]);
  if (rxcrc != calcCrc){
    Serial.println(F("Checksum error"));
    if (digitalRead(debugPin) == LOW){
      Serial.print(F("Calculated "));
      Serial.print(F("Received   "));

What I do is set a one second timer around the entire message and when a single character comes in, I set a intercharacter timer of four milliseconds for the next character. This way the most I can wait for a message is a second and then if it just stops mid message, I only waste four milliseconds before I give up and try again from the beginning. This works really well to cut the necessary time to read a message down as well as notice a failure quickly. I was pretty proud of this piece of code until a little later.

When I tried to send messages quickly, there were problems. One response would pile up on top of another from a different device. This required a delay between devices so things could quiesce a bit. Long painful experience has shown me that setting delays in code is just programming around a problem rather than solving it, but sometimes you just have to wait for other devices to stabilize before moving on. This is one of those cases because the devices on the line don't send you a ready message.

One other thing you'll notice in the code above is that I found a new debugging tool, an input pin. I use pin 3 on the arduino as a digital input pin and check to see if it is grounded before putting debugging messages out. If it's running and I see something I don't understand, just ground pin 3 and the debugging messages come out to the screen. I really wish I had thought of this about eight years ago.

The other pin I use for a special purpose is pin 2. If it's grounded I go into a special piece of code that allows me to change the address of a device. All the devices come addressed as one initially and I have to change them to something else to actually use them. So, if I add a device to the line, and boot the arduino, the first thing it does is check for a device at address one, and when it finds one, it tells me to change the address and hangs up in a hard loop.

I plug in a wire to pin 2 and then boot the arduino again. It senses the pin and goes into special code to allow me to readdress the device. This is also a good time to recompile and add another device to the device table. Yes, I took the cheap way out. I add a device in the code by changing a number and entering the default values as well. It just wasn't worth the time to come up with a more elegant solution for something that will happen six or seven times ... ever.

Basically, I'm done with being able to control and read this device, but that is the beginning of a greater project I've been thinking about for a long time. I'm going to put several of these in an enclosure and measure the power usage of my major appliances. The 2 AC air handlers and the 2 AC compressors are big users of power and I want to track their operation. The stinking dryer that has cost me so much money because people keep using it is another one <link>. I messed up though and only ordered five of the devices. I need one more for the kitchen stove. It'll be on order tomorrow probably.

Before the more astute of my readers comment on how an appliance that uses both 110 and 220 like a dryer or kitchen stove can't be measured with a single current transformer because one leg is referenced to neutral, go look at this post from quite a while back where I found a way <link>. Yes, Dorothy, there is a way to do it.

Here's a little sample of two of the devices monitoring my light that has two bulbs in it. I used the exact same setup when I worked on the 004 version.

I have the debugging pin grounded (that is so cool) and I'm reading the light with one bulb turned on. Notice the difference in the 'Energy' value? One of them has been recording usage longer than the other. They both read basically the same thing for the other measurements because they are hooked to the same thing.

Adding another monitor to the stuff is simple, Wire it in, ground pin 2, reboot, change the address to 4, change a value in he code, recompile and away it goes. Since this is one of those devices that will just run for a long time without changes, that should be fine.

Here's a picture of the setup I used to get it going.

The board in the upper left is the RS485 converter and the CTs are off on the right hand side.

Next, mount them in something, wire them up and hook the CTs around the power lines in the mains panel. I will add an XBee to the arduino and send messages back to the house monitor just like I did for the water heater. I fully expect to add at least one solid state relay (SSR) to the project to make sure the dryer is under my complete control. No more running the dryer during peak period for me.

Have fun.

Wednesday, June 27, 2018

Microwave Trouble: Sometimes a Stupid Question is Just What You Needed

Several times now I've mentioned my microwave oven in passing. It's given me a couple of problems over the years: I managed to explode a coffee cup and the liquid got into the turntable motor, and the entire control board went belly up on me. The turntable motor was easy; I just got a new part and replaced it. The control board was harder, that took a call to GE because I wasn't sure which of the four boards was acting up. I couldn't find a schematic on the darn board to isolate it.

The idea I had was to use the best appliances in the kitchen I could and then not have to ever replace them. The fridge has failed twice; the freezer several times, the range once, the dishwasher four or five. Most of the repairs were done by a real GE repairman using real GE parts except the freezer that had a piece of crap defrost timer in it. So much for the idea of getting top-of-the-line appliances.

But, don't misunderstand, I'm not rich and wasn't rich when I got them. I caught a good sale, the prices were much, much lower then and I had just sold my old house. I was also naive about the actual quality of appliances.

The microwave was working fine with a little fan noise and then the noise got really loud. It still worked, but you couldn't stay in the kitchen with it. Obviously, the bearings in it had failed. Right? Not so, the stupid squirrel cage blower had expanded, rubbed against the fan enclosure and started to get ripped apart. Nice.

Of course, I had to take it apart to find this out. This microwave is a ZSC2001FSS02 and looks like this:

I really like this oven. It's microwave as well as a halogen heated convection oven. It'll do three big baked potatoes in around 15 minutes without waiting for it to heat up. After I got it out of the cabinet and took the lid off to tell what was making all the noise, I looked for the part. No stinking luck; well sort of no luck.

The GE parts web site didn't even list a part number for the blower. It simply wasn't there. Sears listed a part number, but it was shown as "Not Available". Partsdirect showed the number and said the factory didn't supply it anymore. I used the part number and searched for about an hour and couldn't find one. Being a resourceful desert dweller, I went looking for the manufacturer since the name was right on the label, Oh Sung and the part was OBB-2009X1 or maybe m051004.3R. Once again, no luck.

I did find the manufacturer, but I really didn't want to spend a week exchanging emails and then maybe a month getting something from them. So, I went looking for a replacement squirrel cage to put in since the existing motor was working fine. The fan looked like this:

See why it was making noise? Ignore the grease, I didn't bother cleaning it up for the picture. When I pulled the blower assembly apart and looked at the actual squirrel cage, it was worse than I thought:

I found the missing pieces inside the blower cover. I had no luck at all finding a replacement for this. The only squirrel cages I found were for HVAC systems and such and they were waaay too large to do me any good.

OK, fine. I'll get something similar from a different microwave and somehow make it work. I switched over to ebay and started looking. There were a a lot of microwave blowers of different styles and sizes. None of them mentioned how big they were, just the various part numbers from the microwaves they were supposed to fit. It was sort of a order-something-to-see-if-it-works kind of thing. I hate that since it could take a long time and cost a lot of money in mistakes.

But, I did it anyway. I ordered a blower from a GE Advantium Microwave Oven that looked similar to the one I had in the squirrel cage construction:

And, that was a mistake. I took it apart and the squirrel cage was the same diameter, but longer and wouldn't fit inside the old housing. The old housing mount wasn't plastic like this one, it was sheet metal:

So, I just tried to mount the new(er) housing in the same place:

That didn't work out well. See how it protruded above the top of the cabinet? Here look from the side:

At this point I was ready to cut a hole in the microwave cover and just let it stick through.

The fans were longer and wouldn't fit inside the old squirrel enclosure and the new enclosure wouldn't fit inside the oven. The next try involved making room inside the old housing for the fans to stick out through the squirrel cage cover. I had to use the new motor because the shaft was longer to handle the longer squirrel cages. There was enough room and the fans would only stick out about a quarter inch, so why not?

About an hour later I had the modification done and now I could mount the new motor to the old metal brackets and put the thing in place except, the new motor was wired differently. The new motor had six wires and the old one had five. I actually hooked it up though to see what would happen (yes, I was that disgusted by then) and the new motor wouldn't start turning. I could get it going by giving it a push, but it wouldn't start on it's own. The start capacitor was wired differently. These motors all have similar wiring, so I should be able to wire it to match ... somehow.

The plug for the motor was one of those that one could remove the pins and rearrange them, but I couldn't figure out how to do it. Yes, I tried the good old paper clip and small screwdriver trick, but the method evaded me. So, I'm sitting there, on the floor, scratching my head and considering just cutting the wires and using some heat shrink and solder to rearrange them when my girlfriend piped up, "This may be a stupid question, but couldn't you just take the rod out of the new motor and put it in the old one?"

Advice to all men, never, ever tell them that they asked a stupid question. The minute I heard it I said, "No, because it's actually part of the armature and it would destroy the armature to try and get the rod ..." I trailed off because I realized that she didn't have a clue that the shaft was integral to the armature, and she really meant to switch the armature. Crap, why didn't I think of that.

I took the motors both apart; switched the armatures; installed the old housing (with the fan holes modified); the old motor and its correct wiring and newly installed armature with longer ends and it worked like a charm. These motors are mass produced for various companies around the world. The windings in the stator are sometimes different to get two or more speeds, but you can choose to use only one speed if you want. The armatures are all the same and you can move them around as needed. In this case, I needed the longer shaft on the armature combined with the windings from the old stator to match the wiring in the microwave. Really glad she was over watching me flail around.

Never ever tell a woman that she had a stupid idea. Her simple suggestion was exactly the thing I needed to get this to work.

I'm on the watch out for a truly suitable replacement, but don't have the pressure of a dead microwave hanging over me. I may contact the manufacturer for help in sourcing parts to see if I can get any help there. They may even have metal squirrel cages for these, and that would eliminate the problem forever. Failing that, I may go to an appliance store and prowl through their supplies to see what I can turn up. Or a junk yard.

And, what did I learn from this experience?

Mostly, I learned to listen.

Thursday, June 14, 2018

Local Power Politics: APS, AZCC and Things to Think About.

In my last political (well sorta) post I described how the local power company APS is organized and regulated by our Arizona Corporate Commission (AZCC) <link>. After that post and a few I did on local social media, I got a couple of requests to put this stuff all in one place. Well, I have a place to put it, and I'm getting tired of posting it over and over again, so here is my collection of gripes about our own AZCC and the power company APS. I decided to post this stuff on the blog because it related very directly with my efforts to keep the power bill as low as possible and the pitfalls, stumbling blocks and walls along the way.

I'm linking them all together on the (newly added) subject of 'Power Company' over on the top right of this page. Just scroll down to the 'P' and click on it.

The idea is that I can just put up a blog post, and then use a link to expand on my findings or thoughts easily without having to type them in all over again. Clever right? It also means that I can hit and run on social media. That means I can just slap a link on there and go off to the next place and do the same. There's a lot of social media sites that discuss this kind of thing out there.

No, I'm not a social activist, I'm a customer that is tired of getting raked over by politicians and corporations that are supposed to exist in our best interest.

Therefore, here are three 'Dockets' and one 'Announcement' that are recent and directly impact me and my neighbors in this area. They're real and verifiable. I try to put in links for the various items so people can double check me. Some of the text is my opinion, feel free to comment.

AZCC Docket # E-01345A-18-0111 - In the matter of the application of Arizona Public Service Company for approval of its Rate Rider RCP.

Last month (May, 2018) APS applied to the AZCC for a modification of the "rcp export rider for new on-site solar." This is currently being heard by the commission with no decision yet.

But, what the heck is this?

They invent names and acronyms to make it easier to describe things, but it also complicates reading this stuff to the point where people just give up and wander away. Resource Comparison Proxy (RCP) is a complicated series of observations to gather data, then calculations to show how much APS should be paying solar customers, people with solar that produce an excess of power and return it to APS.

What this is, is if your solar was installed after the cut off date, September 1, 2017, they want to change what they are allowing (as credits) for your excess power. Currently it's shown as $0.12900/kWh, almost 13 cents for each kWh you don't use and give to APS, and they want to lower it to $0.116 a little over a cent less.

They actually claim that it should be zero, but they're not going for that yet.
"... the avoided transmission and distribution capacity cost credit to be applied to the RCP should actually be 0%."
They already charge much more to supply power than they pay for it from the excess solar people provide, and now they want to lower that payment (actually credit). This is a decrease of over 10% to them. Essentially they're asking for a 10% decrease in what they agreed to just last fall in the last rate increase decision.

Yes, it's all above board and public in AZCC Docket #E-01345A-18-0111 and it's supporting documentation, but how many have heard about it? Is the news going nuts on this? Have you received any mail about it?

But wait you say, just last year APS agreed not to file for another rate increase until much later. That's completely true, but they're not asking for a rate increase, they're asking for a modification to a rider on your bill. See how it's done? You pay more, but they didn't do it, it's a rider on your bill. When you call them about it, they tell you it was approved by the AZCC.

Why aren't the solar companies complaining about this? Actually, the solar association has filed a response, they're angry that APS is attempting an end run around other agreements. For whatever good it will do.

Those that have solar already are managing to skate past it right now, but APS will be back before the AZCC soon. Those that are getting new solar will be impacted severely by the new rules, so this is a concern that everyone should be interested in.

E-01345A-18-0003 - In the matter of the application by Arizona Public Service Company to Implement Tax Expense Adjustor Mechanism.

This docket is actually in our (the customer) favor. When President Trump's tax changes came into effect, it lowered APS's tax rate to 21%, and they saved money. Someone realized, then insisted that APS revise their bill to reflect the savings instead of keeping it as a windfall. This was done under dockets #E-01345A-16-0036 and E-01345A-16-0123. The amount is a tiny percentage per kilowatt hour, but amounted to about $10 on my last bill.

The adjustment rate is supposed to be $.004258 per kWh, so the more you use, the more you get deducted from your bill. I question why they are paying it back by the kWh, it was a percentage decrease in taxes, why wasn't it a percentage decrease in our bill? When I looked closely at the docket, it was clear that they decided to play tax games with the requirement and deducted for various other things. They got to keep a heck of a lot of this windfall against their own expenses. One could also make a pretty clear case for discrimination; they get windfall money, then when caught, return it to their biggest customers by returning it based on how big their bill was. Our own APS sticking its hands in our pocket again. (actually, I may use that line in a complaint to the AZCC)

However, this also helps disguise the credit for money APS is saving in taxes as something APS is doing for us. It's not them giving us something, it's them not stealing something else from us. They even called it "TEAM" for Tax Expense Adjustor Mechanism, and shows up on the bill as "Tax Expense Adjustor."

"On April 27, 2018, APS filed a request for a Four Corners SCR Adjustment to allow recovery of an annual revenue requirement of $67.5 million. APS estimates that the average residential monthly bill impact would be an increase of approximately two percent. A copy of the request is available from APS, and at the Arizona Corporation Commission's eDocket website (, for public inspection in the above-referenced docket numbers"
The item above and the quote was one of those inclusions in the bill that we all toss out while looking to see how much they gouged us this month. What it's referring to is the pollution lowering devices called "Selective Catalytic Reduction" that they are installing at the Four Corners Power Plant. That particular power plant is coal fired and was cited for pollution. It's a long story beyond this author's willingness to write about right now. 

But, quoting directly from the AZCC filing:
 "(SCR Adjustment) to permit recovery of a $67.5 million annual revenue requirement."
You certainly see what is going on, the clue should have been "recovery." They want to pass the 67 million dollar per year cost of this stuff to their customers. Another quote from the same document:

"That would equate to an approximate 2% customer base rate bill impact. Additionally, APS requests that the SCR Adjustment become effective as soon as possible, but no later than January 1, 2019"
Yes, you read it right, they want to add another 'fee' to the bill to cover this and this one is a straight 2% increase in the base rate. Ever wonder why the base rate applies to all customers. This should give you a hint. You can read it yourself at <link>. It's also on the public record at the AZCC site under the unassuming name: "Motion/Request - Miscellaneous," but I suppose that's a little less noticeable than, "Motion to Screw Our Customers into Paying for Our Mistakes." The link to the document there is <link>.

AZCC Docket # E-01345A-18-0002 - In the matter of the formal complaint against Arizona Public Service Company filed by Stacey Champion and other Arizona Public Service Company customers

This docket is a direct complaint from a group of citizens against APS's latest rate increase (and fees of course). The dockets that the rate increase was approved were E-01345A-16-0036 AND E-01345A-16-0123. These two dockets were combined because they related to the same things. Eventually, they excluded existing solar, customers for the most part (more on that below), but most of us don't have solar, so the latest rate increase (and fees) from APS is directly impacting us; this also has significant impact on any new solar installations.

Stacey Champion, the named complainant, and a group of several hundred people gathered from a web campaign filed this, but as everyone suspects, APS is dealing in an underhanded fashion with the public and the AZCC. Want some facts to look up for verification? APS used the upcoming 2018 election as leverage against the Corporation Commission in writing and they did it on the public record. The following is a quote I copied and pasted:
"Unfortunately, APS is concerned that delay will only push this matter closer to the November 2018 election, which risks distorting this process and increasing customer confusion."
Which means: There's an election coming up and you guys may not get our funding if you don't end this now in our favor. Or maybe, if the complaint isn't decided soon, the voters may notice and vote against you. At any rate, it's pretty clearly a threatening statement. You want to see where they said this, go look at it on the state web site at this <link>. I think it's on page three.  Fortunately, Stacey Champion's lawyer noticed what they were doing and put this in the response:
"As for the November 2018 election, it is irrelevant to this proceeding and APS' professed concern that it "risks distorting this process and increasing customer confusion" should not trump Ms. Champion's right to due process."

Basically, Stacey's lawyer said, "We see what you're doing, and it's bullshit." If you want to read this it's at this <link>.This one is on page 4.

I also ran across the following part of a sentence when reading through an APS response to Stacey's complaint. I cut and pasted this right out of the document on the AZCC web site at <link>.
"(iii) an agreement with the solar industry to resolve a multi-year, otherwise intractable dispute regarding distributed generation that included a confidential agreement to avoid undermining the rate settlement through ballot initiatives, legislation, or advocacy at the ACC, "

What this means is that the solar industry in this state got together with APS and agreed that the solar folk wouldn't put up a ballot initiative, sponsor legislation or lobby the Corporate Commission. Since it is confidential, we don't get to see what the Solar companies got in return for GIVING APS FREE REIGN ON THIS RATE INCREASE.

Excuse my language, WHAT THE HECK??

We were all sold down the road by a secret agreement between APS and the Solar Industry ...

Yeah, this really makes me want to talk to a solar company in this state.

Now, if you do actually read this far, think about it a bit. Here is publicly held documentation that APS is using the upcoming election as a tool against the Corporation Commission and they entered into a secret agreement with the solar industry to shut them up. Now act accordingly. I suggest you visit Stacey Champion's site, read the documentation and contribute to the effort. Stacey is taking on APS for us, and they're driving her down with legal fees. If she has to withdraw because she can't afford it, that's the end of the effort to get this back for a rehearing.

You can also file a complaint directly with the AZCC in support of Stacey's docket. Heres how to complain:

 What you have to do is go to

And file a complaint.

You MUST state that you're commenting on the existing docket number E-01345A-18-0002 in the first line so they can see what you're doing. I started mine off with:

"In support of Docket Number: E-01345A-18-0002 It appears that APS did not deal in good faith with its ratepayers, the Corporation Commission or the public in general. "

The "In support" part means you agree with Stacey Campbell that APS is a bunch of thieves, and it also shows up in a listing of the documents filed on this docket. You also have to fill out all the blanks in the form to identify yourself as a customer of APS so you will be taken seriously. At the bottom of the form is a space to type in exactly what you think about this.

We have elected representatives in the state legislature, time to actually use them and see what happens, so here are the two for District 1. I'm listing their web pages so you can get to the mail facility easily.

David Stringer is at:

and Noel Campbell is at:

State Senator Karen Fann is at:

Just click on their email address and let them know what you think about this.

Sorry this is so long, but I wanted to get the actual links in so you can see for yourself what I have seen.

I really hope I made you angry.

Oh, one other thing: the spam will really be flying on this post, so be warned: talking about how great your solar plan is, sales blurbs or obnoxious comments will be deleted without remorse.

Wednesday, June 13, 2018

Supercooling in the Desert: May 22, 2018 a day that will live in infamy !

This is the day I got clobbered by APS (my power company)

Look just before 8PM (20:00); see that bunch of spikes? My peak billing period lasts until 8, and something was sucking power before the period ended ! Let me expand the little piece that shows the problem:

That little period from about 7:24 to 8:00PM was the clothes dryer.

Yes, just a little before the end of my peak period a guest started the dryer to do some clothes. It wasn't their fault, they didn't know that the fascist power company would be watching to see if such a thing happened.

The peaks run as high as 7.4 kW, and it was doing this for a little over a half hour. The APS chart shows it like this:

And it was almost impossible to find. I looked for quite a while before I noticed it. I put the arrow on there to show you the tiny little green area that resulted. It shows up a little better on a single day chart:

That minor little slope up in the green area is where the meter saw the dryer running. It's recorded as "usage 3.18" during the 7-8PM hour. In theory, this should be my high 'demand' number that is calculated into my bill for the month.

I guess I should do a little calculating to see how this works to help me understand and avoid it even more stringently in the future. Let's look at the detail portion of my bill first:

So, the demand number wound up being 3.17 and is used as a multiplier in several items in billing. Here's the rate sheet for the plan I'm on:

So, my 'On-Peak Demand Charge' is 17.438 * 3.17 for $55.28. But, there's nothing on my bill that says that. Guess what? To make it more complicated and harder to understand, they actually split the $17 charge into two components and calculate them separately. From their tarif sheet again:

Notice how the two numbers, $4.000 and $13.438 add up to the $17.438 they call the 'On-Peak Demand Charge'. OK, fine, I have a calculator and can punch in numbers like anyone else. 4.000 * 3.17 = 12.68 and 13.438 * 3.17 = 42.60, and they add up to the 55.28 I got above. So I should see:

Delivery On-Peak Charge 12.68
Generation On-Peak Charge 42.60

Or something similar on the bill, and indeed I do. Sort of:

Demand charge on-peak - delivery $12.40
Demand charge on-peak - generation $41.66

If you look at the bill, you'll see them on there. The sum of the two charges is $54.06 which is darn close to my initial $55.28. The reason for the difference is that APS made a mistake in the original rate change request and has to use the demand number to one significant digit and they can't round, so the actual demand number they get to use in this case is 3.1kW. That's on the bill also, so I don't even have to do the truncation itself:

Your billed on-peak demand in kW 3.1

That's a good thing because rounding would have put me up to 3.2 and would be paying even more.

Now, I got the cost all figured out, the dryer running cost me some amount, but how much extra based on past performance. To get that, I'm going to look at last month to see; taken from last month's bill:

Your billed on-peak demand in kW 1.5
Demand charge on-peak - delivery $6.00
Demand charge on-peak - generation $20.16

That stuff totals up to $26.16, so my dryer cost me $27.90 last month because I didn't keep it under control. It's actually a little bit higher because the rate per kW during peak is higher ($0.08683 vs $0.05230), but that's only 3 cents per kw, and the dryer only uses 7.5 kW at around a 50% duty cycle for 3.75 kW or $0.32 extra. I'm willing to ignore that.

Now is the appropriate time to talk about how APS gets that demand number. As I mentioned in another post, they average each hour and compare it to the maximum hour during the billing cycle. That gives me 5 vulnerable periods each day: 3-4, 4-5, 5-6, 6-7, 7-8. So, the dryer kicked on and sucked power in bursts like all electrical heating appliances and those bursts pulled 7.5 kW for a short period. The bursts were roughly half the time, so it worked out, on average, to the 3.17 kW number that APS measured. It would be too much to read if I did all the calculations, but you see what I mean. That 3.17 was the highest reading so far that month, so it kept it and continued to look for a higher hour; fortunately, it didn't find one, and that's how the month's bill came to be. Next post I'm going into how to read our smart meter so folk can actually see what is coming. Unless one goes to the trouble of doing what I've done, you can't catch it real time and stop it; you can only see the what's already happened.

This is not going to break me, but it does lose me some bragging rights. Because I didn't keep control, I'm out about 28 bucks. Be warned though, if the hot water heater had kicked on, and the stove was running, this would have been a monetary disaster. Thank goodness it was only the clothes dryer and that close to the end of peak !

There you are, an example of how power can get out of control no matter what you do and how much attention you pay to it. Something will slip in and get you from time to time. Overall though, keeping tabs on my power has saved me thousands over the years. This post is also good for folk that don't completely understand how that 'Demand Billing' stuff actually works, and how to tell if you're messing up.

The parts to prevent this from happening to me again are already on order.

Previous post in this series is <link> then next is <nothing yet>