Slow-Carb Diet Update–Day 7

January 16th, 2011


I think I’m going to start posting some details about the progress of my diet through the course of it as this sort of info might be helpful to others.   I had my 1st “bing” day yesterday, which is sanctioned by the diet.  I decided to try to go full bore and see how it effected me.  My breakfast consisted of:

  • waffles
  • fried chicken
  • 2x sausage & egg sandwiches
  • grits (didn’t like it, didn’t eat much) – how are these supposed to be eaten?
  • 2x 16oz glasses of sweet tea


As good as it tasted, it made me feel horrible for the rest of the day.  I had a headache and my body hurt.  It’s amazing how bad sugar is for you.  The evening was filled with more goodness including crab cakes, bolgogi beef, chicken meatballs, pan-fried mac and cheese balls, shrimp with bacon, sausage burgers, beer, wine, bourbon.   The results:




Now, if the diet works, by Tuesday I should return to my post-binge weight.  Sarah and I went to Safeway (how I hate that place) and I bought more veggies than I ever had before in my life.  Trying to follow the paradigm of “use bag of frozen veggies” just didn’t cut it and I need to get some variety.  So for lunch I had two “slow-carb” burritos that consisted of a large piece of lettuce, layer of refried beans, garlic pulled pork from last week, sautéed green beans/onions/garlic/spring onions, peppercinis, avocado, and habanero salsa (finally found a safeway salsa that I liked).  And it was really good – I didn’t miss the bread at all.  


I’m really enjoying the cooking that I’m doing for this diet, as I’m usually too lazy to cook.  I’ve found it’s been a lot better on the wallet but a huge pain in the ass to clean up.  The dishwasher runs like 2x/day now. 


And tonight – safeway had a great sale on Dungenous crab  — so I’m going to try to make a crab salad with homemade mayo (all the stuff in the store had some sugar added).   I’ll probably add some bacon to it as well. 

diet, Personal , ,

My attempt at implementing Tim Ferriss’ Slow-Carb Diet

January 14th, 2011

I’ve been working too hard at graduating and a number of other projects where I found I wasn’t going to the gym nearly as much as I used to.  As a result, I started feeling unhealthy, but I also didn’t believe in dieting.  That was till I saw a blog entry on about Tim’s book, the 4-hour body.  It’s not a diet book, but rather a somewhat scientific look at how to hack many aspects of your body – and I bought his pitch.  It made sense to me, and it seemed like an approach that I could follow. 

The chapter that talks about the diet is essentially converted from this blog entry.  I’m not going to bore you with the details, but I’m trying to be a bit methodical about the progress and want to document it.  Essentially, it’s 4 meals a day of lots of beans (I never want to eat beans again after this).  He also stresses keeping the meals simple (read: boring) and the same.  He argues it’s simpler that way.  Unfortunately,  following that advice will get me disinterested quickly from the diet.  I need variety.  I just finished cooking the garlic pork dish from this cookbook I found online.   

Anyhow, I’m doing pretty well though I accidentally violated one of the rules and had some fruit juice.  And I’m drinking some whiskey instead of wine right now (thanks diQ for leaving that bottle behind).  But so far I’m on track to hit my goal of 20lbs in 30 days.  I’m also following a regiment of a ton of supplements that he suggests – 13 pills a day no less at a cost of $75/month for the supply.  Normally I’m not into that kind of stuff, but there’s something cool about the thought of hacking my body, so I’ll give I a shot.  Here’s the data, though I started right after finishing 3 days of my unintentional food-poisoning diet which I dropped 5lbs over 3 days.  I’m actually less now than I’ve been in years.  I’m going to start weight training again after I hit 170, but my body puts on muscle fast and I don’t want to see my weight increase (it’s a motivational thing).




Personal , , ,

printf in arudino works.

December 21st, 2010

I’ve always had to deal with the fact that printf() is missing from the arduino environment.  I would have to come up with these huge blocks of code consisting of multiple Serial.print() commands to put together a simple message.  Well, no more!  It seems that printf works just fine, and for some unknown reason, it’s just not used or talked about. 


In order for it to work, you only need to specify a target for STDOUT by adding this function..


