Saturday, October 17, 2020

Simple PyGame program to read probe v8 data

After chatting with my friend John Marzulli, the author of the awesome StratuxHud, I became interested in PyGame and decided to see what it would be like to create a simple program to read data from the new Airball probe using it.

The good thing about the ESP32-based probe is that it is a self-contained air data computer, so if I just telnet to the probe, I get meaningful data (angles of attack and yaw, etc.) rather than a bunch of raw pressures that need to be reduced using magic.

So it's now easy to show "real" data using a program as dead-simple as pyball.

This is the program running, ironically on a Raspberry Pi display unit that is one of the first "displays" I ever made, many years ago! A marriage of the old and the new! :)


Wednesday, October 14, 2020

More about Airball probe v8 charging

Fancy aerospace R&D requires fancy instrumentation. No expenses spared. So you will be delighted to know that the Airball project has acquired a top-of-the-line Eversame USB Digital Power Meter (Amazon's Choice) instrument. Nothing but the best.

With the help of this device, and accounting for milliamps here and there, it seems that our charging circuit is "losing" maybe 20 mA somewhere, but otherwise, the current that gets soaked up by the running system plus the current dumped in to charge the battery more or less equals the 470 mA that we are drawing from USB, which makes sense given that we are a "USB500" device that promises only to draw 500 mA. So all is good on that front.

The next step is -- when I know that I am charging, I can put the ESP32 into a sleep mode to minimize the amount of current I'm drawing for stuff like Wi-Fi transmission. This should hopefully let me charge at a somewhat faster rate. It is probably possible to keep my TCP connections going and transmit battery status only, once a second or something, while in charge mode, but that's fancy. For now, I know I can accomplish what I want to accomplish.

But. There is always a "but", isn't there?

Remember how the circuit has this nice blue LED blinkenlight that blinkens when it's charging? In case you forgot, it's this one:


Ya well, so when the power switch is OFF, the TI BQ24075 chip does NOT charge the battery (weird, but mmkay, whatevs), however it also keeps the "charging" LED ON!

In other words, you plug your probe into USB with the power switch OFF; it tells you it is charging; you go to sleep and come back the next morning; and it has lied to you! It has not been charging the battery.

This is bad. Wrong feedback is strictly worse than no feedback. :P

So a very kind EE friend looked over the data sheet and my design, and confirmed that yes, the data sheet is SUPER misleading. According to their design, this behavior is "allowed". They even give you a sample design with a little "charging" LED just the way I've done it, and it's useless.

So basically I'm going to blow away the "charging" LED and instead use the signaling LED that I have access to from software. I will detect whether or not I'm charging, and based on that, blink the LED appropriately. And also do the sleep thing to save current.

Sunday, October 11, 2020

Airball probe v8 battery charging

To match the battery drain test, I timed a battery charge cycle starting from the completely discharged state. Here is what we have:

You can see that my charger is charging at 270 mA, no more no less. It takes about 12 hours to get to a full charge. Can we do better? Let's think this through --

  1. I am configuring the charger chip (a TI BQ24075) to draw at most 500 mA from the USB input. This is so that I am safely a "USB 500" device and am compatible with most computer USB ports and charger bricks.
  2. I am also configuring the chip to charge the battery at whatever current it can get away with, basically, given whatever the input provides.
  3. I am using a "power" switch connected to the SYSOFF signal on the BQ24075 to control whether the entire system is on or off. When SYSOFF indicates the system should be "off", but the USB input is connected, the BQ24075 powers up the whole system anyway. This means that, any time it is charging, regardless of the value of SYSOFF, the circuitry is operating and drawing the usual 180 mA.
  4. For 500 mA of input, we expect the maximum battery current to be (500 - 180) = 320 mA.
  5. We are getting 270 mA, which is (270 / 320) = 84% of the theoretical maximum.

Based on all this, it seems like the circuit is operating the way I asked it to, and indeed, because of the enormous size of my battery (3700 mAh), and the degree to which I am being "conservative" about the charging, I should not be surprised that it's taking 12 hours to charge.

So how would we "improve" this, today or in the future?

The reason I am "conservative" with the charging is that, as a hobby device, this thing will be connected to people's computers. If it draws too much power, the computer (or cheapy USB hub or whatever) will bump it off USB. This kills the ability to program the thing from the same USB port I'm using for charging, and also makes it hard for people to charge the thing simply by plugging it into their PC because they don't happen to have a power brick laying around at any given moment.

I could create two USB ports -- one for programming and one for charging. The programming port would draw zero current, and the charging port would not do any comms. But then I'd have to explain all this, and mess around.

Another way to think about it is this. I run at -180 mA and charge at +270 mA. Since (180 / 270) = 0.67, what this means is, for 1 hour of operation, you need 40 minutes of charging. Is that great? Is it a "fast charge" monster? Is it a consumer device for the ages? No. But ... does it work? Yes.

My inclination is to leave it as-is and call it a measured success.

Saturday, October 10, 2020

Airball probe v8 battery life

I conducted a battery drain-down test from full charge:


Luckily, the onboard battery charger and power monitor gives me info that I send every 2 seconds over WiFi, so I could just telnet to the probe, grab all data sentences starting with a $B, and plot the results. I went from a full charge (the charger "charging" light went off) to shutdown.

The battery that's installed at the moment is a 3700 mAh 18650-size Li-ion.

It looks like we will have a 1/2-day battery life very very easily, probably without having to spec the super large 37000 mAh batteries. This means you can set it on your airplane, go fly around, and pretty much not worry about having to turn it off while you eat lunch. So this part of the design goal is easily satisfied.

For reference, the steady state current draw seems to be around 180 milliamps.



Wednesday, October 7, 2020

Airball probe v8 mechanical build

This evening, I put together what is very close to an Airball probe v8 kit. The first picture is basically what you'd get in the box, and the steps shown are what you'd do to put it together. The results look like this:



To see the build process, check out this album: