Eric's Arcana and RiderX

Two blogs, one author, munged together.

Hills of the Eastside–Hollywood Hill

clock May 3, 2014 05:11 by author ericgu

View all Hills of the Eastside posts…

Welcome to the second installment of “Hills of the Eastside”.

After doing Education Hill in the last installment, it made sense to move onto Hollywood hill, because it is directly to the north and they are really the same ridge. I chose 124th / 128th as the logical dividing point between the two hills because it’s a bit of a valley and it’s a busy street.  The north boundary is Woodinville Duvall road, which is also a bit arbitrary. The west and east boundaries are the Sammamish river valley and Avondale Road, which, as the low points, are much less arbitrary.

 

I’ll break the hill into two sections; the north and the south. You can connect them a couple of ways if you would like.

South

The easiest way to the top from the South is A (172nd), a steady climb that doesn’t get very steep. The reason it doesn’t get very steep is that you’re already near the top of Education hill when you start, but you will still climb nearly 200’ to the top. At the end there is a bike/ped trail that can get you over to 168th (the top of climb C). It has a good shoulder most of the way and doesn’t have too much traffic. That’s really the only easy way up to the top.

Starting at 124th on the west, B (162nd PL NE to the north) takes you most of the way up. The road surface is good and traffic is calm, but it’s pretty steep – say, 13% or so – on the early pitches. At the top, the road is closed off with a barrier *but* on a bike you can go around it and continue on 168th to the top of C. There is another climb on that section that I should show but don’t; it isn’t that long but it’s pretty steep.

From the west, we have C (Hollywood Hill). If you say “Hollywood Hill”, this is the climb that most people think of, so I guess it’s the traditional way up. It’s a fairly nice constant climb, and would be one that I seek out except for the fact that a) it doesn’t have a shoulder and 2) it’s the main way up the hill from “civilization”, so it gets a lot of traffic. If you’re doing to ride it, a rear blinker is highly recommended. Pavement and traffic may be an issue on descents.  You can turn left at the first bend (155th) for another option.

There are two nice ways to climb up from the East (Avondale) side of the hill. J (NE 154th) is a nice climb up the east side from Avondale. Just before the top, there is a small dirt trail that takes you through to the west side of the hill. K (NE 143rd PL) is another nice climb up the east side from Avondale. It tops out near the top of A, and you can take the same trail through to the west side.

North

Starting in Woodinville, there are 3 ways to get up to the top.  D (NE 171st) and E (NE 174th) start at the same point. The first is hard, and the second one is harder. Both of these take you up to the high point on Hollywood. Nearby, you can find G (NE 178th), a steep climb up to a dead end. F (Woodinville-Duvall Road) is the traditional route up, and also the easiest, used by rides such as RSVP to get east enough to head north towards Maltby.

From the east side, there are a couple of ways up. I (NE 172nd Pl) is a nice rolling climb up from Avondale that isn’t too steep, and it will take you all the way to the top. It’s a great road to ride the other way; curvy and fast with a nice long flat spot at the bottom. On the way up, you can turn left (south), and H (171st Pl) will take you upfrom 172nd to the top of the traditional climb. It’s very steep at the top.

Climbs D and I meet at a stop sign at 164th and 175th. You can turn north and get up to Woodinville-Duvall, or you can head south and work your way back to the south and down the West side of the hill.



Printrbot Simple Metal Black (kit)

clock April 29, 2014 05:43 by author ericgu

I had my eye on a Printrbot Simple, but luckily waited just long enough for the new metal version to come out.