int my_putc( char c, FILE *t) {
  Serial.write( c );


and inside the setup() function you need to point to that function


void setup() {
fdevopen( &my_putc, 0);

That it!  Now printf() works!


  fdevopen( &my_putc, 0);
  printf("hello, world!");




Why this isn’t documented, I have no idea!

Electronics, Software ,

rStep assembled and working

November 27th, 2010

I got the parts in from digikey today, and assembled a couple of the rStep boards.  Seems that sanguino uses the 644p and I ordered the 644.  Additionally, I’m clocking the 644 at 20Mhz while the sanguino expects 16Mhz.  I had to make a number of changes to make the 644 work with the arduino.  First, I had to modify the bootloader by adding an entry for the 644 @ 20Mhz, recompiled it, and uploaded it through the JTAG port.  Additionally, the boards.txt file had to be changed to reflect the 644 @ 20Mhz.  Now, it is compatible with the arduino IDE and I was able to compile a simple LED blinking application and upload it without problems.  A few more tests and I’ll be able to send out the beta boards to the developers for further testing.



Electronics, rStep , , , ,

rStep PCB v3

November 20th, 2010

After a failed order (and 2+ months of waiting) for a PCB order from dorkbot, I reordered the PCB through seeedstuio. $40 shipped for 10 PCBs was great, but they ended up shipping me 18 (must have had extra space on the panels). I paid an extra $10 for the white soldermask (I’m so sick of green. I never want to see a gree PCB). A few weeks later, I got them.


For those of you who have stopped following my CNC posts, I’ve still be active working on an open-source project called rStep. Yes, the r is for Reza. I’m egotistical that way. Anyhow, it’s been a really interesting experience and I’ve gained a lot of insight in running an open-source group. Last I checked, there were 78 members subscribed to the mailing list, and we have about 1/2 dozen active participants who are submitting code, testing, etc. I love seeing an idea start to become something real with people who are interested in the same stuff as I am and see the advantages to such a system. Check out the rStep page for more information.

The parts order is in place, this will be the final beta version (v3) and v4 will be a production run.

Electronics , , , , ,

One year later – Power Supply Fix

November 16th, 2010

So I’ve managed to avoid blogging for a full year. It’s not that I had a reason to stop blogging, nor is there a reason I’m posting almost exactly one year later. I just think it’s a bit neat. I’ve also noticed my last post was about CNCing — I can’t believe I’ve been working on that project for this long. A lot has happened, but I’ll save that for a future post. I just wanted to recount a debugging episode as I think it might be useful to someone.

I bought an HP 6236B triple output benchtop powersupply off ebay some time ago, and a few months back, the output voltage dropped accoring to it’s analog display, about 10-20%. I thought it a strange failure mode, but I didn’t have much need for it and put off trying to fix it – which I did over this past weekend. One thing I love about older electronics is that they actually expected people to fix them, rather than designing things so complex that they have to be replace or entire circuitboards replaced. I found the manual online (adding copy here for posterity), and not only did it contain the schematic but a debugging guide on what to check for what set of conditions.

Manual for HP 6236A, 6236B, 6237A, 6237B

So the instructions tell you, for a lower output voltage, to first start off by checking the reference voltages. I did, and found all the voltages were lower than they should have been – this seemed quite odd to me. Here’s the schematic of the reference voltage stage:


The debugging instructions said that if the +7.5V supply (first one it had me check) was too low, to check for a short in VR3, a zener diode. So I removed it from the PCB and tested it — worked fine. It gave me a finite list of other possible failure modes: U1, U2, U3, and U4 — all the op amps in the device — but I was reluctant to try to desolder them, and I didn’t expect the problem to be there. I poked around for a few hours but couldn’t think of the cause of the problem so I retired for the night. The next day I started to poke around some more, and wanted to look at the power off the transformer which would have been AC across CR56, CR55 using my oscilloscope. It looked reasonable, and having that out, I decided to use it to poke around a bit more – and noticed that it wasn’t that the reference voltages were lower, rather, they had dips in them corresponding to the lines 60Hz voltage. Sure enough, the multimeter was averaging the value and giving me a stable readout even though the votlage was not constant – and that had led me down the wrong path. The instruction manual even said to use a multimeter for debugging – and no where did it suggest I check out what is, in electronics, the most common point of failure – the capacitors. A bit of testing later, and I had narrowed the problem down to C33 – the capacitor that’s supposed to generate a DC voltage from the AC power line input. It had a strange configuration – 4 prongs (3 GND on the can and one positive terminal). It was also very very light and large – I’m still planning on taking it apart, but don’t think it’s electrolytic. I replaced the 85V 490uF cap with 2 50V 1000uF in series that I had in my workbench, and sure enough, it works like new again.


I did learn two lessons I would like to share. The instructions told me where to look, and that was great, but it also led me down the wrong path. Had I had the schematic and no debugging instructions I would have solved the problem more quickly. It’s important to rely on your instincts as well. In addition, I learned that older PCBs can’t take the heat. I tried to use my hot air reflow station to desoler the cap, but only managed to delaminate and burn part of the back of the PCB. I’ve not had that problem with newer PCBs — so don’t do that.

Electronics, Random , ,

Twitter Updates for 2010-01-10

January 10th, 2010
  • now on hold for 10 minutes waiting for #sonicnet — they should make it up by giving me a free year of service. #
  • @alderete brewing beer in the backyard — stop by if your bored. #


Twitter Updates for 2009-11-29

November 29th, 2009


CNC Success

November 14th, 2009


I was showing a friend my progress with the code, and he was complaining that the stepper motors were loud, and suggested I turn on fractional stepping. I switched to 1/16th steps, and he was right, the motors sounded much better. Additionally, the Z-axis magically started working! I was also impressed how well my code handled high stepping rates — well, more surprised that it worked without more surprises. So I’ve passed a big hurdle. I need to test the circle routine (pretty much the only piece of code I’ve not rewritten from the original code base), do some more tests, and try milling my first PCB!

Here’s a quick video demonstrating it moving in 3 axis at different rates, 1/16th step.

You can browse the latest version of the code here:

Electronics , , , ,

Stepper Motor Controller Update

November 13th, 2009

It’s a step forward, two steps back. I burnt out one of the channels running some preliminary tests, and I just got the replacement board in from Spent longer than I wanted trying to hook it up (note to self: don’t use such low gague wire). But I was still seeing more jitter in the clocking than I wanted. I tried a few different configurations, and finally came up with an approach that seems to work well, and exhibits a jitter equal to the resolution of the micros() call (4uS). In this approach, it computes the time when the next step happens, figures out which channel needs to step next, then waits for that time in a tight loop:

// start move
while (xaxis->delta_steps || yaxis->delta_steps || zaxis->delta_steps) {
        a = nextEvent();
        while (micros() < (starttime + a->nextEvent) ); //wait till next action is required
        if (can_move(a)) {
                _STEP_PORT |= a->direct_step_pin;
                //need to wait 1uS
                _STEP_PORT &= ~a->direct_step_pin;
        if (--a->delta_steps) {
                a->nextEvent += a->timePerStep;
        } else {
                a->nextEvent = 0xFFFFFFFF;

The latest version of the code is checked into SVN on google code.

So anyhow, I get everything working nicely only to find that the Z-axis controller is also fried — these guys are way too sensitive. Need to order yet another board.


Electronics , ,