Notes on the APC Back-UPS 700VA

31.01.2021 10:59

I recently had to replace an old Belkin UPS that had developed some weird problems. After some searching around for a suitable replacement I bought an APC Back-UPS 700VA (model BX700UI) from a local web shop. Even though it's not listed under the Network UPS Tools hardware compatibility list, getting it to run under Debian was relatively simple. Still, here are some random notes about it in case anyone else finds them useful.

Image by Schneider Electric

As this blog post reports, the UPS is fully supported by the usbhid-ups driver in NUT. I'm currently using version 2.7.4 as packaged in Debian Stretch. Apart from setting the driver in /etc/nut/ups.conf as described there is no other special NUT configuration necessary.

I also had to add an udev rule to change the owner and permissions of the USB device so that NUT could access the UPS. The correct rule can be found in this answer. Note that the "could not detach kernel driver from interface" part of the error message you get if this rule is missing is somewhat misleading.

I've been testing this UPS for around a week on a test setup and I didn't find any problems with the basic functionality. Switch over to battery works fine. The system shuts down cleanly when the UPS reports battery low and correctly turns off the UPS output afterwards. It also comes back on when the power returns.

My old Belkin UPS seemed to impose a hard 30 minute battery run time limit. It would not run the load for more than 30 minutes and would report that the battery is empty regardless of its state. This UPS doesn't have that limitation and will happily run on battery for hours if the load is low enough.

I did increase the battery.charge.low and battery.runtime.low to 20% and 5 minutes respectively. These settings determine when the system will consider the battery depleted and shut itself down. While I didn't find any problems with the defaults (10% and 2 minutes), they seemed to leave very little reserve. This reserve battery charge comes handy if the line power comes back for a minute and goes away again. In this case the UPS must have enough run time left to boot the system back up and shut it down again. Since the battery is large enough for my use case I thought increasing this safety margin made sense.

Note that setting the variables using upsrw requires that a upsd user is both defined in /etc/nut/upsd.users with the permission for the SET action and also has a permission to connect to upsd in /etc/hosts.allow. I overlooked that latter part and spent some time banging my head over the ERR ACCESS-DENIED error.

I'm not sure how persistent the settings done with upsrw are. They are supposed to write the values to the non-volatile memory in the UPS so they should only need setting once. They should survive across reboots and power losses, but so far I'm not totally convinced they will not revert back at some random time in the future.

As far as diagnostic information goes, this UPS isn't very generous. It doesn't measure line frequency, temperature or output voltage. It does measure input voltage and it returns reasonable values for it when the line power is present, but I noticed that it reports 256 V when the input voltage is in fact 0 V.

I had a quick look at the raw USB HID traffic from the UPS and I didn't find anything particularly interesting. At least it doesn't look like the relative lack of diagnostics is due to missing support in NUT.

The battery takes approximately 3 hours to fully recharge. I noticed some very faint crackling noise from it when it's charging. To me it hears like small bubbles popping when I press my ear against the case. This noise is distinct from the mains hum and doesn't hear like a DC-DC converter running. I don't have much experience with lead-acid batteries, so this is probably normal behavior. I just never noticed it before. Apparently even sealed gel batteries form some hydrogen gas that is then recombined inside with a catalyst.

Posted by | Categories: Life | Comments »

Making replacement Chieftec drive rails

22.01.2021 19:32

I use an old Chieftec tower case for my home desktop computer. Instead of the usual screws the case uses purple plastic retainers for mounting 3.5" disk drives. These parts were quite fragile and even though the case came with plenty of spares I broke all of them over the years. I failed to find an off-the-shelf replacement so I went and designed a 3D printable part to replace them. I'm currently waiting to get the prototype printed.

I don't know the model name of the case or whether Chieftec had a specific name for this method of mounting drives. The only identifiable mark on the case is the name "Chieftec" embossed in the front panel. I wrote about it in this blog post so it must be at least 16 years old at this point. After quite a lot of web searching, this 2004 review of the BX-03BL-BL-BL model was the only other reference to this rail design I could find. It has a photo of the rails that look identical to the ones I have although the design of the rest of the case looks different.

