Sunday, November 30, 2008

Installing an Accesory Power Distribution Plate on a Suzuki DL650 V-Strom

I just installed a power distribution plate on my 2004 V-Strom and noticed a few posts asking questions about where to tie in the relay, etc., so I figured I would post my experience. I'm sure there are other ways to do this, but this seemed to work for me.


Tools needed:

  • wire cutters
  • wire strippers
  • wire connector crimper (or long handled pliers)
  • exacto knife blade (or a sharp pocket knife)
  • phillips head screwdriver
  • flat head screwdriver
  • a tool to trim the horn connector (a dremel works well)
  • voltmeter
  • soldering iron (and solder/flux)


Other supplies needed
  • accessory power distribution plate (from twistedthrottle.com)
  • auxiliary horn connector (Suzuki part number 36852-06G00)
  • velcro strips (package sells for $1 at Big Lots)
  • assorted automotive fuses (or specific to your accessories)
  • 3/8" plastic wire tubing (4 foot length) to protect wires
  • 1/2" plastic wire tubing (4 foot length) to protect 12 gauge wires
  • 12 gauge wire (red and black) to power accessories at front of the bike
  • heat shrink tubing (assorted sizes) and a heat source (e.g., matches)
  • 8 position dual row barrier strip (Radio Shack 274-670) as a ground plate
  • 8 position jumper strip (Radio Shack 274-650)
  • an extra yellow terminal connector (for the ground wire)
  • a yellow butt connector (to connect the ground wire to the ground plate)
  • "dielectric" grease to protect connectors from corrosion

Ordering Parts


Before you can begin, you need to order power distribution plate (I got mine from twisted throttle) and the auxiliary horn connector from a Suzuki dealer. While waiting, you can obtain the rest of the supplies.

The power distribution plate kit.




Suzuki auxiliary horn connector (part number 36852-06G00)



I've heard mention of a "heated grip connector" in some forums. When ordering the part, the Suzuki dealer told me the part was actually listed as a "auxiliary horn connector" and they were not familiar with a "heated grip" connector. I checked the wiring diagram, and sure enough, it's listed as a heat grips connector (kind of surprising though, given the gauge wire used).


Just be aware that when you are ordering the connector from Suzuki, use the part number to avoid confusion.


Prep Work

Secure the bike (use a center stand if you have one) and remove the gas tank and the rear cowling on the left side adjacent to the battery. It will also help to remove the bolt on the right side securing the bottom of the radiator. If you can swing the bottom of the radiator forward a bit, it will help later.

A quick side note...

The first time I had to remove the gas tank, I broke a few of those little black nylon rivets holding the cowling on.


It wasn't until my friend Cullen told me how they worked that I was able to get them off without fear of breaking them. All you have to do is push in the center of the rivet, and then it just slips out. To replace it, pus the pin outward (so it sticks out), insert the rivet, and then push the pin down with your finger so it's flush again. Easy-peasy.

If you do manage to break off any rivets (like I did) you can order more from www.boltmotorcyclehardware.com. Most Suzuki dealers carry them, too--but they aint cheap (around a buck and half per rivet).

Remove the ground lead from the battery, then the positive lead.


Mounting the fuse block


Probably the best place to mount the fuse block for the power plate is on the front of the storage area, just behind the battery. The power plate kit comes with ties, but I found that a good strip of velcro along the length of the fuse block works quite nicely.



Run the red wire from the fuse block along side of the battery compartment, parallel to the wrapped trunk of wires, and then out the side as pictured.



Mounting the Relay

Now for the relay. I mounted mine on the left side along the side rail just inside the cowling.



Even though the relay has a hole for mounting with a bolt, I recommend (again) using velcro. No need to worry--the relay isn't going anywhere. Besides, if you mount the relay with a bolt, it's going to be exposed to more vibration.



If you position the relay as pictured, you'll find that the 30 amp fuse holder will tuck nicely into a niche on the front left side of the battery compartment.



There are three red wires coming off the relay. Not pictured here are the long blue and black wires coming from the relay. They are just hanging off the side of the bike.



The wire with the white tab connector will connect to the wire from the fuse block. The long red wire with no connector will connect to the battery terminal, and the short wire with the light blue crimp connector connects to the positive lead of your battery tender, if you have one.

Measure the length needed to connect the lead from the fuse block to the lead with the white tab connector from the relay.



Measure twice, cut once, strip off about 3/8" of the insulation and crimp on the yellow tab connector, If you don't have a crimp tool you can use long handled pliers but make sure you crimp the wire with as much force as possible. You do NOT want this wire to come loose. Give it a good tug to make sure it's secured, and then attach the two connectors (with a dab of dielectric grease). Tuck the wire under the frame.



Run the long wire from the relay so that it parallels the wire from the fuse block to the positive terminal of the battery. Similar to the way you connected the yellow tab connector, measure, cut, strip and crimp the wire to the yellow ring terminal to later attach to the battery.

Insert the wires into a section of 3/8" wire tubing to protect them. The wires are almost too large for this size tubing, but just be patient and you'll get them in.



Connecting the Relay Wires


The power plate kit comes with a ring terminal and a T-tap for connecting the black wire coming from the relay to ground. Forget them. Throw them away, or stow them for some other project. Instead we're going to use the auxiliary horn connector (Suzuki part number 36852-06G00).



Just behind the left side of the radiator near the top is a trunk of wires wrapped in tape. Attached to this trunk with more tape is the female auxiliary horn connector (or the heated grip connector--whatever you want to call it).



Use an exacto knife, pocket knife, or some kind of blade to (carefully!) detach the female connector from the tape holding it against the wire trunk. Once free, remove the tape that was securing the connector--it's separate from the tape wrapping the rest of the trunk and can be removed without making any other cuts.


