WB8NBS

NBS
This Blog will document projects I have
in progress or completed. You can search for my
handle on Flickr, Facebook, YouTube, or Picasa
for photos. I will link some of those here.

Fun With Direct Digital Synthesis

You know that good feeling you get when a project comes together? Thats what I felt when I saw this sine wave on my oscilloscope.  It’s a Pulse Width Modulation (PWM) signal generated by an Arduino using a Direct Digital Synthesis (DDS) technique and a lookup table of amplitude values. It was the result of searching for a way to improve the tone quality of a morse code keyer project and I had gotten half wave, then quarter sine wave symmetry working in a demonstration sketch.

Quarter Wave Symmetry

Quarter Wave Symmetry
1000 Hz 256 Step Table

 

Digital to Analog Conversion is best done with optimized precision circuits. The relatively simple processor in an Arduino does not have a DAC device but it can do Pulse Width Modulation which can, in most cases, do the job adequately.

Pulse Width Modulation is widely documented. Basically it is a technique for generating an analog voltage from a digital signal. The device generates a high speed pulse train with varying pulse widths.  This is fed through a filter circuit which averages the energy in the pulses.  Fat pulses average to a higher voltage, skinny pulses average to a low voltage. By changing the pulse width over time, digital software can create a good analog representation of an arbitrary periodic signal. Other interesting applications are possible.

An Arduino generates PWM by setting up a timer. This is a counter with a circuit to trigger an interrupt at a specified count. The counter is incremented by the processor clock or, through a prescaler, a submultiple of the processor clock.  PWM is achieved by the Interrupt Processing Routine (ISR) manipulating the specified count at which the timer fires. DDS applications synthesize an arbitrary waveform by using a lookup table of values that the ISR accesses sequentially to change the terminal count.

Common non-DDS applications might be dimming an LED , feeding an RC servo, or controlling the speed of a motor, and the Arduino environment has a convenient analogWrite() function that handles all the details for you. Hybrid cars use PWM to control the traction motors.

I found many articles on generating DDS sound using the Arduino platform. I picked one from KO7M as a base to learn more about the method. Read Jeff’s weblog entry with source code here. His sketch sets up timer 2 for PWM with a 32 KHz base frequency.  Timer 2 is normally used by the Arduino for the tone() function and since my aim is to supersede the tone() function with something better, his example was a perfect starting point. In this article, I will only describe the changes I made in Jeff’s Interrupt Service Routine (ISR) and in the tables. Details of setting up the timers are covered in the source code and in many Internet sources. Here is a drawing of the Arduino connections:

Schematic for DDS Demo

Schematic for DDS Demo

Only five external parts needed including a button switch that stops and starts the sweep.

My test bed started out simple but it grew some (gruesome?).

Test Bed

Test Bed

Part 0: Analyzing and Parting Out the KO7M Sketch

After confirming that the sketch actually worked, I added code to sweep the frequency range from 50 to 2000 HZ so I could hear what it would sound like, and observe fidelity on my oscilloscope. Later I also added lines to generate a pulse at the start of the sine wave on a different pin. Using this pulse as an external sync source allowed the scope to display a steady waveform. I removed the sync code in the examples in this post for clarity.

This is the ISR from the original sketch (with small changes by me). TuningWord is the only parameter passed from the main part of the program. It is adjusted to set the particular PWM output frequency desired:

ISR(TIMER2_OVF_vect) {
  byte sine_table_index;
  static uint32_t phase_accumulator;
  
  // Update phase accumulator and extract the sine table index from it
  phase_accumulator += tuning_word;
  sine_table_index = phase_accumulator >> 24;  // Use upper 8 bits as index

  // Set current amplitude value for the sine wave being constructed.
  OCR2A = pgm_read_byte_near(sine256 + sine_table_index); 
}

Note Jeff is storing his sine table in flash memory. If you’re not familiar with that technique, read this tutorial. It is a good method for reducing the RAM footprint of an Arduino sketch. You can find my version of Jeff’s sketch here.  This is the 1000 Hz output from the original sketch with floating point math:

Original Floating Point

Original Floating Point
1000 Hz 256 Table

Part 1: Integer Conversion and Multiple Sine Tables

At this time, all floating point math in the example was converted to integer. To my surprise, it still works. There is more jitter on the waveforms due to integer truncation, but for keyer sidetone it is acceptable and the sketch sized dropped by about half.

I wanted to experiment with multiple lookup tables to get an idea of the minimum memory footprint possible while still producing acceptable sound. Libre Office Calc easily produced data with a 0-255 range for tables of length 256, 128, 64, 32 and 16 samples. See my spreadsheet here. Calc could also graph the tables to show how rough the waveform might be.  It was a simple matter to paste a table column into VI and join the values into C style  statements. These lines of data were inserted into the sketch and wrapped with #ifdef and #endif statements. At the top of the sketch is this code:

// Table sizes. Uncomment one and only one
//#define Table256
//#define Table128
#define Table64
//#define Table32
//#define Table16

Which allows me to choose a table size to evaluate at compile time. The wrapped tables look like:

#ifdef Table16
// 16 samples per period
#define Bits 12               // # of bits to shift 
PROGMEM prog_uchar sineTable[16] = {
  128,177,218,245,255,245,218,177,
  127,79,38,11,1,11,38,79
};
#endif // Table16

Bits is a constant definition that controls how far the ISR has to right shift the phase accumulator variable so the number that remains does not exceed the sine table size.

The interrupt handler changed little and looks like this:

ISR(TIMER2_OVF_vect) {
byte sineTableindex;
static unsigned int phaseAccumulator;

  // Update phase accumulator and extract the sine table index from it
  phaseAccumulator += tuningWord;
se
  // Right shift because we're only using the most significant bits of the INT
  sineTableindex = phaseAccumulator >> Bits;

  // Look up current amplitude value for the sine wave being constructed.
  OCR2A = pgm_read_byte_near(sineTable + sineTableindex);
}

Code for this full table sketch is here. These are waveforms from the Integer version:

Integer Version

Integer Version
Three Table Sizes

Part 2: Using Half Wave Symmetry of Sine Waves to Reduce Table Size

During my Google research I found articles pointing out that the size of the sine table could be reduced by a factor of two or four if you exploited the symmetry of a sine wave. Several pages described how to do this in FPGA hardware but I could not find a good example of symmetry use in C code and nothing at all for an Arduino. I tackled symmetry in two stages.

For half wave symmetry it is only necessary to duplicate the first half of the wave for the second half, inverting the second half as it is generated. First you need to know which half is being processed during the interrupt. The Most Signifigant Bit (MSB) of the phase accumulator variable has that information. It will be zero in the first half of the sine wave, one in the second half. I added a variable to record this bit and use a mask of 0x8000 to extract the bit. Then a new constant MSBMask was created inside the table definitions to turn off the high order MSB during table lookup. The tables now look like this example:

#ifdef Table16
// 16 samples per period
#define Bits 12
#define MSBMask 0x07
PROGMEM prog_uchar sineTable[8] = {
 128,177,218,245,255,245,218,177
};
#endif // Table16

Note the table sizes are half the original. This 16 stepe per period table is now only 8 bytes long.  The modified ISR with half wave symmetry now looks like:

ISR(TIMER2_OVF_vect) {
byte sineTableindex;                     // calculated index into sine table     
static unsigned int phaseAccumulator;    // running total of phase offset
unsigned int whichHalf;                  // for sine symmetry switching

  // Update phase accumulator and extract the sine table index from it
  phaseAccumulator += tuningWord;
  whichHalf = phaseAccumulator & 0x8000; // record which half of wave

  // Right shift because we're only using the most significant bits
  // of the INT. Leave only enough bits for one half table range
  sineTableindex = (phaseAccumulator >> Bits) & MSBMask;

  // Set current amplitude value for the sine wave being constructed.
  OCR2A = pgm_read_byte_near(sineTable + sineTableindex);

  // invert the second half of sine wave
  if(whichHalf) OCR2A = 255 - OCR2A;
}

The only additions to the ISR were the whichHalf variable, MSBMask which is defined with the sine table to remove the MSB, and the if statement at the end which does the actual inversion.

Code for the half wave symmetry version is here. These photos are from the half wave version:

Half Wave Symmetry Version

Half Wave Symmetry Version
Three Table Sizes

 

Part 3: Using Quarter Wave Sine Symmetry to Reduce Table Size

Exploiting quarter wave symmetry is more complicated. It is a left/right symmetry while half wave symmetry is up/down. First you have to know which quarter of the wave is being generated. The second most significant bit in the phase accumulator variable has this information. It will be 0 if in the first or third quarter, 1 if second or fourth. A new state variable and a mask of 0x4000 records this bit.  Since we are using less of the lookup tables, the MSBMask is smaller, it now needs to discard two MSB bits. The tables now look like:

#ifdef Table16
// 16 samples per period
#define Bits 12
#define MSBMask 0x03
PROGMEM prog_uchar sineTable[5] = {
  128, 177, 218, 245, 255
};
#endif // Table16

Note that the sixteen sample table has been reduced to five (not four) bytes. The 256 level table is only 65 bytes long! The odd byte at the end was necessary to work around a glitch – the table read from flash would look up the same value twice at the beginning and end of the even quadrant. Adding one to the index and one extra table byte solves that issue. The ISR now looks like this:

ISR(TIMER2_OVF_vect) {
byte sineTableindex;                     // calculated index into sine table     
static unsigned int phaseAccumulator;    // running total of phase offset
unsigned int whichHalf;                  // for sine symmetry
unsigned int whichQtr;                   // for sine symmetry
static boolean pulsed;                   // for unique scope sync

  // Update phase accumulator and extract the sine table index from it
  phaseAccumulator += tuningWord;
  whichHalf = phaseAccumulator & 0x8000; // record which half of wave
  whichQtr =  phaseAccumulator & 0x4000; // record which quarter of wave

  // Right shift because we're only using the most significant bits
  // of the INT. Leave only enough bits for one quarter table range
  sineTableindex = (phaseAccumulator >> Bits) & MSBMask;

  // Look up current amplitude value for the sine wave being constructed.
  if(whichQtr) {                         // in second or fourth quarter
  // +1 works around a glitch where same data at the quarter 
  // transitions was looked up twice in a row
    OCR2A = pgm_read_byte_near(sineTable + (MSBMask - sineTableindex + 1));
  } 
  else {                                 // in first or third quarter
    OCR2A = pgm_read_byte_near(sineTable + sineTableindex);
  }
  // invert the second half of sine wave
  if(whichHalf) OCR2A = 255 - OCR2A;
}

This code does quarter wave symmetry first, then wraps half wave symmetry around that for the final output.  The changes to add quarter wave are the whichQtr variable and it’s masking line, and the if(whichQtr) statement which inverts the table lookup left to right. MSBMask in in the byte read statement because it is the number of steps that exactly form a quarter of the wave form.

Code for the quarter wave symmetry sketch is here. Here are scope traces of the quarter wave symmetry version:

Quarter Wave Symmetry Version

Quarter Wave Symmetry Version
Three Table Sizes

 

Conclusion:

These changes to the original Interrupt Service Routine allowed the table sizes to be reduced by a factor of four with hopefully, not too much additional overhead. Any ISR overhead added is executed 32000 every second so you have to be conservative.  CPU time in the ISR is traded for a smaller program.

All three of these sketches can be useful for arbitrary waveform synthesis by constructing an appropriate table.  The base sketch would work for any periodic waveform, including those that have no symmetry either up/down or left/right. A sawtooth wave for example.  Half wave symmetry would be good for representing an underdamped or overdamped square wave.  Quarter wave symmetry works for sine waves, as shown here, or a triangle wave.

The oscilloscope traces are interesting by themselves. These sketches and a scope could be used to demonstrate microcontroller techniques at your local science fair. My scope is an 80’s vintage Tektronix clone. On the screen you can see the generated sine waves and by zooming in, see the artifacts of PWM happening at a 32 KHz rate. Use the coarse 16 step table and the staircase model of DDS is clear. You can view the raw PWM by simply disconnecting the 0.1 Ufd integrating capacitor from the scope input. Interesting though, disconnecting the filter capacitor does not affect the audio much because your ears can’t respond to 32 Khz sound.

DDS quantization is most visible at low frequencies, using the smaller tables. Here you can clearly see the 16 steps and 32Khz fuzz on the trace.

50 Hz 16 Step Waveforms

50 Hz 16 Step Waveforms

 

Footnote:

The 64 step sine synthesizer with quarter wave symmetry was successfully added to my keyer project.  I see no degradation of the morse timing at 50 WPM.  A brief video is here.  Also I recorded MP3s of the tone before and after.  The tone produced by the stock Ardino tone() function is here.  The tone from the 64 step (16 values) DDS function is here.

 

Arduino Based Iambic Keyer(s)

Version 1.0 – ATTiny85 Port

Richard Chapman KC4IFB published an article in the Sep/Oct 2009 QEX magazine (subscription required) for constructing an Iambic Keyer on the Arduino platform. I downloaded his code from the QEX web site (ARRL membership required) and found it worked well.  I have not been active in Ham Radio for years and my morse code is seriously rusty, so I decided to build a keyer for practice purposes and maybe to use on a real radio some day when I figure out how to get an antenna up on this small lot.  I have a WB4VVF Accu-Keyer I used with my homemade paddles long ago.  I bought the PC board from WB4VVF himself at the Dayton Hamvention.  Chapman’s keyer implementation on the Arduino Uno felt exactly the same and I had no problem getting used to it.

I wanted to see if this code would run on an ATtiny85 chip. These are beautiful little microcontrollers in an 8 pin DIP package. They have 8K of internal flash memory and with a minor bit of library downloading, are programmable via the Arduino IDE.  There is a catch though, tiny85 does not normally have bootloader code like a formal Arduino does so you need additional circuitry to burn your sketch onto the little chip. In July 2013 Jim Williams from Workshop 88 in Glen Ellyn conducted a class in tiny85 programming which I attended. At the end of the class we all had our own Arduino ISP adapter board and could burn a tiny85 by using an Arduino UNO as an intermediary.

I amped up my ISP adapter by adding a ZIF socket. It also can program the ATMega328 chips by moving five jumpers.

ISP programmer for ATtiny85 and ATMEGA328 microcontrollers

ISP programmer for ATtiny85 and ATMEGA328 microcontrollers

With the ISP programmer working, I was ready to work on the tiny85 port.  I found Chapman’s code worked but there was no side tone generated.  After a few hours debugging I noticed Chapman’s code was turning the tone on in every iteration of loop(). The tiny85 did not like that. I just added a flag so tone was turned on once, then left on, and the tiny85 port was working 100%. In the end, a very minor change.

I wanted SMALL so I added code to eliminate the speed potentiometer. In my version, you hold both paddles closed for 5 seconds and it goes into speed set mode. Dots increase the speed and dashes decrease.  Another five second Iambic squeeze and it goes back to normal mode.  Also I added a Straight Key mode. If a two conductor instead of a three conductor plug is inserted in the paddle jack it will just beep out what it sees on the dot paddle.  Good for code practice with my J38 if I can remember where I put it.

Source code for the ATtiny85 port is here. This is the finished Keyer in the mandatory Altoids enclosure (but note SMALL Altoids):

Atmel ATtiny85 based Iambic Keyer

It was a challenge to get everything in there and still have the lid close.  The speaker is from a defunct greeting card but rest of the parts were purchased from Jameco. In the end, the most expensive single component was the Altoids mints from the drug store.  The ATtiny85 chips are less than a dollar if you buy ten.