I think these plastic rails were badly designed from the start. I remember even when the case was new it was very hard to insert or remove a drive. The rails are formed in the shape of a slight arc. When inserting a drive into the slot they straighten out which grips the drive in place. However the rails are fixed to the drive at two points so they can't flex freely. The other problem is that the triangular catch that latches into the metal case has no spring. You need to bend a relatively short and thick length of plastic to unlatch.

The plastic didn't age well. It got quite brittle and also changed color from a bright pastel purple to this purplish-gray. Very soon changing a hard drive in the case meant breaking one or both of the rails that held it in place. These days it begins to crack if I put even a slight pressure on it. An unfortunate flaw since otherwise I like this case and it has served me well for all those years.

The rails have a complex shape that isn't printable on a common FDM printer in one piece. To get a single, flat face that starts on the printer's build plate I removed the outward arc in the base shape. It was problematic anyway. Since holes for the sunken screw heads require an overhang in this orientation, I left a thin sacrificial layer that separates the two hole diameters. This needs to be drilled through before the screws can be inserted. I plan to use normal screws instead of the knurled pins the original rails used.

I moved the catch to a separate part that must be glued to the base part. It's mounted on a thin leaf spring that should provide the flexibility I was missing in the original. This part can be printed with layers following the spring shape which should make it more resistant to bending. I also extended the tabs on the sides to make them stronger. After the handle these were the second most common thing to break when unlatching the rail.

This was the first more complicated mechanical part I designed using the FreeCAD's Sketcher Workbench. I like the visual way of defining lengths and constraint on shapes mapped to object's faces. It's much clearer than the approach I took with my previous 3D printing projects - using cubes and other basic primitives from the Part Workbench, placing them using Python expressions and using unions and subtractions to get the final shape.

The problem I encountered however was that Sketcher isn't very convenient for experimenting. Because of the topological naming problem you can't easily go back and change things on a model. So far I've already ended up redrawing this shape 3 times from bottom up. Changing something in the sketch for the base shape tends to invalidate all other sketches for pockets and pads that are built on top of it. I don't know how to fix the missing edge and face references without starting all over again.

I'm now waiting to get these new rails 3D printed and I'm yet to see how they turn out in practice. This is the third iteration and I think I got all the measurements right. I'm mostly concerned if the new rails will fit snugly enough into the case to prevent the drive rattling and at the same time not be too hard to insert and remove. If they are too loose I may just add some rubber padding like the 2004 review I linked above suggests.

I've made the current version of my 3D printable design available for download here. I'll write another post when I have the chance to test these out and if I make any more iterations to the design.

Posted by | Categories: Life | Comments »

On fake 50 ohm coaxial cables

03.01.2021 11:50

I guess by now everyone is already aware that cheap no-name items often aren't what they claim to be. I've recently found out that BNC coaxial cables sold as having a 50 Ω characteristic impedance often are in fact 75 Ω. Since this is something that is not trivial for the customer to measure and a 75 Ω cable will sort of work even in a 50 Ω system I guess it's easy for sellers to get away with this kind of scam.

This article goes into the details of how to measure characteristic impedance of a transmission line. I used the Smith chart method. I connected each cable to the (50 Ω) NanoVNA CH0 on one end and a Zref = 50 Ω calibration load on the other end. I then measured S11 over the frequency range from 10 to 200 MHz. NanoVNA was calibrated using the calibration kit that came with it.

I found the point where the S11 plot on the Smith chart crosses the real axis. This is when the cable acts as a quarter-wave transformer. The point on the chart marks the impedance Zt. It is marked in orange on the plots below. Characteristic impedance Z0 of the cable can then be calculated using the following formula:

Z_0 = \sqrt{Z_t Z_{ref}}

The Seafront 100 cm BNC cable sold as "50 Ω Oscilloscope Test Probe Cable Lead" measured 71.1 Ω using this method. The second cable I got in the pair had a bad ground connection and couldn't be measured at all. The reviews on the Amazon product page mention bad mechanical construction of the connectors. The cable has a readable SYV 75--3--2 marking that already raises suspicions that this is indeed a 75 Ω cable.

The Goobay 50 cm BNC cable sold as 50 Ω RG-58 measured 79.6 Ω. This cable in fact has RG58 50 OHM COAXIAL CABLE printed on it. It was either marked incorrectly from the factory or was relabeled later. There is a review on the Amazon product page from R. Reuter that also reports that the cable they received was 75 Ω based on a NanoVNA measurement.

