100 workouts

Today marked 100 consecutive days where I had a cycling workout in for each day — with at least one major workout each week.

In that time I lost around 20 pounds.

My overall fitness went way up.

I started down this path back in February. As the days ticked up I was increasingly reluctant to break the chain of days. First it was a month. Then 50 days. Now 100.

As neat as it is that I’ve developed this habit, I’ve also not been giving my body any breaks. That’s not ideal. I know that — but honestly I didn’t much care. I must get back in shape; where I got to was completely unacceptable, and I’m never going to go back.

Playing with GoPro Time-Lapse Modes

Starting off with the video:

So, this was four different takes:

  1. 0.5 seconds between frames with a still photo taken each second (one file per frame!)
  2. 0.5 seconds between frames in time-lapse video mode (one video file)
  3. 1.0 seconds between frames
  4. 2.0 seconds between frames

Each of these were originally taken in 4K mode so there’s a lot of data that got lost in the YouTube transition.

I’m basically going to ignore the first one since it adds a lot to my workflow to use it and I tried it by accident.

#2: 1m 33s / 700MB
#3: 1m 07s / 505MB
#4: 0m 26s / 196MB

From looking at the result I can safely rule out anything that’s not 0.5s. The other shots were just way to jarring — especially the 2s one. I think I can also scale back to 2.7K instead of shooting at 4K. It’s good enough without really burning up storage for no really good reason.

Anyway, just some more experiments for the trip preparation.  :-)

Monaco 2015

Watching today’s race from Monaco met expectations for the first 80% of the race.

Yeah… it’s a race I would dearly love to go to for no other reason than it’s one of the most interesting places to race with the history that goes along with that location.

The problem is that the race itself is for the most part rather a snooze-fest since it’s almost impossible to make a pass since it’s such a tight and winding course.

Until around 20 laps to go there was an accident… then Mercedes pulled in Hamilton to pit costing him the lead — effectively gifting the race win to his teammate. It was painful to watch.

<sigh/>

Utazó – Final

I had a hunch today that my license plate would come in the mail today. I was right.

I did have to make the 1337 mod to add the proper accent to Utazó, which like I wrote before is Hungarian for “Traveler.”

I used a super-tough Sharpie. It’s really on there. Not even the solvent I used would really remove it.

:-D

Firmware

I was working on the firmware for the USB charger. I started off with the standard Arduino shell and started hacking away with little bits of code just to make things work.

I was able to see the commands go over the bus and things were going.

But it was growing in a way that would be bad in a couple of ways. It would be hard to maintain and on top of that it would be inefficient with the limited resources that I have on the micro controller.

Then I started going back in time — all the way to 1984 when I was coding on the Commodore 64 which was even less powerful. As I was coding it really felt like I was working on that old system. So decadent working in C++ instead of the MOS 6810’s assembler.

The little tricks that I was using like modifying the configs in place are so out of place in modern systems where you program as though you have infinite processor and memory.

All this is getting me thinking. Even with modern computers, though the resources seem infinite they still aren’t.

What I was coding for the microcontroller wouldn’t pass a modern code review. What would pass modern code reviews wouldn’t run properly on the microcontroller.

But why is that so? Some of it is maintainability and lessening the coupling between subsystems. But much seems to be inertia with how things should be done. But sometimes you have to ask why… what can you do that’s both fast, efficient, and maintainable?

Just because you don’t believe…

There’s something that just annoys me about both sides of the political aisle: disbelief.

From the right you have the Republicans thinking that is you just don’t believe in climate change enough then it won’t happen. If you keep beating the drum you might convince people of your views, but reality is something that doesn’t require believing in.

On the left you have a disbelief in things like macro economics. At once you have people asking for higher minimum wages and affordable (and nice!) housing, but no one seems to think about the larger picture. You can’t just legislate “affordable housing” because whatever rules and regulations you propose will generally backfire. Just because you truly  believe that you can legislate a better world doesn’t make it so.

A perfect example is in Seattle we have cries for “affordable housing.” So the city passes zoning to allow for small apartments (with corresponding smaller rent). Developers jump on this, then people complain that what’s affordable isn’t good enough for them.

<shrug/>

You need to look at the world with open eyes and not try to color it with your own expectations.

Logic Analyzer++

I purchased the Saleae Logic Pro 16 back last year Actually I pre-ordered it and it arrived in late summer of last year.

Now I’m really rather pleased with it.  :-D