There are these few parts required:

  • speaker and 22 ohm resistor
  • 2032 battery and holder
  • two 3.5 mm jacks, one output, one paddles
  • three bypass capacitors
  • Dropping resistor and LED
  • Power switch
  • ATtiny85 chip and 8 pin socket
Interior of ATtiny85 Iambic Keyer.

Interior of ATtiny85 Iambic Keyer.

There is a short video of the keyer in action here.  So now if I spend a few minutes every day practicing I might get back to the 13 WPM I had to do to get my current license.

Version 2.0 – ATMega328 with Memories

Richard’s QEX article suggested several possible enhancements. I thought adding memories would make the device much more useful so began another journey into Arduino programming. Yes, I know there are already Arduino keyers out there. The K3NG implementation has a ridiculous number of options, but I wanted to do my own based on Chapman’s sketch in the most efficient manner possible. A schematic drawing of my completed keyer is available, and I have written a description of the functions. Source code for the sketch is here.

The PS2 keyboard requires +5 volts so I designed around a five volt Sparkfun Pro Mini board. Only ten bucks! Available here or here. The Pro Mini has an on board 150 milliamp capacity 5 volt regulator if you use a 7-12 volt power supply.

Features in the keyer sketch now include:

  1. Memory or keyboard characters are buffered in an asynchronous circular queue so memory buttons or keyboard characters can be “typed ahead”.
  2. PS2 and serial terminal keyboards supported.
  3. Paddle generated morse is interpreted and printed as ASCII letters on the serial terminal.
  4. Four programmable memories with 50 character capacity each.
  5. Memories programmable from the keyboards or from the paddles.
  6. Random code practice modes, letters, letters and numbers, letters, numbers, and punctuation.
  7. Sending speed settable 10 to 45 WPM. Limits can be changed by recompiling.
  8. Sidetone frequency settable 100 to 1500 hz. Limits easily changed by recompiling.
  9. Commonly changed default settings are in a separate header file (Canned.h).
  10. Message strings, sending speed, and sidetone frequency are stored in EEPROM and easily reset to defaults.

The sketch requires five I/O connectors:

  1. A 3 conductor jack for the paddle or straight key. Connect dot paddle to tip, dash paddle to ring. Use a 2 conductor plug for a straight key in the same jack.
  2. A 3 conductor jack for transmitter keying. A 2N2222 open collector output is on the tip. Line level sidetone is connected through a 5k resistor to the ring so you can connect an external amplifier if you need louder audio.
  3. A power jack for either a 5 volt or 7 -12 volt wall wart supply. Consult the Sparkfun documentation for which Pro Mini pin to use for power.
  4. A six conductor mini DIN connector for the PS2 keyboard. See Canned.h for information on the four leads needed.
  5. A connection for programming, and TTL serial terminal through an FTDI adapter. This can also power the unit instead of the wall wart.

There are six push button switches and a volume control needed:

  1. A reset button for the Arduino.
  2. A Function button.
  3. Four push buttons to activate individual memories.
  4. The volume control feeds a one transistor buffer for the internal speaker. It does not affect the level on the line output connection.

Operation:

Pressing reset momentarily has different effects depending on what other switches are closed. A processor reset normally takes a few seconds, when finished three mid tone beeps will be heard.

  • Press the reset button alone to restart the Arduino. This is also the only way to exit code practice mode.
  • Press the reset button while holding the function button down until three low tone beeps sound will restore the four message memories and code speed to defaults. Default messages, speed, and sidetone frequency are set at compile time from the file canned.h. You must do this action when loading the sketch for the first time into a new Arduino to initialize the EEPROM.
  • Press the reset button with a 2 conductor straight key plug inserted and the keyer enters straight key mode where the sketch generates tone and output simply follows the key closures.
  • Press the reset button while holding down one of the memory buttons starts random code practice. Characters will be generated in five character groups and echoed on the serial port.
  1. Memory 1: letters only
  2. Memory 2: letters and numbers
  3. Memory 3: letters and numbers
  • Pressing reset while holding Memory 4 enters sidetone frequency set mode. The dot paddle increases frequency, dash paddle decreases. Press M4 again to exit set mode.

The function button has three duties:

  • Reset to default messages as mentioned above. You must hold the function button down until you hear 3 low tone beeps.
  • Holding function alone down triggers speed change mode. While function is held, the dot paddle increases speed, dash paddle decreases speed.
  • Holding function down and then momentarily pressing a memory button allows programming that memory. After programming, press function again to return to normal.

New memory messages may be entered from the PS2 keyboard, the serial port keyboard, or from the paddles.

Pressing a memory button by itself transmits the programmed message.

Serial or PS2 keyboards have a command mode, entered by typing a back slash followed by a single character. Commands implemented are:

  1. \+ increase sending speed one Word Per Minute
  2. \- decrease sending speed one Word Per Minute
  3. \u increase sidetone frequency by 5%
  4. \d decrease sidetone frequency by 5%
  5. \w save current sidetone frequency and WPM to EEPROM memory
  6. \1, \2, \3, \4 send a message as though a memory button was pressed.

The keyboard translation table (AtoM.h) includes all the characters shown in the Wikipedia article on Morse Code except the underscore and the dollar sign. Typing an unsupported character echos “x” on the serial port and will be ignored by the morse interpreter.

Version 2.0 Hardware Implementation

Here is a photo of my 2.0 construction. There are three jacks on the left for power, paddles and transmitter keying. PS2 keyboard jack on the right, small volume control and send monitor LED on the front. Not visible is the six pin serial connector on the rear.

On the lid of the S.A.E. you can see a small speaker through the holes around the center. Round holes were made with a heavy duty paper punch. For buttons, I used 6 mm square through hole PCB mount switches with four pins, the kind everybody uses on their solderless breadboard. I bent the pins on one side back so they could be soldered directly to the Altoids lid. Quarter inch square holes for the buttons were punched with a hollow chisel mortiser bit which worked quite well.  I made labels by placing the lid in a scanner, adding text to the scan in GIMP, then printing a 1:1 image of the labeled lid on photo paper. I cut the letters out and glued them to the Altoids lid. This technique produces text labels with the original Altoids artwork underneath. I coated each label with clear nail polish for protection.

Arduino Memory Keyer Exterior

Arduino Memory Keyer Exterior

With the box opened you can see the small Sparkfun Pro Mini board. It is mounted by a pair of L shaped wires cut from a paper clip. These are soldered in the Mini’s two ground pins and then soldered to the Altoids tin. A rectangular hole in the back of the tin provides access to the six pin serial connector. All the in use Arduino inputs have 9.8 k pull up resistors added, and are bypassed at the switch with a small capacitor. The outer end of the pullup resistors are soldered to a narrow bit of PC material wired to Vcc.

Three jacks on the left are epoxyed in place. The PS2 jack on the right, which was salvaged from a defunct USB-PS2 adaptor, is held by a narrow copper strap soldered to the jack and to the Altoids tin. A small perf board at the front holds most of the ancillary components for keying and the audio control. I mounted the perf board using more stiff wire cut from the paper clip.

There is a strip of thin PC material laid across the button switches to add more physical support. The two switch pins not soldered to the Altoids lid are bent over the strip and soldered. Notches filed in strategic places across the copper isolate each switch, and I added the necessary 0.1 uFd capacitors at this point.  The speaker is tucked under one of the PC strips and epoxyed in a couple of places. A short piece of flexible solder wick bonds the box lid to the bottom.

Arduino Memory Keyer Interior

Arduino Memory Keyer Interior

Future Enhancements

Add a FTDI USB to Serial adapter inside the box. It would allow a more graceful connection to a host computer running a serial communication program. Or build another unit with a USB integrated chip.

Add a 16×2 LCD display. Code would be trivial, but will probably have to find a bigger box.

Expand to six or eight memories. My sketch is compiling in about 13 k of flash, and has over 1500 bytes of ram free plus the Pro Mini has eight analog inputs so easily done. But how many memory messages can the average ham keep track of? I think four is a good number and I love the Altoids tin paradigm.

 

Credits

Many thanks to Richard Chapman KC4IFB whose February 2009 QEX article provided the inspiration and base for this sketch. His iambic keyer sketch feels exactly like my original WB4VVF Accukeyer. A version of his sketch with instrumentation added so you can see the state changes is here. Also see Rarons Blog  for a discussion of the tree method for decoding and encoding morse characters. Would you believe 300 WPM full duplex?  I did not use his library but his work was very helpful in building efficient translation tables. The circular queue was implemented with help from examples from the Embedded Systems Journal.

 

Revision History

V2.0.0 Initial coding to implement fully asynchronous event loop.
All delay() and spin waits removed from the main loop path.
Remove numbers only practice. Change eeprom order. Add change sidetone.
https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/MemoryKeyerV2.0.zip

V2.0.1 Minor tuning space generation in doIambic.
https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/MemoryKeyerV2.0.1.zip

V2.0.2 Converted sidetone generation to DDS/PWM sine wave with help from
http://ko7m.blogspot.com/2014/08/direct-digital-synthesis-dds.html

https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/MemoryKeyerV2.0.2.zip

Quarter Wave Symmetry

Quarter Wave Symmetry
1000 Hz 256 Step Table

V2.0.3 Changed sine table to half step offset. Saves one byte.
https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/MemoryKeyerV2.0.3.zip

V2.0.4 Added sidetone envelope shaping. Required several other changes.
https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/MemoryKeyerV2.0.4.zip

Shaped Dits at 45 WPM

Shaped Dits at 45 WPM

V2.0.4.1 Bug fix was dropping dits on a long string of upper case “H”s. Disable interrupt while changing sine tables.
https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/MemoryKeyerV2.0.4.1.zip

V2.0.5  Changed AtoM table from prog_uint16_t to char to save memory, which created bug where setup does gratuitous write to A6 and A7. Fixed problems when compiling under Arduino IDE 1.6.1, did not accept typedefs in pgmspace.h. Fixed bug in initByte, 1.6.1 did not like  aaByte = aByte -= 0x20;  Compiled size is 2k smaller in 1.6.1 and no more bogus compiler warnings!
https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/MemoryKeyerV2.0.5.zip

Notes

20 March 2015  —  The keyer sketch was developed with Arduino 1.0.6. Recently I downloaded the latest Arduino IDE 1.6.1 and discovered the keyer sketch will not compile. It appears the newer version of GCC will not accept the typedefs used in the pgmspace.h library. I will upload a 1.6.1 release as soon as I figure out what’s going on. FIXED see V2.0.5 above.

24 March 2015  — Was shopping in Frys and bought an inexpensive (< $3) adaptor, is USB A female to PS2 male, is about the same size as the two connectors placed end to end.  It was made by Shaxon Industries in guess where. To my complete surprise it works. Using the adaptor I can connect any USB keyboard to the keyer which is good news, as PS2 keyboards especially compact ones, are getting hard to find. I measured power supply current with the adaptor, it does not add significant drain over the 25 Ma the keyer itself draws. The small USB keyboard I tried added only about 3 milliamps when not typing. I did find the transistor I used to buffer the speaker draws 25 milliamps itself, will have to find a more efficient amplifier.

Offset Flip Top Table

This article describes a two foot square mobile cabinet, with a pivoting top so two tools can be supported. These are known as “Flip Top Tables” but my version uses an offset pivot point so a much taller drill press sits lower when it is rotated up.

Cost was about $130.

My design was featured in “Americas Best Home Workshops 2009″, a Wood Magazine publication.

 

The Problem

In early 2008 I upgraded a generic 10 inch drill press to a new Delta DP300 benchtop version. The Delta took up about a quarter of my work area. It is 34 inches tall and weighs about 80 pounds. Not exactly portable.

Drill Press

New Drill Press

 

Later that spring, an Ebay opportunity resulted in acquiring this DeWalt 733  planer.

Planer

New Dewalt 733

 

But my shop is in one corner of a garage and I didn’t have a place to store the planer. It is 21 inches tall and weighs about 84 pounds.

 

The Solution

Put the planer and the drill press in the same space.

Table

Flip Top Table

 

A few hours of sketching and arithmetic showed that my drill press on a conventional flip top pivoting at the table surface would put the table 42 inches from the floor. The press chuck would be above eye level, too high for comfortable work.

So after many paper designs, I had the idea of making the top as a tray, with pivot points offset four inches vertically from the tray surface. This allows the drill press to sit eight inches lower when it is rotated up.

Since this tray style design obviously cannot have a solid pivot axle from side to side as most fliptops use, I made sturdy hinges from 1/4 inch plate and half inch carriage bolts. There is a short length of 3/8 pipe slipped around the bolt that acts as a spacer and also forms the pivot bearing surface with the smaller steel plate.

Pivot Prototype

Assembled Pivot Hinge

 

Here is the prototype hinge mounted in scrap plywood. It proved to be extremely rigid and easily handles the bending moment of the loaded tray.

Hinge

Prototype Hinge

 

This photo shows the drill press attached to the finished pivoting tray. I added two small bolts at the rear of the cast iron foot as I thought the strain of supporting the drill press head might be too much when the machine was leaned over.

One of the four bolts holding the planer to the other surface is visible.

Press Mounting

Drill Press Mounting

 

There is a lock screw at either side of the tray at front. They are big star knobs with 3/8″ threaded shafts running through to T-nuts inset in the cabinet side.

Front Tray Lock

Front Tray Lock

 

Note how the front edge of the tray is cut away around the cabinet support gussets. When the top begins to pivot, the cut away allows clearance for the tray to rotate.

Tray at Start of Pivot

Tray at Start of Pivot

 

The next detail shows the rear of the tray as it begins to pivot. The back is *not* cut away around the gussets, instead the gussets form a positive stop for the rear structure. Thus the tray will only pivot in one direction, and only 180 degrees.

There are T-nuts installed at the rear of the cabinet sides for the lock bolts when the planer is rotated up.

Rear View

Tray at Start of Pivot – Rear View

 

I used 3 inch casters to make the cabinet mobile. The bottom plate is a double layer of 3/4 plywood and there is an additional 3/4 block at each corner where the casters bolt through.

The entire cabinet is screwed together. I was going to do a dry fit, take it apart and glue everything, but it is very rigid as is, I don’t think glue is necessary.

Caster Mounting

Caster Mounting

 

This shows the table with drill press up.  Note the base of the press is now 4 inches below the pivot points.

Drill Press Proud

Drill Press Proud

 

I was surprised to find that the planer and drill press balance each other very well.  It takes only one hand to rotate the tray, which is carrying over 160 pounds.  I did not think this would be the case as the drill carries most of it’s mass at the top, but the 4 inch offset evens out the weight distribution nicely.

Table Rotating

Table Rotating

 

This shows the table with planer up. The rear face of the tray is now sitting on the front gussets which positively stop the rotation.

Planer Proud

Planer Proud

 

This shows the rear of the cabinet. I had to cut away the rear gussets to clear the planer handles. I could have mounted the planer sideways for more clearance, or removed the handles. Also you can see a section of plywood added across the bottom for lateral stiffness.

Note in this position, the top is four inches above the pivot point. The planer is a bit high for a large, heavy board but at least it has a home, and I use the drill press a lot more than the planer.

The lock knobs have been inserted at the rear in this picture.

Planer Locked

Cabinet Rear View

 

Here is a rough drawing of the cabinet. The dimensions are for my build, if you decide to make a table like this, you will need to work out sizes for the tools you plan to mount. The limiting measurement for my table was the height of the tallest tool, the drill press.

Basic Dimensions

Basic Dimensions

Basic Dimensions

Basic Dimensions

 

There is a short video on YouTube.

My offset cabinet has been very successful. I generally wheel it out in the driveway to use the planer, my dust collection consists of a broom and a leaf blower. It takes only about a minute to stow the drill press cord and lamp and then flip the top.

Portable Planing Board

Lately I’ve gotten much more interested in using hand tools. I don’t have a real bench though, just an old office desk and there is not a good way to hold a board down flat to work on it. Holdfasts just don’t work well with an office desk, and the desk doesn’t have any structure to support a tail vise.

So I made an 11×48 inch planing board. It clamps easily in the bench front vise, or in a Work Mate out in the driveway. The bed is made of 5/8 Birch plywood, with 3/4 inch holes every 2 inches down a rigid spine, and there is a wide stop screwed to the left end. I researched several different methods of constraining a board. The most promising was the Veritas “Wonder Pup” but it looks awkward to tighten, is 3/4 inch tall, made of plane blade unfriendly metal, and is not cheap.

I worked out a cam arrangement to secure the work but found it takes a pair of cams to cover the 2 inch range.

In this photo the larger cam is lying on the bench at rear along with the plywood spanner wrench used to torque the cams. A pine board is locked by the smaller of the two cams which has a range of 1 to 2 1/4 inches.  The larger cam has a range of 2 to 3 1/4 inches.

Planing Board

The Planing Board on the Bench

 

In the next photo, you see the small cam locking a board. There is an aluminum follower that slides underneath.  A tapered wood wedge is screwed to the face of the follower which helps to keep the cam from loosening.

I initially thought I could just use the cam against the work piece. It would tighten (with some difficulty), but if the work wiggled even slightly the cam would rotate and release. Next I made the aluminum cam follower captured by the central peg, which worked better but still loosened too easily. Finally I added a ramp to the follower. It changes the point of contact so clamping force tends to tighten rather than loosen the cam. This works much better, though the thickness of the follower does add a bit to the half inch height of the cam.

The spanner wrench is just quarter inch dowels in a bit of scrap. The wrench has two sets of pins at 90 degrees to each other because the cams have about a 225 degree swing.

The Cam Lock

The Cam Lock

 

I don’t have to use the left end planing stop, I can put a 3/4″ peg in any one of the holes and pin the work with the cam.  The next photo shows a board locked cross grain using the larger cam.

One problem is the large cam overhangs the edge in some situations, possibly interfering with the plane. If I had to do it over, I would build the spine an inch closer to the sled center. I have also added many more holes for additional short pegs, see later photos.

Large Cam Working Against a Pin

Large Cam Working Against a Pin

 

Showing the whole planing board. I spent a lot of time drilling holes, then sunk a 2 inch screw between every pair of holes for strength. It is quite rigid when the vise is snugged up, and more importantly, FLAT.

A Board Pegged in the Sled

A Board Pegged in the Planing Board

 

Here you can see the cam follower, large cam upside down, spanner wrench, small cam, and a peg in one of the holes. I made two sets of cams, one works clockwise, the other counterclockwise. This photo shows the counterclockwise set but I mostly use the clockwise arrangement. Sometimes switching the cam sense will work around a plane interference problem.

Peg holes are 3/4 inch blind drilled 2 inches deep, then 1/2 inch drilled through.  This stops the pegs but lets shavings fall through. You can also stick a screwdriver up through the half inch hole to push out a stubborn peg.

The Parts

The Parts

 

This is a picture of the clockwise cams, the profile was refined using this spreadsheet: Cam. If you decide to build a board like mine, you can scale and print this as a pattern. Shape and size are not critical as long as there is sufficient range (> one inch) between smallest and largest radials.  The range of the two cams overlap a small amount.

Cams

Large and Small Cam
Large Cam 5 3/4″ x 4 5/8″
Small Cam 3 7/8″ x 2 7/8″

 

And here is a photo of the clockwise cam follower. It is made of aluminum cut from a box lid from my junk pile.  the two legs are 3/4″ apart, they straddle the cam dowel so the follower is constrained to move mostly in the direction of the work but can still angle a bit to conform to a board that isn’t square.

Cam Folower

Cam Follower
2 3/4″ x 5″

 

Here you can see how the plywood wedge attached to the follower works. It moves the point of contact between cam and follower to a point just past the centerline. Back pressure from the work then tends to rotate the cam in the direction that tightens. If the wedge was not there, the point of contact, because of the spiral shape of the cam, would be just before the centerline and the cam would tend to loosen from back pressure.  Also there is a fair amount of friction between the cam dowel and spine holes which helps keep the cam in place

Cam and Follower

Showing Cam Follower Offset

 

The fixed planing stop protrudes 3/8 inch above the sled surface at the left end. It is held with screws and can be moved to the right end if necessary. To plane stock thinner than 3/8″, I put hard board spacers underneath the work.

The Planing Stop

The Planing Stop

 

In this bottom up photo, you can see the spine made of two 2 inch strips of 5/8″ thick plywood laminated together.  It provides overall rigidity, meat around the peg holes, and gives something for the bench vise to hold on to.  The spine is fastened 2 inches back from the edge to allow room to set clamps.

The small bit of darker wood at rear is a spacer the same width of the inside vise jaw so the board bears directly on the edge of the bench, which helps keep the far end from wiggling.

Bottom of the Sled

Bottom of the Sled

 

Since I made the planing board, several improvements have been implemented. The first was, I drilled a bunch more peg holes, and cut a handful of 3/4″ pegs in various lengths to fit the job. This photo shows the bottom of the board.

Planing Board Bottom

Planing Board Bottom

 

Each added hole has a slot routed in the bottom to accommodate a steel pin screwed into these short pegs. The pin helps keep the peg from wobbling in the relatively thin plywood. For most jobs though, it is sufficient to insert a peg in the top of the board. Note I have planed a flat spot in the side of each peg and the steel pins align the flat.

Pinned Pegs

Pinned Pegs

 

Planing along a board edge was a problem because the larger cam sticks out far enough and high enough to interfere with the tool.  I can raise a work piece by putting spacers underneath, but my Stanley 45 fence hit the protruding cam. The solution was to provide a long, thin spacer between the cam and the work. This is made of a half thickness of maple flooring, with a milled slot that accepts a carriage bolt. I loosely fit the bolt through one of the spine holes and it keeps the spacer from buckling.  Planes now have plenty of clearance.

Spacer in Use

Spacer in Use

 

This photo shows a work piece locked in by the large cam using the hardwood spacer.

The Cam Spacer

The Cam Spacer

 

A close view of the spacer. The slot is wide enough for the carriage bolt head but has a narrower bottom so the bolt won’t spin when tightening the wing nut.

Spacer Componants

Spacer Components

 

In the four years since it was constructed, I have used this planing board a lot. I consider it one of my more successful projects. Nowhere was it used more than the Eleven Grooved Box project. Every piece goes on the board for smoothing and grooving.

This photo shows stock for the box sides getting the last of three grooves. The Stanley 45 has to reference it’s fence against the vertical edge of the work which I have aligned with the edge of the planing board. You can see how the long spacer block just behind my left hand keeps the cam far enough behind the plane fence that they don’t interfere.

Groove three

Groove three

 

Here, the thin board which forms the top or bottom of an Eleven Grooved Box is getting rabbited so it fits into it’s eighth inch groove. I could not do this operation without clamping in the planing board. Again, using the spacer block so the cam doesn’t interfere with the fillister plane.

Rabbit end grain edges to 1/8 inch

Rabbit end grain edges to 1/8 inch

 

Finally, this is an interesting use of the board. The edges of the thin Eleven Grooved Box lip strip have to be planed down until the strip fits tightly in it’s groove. I stick several pegs in the planing board and weave the strip through them. The strip stays put and planing the edge square is easy with a big Stanley number six. It’s very quick to pop out the strip to test it’s fit.

Preparing to trim lip strip

Preparing to trim lip strip

House for a Homeless Stanley

This page documents a White Oak box I constructed in early 2011 to house a Stanley 45. It features a hard wood spine designed to hold the plane securely in place which I will describe in detail.