They say that the build was of moderate difficulty. I’m an experienced maker in a lot of ways, and it was mostly easy but I wasted a fair bit of time figuring a few things out.

 

 Thoughts on the build:

  1. The instruction manual is done solely in pictures. This works okay in most if you are used to looking at pictures and figuring them out, but if you don’t, it can be hard.
  2. It would have been nice to have a page that detailed all the screws and small hardware from a size perspective. I spent a lot of time differentiating between the different lengths and sizes of screws.
  3. In step 5, the wires had too much solder in places, so I had to bend them tight towards each other to get the nut off.
  4. In step 7, it’s fairly clear how to put the belt on, but there’s no data around how tight it should be.
  5. In step 13, the hole for the proximity detector was slightly too small; I had to screw it in. This would make tuning it later harder.
  6. In step 14, it’s not clear how tight the tension should be.
  7. In step 16, the z-axis block was slightly too wide, so the screws didn’t line up with the holes in the stepper frame. I machined a little of the plastic away with a dremel and it worked fine.
  8. In step 19, it would be good to understand the tension level.
  9. In step 22, it would be great to have a list of all the wires that need to be bundled here.
  10. Step 24, there’s no way all of those wires will fit through the grommet. I got two of the 5 connectors through, and could get no more. I ended up cutting the grommet.
  11. Step 26, it would be great to know how long each wire bundle should be to permit full travel.
  12. Step 27, it’s really hard to see how the stepper cables should be connected, and it would be nice to have a description of which motors are X/Y/Z/E.

Then it’s onto the setup. This was quite a bit more frustrating than the build was.

I got the teensy driver (windows) and repertier-host installed easily. Then, it got difficult. 

Thoughts on the setup:

  1. My power supply died the second time I plugged it in. Luckily, I had an exact replacement on hand.
  2. It would be really nice to have a quicker way to set up the values for Repertier and Slic3r. This takes a while and it’s easy to mess up.
  3. The print size is specified as 200mm and the center as 100mm, when the correct values are 150mm and 75mm.
  4. Repertier won’t talk to the system until you hit OK in the manual controls part.
  5. The setup guide says just to use the manual controls to check if the steppers work. This is a decent step, but it will not detect whether the steppers and switches are wired correctly. I had one stepper backwards and the Y limit switch not connected, but it took me hours to figure this out. I suggest the following sequence instead:
    1. Use the manual X/Y/Z controls to verify that the steppers move, and that they move in the right direction. For example, if you press the “Z+” button, the extruder assembly should move up, and “Z-“ should move it down. This allows you to verify that the Z stepper is hooked up correctly. This should be done for each axis.
    2. Use the home command in each axis to verify that the switches are set up correctly. In the manual control section, do the following:
      1. Type “G28 X” and hit “run” (or execute, or whatever it says). The print bed should smoothly move all the way to the right, and then move back until it is centered. If there is any clunking sound, the X limit switch is not connected or not working. If the bed moves to the left, the X stepper connector is backwards.
      2. Type “G28 Y”, and hit “run”. The extruder assembly should smoothly move all of the way back, and then move forward until it is centered on the print bed. If there is any clunking sound, the Y limit switch is not connected or not working.  If the bed moves all the way to the front instead of to the back, the Y stepper connector is backwards.
      3. Type “G28 Z”, and hit “run”. The extruder should smoothly move down until it is close to the bed.
  6. Better directions to set up the Z offset would really help.
  7. I watched the video on setting up the auto-leveling bed. I understood the concept, but there really needs to be a guide for it.

 

Overall thoughts:

I’ve done a few prints with the printer, and it has performed quite well. Overall, I’m quite pleased.



Hills of the Eastside – Education Hill

clock April 1, 2014 07:15 by author ericgu

View all Hills of the Eastside posts…

Five or seven years ago, I started riding with the Eastside tours group. We ride Tuesday and Thursday nights all over the east side, and we climb a lot of hills. A couple of years ago, I was lucky enough to inherit the leadership of the group from Per Sunde.

I’ve learned a lot about the hills on the east side during this time. In my spare time, I run a website – BicycleClimbs.com – that show the different ways up those hills.

I’ve decided to share that information through a series of posts that talk about a hill and the different ways that you can climb it. If you want to know the easiest way up, I’ll show you that, and I’ll also show you the harder ways. I’ve ridden up pretty much all of the routes I’ll show; if I haven’t I’ll let you know.

Since I’m hoping it will be educational, I’m starting with Education Hill north of Redmond.

Education Hill

Education hill is the hill directly north of Redmond. It is named because of the number of schools that it contains.