The 60 cm LMR-200 SMA cable that I got with the NanoVNA measures 50.4 Ω. I'm showing it here for comparison with the two results above. The cable construction is not that great - one of the two such cables I got in the kit wasn't crimped properly and the connector fell off the cable after a few uses. However the cable actually has the correct characteristic impedance within a reasonable tolerance.

I'm curious why this is happening. I'm guessing because 75 Ω cables are cheaper for some reason. Maybe there is a bigger demand for 75 Ω cables for video applications and 50 Ω used in RF systems is more of a niche application? Also the cables I measured didn't have good matching even for use in 75 Ω systems. Maybe they're in fact quality control rejects from a failed factory run? Anyway, it's good to be aware of this practice and double check if using a cable in an application that is sensitive to this sort of thing.

Posted by | Categories: Analog | Comments »

Jahresrückblick

01.01.2021 21:47

What can I say about the last year that hasn't already been said a hundred times over? It's been a year of restrictions, lockdowns and changing habits. I'm immensely thankful that everyone close to me has managed to avoid the pandemic so far. It has not been easy for anyone. The quickly changing information on the virus was a constant source of doubts in what was a good balance between keeping safe and retaining some resemblance of normal life.

I don't feel I have much right to complain though. Compared to other personal stories I've heard I'm lucky. I don't have many responsibilities that would require a lot of personal contacts. I work for a company that has recognized the seriousness of the situation very early on and switched largely to remote work where possible.

It's been a year of sitting alone at my home desk. I've never been a particularly social person and I usually enjoy working alone, but the isolation this year sometimes felt painfully strong. I feel like the social distancing didn't just apply to physical contacts and we've all grown further apart even with all the video, voice and text communication within hand's reach. It was easy to get unreasonably angry over people holding different opinions on what risks they were prepared to take with their own health and the health of others.

Reduced work and the general chaos interrupting other plans meant that I worked a lot on personal projects. I've expanded the instrumentation in my home electronics lab: I've finished my home-brew curve tracer for non-linear device measurements. I didn't write much about that on the blog. I still have some unpublished notes on an interesting detail of bipolar junction transistors, which was the original motivation for making the instrument in the first place. Maybe I'll find the time to write it up next year.

On the other hand I did write a series of posts on RF vector measurements. I'm very happy with how my SDR-based system turned into a small, versatile instrument. With a NanoVNA available at perhaps a tenth of what I spent in total it might not look like the project made much economic sense. However I found that my instrument complements it nicely, with better characteristics in some places, worse in others and much more flexibility. It seems to fit nicely between the extremely low cost NanoVNA and the astronomical price of a professional instrument. Not to mention that I learned a lot while making it and refreshed my knowledge from the under-grad microwave engineering course I took long ago.

I've again drawn a lot, more than any other year despite the arts classes being interrupted. It was my almost daily activity in the evenings after I got fed up with electronics. In May, my comic Social distancing won the second place in its category in the Life in the time of coronavirus competition organized by the National Museum of Contemporary History. With the bird flu epidemic hitting local bird populations later in the year, my two quarreling crows might have been an even better allegory for the times than I originally intended.

In general I wanted to give some more meaning to the illustrations and characters I've drawn this year. This led me to write a few short stories. Looking back, these were probably more things I needed to do for myself to deal with various frustrations and anxieties. I've only published one so far here on this blog and even that was quite an internal struggle to do. I don't know about the others. I still like the pictures that go with them, but the text would need significant editing before I would be comfortable with putting them out in public.

The web was full of people cheering for 2021 to come as quickly as possible, as if viruses and other such things pay any attention to the numbers on the calendar. I have some ideas what I want to do next year: I want to keep drawing and, considering I'll be using my home desk as the company hardware lab for some time yet, I have some further ideas on new instruments I want to make. However I can't shake the feeling that the freedom to pursue my personal projects in relative idleness during lockdowns was on borrowed time and that I'll have that much less time for such things in the future. We'll see. If we all remain healthy it will be a good year.

Posted by | Categories: Life | Comments »