As far as I can tell, this particular 45 dates from the late 50s. Almost new!  It was a Christmas present to myself. Actually, I already had a 45 but dropped it onto the concrete garage floor. In a fit of despair, I bid on this 45 on EBay and won.  Meanwhile I was able to repair the cracked main stock on the first 45 so now I have two of them working.

Neither came with an original box which was likely cardboard anyway. Hence this project.  Guess I will have to build two of them.

The first photo shows the plane side of the spine. The peg at left hooks the front of the skate on the 45. The plane then is lowered till the skate sits on the horizontal wooden ledge. Three magnets grab the main stock skate while the bottom of the wooden fence sits on a thin strip of Oak underneath the spine.

Finished Box Spine

Finished Box Spine

 

A Stanley 45 has sort of a turned up nose on the skates. That fits under the peg.  The flat strip of Oak under the Rosewood fence is necessary and is cut away at the front because the front tip of the fence pivots down a bit while hooking the plane under the peg, and needs additional clearance there.

Hooking the Skate Under the Peg

Hooking the Skate Under the Peg

 

The main stock side of the oak spine has to be relieved to accommodate the slitter stop and the depth gauge and there was minor chiseling near the dowel to get everything to fit.

It was my goal to not have to disturb the plane’s settings just to put it away in the box. Usually that succeeds, though the fence does have to be close in and in the higher of it’s two positions.

Main Stock Side of the Spine

Main Stock Side of the Spine

 

This is the “new” Stanley 45 plane nestled in it’s docked position. It’s snug and the magnets hold it down pretty well.

On this plane, the tote and fence are Rosewood but not the fence knob.  Stanley stopped using Rosewood about 1960, so this plane was probably made during that transition. The 45 was not made after 1962. I have not yet attempted to de-rust or otherwise clean this plane. Its clean enough to use. I’ve made a lot of Eleven Grooved Boxes with the two 45s.

Docked

Docked

 

Box joints for this project were cut with my lead screw box joint fixture, which is documented elsewhere on this Blog.  Grooves for the top and bottom pieces were cut with a Lee Valley Box Slotting bit  which works really slick.  It cuts a 1/8″ slot so needs two passes to get the 3/16″ groove I needed.  The July 2008 issue of  “Wood” magazine had an article (“Box-Slotting Bits”, Page 24) on using this bit, but unfortunately, it does not seem to be accessible on line. You just set up the slotting bit in a router table, dry fit the box with strap clamps, then set the box over the bit and run it all around the inside.

The next photo shows completed sides and bottom with inside components attached. There is a double grooved block on the bottom which holds the longer set of rods. Button magnets keep the rods in place and there will be more button magnets inset in the bottom to retain the two removable depth stops, and the cam. I made seperate thin sided boxes to hold the cutters, these are screwed in place along the sides.

Box Dry Fit

Box Dry Fit

 

And this is the Stanley 45 nestled in its new home.  I should have made the box a quarter inch longer, had to relieve the panel on the right side to allow the tote to seat all the way. The sliding top fits well enough that the plane can’t move much once the box is closed.

Dry Fit with Stanley

Dry Fit With Stanley

 

I did the glue up in the house as the garage was so cold that PVA wouldnt work.

About 120 box joint pins have to be coated with glue and the whole thing assembled at one time. I use Titebond 3 extend which has a long open time. You get at up to 15 minutes but that still means careful preparation and rehearsal is needed to get the thing together before the glue sets up. 15 minutes is used up very quickly.

I did stain all the interior surfaces prior to glue up as it would be difficult to get into all the corners later. Also liberal use of masking tape inside and out to control glue squeeze out.

On removing the clamps I noticed the box had racked a bit.  Next time I will use strap clamps with corner cauls on the panels. It will be much easier to check for and correct errors.

Clamp Time

Clamp Time

 

The box is finished and assembled.  It has had one coat of straight Minwax Golden Oak stain, two coats of 50/50 Golden Oak and Watco Natural, and a final coat of Watco Natural alone. After the Watco cures, everything gets several coats of paste wax.

You can see the cutters inserted in the two side boxes, long rods stowed at bottom left.  The cam and one of the depth stops are tucked away at top left, and the tongue stop stuck to a magnet at bottom right. Button magnets work well to control those little parts.

Finish Applied

Finish Applied

 

This is the docked position of the plane.  One of the medium width cutters is installed to check the fit and you can see the skates hooked under the dowel at the front.  Later I learned to store the cutters pointed end down. Please don’t ask how I learned that.

Stanley in New Home

Stanley in New Home

 

All the White Oak material was obtained from inch thick cutoffs. It was resawn on my table saw, thicknessed to 3/8″ using a lunchbox planer, and glued up into panels.

The lid slides in a 3/16″ groove which was made with the box-slotting bit. There is a 3/8″ inch radius sanded on the rear corners of the top plate to match the size of the slotting bit  A small lip at the front of the lid gives a better purchase for the brass latch.  The box bottom has a similar design.

That brass latch was way more trouble that it was worth….

All the Parts

All the Parts

 

The box can now be considered finished.  I let the finish cure for a few days then applied several coats of  Butchers Bowling Alley Wax.

Final dimensions are 6 3/4″ x 7 1/4″ x 11 1/2″.

The Money Shot

The Money Shot

 

It’s now May 2012 and I  finished a box for my second Stanley 45.  This one is made of Jatoba – a hard tropical wood with twisty grain which makes it a real pain to smooth out.

Jatoba Box

Jatoba Box

 

The second box is pretty much identical to the first but is 3/8 inch longer.  Please Don’t Ask Me Why the first box is shorter.  Also I made the cutter holders longer on the right side, and used more magnets in the long rod holder.

Second Stanley At Home

Second Stanley At Home

 

This Family Shot shows the new Jatoba box next to it’s older White Oak brother.

Two Stanley 45 Boxes

Two Stanley 45 Boxes

 

The following photos have dimensions added.  Most of my projects are Ad Hoc and if you build something based on these, make sure it fits your tools. I have noticed the two 45s I own are slightly different.

Outside Dimensions

Outside Dimensions

 

The spine has cutouts for the main and slitter depth stops. Two button magnets and a magnet from an old hard drive inset.

Spine Details

Spine Details

 

At the nose end, the spine has an extra piece glued on. The peg that constrains the hook on the front of the skates is inset in that piece.  This is a critical part and needs to be positioned so the skate has enough clearance to hook underneath but is captured securely.

Spine End

Spine End

 

There is a thin spacer underneath the spine. It has a cutaway at the nose end to allow clearance for the fence when the plane is hooked under the dowel.

Spine End

Bottom Spacer

 

Finally, a close up of the dowel in the spine. You can see where I had to remove material to clear parts of the plane body.

Box Spine Nose Close Up

Box Spine Nose Close Up

Automating the Box Joint Jig Lead Screw

I constructed an Arduino based controller to automate the carriage on my lead screw Box Joint Jig which was originally inspired by Matthias Wandel at woodgears.ca. Interestingly, Matthias added automated operation by a laptop to his design at the beginning but later removed the function in favor of multiple wooden gear sets. My jig was manual at first and automated later after I kept losing count of the crank turns

See this WordPress Blog entry on construction of my Box Joint Jig and also this Blog entry on some of the applications.

A video of the development breadboard in action is at www.youtube.com/watch?v=6Zz1fGDO5jw.

A video of the controller installed on the jig and working is at www.youtube.com/watch?v=URk4qYnEWgI

I used an inexpensive DC motor driven with a Polou MD01B H bridge, and added position feedback to the lead screw. This gear drive motor from All Electronics (DCM-697), was intended for actuating automotive power seats.  I sawed the shroud off the connector housing so I could use standard push on terminals.  The mounting base is a bit of hardwood flooring rounded out to fit the motor and hose clamped on. I can loosen the clamps and slide the motor to align the sprocket and adjust the chain.

Modified Power Window Motor

Modified Power Seat Motor

 

This shot shows how the lead screw shaft has been cut and ground down to fit the &quot;D&quot; shaped hole in the drive sprocket.