Easier ways up

  • The easy traditional way up the hill is from the west [A], starting near 60 acres. This climb starts with a very steep (15% or so) section right at the beginning (okay, so it’s not that easy), and then is a mostly easy climb except for the last little pitch near the top. This climb is featured on the 7 hills metric century ride.
  • There’s a nicer option [B] that starts at 124th and avoids the steep climb at the beginning. It tends to have a bit less traffic, but the road has a few deep grooves in it, so pay attention.
  • From the east, NE 116th St [D] is the easiest way up, and is also featured on the 7 hills metric century. It has a couple of steep sections but isn’t too bad.

That’s it for the easy ways up. The other options are harder.

  • If you head east on 124th, you can turn tight and climb up 162nd Pl SE [C]. This is a steep climb, peaking at around 15%, but is pretty good from a traffic standpoint.
  • From the east, there are two harder ways up. The first is 104th [E], which is really steep – a sustained pitch in the 15% range, and it has a lot of traffic. It does feature a bike lane, but I don’t think you are going to enjoy it, and I don’t recommend it. Just to the south off of Avondale, there is the Hidden Ridge Trail [F]that cuts into the neighborhoods to a nicer climb. Still quite steep, but with less traffic and a bit more rolling; this is a much nicer way to the top.
  • From the south there are a few options. The westernmost one  is 166th Ave NE [G]. This is a two lane road without any shoulder, so I wouldn’t recommend it unless it’s a really quiet time from a traffic sense. A bit two the east, there are three options. 171st [I] and 172nd [J] Aves NE both start with a steep pitch on NE 80th, and then both turn north and run parallel to each other. I think 172nd is a bit easier, though ask me tomorrow and my answer may change. 171st has a bike lane, while 172nd doesn’t, but 172nd has less traffic. Both peak at perhaps 11%.

    A climb through a new development just to the west of these, 169th [H] offers a route that gets steep and flattens repeatedly. The maximum gradient is around 14%.

Descending

The easy ways down work fine when descending east or west. I do not recommend descending 104th to the east; it’s super-steep, it ends at a stoplight, and there is sometimes a bit of grit on the road. Either take the hidden ridge trail, or head down 116th. Heading to the south, 166th is a nice way down; just beware the stoplight right at the bottom of the hill.



A better way to treat that cough…

clock March 27, 2014 07:07 by author ericgu

About a week ago, I had a problem. My wife and I were getting ready to leave on a week-long ski trip to Colorado, and I had a cough. Not one of those light coughs, the kind of cough that becomes that is more of a career than a distraction, the one where you cough for 15 minutes straight.

It was, not surprisingly, making it hard for me to sleep. One night, while sitting up on the couch in the basement, waiting for it to stop, I decided to do a little bit of research. Just like anybody would do, I pulled out my laptop, fired up Chrome, and did a search for methods of cough treatment.

Okay, that’s not true; first I searched for cough and came up with an impressive list of deadly diseases that I had a minute chance of having. Then I did a search for cough treatments, and, after a bit of digging, ran across the following paper.

Diagnosis and Management of Cough
Executive Summary
ACCP Evidence-Based Clinical Practice Guidelines

The ACCP is, of course, the American College of Chest Physicians. Amazingly, the paper is free (most journal articles are not), so I pulled it up and started reading. It’s heavy going if you are a medical amateur, but basically, they did a huge study of the available evidence relating to cough and came up with expert recommendations. After a bit of reading, I came to the section on the common cold (section 11 if you want the details). It has two interesting findings:

  1. Patients with acute cough (as well and PND and throat clearing) associated with the common cold can be treated with a first-generation A/D preparation (brompheniramine and sustained-release pseudoephedrine). Naproxen can also be administered to help decrease cough in this setting. Level of evidence, fair; benefit, substantial; grade of recommendation, A
  2. In patients with the common cold, newer generation antihistamines are ineffective for reducing cough and should not be used. Level of evidence, fair; benefit, none; grade of recommendation, D

Pseudoephedrine was most commonly available as Sudafed, which was great stuff until it started getting used for meth production and got moved behind the counter (at least in Washington; in some states it’s by prescription only). Naproxen is available over the counter as Aleve. Note that dextromethorphan, the most common cough-suppressant in OTC cough medicines, is not recommended in this situation (it does show up elsewhere, as does codeine).

So, on the way to the airport, we hit a pharmacy, and I picked up some 12-hour Sudafed and Aleve, and, when we got to our first night, took both.