Temporarily connect the battery leads to the battery (positive lead first), turn on power to the ignition, and use a voltmeter to verify the polarity of the leads to the female connector. The lead connected to the orange/green wire should be positive, and the black/white wire should be ground. When done, disconnect the battery leads again (negative lead first).



The horn connector (part 36852-06G00) has a black connector and a white connector on each end. Use wire cutters to cut off the black connector. You can even cut the wires to the white connector down to a couple of inches long (or not). The white connector has some kind of tab molded onto it that looks like it snaps into a hole somewhere on the bike. I wasn't able to locate any place for this to fit, and it looked to me like it would be in the way so I simply used a dremel to cut it off.

Feed the black and blue wires from the relay along the left side of the bike to the connector. Measure (a little long is ok) and cut the wires. Strip the black and blue wires to expose 3/8" of wire, and strip the wires from the wires from the white connector as well. Twist and tin the wires with a soldering iron. Mock fit the connector to verify polarity, then remove again to solder and heat shrink the wires onto the connector. The blue wire connects to positive (to the orange/green wire on the bike), the black wire to ground (to the black/white wire on the bike).



Insert the wires into a length of 3/8" wire tubing to protect them from heat, vibration and rubbing.



Mounting a Ground Plate


The last thing to connect is the ground plate. The kit doesn't come with this, and the V-Strom definitely needs one.

The VStrom electric system is designed with all grounds returned via wires to the battery ground. The frame should never be used as a ground return path on these bikes. Due to the fact that the frame is a mix of aluminum and steel, running current through these parts will result in an electrolytic reaction which will eat away at the frame. All added electrical accessories should have their ground current running through wires to the battery.

Special thanks to Mark Lawrence for publishing this information :)

Make a Radio Shack run (if you haven't already), and get either a six position or eight position dual row barrier strip and a jumper strip.


Attach the jumper strip to the barrier strip (this will turn every connector into a big ground). Then attach it to the right rail (again, velcro is fine here) behind the helmet holder wire. Test fit your seat to make sure nothing hits, and adjust/move the ground plate accordingly.



To connect what is now the ground plate to the negative battery terminal, take a length of the extra red wire you previously cut off and cover it with heat shrink (you don't want a red wire connected to your ground plate, right?). If you happen to have some black 10 gauge wire on hand, you can use that instead. Strip and crimp on a yellow terminal connector to one end and a butt connector to the other end. You'll need to file down the sides of the butt connector a bit to get it to fit on the ground plate.

Connect the positive lead (and the terminal connector from the relay) to the battery, and then the negative lead (and terminal connector from the ground plate) to the battery.

Now time for the initial test. Turn on the ignition and listen for the "click" from the relay. If you hear it, great. If you insert the 30 amp fuse, you can also test the lead to the fuse plate to make sure it shows voltage when the ignition is on.

Now you can insert fuses for each of your accessories, and run wires on the right side of the bike to the front through 1/2" wire tubing, and you are ready to roll!

Wednesday, May 28, 2008

Watermelon Hydroponics Project 2008

The 2008 watermelon hydroponics project is officially underway! On Memorial Day, after returning from my trip to Lafayette, I was finally able to transplant my watermelon seedlings into their new environment.





This blog entry started out describing some of my past projects, the current design, mixing the stock solutions, and a number of other topics. It didn't take long to realize that a blog was not a suitable format for information that really needed a hierarchical organization with links. I use a wiki at work, so I decided to set out to look for a wiki with the features I wanted.

There's a really cool website for comparing wiki's (WikiMatrix) that helped me narrow the search down to a handful in a very short period of time. After trying the remaining few, I settled on WetPaint. The features I like about it:

  • it's free (that's always a plus) and it's hosted

  • it's easy to start

  • your wiki can be as public or as private as you like

  • to edit a page, just start typing

  • no wiki language to learn

  • very clean look

One thing I don't like about it: no superscript or subscript. Oh well, I'll make do for now I suppose.

My intention was to get the wiki in a fairly stable state before linking to it here, but I think it's just going to have to be a work in progress for a little while:

http://backyard-hydroponics.wetpaint.com/

Sunday, September 30, 2007

My First MP3 Tire Change

With a new Michelin Pilot from MotorCycle Superstore online all I needed to do was swap it out. I could have sent the bike to the shop to do this, but I figured I could save some bucks doing it myself. Besides, these kinds of projects are hardly intimidating. I had the following rendering from the Piaggio Catalogue of Spare Parts. Looks simple enough.



Notes:

  • All tools required are metric

  • Have a safe place ready to hold the various nuts, bolts, and pins. The one thing you don't want to happen is to lose any of them. They may be difficult or impossible to replace during the weekend or after hours.

  • I didn't use the bike stand until after loosening the wheel bolt.

Step 1. Use a (17mm) socket or wrench to loosen the collar fastening the exhaust manifold to the muffler. Once the collar is loosened you should be able to move the collar off the muffler and onto the exhaust manifold. No need to remove the collar completely.



Step 2. There are three bolts which fasten the muffler to the bike. One of the top bolts (pictured) also fastens the parking break cable support. Remove the bolts and put them aside in a safe place.




Step 3. Remove the screw attaching the (black plastic molding) to the aluminum (rear wheel assembly) just above the rear brake (pictured).





Step 4. Examine the wheel nut assembly. The nut is secured by a metal cover held in place by a cotter pin. Notice that if you turn the wheel, the cotter pin turns with it. Turn the wheel until the loop of the pin is oriented with the depression (at about the 4:00 position). This positiion gives the pin more room, making it easier to remove. Straighten the ends of the pin, then pull it out. With the pin removed, the nut cap can be removed by hand, exposing the nut underneath.
The snap ring around the wheel shaft (pictured below) does not need to be removed unless you need to replace the wheel bearing.



Step 5. Use a torque wrench or breaker bar with a 22mm deep-socket 6-point torque socket to loosen the wheel nut. You'll need a deep socket in order to clear the wheel shaft. I do not recommend using a 12 point socket--the force required may damage the nut. Directly under the nut is a bushing you can remove it by hand. With the wheel nut loosened, apply the bike stand.



Step 6. Remove the two allen socket bolts holding the rear wheel support assembly to the crankcase. These bolts are really tight. When they break loose you'll hear it. Keep a mental note of how tight they were, you'll need to tighten them again when it comes time to put things back together.




The first bolt is on top near the water pump. The second bolt is on the bottom near the exhaust manifold.




Step 7. There are five small allen socket bolts holding the brake disc in place. I discovered that it's easiest loosen and remove them one by one by turning the wheel so that they are in the lowest position (pictured below). Once you have removed four of the five bolts, turn the wheel to position the last bolt for removal. However, before loosening and removing this last bolt, put on the parking brake. This will clamp the parking brake calipers to the disc, so that when you remove the bolt, the disc will stay in place. Don't worry if the disc moves or gets out of position. You're just using the brake as another set of hands to keep the disc from getting in the way until you get the wheel off.





Step 8. There's one attachment remaining connecting the support assembly to the bike--the right rear shock absorber. I removed the bolt attaching the shock absorber to the bike just under the trunk, but I suppose you could just as easily remove the bottom bolt if you prefer. Use a 13 mm wrench and put the bolt aside.




Step 9. With all the attachments removed (except for the brake lines), you should be able to carefully remove the support assembly (along with the brake disc) as one piece. You won't be able to go far with it, though, because the parking brake cable and the rear brake line are still attached.





Step 10. The wheel should slide off the driveshaft, and the disc brake should remain clamped by the parking break, still attached to the wheel support assembly. Having a dachsund around to lend a hand always makes things go smoother :)





Here's an inventory of the nuts, bolts and screws removed.




At this point, I had the old tire still on the wheel, and the new tire ready to go on the wheel. Fortunately, my friend Jason has a tire changing tool, and said I could come over and he would help me use it. I forgot to bring the camera with me, but maybe that was a good thing. I'm sure we looked like two clowns trying to put the new tire on.

Getting the old tire off went well enough, but it wasn't easy. If taking the old tire off wasn't bad enough, putting the new tire on proved to be almost more than the two of us could handle. Jason races motorcycles, and said that every Michelin tire he's ever had to put on was stiff. We had to leave it out in the sun to heat up before we could even attempt to get it on. And to make matters worse, once we got the tire halfway on I noticed the direction of the tire got turned around (which must have happened when we set it down to warm up in the sun). So we ended up having to take it off and try again. A trick Jason showed me was to use strips from a cut up plastic milk jug to protect the aluminum wheel while leveraging the wheel on.

Once the tire was on with the correct orientation, we also had a tough time setting the bead--even with his 50 gallon air compressor. He showed me another trick for setting the bead which is to stand the tire up and slam it against the ground repeatedly. Eventually, the tire caught enough air, and... "pop!"... "pop!" The bead was set. We balanced it as best we could (his balancing tool didn't quite work as well as with larger wheels).

After hauling the tire home, it was a simple matter of reversing the process to put the wheel back on. I lubricated the driveshaft with lithium grease before replacing the wheel, although I'm not certain that is required.

I think next time I'm going to just bring the wheel someplace to have someone swap out the old tire. It was a serious pain in the ass.

Monday, June 11, 2007

"Set Yourself Up to be Successful"

Last weekend I took the Beginner's Riding Course offered by the Motorcycle Safety Foundation.




I signed up for the course a couple of months back, and even though I was issued my motorcycle endorsement prior to the class, I figured that taking the course was still a good idea. I'm still very much a beginner, but I was starting to wonder if I was going to be bored with the course. It turned out to be a lot of fun, and I learned a lot. Not only did I get valuable foundation knowledge on being a better (and safer) rider, it also offered a great opportunity to get some experience riding a motorcycle of the two wheeled variety (i.e., something other than the MP3). Since my MP3 has no manual clutch, no gear shift (and hence no "neutral" per se), no right foot rear brake pedal (it's on the left handlebar where the clutch would normally be), and no manual fuel valve, it was really helpful to get that experience. I was pretty much starting from scratch, but it didn't take long to get the hang of things.

Other than the online video on the MSF site, I wasn't really sure what I was walking into. I was half expecting to see a classroom full of as many people as could fit. Fortunately, the class was limited to twelve, which was, I thought, the perfect size (and explained the two month waiting list). My classmates ranged from quite young to more mature, from very inexperienced to several years experienced, and about as many females as males. Tim and Susan led the class. Tim is a good ol' coon-ass from Louisiana like me, and Susan was born and bred here in North Carolina, and has about the coolest Harley I think I've ever seen (I'm kicking myself because I forgot to take a picture of it!) There was a group of five who signed up together and really set the dynamic for the class. There was Tina, the ring leader and former bus driver (and all around ball of fire), her children Josh and Autumn, and their neighbors Eric and Candy. The way they interact you'd think they all lived under the same roof. Bickerin'est bunch you'd ever meet, but all in good fun, and great people to be around. The class would not have been the same without them.




Josh, Autumn, Candy, Tina and Erick

Tim and Susan were great as both instructors and range coaches. Tim's motto for the class was iterated over and over again, "Set yourself up to be successful." In the classroom there was a mix of material with some good natured ribbing and humor, but once we hit the bikes, it was all business. We started our first range exercises Saturday right around 7 AM to try to beat the heat of the day. As the day went on it got progressively hotter and hotter, we took short breaks between exercises to cool down while Tim and Susan set up the course for the next round. The first few exercises were baby steps, but each exercise built upon the next and by the end of the day, we were practicing slow tight turns with (some) success. Before we called it a day, we had a few more hours of class work (and some laughs).


Tim and Susan

At some point in the classroom Autumn must have been complaining about something or another, because it prompted Josh. "Tim, can you take her, please? How much would we have to pay you to take her?"

"Uh.." paused Tim, "I think I'd rather stand outside in the heat."

Tina: "You may have to!"


I went home that night, sore and heat exhausted, collapsed on the bed and dreamed of obstacle cones.

I didn't bring the MP3 Saturday because I needed the car to haul the lawn chair, umbrella, and other supplies, but today was supposed to be a little cooler so I packed up the MP3 with as much frozen water and refreshments as it could carry and rode it to the course. I couldn't use it on the range during the class, of course, but I thought people would get a kick out of it just the same. I was curious how the transition from the MP3 to the Suzuki and then back to the MP3 was going to go. They definitely have a different feel, but it wasn't a big deal at all.

Seven AM Sunday morning bright and early, and we picked up right where we left off. In one of the exercises where we broke off into two groups of six, Eric was in the first group, and I was in the second group with Candy and Tina and watched while we waited for our turn. Every time Eric came around, he had this big mischievous grin on his face, like the cat with the canary still in it's mouth.

Candy: "Look at him, the show off!"

When the ride was over, Eric (still grinning) retorted, "Now why do you have to pick on me? Can't a man just be happy?"

I seem to recall the phrase "happy my ass" getting thrown in there somewhere. I wish I could begin to remember everything that came out of Tina's mouth. She was a riot.

By noon we were ready to test, and the class decided to go ahead and get the test out of the way before breaking for lunch. Everybody picked a position, and once we lined up, Tim and Susan signaled each of us through one at a time.

When it was all over Tim gathered the class together at the staging area and asked, "Do you want to hear the good news or the bad news?"

"The bad news."

"The bad news is you all passed, so now we have to give you the written test. The good news is it's time for lunch."

I followed Tim riding his Gold wing to BK where we met Kasha and Trisha, and then we all headed back to eat in the air conditioned classroom, where everyone else was already eating lunch and/or doing some last minute reviews.


Trisha and Kasha

After the test, Tim graded the answers, while Susan went over the course results with each of us individually outside the classroom. We were given our MSF cards, and some stayed behind to help collect cones and refuel bikes.



David helps collect cones




Helping Tim prep the bikes for storage


Tim asked to try out the MP3. After briefly reviewing the controls, Tim made a couple rounds on the range and then disappeared around the corner towards the street.


When he returned, he said it was "unique" which I loosely translated to mean that he was now a scooter convert, ready to trade in his Gold wing for 250cc and three wheels because dealing with the clutch and that whole "shifting" thing is overrated.


As I said, it was a loose translation.


When we were all done, I decided to head over to Capital Blvd. to check out Ed McKay's books. I was half way down Capital in the middle of stop and go traffic when... it happened. I laid the MP3 down. The car behind me waited patiently for me to get back up, and a guy in a van pulled up to the side of me to ask if I was alright. I nodded that I was OK. A little shaken, but otherwise fine. The bike was alright, and I decided the best thing to do was to get back on the horse and go the last half mile to my destination. I was more angry at myself than embarrassed.

I stopped under a shade tree, took a deep breath and took inventory. No injury to myself, that was good. There was some scratching on the right edge of the front plastic panel. A very small scratch to the rear panel, and also a nick on the muffler guard. Not very sightly, but that was the extent of the damage. I realized that I was relying too much on the suspension locking mechanism. I thought it had locked, and by the time I realized what was wrong, the bike was already on its way down. I think the take away from this is to always stabilize after stopping. Only after confirming the suspension lock is engaged should you return your feet to the floor panels.

So now I need to figure out a way to either repair the texture on the plastic panel (sounds like a challenge, but I like challenges) or have the panel(s) replaced when I'm ready to get it painted. I've seen mention online about a product called Plastex and Flex Tex, but one is for recreating an existing part, and the other is a paintable texture medium, and neither seems applicable to this situation. I found a book entitled "How to Repair Plastic Bodywork" but I'm a little skeptical about that also. I have a feeling I may be purchasing new panels. You can bet on one thing though. It won't happen a second time.

This morning I went to WRAL's online weather site to get the "MP3 forecast" for the week, and decided to take a look at the headlines for the day.

Motorcyclist Dies After Failing to Stop at Sign

More details from the N&O:

Accident claims life of motorcyclist

It's eerie to think that just as the course was coming to a close Sunday afternoon and everyone was dispersing, this was happening not more than twenty miles away to a young man named Michael. It really hits home why I decided to take this course.

Anyone who rides, experienced or not, should take this course.

Sunday, May 27, 2007

My Piaggio MP3

I am now the proud owner of a Piaggio MP3. At the time of this writing, I've had my MP3 for three weeks now, and I've clocked over 900 miles on it.



It was November 2006 when one of my coworkers piqued my interest in the Piaggio MP3. He owns a 200cc Vespa scooter, and with gas prices on the climb I started asking questions. One morning he pulled up a web site to "show me something cool." As you've probably already guessed it was a 3 wheeled scooter--the Piaggio MP3! As soon as I saw it, I knew I had to have one. I printed a picture and stuck it to my bulletin board at home. I had no idea they were coming to the states, but I just loved to look at it and imagine having one. I even picked out a place in the garage that could be it's home.

Piaggio announced the MP3 open house starting April 19th. As soon as the announcement was made, I went looking for dealers in the area. The BMW dealer sent a double sided brochure with technical specs. This I stuck to my cube in my office.

I actually visited the dealer three times to look at the scooter in the showroom, dragging any and every friend I could coerce to go to look at it with me. The dealer had two MP3's at the time, one graphite and the other silver. Of the two, the graphite was the more attractive of the two, but neither was particularly colorful. What I really wanted was the red scooter I had seen on the web and in the brochure. I asked about getting a red one. The dealer wasn't sure when one might come in, but he'd let me know.

On the way home the thought occurred to me that there must be another dealer somewhere with a red MP3 I could get a look at. A quick Google search revealed a dealer in Aberdeen, NC: Steve Jones Motorsports. After a quick call, I made arrangements to haul a friend with me to Aberdeen to go look at their red scooter the following Saturday.

Steve Jones Motorsports

As soon as I walked into the Steve Jones dealership in Aberdeen, I liked it. The showroom was bright and inviting, and everyone greeted me with a warm welcoming smile.

Tamilla introduced me to David, the manager of the dealership, and brought me out back to see the red MP3 they had just finished putting together. As soon as I saw it, I grimaced. This was not even close to the shade of red shown in the brochure or shown on the Kneeslider web article.

The actual color is really more of a burgundy with some purple in it. My friend agreed, this was not an attractive color. What were those Italians thinking? I considered getting one of these red scooters anyway and painting it later to a better shade, but I just couldn't get over the fact that I would have to ride around on a scooter that hideous red color until I could get it painted.

Oddly enough, one of the candy blue Suzuki SV1000's in the showroom caught my eye. David, the manager, told me the color was called "Plasma Blue." This color really appealed to me, and now the idea of getting the graphite scooter and painting it candy blue was starting to blossom. I'd seen photos of MP3s that were blue and if this had been an available color, I would have gone with it:




David had one graphite scooter, and it was still in the box. The dealer in Raleigh also had a graphite scooter that was already put together, but it already had 250 miles on it. I decided that if I was going to drop seven grand on a scooter, I wanted a new one. The following weekend my coworker drove me down to Aberdeen with his trailer to help me haul the scooter back to Cary.

I have to say that the entire Steve Jones Motorsports staff (Tamila, David, Janet, and their head mechanic Jay) all made this purchase experience very pleasant. They make a great team, and as much as this is going to sound like a plug, I really like these people and recommend this dealership to anyone who is considering buying an MP3. Even though I live an hour away, they always make me feel at home. I really like these guys. You will too.

I got most of my gear (including my Shoei RT-1000 helmet, and FieldSheer jacket, pants and gloves) from Triangle Cycles in Durham. If you need outfitting, Michael in the parts department is your man.

I've had my MP3 for three weeks now, and having gotten to know the bike a little better, I have some observations to offer.

Some Things I've Noticed About the MP3

  1. At slow speeds (at 5 to 10 mph) you don't counter steer--you just steer; however, as you speed up (anything over about 20 mph) counter steering kicks in.

  2. Cornering is a breeze (and a lot of fun). You can slow corner at speeds and radii that would drop an ordinary scooter.

  3. My fuel consumption is right at 63 mpg.

  4. After doing some controlled tests to get a feel for the brakes, I really laid into both the front and rear brakes a time or two. This thing REALLY stops.

  5. Under the seat is enough storage for my backpack, my extra shield, and a few other items. In addition to that there's a trunk (yes, a trunk :) big enough to store my helmet.

  6. On the highway I can generally keep up with traffic without any problems (much to the surprise of some automobiles).

  7. Maybe I just need to get used to it, but the seat becomes a little uncomfortable on rides longer than an hour.

  8. The speedometer registers about 8% higher than the actual speed. I've had it confirmed by multiple sources that this is typical for most motorcycles. For example, when the speedometer registers 75 mph, you are actually going 69 mph.

Some Things I've Noticed About Scootering in General
  1. When the outside temp drops below 80 degrees Fahrenheit, I need the jacket liner to stay warm.

  2. Jeans do not offer a lot in the way of of insulation. I always wear protective pants.

  3. It's hard to hear myself think at 60 mph without earplugs (even with my Shoei RT 1000 helmet).

  4. A bug hit my hand at 65 mph while I was wearing gloves. I can only imagine what it would have felt like without them.

  5. I like the reflective shield on my Shoei RT 1000 helmet. Looks like some kind of alien riding a bike :)

  6. My throttle hand cramps during long rides.

My First Road Trip

The first service for the MP3 is at 620 miles. Getting back to Steve Jones Motorsports was to be my first "long" trip on the scooter. The itinerary included visiting my parents in South Carolina. While there I planned to stop by Junior Freeman's shop (Chesterfield Auto Body and Paint) to get an estimate for a candy blue paint job on the MP3 and do some work with Dad in his shop.

I started out at 6pm Friday from Cary. I filled up a camel pack with water, partially frozen, it so I could stay hydrated on the road. I distinctly remember stopping at the side of the road just prior to taking the entrance ramp to Hwy 1, gathering up some courage and saying to myself, "Well, here we go..."


The trip down was really very nice. For Memorial Day weekend, I was surprised that the traffic was no worse than any other weekend. I do remember having to shift in my seat a few times to while trying to find a comfortable sitting position, and also the cramping in my right hand while holding the throttle open. I vowed that I would never do another trip like this without a cruise control. Once in Aberdeen (my half-way point), I traded my iridium shaded shield (now full of bugs) for the clear one, took a bio break, and put on my jacket liner. The rest of the trip was in darkness and I loved it.

The next morning, I woke at my parent's house and found a note written on a paper towel from my dad: "Robert, I'm down at the shop. Like the bike. Dad."

Dad and I did some work in the shop, and then I headed over to Junior Freeman to see about getting the MP3 painted. Junior showed me some of the Kosmic Kandy colors, and I found a blue that resembled the Suzuki. He said he could even add some extra flake to make it really stand out in the sun. He painted his son's Mustang candy apple red and silver and it was beautiful. He said that if I could get all the pieces removed for him to paint, he could do the job for 350 to 400 dollars, but add 75 for the Kosmic Kandy paint.

By noon, I had made it back to Aberdeen for the first service. More cramping on the throttle hand, so I asked about adding a cruise control. Jay looked at the throttle and concluded that the cheaper 40 dollar unit couldn't be made to work. The more expensive device could be installed but he would need to fabricate a part to get it to work. I told him to go for it. When it was all done, Jay said it was the first cruise control he'd ever put on a scooter :)

The remaining trip home was so much nicer! The throttle still needs adjustments to account for speed variations due to varying inclinations, but all I have to do now is adjust the throttle a few clicks one way or the other, and there it stays.

This afternoon I took the scooter to the car wash to knock off the bulk of the bugs and debris. At home I put the finishing touches with a good wax, Armor All, and tire black. It cleans up nicely :)

I've decided that I'm going to continue riding the heck out of the scooter during the summer months, and then dismantle the shrouding to get painted when it's too cold to ride in the Winter.


In closing, I just have some advice for Piaggio:

Gli Americani hanno bisogno dei colori bellissimi.

Ciao,
Roberto



Wednesday, May 16, 2007

Creating a Custom NAnt Task with Nested Elements

NAnt has built in tasks (e.g., the copy task) that utilize nested elements, and sometimes a custom task utilizing this feature is needed. While it's certainly possible to take advantage of some of the built in nested types already provided by Nant, the bulk of the standard nested types are file related (fileset, filterchain, path, resourcefileset, etc.). If you need something more specific to your application, or if you need vastly different or more complex types, the standard types that come with NAnt are not enough.

Fortunately, creating custom NAnt tasks with nested elements is not much more difficult than creating a standard custom task.

This post we'll walk through the steps to create a task we'll call iis.httperrors. This is a task I created to be able to set the http errors for a specific site on a Windows server.

This type of task is something that can be accomplished using vbscript...

Option Explicit
Dim objIISObject
Dim objHTTPErrors
Dim intIndex
Dim arrOrigHTTPErrors
Dim arrNewHTTPErrors(43)
arrNewHTTPErrors( 0) "400,*,FILE,C:\WINDOWS\help\iisHelp\common\400.htm"
arrNewHTTPErrors( 1) = "401,1,FILE,C:\WINDOWS\help\iisHelp\common\401-1.htm"
arrNewHTTPErrors( 2) = "401,2,FILE,C:\WINDOWS\help\iisHelp\common\401-2.htm"
arrNewHTTPErrors( 3) = "401,3,FILE,C:\WINDOWS\help\iisHelp\common\401-3.htm"
arrNewHTTPErrors( 4) = "401,4,FILE,C:\WINDOWS\help\iisHelp\common\401-4.htm"
arrNewHTTPErrors( 5) = "401,5,FILE,C:\WINDOWS\help\iisHelp\common\401-5.htm"
arrNewHTTPErrors( 6) = "401,7,FILE,C:\WINDOWS\help\iisHelp\common\401-1.htm"
arrNewHTTPErrors( 7) = "403,1,FILE,C:\WINDOWS\help\iisHelp\common\403-1.htm"
arrNewHTTPErrors( 8) = "403,2,FILE,C:\WINDOWS\help\iisHelp\common\403-2.htm"
arrNewHTTPErrors( 9) = "403,3,FILE,C:\WINDOWS\help\iisHelp\common\403-3.htm"
arrNewHTTPErrors(10) = "403,4,FILE,C:\WINDOWS\help\iisHelp\common\403-4.htm"
arrNewHTTPErrors(11) = "403,5,FILE,C:\WINDOWS\help\iisHelp\common\403-5.htm"
arrNewHTTPErrors(12) = "403,6,FILE,C:\WINDOWS\help\iisHelp\common\403-6.htm"
arrNewHTTPErrors(13) = "403,7,FILE,C:\WINDOWS\help\iisHelp\common\403-7.htm"
arrNewHTTPErrors(14) = "403,8,FILE,C:\WINDOWS\help\iisHelp\common\403-8.htm"
arrNewHTTPErrors(15) = "403,9,FILE,C:\WINDOWS\help\iisHelp\common\403-9.htm"
arrNewHTTPErrors(16) = "403,10,FILE,C:\WINDOWS\help\iisHelp\common\403-10.htm"
arrNewHTTPErrors(17) = "403,11,FILE,C:\WINDOWS\help\iisHelp\common\403-11.htm"
arrNewHTTPErrors(18) = "403,12,FILE,C:\WINDOWS\help\iisHelp\common\403-12.htm"
arrNewHTTPErrors(19) = "403,13,FILE,C:\WINDOWS\help\iisHelp\common\403-13.htm"
arrNewHTTPErrors(20) = "403,14,FILE,C:\WINDOWS\help\iisHelp\common\403-14.htm"
arrNewHTTPErrors(21) = "403,15,FILE,C:\WINDOWS\help\iisHelp\common\403-15.htm"
arrNewHTTPErrors(22) = "403,16,FILE,C:\WINDOWS\help\iisHelp\common\403-16.htm"
arrNewHTTPErrors(23) = "403,17,FILE,C:\WINDOWS\help\iisHelp\common\403-17.htm"
arrNewHTTPErrors(24) = "403,18,FILE,C:\WINDOWS\help\iisHelp\common\403.htm"
arrNewHTTPErrors(25) = "403,19,FILE,C:\WINDOWS\help\iisHelp\common\403.htm"
arrNewHTTPErrors(26) = "403,20,FILE,C:\WINDOWS\help\iisHelp\common\403-20.htm"
arrNewHTTPErrors(27) = "404,1,FILE,C:\WINDOWS\help\iisHelp\common\404b.htm"
arrNewHTTPErrors(28) = "404,2,FILE,C:\WINDOWS\help\iisHelp\common\404b.htm"
arrNewHTTPErrors(29) = "404,3,FILE,C:\WINDOWS\help\iisHelp\common\404b.htm"
arrNewHTTPErrors(30) = "405,*,FILE,C:\WINDOWS\help\iisHelp\common\405.htm"
arrNewHTTPErrors(31) = "406,*,FILE,C:\WINDOWS\help\iisHelp\common\406.htm"
arrNewHTTPErrors(32) = "407,*,FILE,C:\WINDOWS\help\iisHelp\common\407.htm"
arrNewHTTPErrors(33) = "412,*,FILE,C:\WINDOWS\help\iisHelp\common\412.htm"
arrNewHTTPErrors(34) = "414,*,FILE,C:\WINDOWS\help\iisHelp\common\414.htm"
arrNewHTTPErrors(35) = "415,*,FILE,C:\WINDOWS\help\iisHelp\common\415.htm"
arrNewHTTPErrors(36) = "500,12,FILE,C:\WINDOWS\help\iisHelp\common\500-12.htm"
arrNewHTTPErrors(37) = "500,13,FILE,C:\WINDOWS\help\iisHelp\common\500-13.htm"
arrNewHTTPErrors(38) = "500,15,FILE,C:\WINDOWS\help\iisHelp\common\500-15.htm"
arrNewHTTPErrors(39) = "500,16,FILE,C:\WINDOWS\help\iisHelp\common\500.htm"
arrNewHTTPErrors(40) = "500,17,FILE,C:\WINDOWS\help\iisHelp\common\500.htm"
arrNewHTTPErrors(41) = "500,18,FILE,C:\WINDOWS\help\iisHelp\common\500.htm"
arrNewHTTPErrors(42) = "500,19,FILE,C:\WINDOWS\help\iisHelp\common\500.htm"
arrNewHTTPErrors(43) = "500,19,FILE,C:\WINDOWS\help\iisHelp\common\500.htm"

Set objIISObject = GetObject("IIS://LocalHost/W3SVC")
objIISObject.HTTPErrors = arrNewHTTPErrors
objIISObject.Setinfo
Set objIISObject = Nothing


... but things get more difficult if you want to implement this in NAnt without shelling out the execution to a separate vbscript.

You might consider executing a series of "exec" commands in NAnt to accomplish this, but you'll discover there is no single command to set an individual http error setting (well, there may actually be, but let's say for the sake of argument that there isn't an easy way to do this atomically). Wouldn't it be great if we could just include lines in a NAnt script to specify these settings?

<iis.httperrors sitename="MySite">
<httperrorset>
<httperror definition="400,*,FILE,C:\WINDOWS\help\iisHelp\common\400.htm">
<httperror definition="401,1,FILE,C:\WINDOWS\help\iisHelp\common\401-1.htm">
<httperror definition="401,2,FILE,C:\WINDOWS\help\iisHelp\common\401-2.htm">
<httperror definition="401,3,FILE,C:\WINDOWS\help\iisHelp\common\401-3.htm">
<httperror definition="401,4,FILE,C:\WINDOWS\help\iisHelp\common\401-4.htm">
...

</httperrorset>
</iis.httperrors>


Good news! We can. More good news! It's not that hard to do.

Define the xml schema



Referencing the nant script above as our guide for a schema, the first line declares the task iis.httperrors with one parameter, sitename:

<iis.httperrors sitename="MySite">


It contains an embedded type, httperrorset which is a set of zero or more httperror definitions:

<httperrorset>
<httperror definition="400,*,FILE,C:\WINDOWS\help\iisHelp\common\400.htm">
<httperror definition="401,1,FILE,C:\WINDOWS\help\iisHelp\common\401-1.htm">
<httperror definition="401,2,FILE,C:\WINDOWS\help\iisHelp\common\401-2.htm">
<httperror definition="401,3,FILE,C:\WINDOWS\help\iisHelp\common\401-3.htm">
<httperror definition="401,4,FILE,C:\WINDOWS\help\iisHelp\common\401-4.htm">
...


If we really needed to get fancy, we could break apart the definition, for example:

<httperror url="C:\WINDOWS\help\iisHelp\common\400.htm" uri="FILE" suberror="*" error="400">


This is not difficult to do either, but the goal of the post is the embeded type itself so I'm going to stick with the simpler case. As an exercise you can make the modifications yourself to accomplish the more complex schema (see hints at the end of this post).

Create the Custom Class