Window Motor Shaft

Seat Motor Shaft Ground Down

 

Two 24 tooth sprockets from All Electronics (GR-100).  They don’t come with a cap for the shaft collar so I made some from a piece of aluminium. Normally they have a “D” shaped hole. The sprocket on the left has it’s D intact – it will go on the motor shaft. The sprocket on the right has it’s D filed out round so it can clamp on the 3/8 threaded rod that drives the Box Joint Jig.  I have since replaced the motor side sprocket with a 42 tooth part to speed up the carriage motion.

24 Tooth Sprockets

24 Tooth Sprockets

 

Photo of the first test bed.  Power seat motor on left, Pololu motor driver (MD01B) above that, protoboard in the center and Arduino on the right.  Two buttons on the protoboard run the motor either CW or CCW.  The amazing little Pololu board has a VNH3SP30 H bridge chip which is less than 3/4 inch square but can switch 30 amps!

Bare Test Bed

Bare Test Bed

 

Since the motor is a simple series type, I need a way to inform the Arduino how far the shaft has rotated.  An optical sensor could be used but then there would be sawdust issues. Instead I use a Hall Effect sensor and permanent magnets.

This is the prototype position disc. It will go on the jig’s lead screw.  Quarter inch button magnets are coupled to six penny nails to focus the magnetic field and pressed into slots sawn in the disc.

Prototype Feedback Disc

Prototype Feedback Disc

 

Here the magnets and nails have been epoxyed and a coat of varnish applied.

This was intended to be a prototype but performs well enough that it probably will be the final.  The disc is 3 inches in diameter and will be taped directly to the motor sprocket for software development purposes.

Trimmed Magnet Disc

Trimmed Magnet Disc

 

Detail of the disc edge showing one of the six penny nails sawn off and filed flush.

The Hall Effect sensor (SS441A from Jameco) gives a clean transition when placed about a quarter inch from the edge of the disc. NO bounce observed (Yay!) so I can easily code an interrupt driven counter. Eight steps per rotation on the 16 TPI shaft will give a resolution of  0.0078125 inch at the carriage. One – One Hundred Twenty Eighth of an inch.

One of the Magnetic Poles

One of the Magnetic Poles

 

Since this is the Breadboard phase of development, I thought it appropriate to mount the parts on a real board.  At this point the motor software is done but the menus are not. A video of the development breadboard in action is at www.youtube.com/watch?v=6Zz1fGDO5jw.

Clockwise from the top:
– Chain and sprocket for the lead screw
– Sensor disk temporarily on motor
– Motor and mount screwed down now
– Hall Effect sensor glued to a stick
– Stick clipped to mount so its adjustable
– Arduino clone board
– 16×2 LCD display
– PWM pot (not used, will be removed)
– Proto board with LEDs and buttons
– MD01B motor driver

Final Development Breadboard

Final Development Breadboard

 

Here is the box I selected to hold the completed controller.  It is a standard electrical box from Lowes, but it has a bump out on one side that forms a nice surface on which to mount button switches. The lid of the bump out is molded as part of the box. You fold it over and it snaps on. You can do this about 3 times before the plastic hinge breaks off so plan the layout carefully beforehand. 30 Cubic Inches sounds like a lot until you start stuffing cables in there.

I amputated the 8 penny nails and mounting ears.  LCD and LED indicators mount flush on the top where the AC receptacle would normally be.

Electrical Box

Electrical Box

 

I think the box has enough holes now….  Putting the controller hardware into the box is more complicated than it seems. Just the box itself needs wires from two buttons, power switch, 12 volt feed, motor feed, two limit switches, and the Hall Effect sensor.

Outside, a blue Euro style block is glued on for the Hall and limit wiring, Two pin Molex connectors added for the 12 volt leads.  The box material is soft enough that it cuts easily with a utility knife.

Box With Wiring

Box With Wiring

 

Here is the Pololu MD01B motor driver in it’s new home. Have to use plastic screws because the plating around the mounting holes is electrically hot (why??).  This small sheet of aluminum fastens inside the box via the two countersunk holes visible just above the buttons in the previous photo.

Pololu MD01B Mounting

Pololu MD01B Mounting

 

The Arduino clone processor is mounted on the opposite side of the aluminum plate.  Four analog inputs and 12 digitals are cabled out.

Arduino on Mounting Plate

Arduino on Mounting Plate

 

Four LEDs and the 2×16 Liquid Crystal display are mounted on a piece of plexiglass cut to fit the top opening of the box.

Leds are:
slewing left
power on
hall sensor (added for coolness factor)
slewing right

Display Panel Front

Display Panel Front

 

This is the display panel seen from the bottom.  Four 2 wire connectors for the LEDs and a 10 wire cable for the LCD display.

The small connectors are salvaged from PC front panel displays, the multi wire connector is sawn off an IDE hard drive cable.

Display Panel Rear

Display Panel Rear

 

I used a Radio Shack PC board to make a central interconnect for all the buttons, limit switches, LEDs, Hall sensor, LCD display, and processor.  There is a 5 volt regulator for the logic side, pullup resistors and LED dropping resistors.  This cries out for a printed circuit board but since I’m only building one of these, it will do as is. I would have to work through this stage to design a PC board anyway.

Interconnect Board

Interconnect Board

 

Made a drawing of the interconnect board so I could remember where things plug in.

Interconnect Board

Interconnect Board

 

Final mock up to test wiring. All this has to go into the blue electrical box. Found two LEDs functionally reversed. One of the cool things about the Arduino is the pins are software defined so that took maybe a minute to fix in software. The 5 volt regulator got too hot for comfort so in a last minute change, I moved the regulator chip over onto the aluminum sheet – even more wires!

Final test Before Assembly

Final test Before Assembly

 

Well it does all fit, though it’s a PITA to find a place for all those wires.  This shows the completed controller connected to the breadboard motor mount having just made a 128 step (1 inch) simulated slew, sixteen revolutions of the sensor wheel.  Those two microswitches will be limit switches on the jig, and I will use an inline fuse in the 12 volt feed, couldn’t find room inside.

Testing Controller on the Breadboard

Testing Controller on the
Breadboard

 

This shows the motor screwed to the end of the jig, two sprockets, and #25 chain. These parts came from All Electronics.

It sticks out more than I hoped.  Maybe need some kind of guard to keep fingers out of the chain.

Motor as Mounted

Motor as Mounted

 

I made a small L shaped plywood structure for mounting the controller on the box joint jig.  The mounting is tall enough to protect the sensor wheel assembly and the right limit switch.

Controller Mounted on Box Joint Jig

Controller Mounted on Box Joint Jig

 

Mounted the left hand limit switch horizontally. It is very exposed so I cut off most of the actuating lever and made a guard out of aluminum.

Left Limit Switch

Left Limit Switch

 

This photo shows the sensor wheel mounted on the lead screw shaft. The Hall Effect sensor is epoxied into the small wood block just right of the wheel.  It gave me grief, it didn’t work!  After a lot of experimenting, I determined the Hall sensor is only sensitive on one side. I had glued it into the block upside down.  Turned it over and success!  You can also see the right limit switch mounted vertically.

Sensor Wheel

Position Sensor Wheel

 

I set the controller to slew sixteen inches. Ran it up and back about ten times, it always came back to the exact same spot.  Takes more than a minute to go 16 inches.  I will look for different sprockets to speed it up. The motor has plenty of torque, I put most of my weight on the carriage and it didn’t slow down a bit. I’m using an XBox power pack to supply 12 volts, it’s easily up to the job, but wish I could figure out how to get it up to 15 volts.

A video of the controller installed on the jig and working is at www.youtube.com/watch?v=URk4qYnEWgI.

Sixteen Inch Setting

Sixteen Inch Setting

 


Completed Box Joint Projects


 

A Roy Underhill Memorial Tool Tote.  About 30″ long, 9″ wide.  The yellow pine does not seem to take an oil finish well.

The box (finger) joints all cut on the automated lead screw jig.

