Monthly Archives: January 2010

Landscape light update

I’ve been pretty busy with skiing, but have made some good progress. I’ve played around a bit with the available commands, and have made a few decisions.

First, I’ve decided to use the xbees in their simple serial replacement mode. In this mode, it just acts like there’s a serial cable between the two modules. The more complex stuff looks interesting for future stuff.

Second, I’ve figured out what I want to do to handle the handshake between the two devices and how to structure the code. I’ll share some code when I get it written.

Base station:

  1. The main loop will constantly send out a heartbeat with the current status of the lights. It will send “EG0” if the lights are off and “EG1” if the lights are on, at an interval of 1 second. I’ll either do the loop with a simple delay routine (delay_ms() from the standard library), or I’ll piggyback on the short-period timer that I’ll use to debounce. Probably the former.
  2. The interrupt service routine for the xbee will look for commands and process them. If it sees S0 it will turn the lights off, and S1 it will turn the lights on.
  3. The interrupt service routine for the pushbuttons (“all on”, channels 1-3 on individually, “all off”) will handle servicing the buttons. I’ll probably use the short-period timer to debounce the pushbuttons
  4. The interrupt service routine for the long-period timer will handle turning the lights off after a time period.

That’s going to use up most of the capability of the 2313 I’m using. I decided to do 3-5 output channels, each with a dedicated 30A relay to do the actual switching. The relays will be driven off of the avr using a transistor to get the necessary current, which is something like 200mA, far more than you can get from an AVR.

The xbee unfortunately runs on 2.8-3.4V, not the 5 volts I bought for the power supply. The adapter boards that I bought down-regulate the voltage, but I don’t want to waste them on a project like this. I could put a nice 3V regulator on it if I have it, but I’m thinking of just putting three silicon diodes in series, which would give me 0.65 * 3 volts – almost perfect – and it will work fine assuming I don’t pull too much power through them.

Remote station:

This one is going to go in a tiny project box, which an on/off switch, a link LED, a status LED, and a pushbutton. I’m going to fit all that into a tiny project box, along with two AA alkalines (or maybe AAA if I don’t have the space).

The code will be something like the following:

  1. On startup, blink the link LED a few times.
  2. On the interrupt service routine for the xbee, look for the EG0 or EG1 data. If it’s there, turn on the link LED, and turn on the status LED if the command was EG1. Set the short-period timer for about 900 mS.
  3. On the short-period timer interrupt, turn off the link LED. This will have the effect of blinking the link LED off for 100mS as long as the remote is receiving data from the base station.
  4. I’ll use the long-period timer to debounce the switch. On that interrupt I’ll send S0 if the current status is on, and S1 if the current status is off.

 

Lights

I mounted three sets of three lights on trees over Sunday, so this weekend I’ll be able to wire them up to the transformer and see what voltage I need to use for each zone.


Ski Instructoring – Day 2

Yesterday was day 2 of the 2010 ski lesson season.

We got up there early, and I found that my cadet Rosemary (not her real name, in case you haven’t figured it out) fell and hit her head while skiing during the week. She’s fine, but is out for the season. A few other things changed (not unusual early in the series):

  • My missing student “M” would be coming up this week. According to the email that I saw, she had skied hogs before but wasn’t really a big fan of it (sounds like parents taking her up a bit before she was ready).
  • My lower-ability student “H” would be dropping down to a lower class
  • I was getting another student (“Z”). He had been riding Daisy before but I don’t know much more than that.
  • I have a new assistant to help me (we’ll call him “Lemont”).

Not to bore you with details, but we did one trip up daisy and then two trips up hogs, with a play-in-the-snow break in between the two runs. My goal for right now is mostly around mileage – we’ll do a little on technique (wedge-christie and up/down), but mostly I’m just looking for mileage.

In the afternoon I got two first-year kids and took them on a couple of trips on daisy. That also went well – I spent a lot of time skiing wedge turns backwards so that I could show them the path that I wanted them to follow and make sure that they were turning out of the fall line on each turn (they need that to be able to progress to steeper slopes). My legs were more than a bit sore after that.