It made a huge difference; I had no big cough attacks that night. I did note, however, that the aleve made me feel spacey and I didn’t sleep well, so I dropped that in later nights.

Note that Sudafed makes an OTC series called “Sudafed PE”, where the PE stands for “Phenylephrine”, not “Pseudoephedrine”. You want the real stuff.



Ski instructor secrets

clock March 17, 2014 02:22 by author ericgu

It’s the question that nobody asks.

They find out that you are a ski instructor, and they ask you where you teach, how long you’ve been teaching, but you can can see it in their eyes, that one question that they want to ask…

They’ve heard the stories – surely they must be exaggerated, but just as surely, there must be something behind them – and they want to know more, but they don’t ask. Maybe they think that you would consider it too personal to talk about. Maybe they think that a secret agreement prohibits sharing the detail with them. Maybe – and this would be the worst – maybe they are afraid that you would tell them that none of the stories are true, and that would shatter the picture they had built up in their mind.

The time has come to share the details – or, to be more precise – to do what is in my power to provide some confirmation of the rumors. I regret that, under PSIA policy, I cannot discuss certain matter, but I can provide an answer to one question:

As a ski instructor, do you get to teach a lot of cute single babes?

The answer is yes. I can confirm that, as a ski instructor, you do get to work with a lot of single babes. I can also confirm that the majority of them think you are great, and that the phrase, “babes dripping off of him”, is, at least sometimes, true.  And they are cute, some of them heart-meltingly so. It should come as no surprise if I were to tell you that working with them is one of the best part of the jobs.

Unfortunately – or perhaps fortunately, given my relationship status – the vast majority of them are 6 years old.



Tricks you can play on yourself #23 - ski edition

clock February 19, 2014 08:10 by author ericgu

The school that I teach for has a Freeride team – they ski all over the mountain (including cliffs for some of them). The last lesson day of the season they have an informal competition, and, for the second year, I volunteered to take pictures of them. This lets me keep my sports photography skills up, and lets me work with a great group of kids. Oh, and it excuses me from helping out from helping out with the other “last day” activities, though I still found time to reprise my role of “Mr. Catsup” in the hot dog line.

The chosen location for the competition was 7th heaven, a double-black diamond section at the top of Stevens pass.

I am a decent off-piste (“ungroomed” for the non-skiers and/or less pretentious among you) skier. By “decent”, I mean that I can get down most slopes that don’t involve the words “drop” or “cliff”, and that I ski them with occasional flashes of competence. It’s a little harder to ski with a 5lb camera (Canon 7D + 70-200mm F2.8L 2.8 IS II lens) on my chest, but it’s not too bad.

After a warm up with the team on Big Chief (where there was some surprisingly nice powder (and no, I just can’t call it “Kehr’s Chair”…)), we headed over to Skyline, and then up the 7th Heaven Lift (yes, it is as steep as it looks), which is 4 years older than I am but luckily, far less cranky. The original plan was to head over to the side of Rock Garden (a bumped but not super-steep run), but there was a fair amount of skier traffic, so we headed down Cloud 9 and hooked back towards Meadows above the Skyline run, to a steeper and less bumpy run.

There was some very nice snow; the kids skied down to get the feel of the run, and I skied down to set up above a small clump of trees.

Shooting on a steep slope – this one looked to be around 45 degrees – takes a bit of preparation. Actually, just taking off your skis takes a bit of preparation, lest you sink in and slide down the hill, and I spend 5 minutes carefully down the snow to try to get a 12” wide platform I can stand on. Then, I take my skis of – carefully - and stuff one at each end of the ledge so people can see me, and then enlarge my ledge with my boots. I get the camera out, get it set up, get my shooting gloves on…

And then I wait. and wait some more. The kids need to ski down to the bottom, and then cycle up two lifts, then work their way back around to this slope. The time that it takes is directly proportional to how cold it is, and since it’s pretty darn cold, foggy, and lightly snowing, it takes a long time. Eventually they come back, and the shoot goes well; I shoot for 20 seconds, wait for the kid to ski the bottom half and be scored, and then shoot the next kid. I think I’m doing pretty well but I can’t really tell; the eyepiece has some snow in it and there is a lot of frozen snow on the camera and lens. My hands are pretty frozen even with gloves on them.  (editors note – they came out quite nice. See gallery here).

I finish shooting, check signals with the two coaches, and get ready to leave. The camera goes back on the chest carrier, coat closed, and gloves on. I pull my goggles down and find that they are totally ice-covered, but a minute of scraping with my fingernails fixes them up. Skis on, and I’m almost ready to ski out – after I demolish the ledge that I built, so that nobody gets tripped up by it. I climb up until I’m on top of it, scrape snow down into the ledge, and then compact it a bit.

To ski out requires a small traverse, then a short tight-ish section until the slope open ups. I start to slide forward to get into position, sideslip a bit, and am surprised to find that I have fallen over backwards. Falling down is not a great idea on this sort of slope, and it’s especially bad to fall over backwards.  I get up, slide forward again, make one turn, and at the bottom of the turn I lose balance and fall over backwards again. This freaks me out a tiny bit, which always inspires me to ski better. Ha ha – of course it doesn’t – it actually makes me much more tentative.

I think I know what is going on, but to fix it I will have to pull my skis off, and since I’m in the middle of a tight section without great visibility from above, it’s really not a great idea to stop. I muddle my way through one turn, do a huge (and unstable) traverse, and then stop and pull of my skis.

I find what I expected. The bases of my skis were facing uphill, and they got the same coat of ice on them that my goggles did – but the ice was only on the front of the skis because the back half was stuck in the snow. The meant that whenever I went to push them sideways, the front would stick and the back would slide downhill.  I scrape them off with a plastic piece on my gloves, and finish the slope.

So – Important Safety Tip – it’s not a great idea to leave your ski bases exposed when you stick them into the snow.



Eric’s Cycling Summary 2013

clock January 2, 2014 05:40 by author ericgu

As many of you know, it is difficult – some would say impossible – for me to say briefly what can be said at length. This will not be an exception.

After a casual year of cycling with no real goals in 2012, I decided to shake things up a bit for 2013. I started by looking at my constraints:

  • I ski most weekends from December through March, and therefore have little weekend time to train on my bike.
  • During the winter, the Tuesday/Thursday rides I lead (“Eastside Tours”) are often constrained by weather, so we only go on about half of the rides.
  • Cycling is not the only thing I want to spend time on; the evening rides plus a ride of reasonable length (less than 4 hours unless it’s an event) on one day of the weekend is the amount of time I’m willing to devote.

I then looked at my goals:

  • Have more fun
  • Do some different events
  • Finish RAMROD without hating it

It was clear that to reach my goals, I needed to be more efficient in my training, so I bought a copy of Carmichael’s “Time-Crunched Cyclist”, and dug in. I started with the “Experienced Century Rider” program, and then adapted it to my schedule. Fitting into the constraints of a group ride was a bit challenging at times; I needed to pick routes that worked for the group and then fit the assigned workout into it, so sometimes I would do 3 intervals on one hill, 3 intervals on the next, and then the final 2 on a third hill. I put all-out intervals on the weekends because they didn’t really fit in. All of the workouts were based on power, and the specific power levels were based on a field test I did. This was my first experience training using power, and being able to quantify the expected effort level makes things so much easier and more effective.

The training was quite successful; I ended up being leg constrained (ie my legs hurt from the lactic acid) on my climbs rather than being aerobically constrained, and that was a very nice outcome.

RAMROD was pretty good; I was much faster up Paradise than previously, but Cayuse turned into the usual suffer-fest, with me stopping multiple times. I think that the problems I had on Cayuse are related to me not eating enough; my later performances where I ate more were much better. So, chow down seems to be the order of the day.

Our California trip was very nice; I had great energy pretty much the whole time, and managed to do two mountain climbs (Figueroa and Diablo) at a high consistent power output and feeling reasonably good while doing it (I lucked out and had great weather on Diablo, but Figueroa was hot hot and that reduced my speed and increased my pain a bit).

And finally, I felt strong all the way through the Passport 2 Pain, staying ahead of the usually-faster riders from my group. I’m a little worried about attempting it a second time, as a look comparing my RAMROD performance to my P2P performance would make you think it was two different riders, and P2P may have just been one of those days when you have great legs.

In summary, a pretty good year.

Statistics

2013 2012
Rides 106 90
Distance (Miles) 3000 miles 2356 miles
Total time 210:39:10 162:54:52
Average speed 14.2 MPH 14.46 MPH
Total Elevation 215,052 feet 150,804
Longest ride 149 miles 107
Feet/mile 72 64

A 40% increase in elevation this year; some of that comes from about 25% more miles, but the remainder comes from a 12% increase in the number of feet climbed per mile, which is a pretty significant increase. The decrease in average pace is because of that; I have actually be faster on the flats this year than in the past but have been trying to stay within our 17 MPH goal pace for the Eastside Tours rides.



Microcontroller RGB LED Animation Software

clock December 30, 2013 02:43 by author ericgu

I’m building a project using non-addressable RGB strip, where all of the LEDs in the strip are connected in parallel and are therefore the same color. I thought it might be a bit useful to talk about the techniques that I’m using in the software, and some of the options & tradeoffs that exist.

The hardware and code are from the Arduino world, but they apply equally well in other ecosystems.

Hardware choices

The LED strip is composed of RGB LEDs, which are in turn made up of separate Red, Green, and Blue LEDs. Simplistically, I can get 8 colors out of the combinations of these colors:

  1. Red
  2. Green
  3. Blue
  4. Yellow (Red + Green)
  5. Purple (Red + Blue)
  6. Cyan (Blue + Green)
  7. White (Red + Green + Blue)
  8. Black

To get more colors, I need to be able to do something more than just turn a color on or off – I need to control the intensity of each color independently. While it is possible to control LED brightness directly by controlling the current through it, that is fairly complicated, so in most cases we take a shortcut. If we want half the light output, we flash the LED so that it is only on for 50% of the time. This would seem to produce a flashing LED, but because of the way our vision works, if the flashing is quick enough, we see not a flashing LED but a dim one. This technique is known as “Pulse Width Modulation”, or PWM. Doing it 60 times per second (ie 60 Hertz, or Hz) is a minimum bar, but I like to shoot for 100Hz. A lot of cheap holiday LED lights flicker at 60 Hz and if you move you head you can see it.

The number of colors we can get depends on how many levels of intensity we support. 64 levels gives us 64 * 64 * 64 = 262144 different colors, while 256 levels gives us about 16 million. We want enough to give us smooth fades between colors, and I think 64 levels is probably significant.

PWM is also used for controlling the speed of some motors and for driving servos.

PWM Implementation

PWM is such a useful technique that it is implemented in hardware on many microcontrollers. Using the hardware PWM has a lot of advantages:

  1. You don’t have to write/debug/maintain the PWM implementation.
  2. You don’t have to deal with interrupt-driven code, which is more complex and a bit mind-bending at first.
  3. The hardware PWM does not consume any execution resources, so your software has 100% of the microcontroller to use.
  4. It’s very simple

So, hardware PWM is great. However, it has some disadvantages, the biggest being a limited number of PWM channels per microcontroller. The Atmel ATMega386 in the Arduino supports 6 individual channels. I’m using a Trinket, which is built around the ATTiny85 microcontroller, and therefore supports only 3 channels. Hardware PWM is also limited to a specific number of discrete levels. If you need a lot of outputs and/or more discrete levels, there are boards that you can connect to your microcontroller that can do more channels at with more levels, such as this 16-channel one.

If the hardware PWM support is not enough, PWM can be implemented in software. We configure the microcontroller to call a bit of code at a specified interval, and in that code, we decide whether the output should be on or off.

This gives us a bunch of flexibility; we can, at least in theory, do PWM on every single output on a microcontroller. However, the code that is running is taking up system resources, and at some point we won’t have any resources to do any other work.

Animation storage

There are two ways of storing animation; we can express them in procedural code such as:

DoFade(redTarget, blueTarget, greenTarget, fadeTime)

and then create a program that has one DoFade() for each animation. Or, we can do a table-driven approach, where we express what we want in a table:

Red Target Blue Target Green Target Fade Time
255 0 0 15
255 255 255 45
etc.      

And then write a very simple program to loop through the entries in the table sequentially.