Yellow Pine Tool Tote

Yellow Pine Tool Tote

 

Another smaller tool tote done on the automated jig. This example in Cherry.

Tool Tray in Cherry

Tool Tray in Cherry

 

These boxes made for my two Stanley 45 Combination Planes.

House for Homeless Stanleys

House for Homeless Stanleys

 

I made this to hold a small Variac transformer. Keeps my soldering iron at just the right temperature.

Variac Box

Variac Box

 

This Walnut, Butternut, and Oak box was made for my Brother-in-Law.

A Box for Johann

A Box for Johann

 

 

Compound Angle Box Joints

This is a practice piece for a larger project.  I wanted to make a tool tote like the one Roy Underhill carries in the introduction to “The Woodwright’s Shop”.  There is a description of the tray in Roy’s book “The Woodwright’s Apprentice”. His example is butt jointed and nailed together, but I thought it would be nice to do the tray with box joints and glue.  Thus started a journey into trigonometric hell.

Practice Piece

Practice Piece

 

The sides of this piece are 15 degrees from vertical (75 degrees from horizontal) which is close to Roy’s slope of 1 1/2″ rise over 5 1/2″ run.

The only other reference I had for compound joinery was a section in Tage Frid’s book “Tage Frid Teaches Woodworking, Book 1: Joinery” on hand cutting dovetails in a similar situation. Not for the amateur woodworker and difficult to follow.

Other references may be available – Google is your friend.

Strange things happen when you slope the sides of a box.  All the angles change and the side edges are no longer parallel.  People who install crown moulding are familiar with this.  I used the Butt Joint calculator at www.pdxtex.com/canoe/compound.htm.

To get the side and bevel angles needed for the project. It is easier for me to think of these angles as offset from vertical (90 degrees) so I entered 75 degrees as the side slope.

Compound Angle Calculator

Compound Angle Calculator

 

The table saw has it’s blade tilted to the calculated bevel angle (3.84 degrees) and the miter gauge tilted to the calculated side end angle (14.51 degrees from 90 or 75.5 degrees).

Cut the first edge with the miter gauge in the left hand gauge slot. It helps to label the faces as the small bevel angle is small and not obvious. The narrower face goes towards OUTSIDE of the pyramid. For my right tilt saw, the piece being cut off in this photo has it’s INSIDE face up in this photo. The next piece, on the left of the blade, has it’s OUTSIDE face up in the picture.

Compound Cut

Compound Cut

 

Now rotate the miter gauge 180 degrees and put it in the right hand slot. Flip the board over and make the second cut. The piece being cut off now has it’s INSIDE face up.

This method does not waste any wood, but every other piece has it’s face side reversed which may be a concern if you’re matching grain.

After all the pieces were cut out I ran them through the saw a second time with a stop block clamped to the miter gauge to ensure they were all the same width.

The final step in fabricating the four sides is to tilt the saw blade to the slope angle (15 degrees in this case) and bevel the top and bottom of each piece. I used the table saw fence to guide this, but watch out for kickback.

Second Compound Cut

Second Compound Cut

 

If the butt joint angles are cut correctly on the table saw, a straight edge held parallel to the top or bottom will show no gaps across the junction of two sides.

Joint Alignment

Joint Alignment

 

To dado angled box joints exactly parallel to the slanted top and bottom edges, the work pieces have to be held in the jig in the position they will occupy in the finished assembly.

I made two complimentary spacer blocks, one for the right edge of the work piece, and another for the left.  I first glued up a 3 inch thick blank from four pieces of 1×6 pine. This was trimmed and planed square.  Then I laid out the lines for the necessary slopes all the way around the block.

Angle Block Layout

Angle Block Layout

 

The next corner of the block.

I found it was easier and more accurate to lay out the lines by calculating and measuring rise over run rather than use a protractor.

Second Side of Angle Block

Second Side of Angle Block

 

This is the opposite corner of the block.  The layout lines go all the way around.

I made several of these blocks before I got the angles dialed in right.

Third Side of Angle Block

Third Side of Angle Block

 

The fourth corner of the prepared block. The next step is to slice the block along the layout line.

Fourth Side of Angle Block

Fourth Side of Angle Block

 

A Sketchup model of the jig spacer block.  Angles for this 15 degree project are 3.8 degrees on the long side, 14.5 degrees on the short edge.

The dimensions shown are approximate due to Sketchup limitations.

Sketchup Screenshot

Sketchup Screenshot

 

This shows me and Henry Disston dividing the block along the layout line. It’s easier than it looks.

For a good example of how to do this see www.pbs.org/woodwrightsshop/video/2800/2810.html where they slice veneer off a walnut block by hand sawing.

Splitting the Angle Block

Splitting the Angle Block

 

Here the two halves of the block have been smoothed, and pegs added so they will plug into my box joint jig.

Note the orientation. The block on the left will go against the jig on it’s square face. The block on the right plugs into the jig on it’s sloping face.

Two Setup Blocks

Two Setup Blocks

 

A view showing how the sloping faces of the spacers lay against the jig. One spacer tilts out 3.8 degrees and slopes 14.5 degrees left, the other tilts in 3.8 degrees and slopes 14.5 degrees right.

Side View of Spacer Blocks

Side View of Spacer Blocks

 

The dado stack has to be tilted to match the side angle. This aligns the slot with the top and bottom surface of the work piece. For this 15 degree side slope project, the angle is 14 1/2 degrees off vertical.

An additional complication is, now that the dado is angled, the slot will be slightly wider than the stack width. Box joints depend on the slot being exactly the same width as the pin, so the pin size has to be increased to match. For this 15 degree project, I added 0.012 shims to the dado stack and increased the pin cycle by 1/16 inch. It came out pretty close.

Wixey out the Angle

Wixey out the Angle

 

Finally the jig with spacer is ready for duty. Here one of he blocks is plugged into the lead screw jig carriage, the work piece and a backer board are clamped to the spacer and I am pushing through the dado.

Note the masking tape throat plate. The jig itself provides a throat for the Dado set, the tape just keeps down the sawdust.

Clamping the work piece at the necessary angle is difficult. I used tapered shims to get a straighter purchase for the clamps.

Clamping the Workpiece

Clamping the Workpiece

 

Since the stacked Dado set cuts a square bottomed slot, but the edge parallel fingers require a trapezoidal hole, there is a small triangle of material that must be removed from each of the slots by hand.

Here I am knifing the edge of the triangular area.

Knifing the Slots

Knifing the Slots

 

The small side of the triangular areas can be sawn.

Sawing

Sawing

 

One of (many) practice pieces showing the small triangular area at the top of each slot that must be removed. Here I have defined the triangle using a straight edge and utility knife, also the small side has been cut with the dovetail saw.

DSCF0324

 

Now to remove the waste from the triangular area with a paring chisel.

It might be possible, if thinner stock is used, to build a fixture and do the clean out with a 14 degree dovetail router bit. If I had to do a lot of these I would investigate but it doesn’t take long with a sharp chisel.

Paring the Slots

Paring the Slots

 

Not a bad dry fit.  The material is cupped a bit which left some spaces but I think it will pull together with sufficient glue clamps.

The sloped sides are going to be a problem on the glue up.  I will make some 15 degree cauls to keep the clamps from sliding off, also will use strap clamps.

Practice Piece

Dry Fit Practice Piece

 


Finished Compound Angle Projects


 

This is the finished Roy Underhill Memorial Tool Tote created with the compound angle box joint jig.

First Tool Tray

First Tool Tray

 

Close up of the compound miter box joints on one end of the tool tote.  I don’t have all the cool hand tools Roy has so this project was built with machines.

Corner View

Corner View

 

Detail showing how the handle is mortised into the end pieces. Just like Roy’s.

Handle Detail

Handle Detail

 

This is a smaller tray in Cherry.

Tool Tray in Cherry

Tool Tray in Cherry

Follow

Get every new post delivered to your Inbox.