Ski Instructoring – Day 1

Last year my family decided to try the ski instructor thing, and spent the year as cadets for Olympic Ski School. We’d taken lessons from Oly for a long time, and after topping out in their classes got asked to try teaching.

This year, we all have classes on our own. I have a class of level 1.5 kids – 4 and 5 year olds.

PSIA (Professional ski instructors of america) uses a 9-level scale to classify skier ability. Level 1 skiers have never skied before (or, perhaps, have only been on skis a few times).

The kids in my class have been on skis a bit but aren’t quite up to a level 2 class. This isn’t surprising – 3 and 4 year olds don’t have a lot of coordination and may not be able to progress too much in their first year.

I have 5 kids scheduled in my class, and a cadet (who I’ll call Rosemary) to help me. Four of the kids show up, we put on our skis and shuffle out to the beginner area.

This will be the first test of the 4 days of clinics that I did in early December. I worked with a great instructor last year, and after a lot of experience teaching other things, I don’t tend to get very nervous.

My first task is to assess the class. I talked with all the parents before hand and from my discussion with them, all the kids should be at a roughly compatible level, but parents often don’t do a good job of matching their kids to the description in the ski school pamphlet. All the instructors will do this and determine whether we can shuffle students around to better equalize the skill level in classes.

I watch the four kids shuffle over to the beginner area. This is the first evaluation step – you can tell a lot about how comfortable the kids look with these weird heavy things attached to their feet.

We start with a straight parallel run down a slope that is just steep enough for them to go forward. They look fine doing this. Next we send them down and ask them to do a few turns. E, J, and A do these turns well, but K says that he doesn’t know how to turn. We talk with him a bit (hard because he’s not very talkative right now), so Rosemary says she will work with K while I take the rest up the magic carpet (aka “conveyer belt”). If they do well enough on this we’ll head up the chair lift. They do nice wedge turns coming down the steeper part of the magic carpet, and my evaluation is that they’re good enough to do daisy. As the last one comes down, one of our level III instructors comes over and says, “take them up Daisy”. We talk a bit about K and he goes over to give Rosemary a hand (it’s a bit hard to start that way as a cadet).

We end up taking two trips on daisy during the remainder of the lesson. We’re working on linking turns, and we start moving into the next part of the progression – doing straight runs (“french fries”) across the hill, and then wedge (“pizza”) for the turn.

Next week, we’ll spend some time working on vertical motion, and starting that vertical motion by standing tall on the uphill ski. This will help the uphill ski start carving around the turn *and* unweight the inside ski, so that the kids will start being able to match the inside ski to the outside ski as part of the turn.

It was a lot of fun and a nice challenge to do this – I stopped coaching soccer when my daughter entered high school, and I’ve been missing that sort of interactions. The kids are a kick and I enjoy being silly with them.

Late in the lesson we had to stop for a bathroom break (not uncommon in this age group), and then headed in for lunch. I was originally scheduled to have the afternoon off, but I ended up getting a second gig – I’m assisting with my wife in the afternoon of her 4-hour level 1 class. We spent a couple of hours working with kids on the magic carpet – a lot of running around in ski boots and picking kids up.

Then we spent an hour or so at a preparation clinic for our upcoming level 1 instructor test in February.

We skied a few hours Sunday morning, but didn’t last long. We are really tired.


2009 Cycling Summary, 2010 Preview

I finally imported all my Polar data for last year (complicated because my new laptop doesn’t have an IR port, so I need to go through my old laptop), so here are my stats for the last year.

 

2009

2008

Distance

2253.3 miles

1578

Rides

84

75

Time

150:24 hours

110:41

Average speed

15.0 MPH

14.8

Elevation Gain

109777′

80459

Calories

81273

66333

Min temp

33.8 (12/3)

37

Max temp

95 (RAMROD)

84

Overall, the year was pretty good, featuring both Livestrong and RAMROD. About 50% more mileage than 2008, though I probably spent more time on my rollers in 2008 than 2009, and that doesn’t show up.