There’s something cool about being able to look at not just a tiny sliver of time that you get with a standard oscilloscope, but have many seconds worth of capture.

Screen Shot 2015-05-20 at 10.07.41 PM-X3.png

That up there is 45 seconds with the digital recorded at 100MHz. I recorded the analog at 5k since it’s not super critical.

So I can look at that or zoom in a just a slice:

The amount of cool this is amazing. And it’s not too expensive either

If you want do download their viewer I’m pretty sure you can load up by trace to look at it. Obviously you can’t capture anything without their hardware.

Take a look here: 16-port(ish) Trace. You’ll need to get the software to look at it which you can get from Saleae.

Glitchy

Playing around with my setup I wanted to get a nice screenshot and log of the I2C chatter including the initialization sequence.

Here’s the thing. Every time I got things hooked up the system stopped.

Eh?

I eventually narrowed it down to connecting anything to the TX pin of the micro controller it seemed to lock up.

All I can think of is that the added capacitance of the lead can be causing problems?

Strange.

Even stranger is that it’s just intermittent.

Update!

So I tried again with a different Arduino. When I wrote the stuff above I was using a pretty well hardened Ruggeduino. I swapping in an off-brand OSepp board and suddenly things started working.

So the plot thickens.

What’s different between the TX output stage between the two… next time.

It lives!

The pile of parts is charging up an iPad!

Basically you have the power going to the charge switch (square chip second from the right) to the USB port with the embedded sense resistor. The charge controller (all the way on the right) is letting the iPad know it’s allowed to draw 2.1A. The sense resistor’s voltage is going to the sense amplifier (all the way on the left). That, in turn, is going to the analog to digital converter (ADC) on top.

The ADC’s output goes over I2C to the micro controller (an Arduino in this case) that’s monitoring the charging.

That gets sent over serial to — well — nothing at the moment. But the scope is there monitoring it none-the-less.

The ASCII is the output of the ADC in text.

With the 10mΩ sense resistor and the 100 V/V amplifier the result is 1V/A at the input of the ADC. This is convenient because the unscaled value of the ADC is in mA.

Above (take a minute or two after the multimeter shot) is reading 1551mA — or 1.551A… which is pretty darn close to the multimeter output!

All that’s left to do is hook up the IO expander (that was blinking the LED before) and have that control the power switch and read any faults.

Then… then I have to build a circuit board.  :-)  Then maybe launch a kickstarter or something.

Speaking of boards — I came to a realization today. I was planning on building a modular system before, but I think I was overthinking things. I was thinking of spinning multiple versions of the board depending on how many ports are needed. An easier way is to build a master board with an I2C mux (multiplexer) and have that just chain to sister boards. This way I can have one board and optionally populate the mux and associated circuits or not. Having one board definitely makes thing cheaper.

Learning — Trial and Iteration

I’ve been working on the USB charger project in force over the weekend and I’ve made some good progress. It’s not completely prototyped, but all the parts that I need (except one, but it’s almost a passive part) have been made to show signs of life.

But here’s the thing… sometimes you need to try something only to have it fail. Then debug it and make it better the next time around.

Take one of the simplest parts of the entire project: the current sense resistor.

All it is is 0.01Ω resistor placed in series with the power supply to the USB. That tiny resistor will drop a tiny amount of voltage that will be sensed (hence: current sense resistor) to determine how much current (ergo: power) is being drawn.

So, for the example of 5V (USB supply voltage) and 1A (iPhone charging) you’ll get a 0.01V across the resistor. It’s not a lot, but it’s enough that once it’s amplified it’s perfect for the D/A convertor.

The first one I built was pretty janky.

It had male connectors on the top which is annoying to use and it seemed to have too much wire.

I had an idea — just slap on another pin and viola:

(And also make it double-wide)

It looks neater and it makes breadboarding easier.

Except it gives the wrong result.

At the current-sense it was showing 0.015V.

?

That’s when I realized that this was with a 1A load.

The addition of the connection back to the breadboard was adding another 0.005Ω in series with the already in-series resistor causing an addition voltage drop.

So I made up another another one… this was a combo of both the first and second ones…

That fixed things right up.

Basically I wired it up with a Kelvin connection and it was all good.

Since there’s almost no current going into the sense amp there’s virtually no voltage drop in the sense direction.

I guess it’s something that I had to spend a few bucks on for the parts to learn that lesson C’est la vie.

And don’t get me started on the resistor I blew.  :-/

%d bloggers like this: