Introduction: Sailing Demonstrator

I am a relatively new sailor. I've fallen pretty hard for the sport and am getting involved with my own boat as well as helping a local nonprofit educational program. In the course of learning about sailing and watching others learn to sail, I realized that for some people it's really hard to get a handle around the variability and movability of wind direction versus boat orientation. For people used to driving a car which goes where you want it to go sailing can be really challenging. The experience of having to constantly reorient yourself to an invisible force, and make adjustments to the boat heading to respond to the wind while also dealing with an inverted steering process (you turn a tiller away from your intended direction) are very confounding.

During basic sailing classes, instructors often use a simple top-down 2d model of a sailboat to illustrate wind direction, boat orientation and sail position (close hauled, close reach, beam reach, broad reach, run) and sailing actions (tacking, jibing).

I thought it would be great if students could have a way to play with all of this in real-time without being on the water in a boat (which can be scary at first). So I created the sailing demonstrator. There's a few well-developed sailing simulators for computers that have a lot of features and functionality, but this demonstrator is intended to show basic sailing concepts in a hands-on way.

The current instructable is for my first prototype. It's not as pretty or lean as I'd like to make in time (hence the final step), but it does what I want.

Currently the demonstrator has the following features:

  • A potentiometer is used as the tiller and drives a stepper motor for the sailboat (with 360 degree rotation)
  • Another stepper motor is connected to an aluminium bar arm that has a fan on top of it which generates wind and can move over about 180 degrees to provide variation in wind direction.
  • A bicolor matrix is used to show which of 4 modes is currently active.
  • There are 2 momentary push buttons used to adjust wind orientation during.
  • There is 1 momentary button for changing modes.
  • There are 2 latching push buttons to power on or off the Uno and motorsheild battery packs.

I built up the current arduino over a lot of trial and error and currently includes the following features:

  • State machines to allow more dynamic multitasking of elements such as the tiller, wind motion, and modes.
  • The speed of boat turn is proportional to degree tiller position
  • The tiller action includes some drift when coming to center to reflect delay in boat motion in the real-world.
  • One of the modes includes random movement for the wind position with delay to create a "game" option for setting position under time-pressure.

The four modes for the demonstrator are currently:

  1. Just tiller active: Wind buttons do nothing so you can start out just playing with the tiller to get a feel for movement and setting sail position.
  2. Tiller and wind adjustment: the two wind buttons can be used to move the wind orientation around the boat so a student has to reorient their sail position relative to that new wind direction.
  3. Random wind movement: After getting comfortable with setting sail positions in different orientations, this mode turns the process of resetting wind orientation into a bit of a game by automatically (and randomly) moving wind orientation with a fixed delay so a student can try to set various sail positions quickly.
  4. Swapped tiller control from boat to wind: this last mode is designed to replicate the feeling of changing positions more than the details. When you are on a sailboat and you shift position, it functions as if the wind moves not the boat. So in this mode the tiller controls the wind directio not the boat which remains fixed, and counterintuitively, the wind position moves opposite to the boat. Because of the mechanics of this build, you can only move the wind about 180 degrees, simulating more of a tack to tack than all points of sail.

I've had a lot of fun creating this demonstrator, and I plan to bring it to our club's sailing classes to see if real students benefit from it. There's a lot of refinements to be made (a nicer sailboat with more dynamic sail responsiveness, a lighter and more streamlined enclosure), but it really does the job it was meant for. I hope you enjoy it and I'd love to hear any feedback.

Supplies

  • Electronics
  • Arduino Uno
  • Motorshield
  • 2 stepper motors
  • 2 stepper motor flange couplings
  • Potentiometer
  • 8x8 bicolor matrix
  • 3 momentary push button switches
  • 2 latching push button switches
  • 2 battery packs (1 for motorsheild, 1 for Uno)
  • 5v fan
  • 1 PN2222 Transistor
  • 1 1N4001 diode
  • 1 270 Ω Resistor
  • Lots of jumper wires
  • Soldering iron and soldering wire
  • Mechanical & Structural
  • Wood for enclosure (thickness and specific dimensions will vary depending on your box design)
  • 2 @ 12" x 16" for the top and bottom
  • 2 @ 16" x 5.5" for the long sides
  • 2 @ 12" x 5.5" for the short sides
  • 3 hinges
  • 2 magnetic cabinet catches
  • Aluminum flat bar for wind arm (approximately 12" long by 1" wide )
  • Small screws (to assemble box)
  • Small bolts and nuts (to attach the sail boat and fan to the stepper flange and wind arm respectively).
  • Balsa wood (4" x 2" x 1") and dowel (4") for sailboat
  • Empty disposable pen sleeve with cap
  • Cloth and string for sail and main sheet
  • Wood for tiller
  • Wood glue
  • Paint & varnish
  • Brush cleaner
  • Tools
  • Vise to bend flat bar
  • Drill and bits for putting together enclosure and for cutting holes for buttons, motor shafts, etc.
  • Screwdrivers for adjustments
  • Allen keys for stepper motor sleeves
  • Jigsaw with wood and metal bits
  • Dremel with various routing or smoothing bits
  • Hot glue gun
  • Chisels
  • Exacto
  • Sandpaper
  • Small paint brushes