To work on strength I spent the bulk of my rides on the middle ring of my triple, which makes my smallest gear a 39/27. That was pretty painful on group rides when we hit slopes that are 10%+, but it did make a significant difference in my strength during the summer. I did drop down to my 30 on the front on the 7 hills of kirkland, livestrong, and ramrod.

Next year, my plans are to do 7 hills (the full century version), and then repeat on livestrong and ramrod. I also plan on skiing more so my mileage in the early months may be low – I hope to play some soccer during the week to compensate.


Landscape lights V2.0

I’ve taken a new approach with my landscape lights.

To recap, I needed a system that had remote on/off from a few (2 or 3) locations perhaps 150′ or so away from the transmitter. My plan was to do a simple remote pushbutton system, and then to run two runs of wires out to the remote locations – 12VAC for the lights, a second pair of wires for the pushbutton.

I bought the main wire, and at about $0.30/foot for 12 gauge, that was $150 in wire for 500′. I spent some time looking for all my local sources, but nothing I could find was much less than $0.30/foot, which would mean at least another $100 to get to those two locations. Plus, while the main wire was rated for outdoor applications, I was having trouble finding something thing (say, 25 gauge) that was outdoor rated, and I was concerned that it wouldn’t last very well running from here to there through the woods. Not to mention the pain of running two lines over one line.

So, I needed a way to get rid of the cable. My first thought was to do some sort of higher-frequency signaling over the main power line, but a) I don’t know a lot about that area, ii) I don’t want to know more about that area, and 3) the X10 folks had a fair bit of trouble getting it to work reliably. If I went that direction, I could put in a whole lot of work without getting something that worked reliably, which would be more than a bit annoying.

The second option I considered was wireless. I dug out some links I had kept, and once again came across the xbee stuff. At something like $20 per node, I could build a base station node + 2 remotes for less than the cost of the wire. After a bit of though, I decided to build one base station node and one remote that will live in the ski car. I also decided that I would probably go with the XBee pro implementation for the extra range, as I’m at the limit of where the normal xbee stuff works reliably, and the place I plan to mount the transformer may not be the best location for radio. The pro nodes are a bit pricier, but it will still be a wash compared to cable and I have a couple of other wireless projects in mind.

Granted, this will be a ridiculous amount of overkill. I’m going to use a full-duplex 256Kbit link to send simple on/off commands. I thought about using some of the other wireless approaches out there that are a bit cheaper, but I think the XBee will work well for a couple of other projects that I’m considering, and I’d rather bite off that part once.

You can get the xbees from a few places. I ended up ordering mine from SparkFun, two XBee pros, and then a couple of breakout boards – one USB one, and one simpler one. I also ordered a new transformer, which is a fair bit nicer than the previous one, and has the added advantage that it, like, works. Last weekend, on my last day of vacation, I hooked plugged each of the xbees into the USB, ran X-CTU, and upgraded them both to the newest firmware.

Last night, I dug out an ATMEGA16 processor, put it in the programmer, and started writing code. I chose that processor because it’s the only one that I have right now that supports USART serial, and I wanted it to be serial. Put it in the programmer, got things running, and wrote some code to put the XBee into command mode “+++” (the xbee should respond with “Ok”). Hooked up the XBee to the USART, and nothing happened.

Put my scope on the data line, and it looked like the characters were there. Modified the code so that it looped on writing characters, and I could see the serial data on the scope (well, not the data itself, but the fact that there was data). Still nothing from the xbee. Did a bit more thinking, and then remembered that some of the avrs aren’t shipped at the proper clock rate. I fired up avr studio (which is better for this), had it read the fuse bits, modified them so that it would run at 8MHz on the internal processor, and burned them to the chip.

At that point the xbee started responding, and I could go to the second xbee (hooked up to X-CTU), and send messages back and forth. Whee!

Now that I’ve proved it works, I’ve ordered a couple of ATTiny2313s (the smallest AVR that has an USART) and some project boxes, and a new solid state relay to replace the one that died with the last transformer.

Next step is to do some range testing, to see how far I can get it to reach, and then when the new stuff shows up I’ll get into some more serious prototyping.

Oh, and I also managed to get a bunch of the cable run over the holidays.