The table-driven approach has simplicity going for it, and works well in most cases. It doesn’t work well in cases where there are repeated patterns; if we wanted to fade from red to green and back to red 50 times quickly, that would take 100 entries in the table, but would only require a short loop to write procedurally. There are ways to get around this by making the table more complex.

Architectural options

There are a few different architectural options. In rough order of complexity:

  1. Use hardware PWM and code in the main thread (ie “loop()” in the arduino world) to drive the animation.
  2. Use hardware PWM and a separate timer interrupt to handle the animation. The timer interrupt code is called a fixed number of times a second, and that code drives the animation.
  3. A timer interrupt to implement the PWM (software PWM) and to handle the animation.

There is also a fourth option – using a timer interrupt for PWM and splitting the animation between the timer interrupt and the main thread. I built one system that does that, but I think it ends up being more clever than necessary.



RGB Strips Construction

clock November 23, 2013 05:45 by author ericgu

With the electronics done on my RGB project, I moved on to the physical construction.

As a veteran of a number of these projects, I’ve learned that the electronics part is always the easy part; it’s all of the physical construction (wiring/cabling/support) that takes the time. I’ve also learned the new projects need to be quick to put up; it already takes too long for me to put up the current displays.

The LED strips that I’m using are quite flexible, so they need some support. I chose 1/2” EMT electrical conduit as my mounting method. I have 67’ to cover, so I bought 7 lengths of the tubing for about $3.50 each. The strip has an adhesive backing on it (it claims to be a 3M adhesive, but counterfeiting is rampant in China, so I’d be surprised if it is…), so it’s a simple matter of attaching the strip.

The first step is to mark a straight line along the conduit.

To do this, you need a way to hold the tubing so it won’t spin. I used a 8’ cutting guide that I have, and a sharpie to mark the edge. If you don’t have that, a baseboard in a room that has hard flooring would work just as well.

Next, slowly peel of the adhesive of the strip as you move along the tubing, and stick it down. The strip is made to be attached to a flat surface, so it won’t adhere perfectly. I used zip ties to give some extra security.

I needed a nice way to joining the pieces of conduit together. I originally just wanted to use conduit connectors, but they don’t really hold the joint very straight and they make the tubing wider, so I did some searching in my hardware store, and found some connectors for flexible pipe that worked just fine. One end is a tight fit, and I ground down the connector so the others just slide on. I'll note in passing that inside diameter of 1/2” EMT is 0.6 inches, and the outer diameter is around 0.7 inches. Here’s a picture of them.

This shows a tactical error I made; the strips can only be cut on the segments between them, so I let them run long, and made sure they overlapped correctly. It was a bit of a pain. On the second set, I got smart and trimmed the conduit to the length that I needed. Here’s what the completed sections look like:

There are connectors at both ends because I need to feed power from both ends to keep the voltage constant; they are Molex connectors that took a long time to put on; each one gets crimped and soldered.

I bought a 250’ spool of 12-gauge landscape wire, and then soldered on some more connectors. I used hot glue to insulate the connections and hold everything together.

After a lot of work, I got it done, and then surveyed the carnage:

 

and here are a couple of shots of the final result:

That intense red line is the RGB strip. Note that it’s really hard to take crisp pictures of lights, as they tend to bloom.

 

Here’s a closer picture; you can sort-of see the individual leds. At this distance – 20 feet or so – you can see the individual light sources pretty easily.



Trinket debugging…

clock November 23, 2013 02:08 by author ericgu

One of the nice things about debugging code on the Arduino is that you can send debugging information back out the serial port. The arduino can do this because it has a separate microcontroller to handle the USB communication duties.

The Trinket, however, does not have a separate microcontroller – the USB communication is handled by the same microcontroller your code runs on.

I needed to do some debugging, and decided to do something very old school. I wrote some code like this:

temp = valueIWantToView

digitalWrite(0, HIGH);
digitalWrite(0, LOW);

for (int I = 0; I < 8; i++)
{
    if (temp & 080)
    {
        digitalWrite(0, HIGH);
    }
    else
    {
        digitalWrite(0, LOW);
    }
    temp <<= 1;
}

I ran this on a timer interrupt, hooked up my scope to pin 0, and I could then read the bits directly off the scope.