Step 1: Build Enclosure

A few process / design notes upfront.

  • I started out developing this on a plastic lid with legos and glue gun to get it figured out. That was a very ugly but helpful process. So I'm reverse engineering instructions by suggesting you build the enclosure first, but if you know where you're going (I didn't), it makes sense to start with this step.
  • It doesn't really matter what kind of box you put this all in. The only important parts are having room for the wind arm to move and to fit everything inside. For my box, I was using wood I had on hand which determined the height of the box. I did end up having to route out the wood bit to fit the buttons and potentiomter as my top piece was kind of thick. If I was starting over I'd use lighter weight wood.
  • The wind arm takes some care. It has to be as light as possible so your stepper motor can turn it easily. It should also be as narrow as possible while not deforming under the weight of the fan.
  • The other determining factor was the size of the stepper motors. I wanted the boat and the wind arm to be centered one on top of the other, so I had to have enough height to for both stepper motors and room between them for the arm to come off if needed.
  • There's also flexibility in layout of the buttons, tiller, and bicolor matrix. Now that I have it built, I think I'd move things around a bit (moving maxtrix closer to the tiller, putting mode button closer as well).
  • I also added hinges and a side access door after the fact. I think there's likely neater ways to retain access to the inside than I went with.

So with all that in mind, here's some basic steps to building the enclosure.

  1. Layout elements: First you want to figure out the overall scope of the design which involves determining the rough size of your boat and the swing of the wind arm. That will determine the width of the box and the approximate length. For depth, measure the height of each stepper motor and leave room between them so the wind arm can come off (~1"). I ended up with a width of 12" and length of 16" and a height of 5.5". Mark all the holes. Draw the radius for your windarm and a square for the bicolor matrix. For the radius, draw two radii approximately 1/2" apart so your windarm has room to swing.
  2. Cut wood panels: with height width and depth you can then cut the top, bottom, and four sides of the box. With my design I had the long sides full-length and the short sides fitting between them. If you are going with a hinged access door on one end, you want to cut one of the short sides of that panel at 45 so it can close. I saved the cutoff piece and used it as a stopper for the door when closed.
  3. Drill holes: Based on your layout, drill holes for each button and the boat stepper motor shaft.
  4. Cut bicolor matrix square: Drill pilot holes for your jig saw on two corners of the square. Cut from the hole along 2 sides, then repeat from the other hole. Clean up your cuts so it's clean and square. Sand as needed to ensure a snug fit for your matrix.
  5. Cut path for wind arm: This is a bit of careful work. I have a pretty rough jigsaw, so I ended up cutting this, and then sanding it a lot with a dremel to get the swing right. If you have your windarm material, you will need this to be wide enough that the arm can swing freely. I had a piece of 1.5" aluminum flat bar that I tapered to about 1/2" for the section that went through the box top. That required a path width of about 1/2" A smaller width of windarm would require less space, but given the tolerences I was working with, more room is better.
  6. Assemble box: Once you have your top, bottom and sides. You can sand edges and then start to assemble. Using clamps, glue, and screws, put the top and 3 sides of the box together as squarely as possible. Leave the floor and access side off for now.
  7. Shape wind arm: A major piece of the enclosure is the cutout for the windarm. So while it's not part of the enclosure itself, I suggest shaping your windarm as you build the enclosure to be sure it will work OK. Once you ahve the basic box built (top attached to sides). You can position the stepper motor that will hold the wind arm (centered under the hole for the sailboat stepper motor shaft) and work on shaping a wind arm that moves easily in the opening. I used a single piece of aluminum bar bent in 3 places to create an "L" shaped arm with a small flat top to attach the fan to. Measure the distance between the center of your stepper motor shaft and the center of the path in the top of the box. Your windarm should be long enough at the base to have overlap your stepper motor flange (so you can drill holes to attach it) and then bend 90 degrees upwards through the center of your path hole. It should be tall enough that the base where a fan will sit is about level with the bottom of your planned boat. this way most of the wind from the fan will hit the sail area of your boat. During this process you will likely need to tweak your wind arm and also likely make adjustments to the path the arm is traveling through in the top of the box to allow for free movement. Note that you want enough clearance to allow for the wiring for the fan to pass through as well.
  8. Add hinges and latches: Use 2 hinges to attach one of the long sides of the box to the floor and 1 hinge to attach the access door to the side. Install whatever latches you want (I went with magnets) to make sure the box and access door stays closed.

Step 2: Build Sailboat Parts

Now you can turn to the sailboat. Again a few notes on my process and design:

  • I was using a lot of on-hand materials and built it up and then refined it a bit. Starting from scratch, I'd be more intentional about the materials for the wind arm, the tiller, and the sail boat itself.
  • The sailboat can be as detailed or simple as you like. I started with just a flat piece of balsa and a paper sail, and then evolved it to a more boat shaped piece of balsa with a cloth sail.
  • I have yet to figure out how to create an active "sheet" to trim the sail properly as it turns, so for now, I'm just using thread which allows the sail to move freely from close hauled to fully sheeted out. I've thought about using springs or rubber bands, but the sail and fan are so small that anything too rigid won't move.

On to the boat parts

  1. Cut and shape sailboat: This is a place to have some fun. You could use a toy boat from a hobby shop or build something new as I did. If you shape your own boat, I suggest you keep it simple and sturdy. Leave enough width to run bolts from the deck to the flange for the stepper motor.
  2. Build mast and boom: It's important that the sail move easily around the boat. I came up with a simple and cheap approach that worked pretty well. I took a ballpoint pen case, put a bead of hot glue in the cap and stuck a small push pin that I'd cut some of the pin part off of into the cap. This created a sleeve that could sit on the mast and move easily in 360 degrees. For the boom, I used a toothpick hot glued to the mast sleeve. Make sure the boom and mast sleeve are at 90 degrees to each other. Place the boom just about 1/4" above the end of the mast sleeve so there's clearance below for the sheet to move. For the mast itself, I used a dowel hot glued to the deck of the sailboat. This is another place to make sure it's 90 degrees both forward and back and side to side so the mast sleeve moves evenly around the mast. I reinforced the mast with a small triangular piece of balsa forward of the mast.
  3. Cut tiller and fit to potentiometer: this is another place I had some fun. I started with just a simple lego piece hot glued to a potentiometer knob. But then I decided for aesthetics (and because I had some nice wood lying around) I'd make something that looked more like a tiller. So I shaped and sanded a tiller handle with a bit of a rudder coming off the end. I made it thick enough at the base to fit the potentiometer, and cut out a knob top and inserted that into the base of the tiller so it could fit nicely on top of the potentiometer.
  4. Paint or varnish the boat and tiller: I used varnish to make the tiller and sailboat look nicer. A few coats with sanding between coats can make a real difference in how it looks (and holds up).
  5. Create sail and sheet: For the sail, I cut some very lightweight cloth into a sail shape and then hot glue gunned it to the mast. I also glued it to the end of the boom. I also used a piece of sewing thread as the sheet, glueing it to the end of the mast and using a very smal bolt and nut to hold it to the deck.

Step 3: Install Electronics AND Mechanical Pieces

Now we can move on to the functional side of the demonstrator. Note the schematic I've included used Fritzing to layout the wiring and structure. The only motorshield in Fritzing is the rotoshield, but I was using the Adafruit motorshield so the layout is slightly different.You will note in the diagram and the one picture, that I wired the fan through the resister, diode, and transisters off the breadboard. The 9V battery is powering the Uno directly, while the 1.5v battery pack is powering the motor shield.

Place stepper motors: Each of the stepper motors should be placed centered on each other. If using the same motors as I did, I used stepper motor enclosures for the one to control the wind arm because it provided a way to screw the motor to the floor of the enclosure. This stabilizes it since it's taking more force than the one controlling the sailboat. For the sailboat motor, I simply hot glued it into place in this version. A more permanent solution would involve mechanical attachments. But this was sufficient for now.

Place the Ardunio: Since this box can fully open from the hinged side, it's not critical where you place the ardruino, but I opted for a location closer to the buttons and tiller since more of the electronics and wiring are on that side of the box.

Place battery packs: This build uses 2 battery packs to operate without an ac power supply. One powers the arduino and the other the motorshield. Again placement is not critical, but easy access to changing batteries when the top is open is a good idea as is ease of wiring.

Attach buttons, potentiometer, and bicolor matrix: With your cutout and holes already complete, inserting the buttons, potentiometer and bicolor matrix are relatively easy. The potentiometer and the buttons I used all have threaded nuts to secure them. The bicolor matrix was hot glued into place, though it does have holes for small screws if you have them. As noted above because of the thickness of wood I used, I had to route out the underside of various holes to make sure the pieces could fit properly, but if you use a thinner wood for the enclosure this would not be an issue.

Attach fan: Now you can secure the fan to the wind arm and run the wiring through it. I used small bolts to attach the fan to the wind arm and then drilled small holes for the wiring to run down and along the wind arm to about the center where it attaches to the stepper motor. This was useful so the wireing wouldn't snag while the arm was swinging back and forth.

Wire up: Once the parts are all in place you can wire up the pieces as needed. I found that given the swing distance of the top to the floor of the box I added a lot of jumper wires to give everything room to move. I also pulled the fan wiring off the breadboard so I could get the various pieces solidly connected.

Step 4: Upload and Tweak Code

Now comes the real adventure seeing if it works and how.

  • Upload the code: Use the attached .ino file. For initial testing you may want to leave the box open, with the wind arm unattached (but with the fan wired).
  • Test all features: Check your power buttons. Do they light up the arduino and the motorshield? Do the fan and bicolor matrix start up? Now try the tiller. Does it respond? Does it turn appropriately (the boat should turn the opposite direction from the tiller). Press the mode button so the matrix displays "2." try the directional buttons. Does the wind arm move appropriately.
  • Refine as needed: it's very likely your exact setup may not align with the variables and operating parameters in my code. Your motors may move faster or slower, there may be more steps per revolution. Your windarm might have an easier or harder time turning. Some of the key variables to toy with include:
  • int baseSpeed = 5 // this is the base stepper motor speed for most modes for the windarm.
  • int slowSpeed = 1 // this is the slower stepper motor speed for the mode three and mode four.
  • int lowAngle = 80 // this sets the lower end of the window for a "neutral" tiller.
  • int highAngle = 100 // this sets the upper end of the window for a "neutral" tiller.
  • const int maxMomentum = 18  // Maximum momentum after the tiller goes to neutral. Controls the 'drift' effect
  • int buttonStepCounterMax = 50 // max total steps in any one direction. Controls how far in mode 2 the wind arm can move. This helps it not bump up against the end of your cutout.
  • int pauseDuration = 2000 // For mode three this controls the length of time the wind pauses in one position.
  • int random1 = 10 // For mode three this is the lower end of random steps in one direction.
  • int random2 = 60 // For mode three this is the upper end of random steps in one direction.

Step 5: Modify, Refine, and Share!

Once you have a working demonstrator you can start to explore and play with features. You can design new modes that operate a little differently. You can try to refine the sailboat to be more responsive. Here's some ideas I'd look at implementing in a next version

  • Figure out how to implement dynamic "sheeting" for the main sail: It would be ideal if on a close haul the sail was sheeted in so the angle of the sail to the wind was more accurate. I think with some micro motors and a bluetooth arduino card it might be possible, but it might require a much larger sailboat. A simpler solution might be to use elastic or a spring with a stronger fan to have the sail "sheet" out under tension and then spring back to a close hauled position when the wind is less direct to the sail.
  • Create cleaner, smaller and lighter enclosure: My box is pretty heavy and big. It's also pretty unpolished. I'd like to start over with thinner wood (or even aluminum to reduce the weight significantly). I'd reconsider the placement of the steppers to lower the height needed, and make sure to build it up with cleaner cuts and edges so it came out with a much cleaner look.
  • Add a jib: There's no reason the sailboat couldn't include a jib that was also responsive to the wind.
  • Figure out how to have more dynamic visual feedback / guidance: I'd love to see if I could add prompts for mode three (e.g. directing a person to a particular point of sail), but so far the LED refresh really slows things down, so I've kept it to a minimum. Better coding might allow for more dynamic use of a screen.

That's just some ideas. I hope you have some fun with this project. I know I have. If you try it out and take it further I'd love to know.

Anything Goes Contest

Runner Up in the
Anything Goes Contest