The first steps involve creating a ordinary custom NAnt task. Here's a summary of the steps (but I highly recommend you read and make yourself familiar with Richard Case's blog post on creating custom NAnt tasks).


  1. Create a Class Library project. The assembly name should end in "Task" and you should reference Nant.Core.dll. We'll also be using the System.DirectoryService assembly to do the work, so you can also go ahead and include that, too.
  2. Create a class (or rename the initial class) with the name IISHttpErrorTask

  3. Add the necessary using statements:
    using NAnt.Core;
    using NAnt.Core.Attributes;
    using System.DirectoryServices;

  4. Have the class derive from Task and add the TaskName attribute to the class definition.
    [TaskName("iis.httperrors")]
    class IISHttpErrorsTask : Task
    {

  5. There is only one property to define: sitename (the name of the IIS site on the local machine to update). Add this in the standard way:
    class IISHttpErrorsTask : Task
    {
    string m_siteName;

    ///
    /// The site name as displayed in IIS
    ///

    /// Required.
    [TaskAttribute("sitename", Required = true)]
    [StringValidator(AllowEmpty = false)]
    public string SiteName
    { get { return m_siteName; }
    set { m_siteName = value; }
    }

  6. For now just add a "do nothing" Execute() method. We'll come back to it later.
    /// 
    /// Executes the IISHttpErrorsTask task.
    ///

    protected override void ExecuteTask()
    {
    // TODO: Implement the Execute() method.
    }


At this point, you should be able to build the project. If all goes well, you are now ready to create the nested type!

Creating the Nested Type



Now we need to define what a NAnt "httperrorset" is, and map how the data gets loaded from the NAnt script. Add a new member variable instance to the class we just created:

IISHttpErrorSet m_httpErrorSet;


You won't be able to compile after adding this declaration because we haven't yet defined what an IISHttpErrorSet type is, but we will define that class soon enough. For now though, go ahead and add the HttpErrorSet property and add the NAnt attribute "BuildElement". This attribute tells NAnt that there is additional instance data in the IISHttpErrorSet class to load from the script.

/// 
/// Used to specify the HttpErrorSet to configure.
///

[BuildElement("httperrorset")]
public virtual IISHttpErrorSet HttpErrorSet
{ get { return m_httpErrorSet; }
set { m_httpErrorSet = value; }
}


Ok, if you are like me, having dangling class definitions like IISHttpErrorSet is something that just nags at you, so let's get to it. Create a new class called IISHttpErrorSet, add the necessary using statements:

using NAnt.Core;
using NAnt.Core.Attributes;


Derive the class from DataTypeBase and also add the NAnt attribute "ElementName".

[ElementName("httperrorset")]
class IISHttpErrorSet : DataTypeBase
{


So now you can start to see how NAnt pulls all this together. In the IISHttpErrorsTask we declared a property with a BuildElement attribute, and we have just created a class with an ElementType attribute, and both have the same value. This essentially maps these guys to each other, allowing NAnt to build the "httperrorset" from the data in the script. Cool, huh? This should all compile without errors now, but we're not done yet. NAnt has no idea what kind of data belongs to this thing we have defined as an "httperrorset" so it's now time to get that going.

If you peruse the NAnt classes in the Object Browser you'll notice that NAnt has a convention of adding all the classes for their nested types in the NAnt.Core.Types namespace, whereas the tasks can be found in the NAnt.Core.Tasks namespace. You can (and probably should) adopt a similar convention for your own embedded types; however, for the purpose of making this example easier to follow, I've simply added the nested types to the same assembly as the task.


If we say that an "httperror" definition is essentially a string, we can define our "httperrorset" implementation as a collection of strings. Add a member variable to the IISHttpErrorSet to reflect this:

private StringCollection m_httpErrors = new StringCollection();


To make it easier to "get at" this collection from another class, let's go ahead and define a read-only property:

/// 
/// Gets the collection of HttpError strings
///

public StringCollection HttpErrors
{
get { return m_httpErrors; }
}


To have NAnt build this collection from data in the script we need to define a specialized property. This property has an the BuildElementArray attribute "httperror" defined.

/// 
/// The items to include in the httperrorset.
///

[BuildElementArray("httperror")]
public HttpError[] HttpErrorElements
{
set
{ foreach (HttpError httpError in value)
{
HttpErrors.Add(httpError.Definition);
}
}
}


Ok, I pulled another one of those dangling definitions. The HttpError type is undefined, so this will not yet compile. If we're just loading a bunch of strings and we've already defined an httperrorset as a collection of strings, why do we need this extra type? Because it will help us set up a complex element type later (if we need one).

We're going to define the HttpError type as an embedded class which derives from Element:

[ElementName("httperrorset")]
class IISHttpErrorSet : DataTypeBase
{
...

public class HttpError : Element
{
private string m_definition;

///
/// The http error definition.
///

[TaskAttribute("definition", Required = true)]
[StringValidator(AllowEmpty = false)]
public virtual string Definition
{
get { return m_definition; }
set { m_definition = value; }
}
}


This class has a single member variable (the string which defines the error) and a single read/write property for get/set operations. Notice also that the property has TaskAttribute and StringValidator attributes very similar to the TaskAttributes we've seen before.

Testing what we have so far



At this point you should be able to compile the assembly. You can test that the data gets loaded properly by adding the following to the Execute() method:

protected override void ExecuteTask()
{
foreach (string httpError in m_httpErrorSet.HttpErrors)
{
Project.Log(this, Level.Info, String.Format("Found httperror: {0}", httpError));
}
}


I'm going to follow up the implementation of the Execute() method using ADSI in a later post. There's actually a lot of ground to cover there and I don't want to shift the focus of creating the framework for the custom NAnt script nested types.

More complex Elements



I mentioned earlier in this post that it should be possible to create a more complex type for the "httperror" element:

>httperror url="C:\WINDOWS\help\iisHelp\common\400.htm" uri="FILE" suberror="*" error="400">


By now, it should be pretty obvious how you might go about this. In the embedded HttpError class we just added, just add some additional member variables and properties with the necessary TaskAttributes for each of the parameters. Presto. You now have a class that represents a complex element. Have fun!