Warning: Creating default object from empty value in /home/mcmaster/public_html/hackhut.com/wp-content/plugins/download-monitor/classes/download_taxonomies.class.php on line 156

Warning: Creating default object from empty value in /home/mcmaster/public_html/hackhut.com/wp-content/plugins/download-monitor/classes/download_taxonomies.class.php on line 156

Warning: Cannot modify header information - headers already sent by (output started at /home/mcmaster/public_html/hackhut.com/wp-content/plugins/download-monitor/classes/download_taxonomies.class.php:156) in /home/mcmaster/public_html/hackhut.com/wp-includes/feed-rss2.php on line 8
HackHut http://hackhut.com A network for hackers/DIYers to host their work. Fast, free, and simple Mon, 05 May 2014 11:44:02 +0000 en-US hourly 1 http://hackhut.com/?v=4.2.4 Building a Magnetic Tape Recorder from Scratch (1949-1952) http://relwin.hackhut.com/2014/02/07/building-a-magnetic-tape-recorder-from-scratch-1949-1952/ http://relwin.hackhut.com/2014/02/07/building-a-magnetic-tape-recorder-from-scratch-1949-1952/#comments Fri, 07 Feb 2014 22:32:23 +0000 http://83.87 I’ve known Hans many years and one day he mentioned a project he made as a youth growing up in post- WWII Germany. He finally sent me his notes so that I may share them online.

 

Building a Magnetic Tape Recorder from Scratch, (1949-1952)

 by  Hans G. Mesch

It all started with a letter to our regional radio station in Hamburg, the Nordwest Deutscher Rundfunk (NWDR), when a friend and I politely requested a closer look at the technical part of the radio station.

As a 16-year-old boy this was my greatest wish. Ever since I built a crystal radio as a 13-year-old, and a radio with German military surplus tubes (RV12-P2000) as a 14-year-old, I knew working with radio equipment was going to be my future.

About one month later I received a reply and a date: Sunday, June 12, 1949 / 10 o’clock in the morning. I was allowed to bring one friend.  I chose my friend Gerhard. At 10 o’clock sharp we were met by an engineer who took us on a two hour tour, from studio B through control rooms and concert halls, where the performances were recorded on magnetic tape recorders for later transmission. Finally we were taken into a studio where our conversation was recorded on magnetic tape and thereafter played back to our amazement!   We heard voices we did not recognize. That was the moment I decided I was going to build a magnetic tape recorder. Little did I know about the difficulties I had to face, primarily due to my lack of knowledge.  It all started with lots of experimentation.  I did understand the basic principle of the recorder but was missing the finite technical points that could only be achieved by reading the appropriate literature.  However, technical literature was difficult to find in those days.  With the moral support from my friend Gerhard we planned our project.

The tasks that needed to be addressed were the following:

1) The Magnetic Tape:   We were told the tape was coated with small metal particles. We found an old 8mm film on a 3 inch diameter spool. With a fine metal file we slowly and laboriously removed the desired metal shavings from a block of steel. Thereafter we glued the metal shavings onto one side of the 8mm film strip — what a job!

2) The Recording Tape Head: We knew that the tape head needed to be non-magnetic. We traded a multi position rotary switch for a coil wound on a Mu-metal core. After removing the thicker windings we cut  a very narrow slot into the ring and wound hair thin wire through the slot, 4000 windings to be exact. Gerhardt and I took turns, making it a weekend job. It was time-consuming because about every 50th winding the wire broke and had to be soldered and insulated.

3)  The Tape Transport: We employed a small 12 VDC motor to turn an empty 3 inch spool to unwind the loaded 8mm film spool while pressing the film against the recording head.

4) The Playback Head:  At the time it was our plan to also use the recording head as playback head.

5) The Signal Amplifier: Months before, I had built an amplifier for an old record player, which also served as a PA system. The vacuum tubes had been removed from military radio equipment that the German Army had left behind in the woods during the last days of the war.

Testing the homebrew PA

Testing the homebrew PA

6) Erasing the Magnetic Tape: Easy, use a magnet–WRONG!  Little did we know at the time, total magnetic saturation of the tape made the detection of future recordings for the much smaller recorded signals impossible.

Tube amplifier schematic

Tube amplifier schematic

7) The Final Test: We finally shouted into the carbon microphone as the 8mm film rushed across the slit of the recording head. We then connected the recording head to the input of our amplifier. After rewinding the 8mm film our prerecorded “magnetic tape” passed once more across the now playback head. – We heard nothing! We repeated it several times with the highest amplifier gain setting and still — wait, did you hear that? No.  – Again, nothing.

We realized then the 8mm film was too thick and indeed the whole thing was nothing but a pipe dream. I had lost all hope. Meanwhile I worked on other electronic projects that had caught my interest.

Had it not been for my friend Gerhard who encouraged me not to give up on the Magnetic Tape Recorder, the project would have stopped right then and there.  Of course, we knew that without the tape the professionals were using, our project would have no chance for success.

The BASF ( Badische Annelin und Soda Fabrick) in Bavaria was the only company that produced this tape. But to purchase such a tape was another story!  Our first letter to BASF: Received no answer. Our second letter was answered: “ BASF only sells to radio stations and film studios.”  In our third letter we explained what we boys were trying to accomplish.  Someone at BASF must have had a heart because one month later, to our astonishment, we received a 1000 meter (3000ft) tape for the price of the 20.- DM.

It took me a while to come up with a better tape transport for the much larger tape reels. Two old turntable discs supported the tape but the right motors were hard to find. With my 18th birthday coming up by the end of the year I wished for money to buy a synchronous drive motor and another smaller (fan) motor to the wind our precious tape.  I had also repaired radios, vacuum cleaners, doorbells, etc. that brought in some more needed money.

With a rather crude transport system mounted on a plywood board, the new magnetic tape and the home-wound recording/playback head we actually produced the first positive results. Nothing to get too excited  about, but a low volume garbled voice was audible and sure sounded better than nothing at all.

Finally, we identified the recording head as the weak link in the system.  Months later we discovered the location of the AEG supply store in Hamburg that dealt with spare parts for AEG and Telefunken magnetic tape recorders.  The idea was to purchase a used recording head.   After a long time the AEG clerk returned to the desk and asked for the recorder model number.  We told him we had not assigned one yet.  When he found out that we were going to build a tape recorder from scratch he advised us to save our money because it had been unsuccessfully tried before. Twenty minutes later we left the AEG supply store with a 30.- DM used playback head.

One could tell it had been used because the playback head had worn down some of the Mu-metal across the slit. A distinct difference between our head and the AEG head was the width of the slit. Our slit was about 1 mm wide — the AEG slit was less than 0.1 mm (meaning better frequency response). The AEG Mu-metal ring consisted of two halves, each side wire wound.  The two halves were mounted between two cast iron rings, a very smart design.  From now on we were able to show some rewarding progress, slowly, step by step.  The new head functioned as recording and playback head and for the first time we heard our voices more clearly, but still not loud enough. We solved our problem by building a preamplifier with two additional tubes.  However, excessive 50Hz hum put a damper on our progress. (The German Power stations generate 220 Volt AC, 50Hz)

Preamp schematic

Preamp schematic

The partial solution to the problem was found by relocating our power transformer as far away from the playback head as possible and then rotating the transformer slowly for a minimum of 50Hz hum.  By now we had used about half of our magnetic tape without erasing the pre-recorded section. Erasing the tape with a magnet was a no-no!

Since Christmas 1950 was near, I was hoping for money to buy the missing recording and erasing heads.  Santa was good that year. So, we were not only able to buy two heads but also a better synchronous motor to allow us to move the magnetic tape in a more constant speed (At that time we had not heard of piston drives.)   Meanwhile we found some literature (Radio Magazine) describing how magnetic tapes are erased with a 32 kHz signal. We found a schematic for a simple oscillator and calculated the capacitance and inductance required. We had to wind our own coil for the 32 kHz oscillator. Having found a coil of unknown inductance, we needed to determine the constant (K) of the ferrite core. We accomplished that by placing a  500 microfarad capacitor in series with the coil and placed the LC network between our radio receiver antenna input and the antenna. We selected a radio station with a known frequency and then started to unwind the coil until the station was no longer heard. We then disconnected the coil and counted the remaining windings of the RF coil.  Now we knew the number of coil windings.  We also knew the frequency and the capacitance.  With that data we were able to determine the constant K of the ferrite core, enough information to calculate the windings for the 35 kHz oscillator.  In order to make sure we were providing enough RF power we selected the high-power LS50, a tube used in military radio equipment.  We also read that a small amount of the 32 kHz RF signal would be beneficial for the demagnetization of the playback head.

The final results were stunning.  The quality of our voices had improved and the signal was also more amplified than before.  However, the music recordings left something to be desired because the tape speed was not constant.  The two guides that positioned the tape over the three heads were stationary and not turning. We later found some rollers that improved the tape’s constant speed.

In spite of all progress made over the last few months we still could not totally get rid of the 50 cycle hum during playback recordings.  I am not sure who came up with the idea, but by placing a coil with about equal impedance of that of the playback head, wired between the playback head and the preamp, we were able to reduce the hum.  We positioned the coil several centimeters below the playback head and turned the coil around until the 50 Hz signal was almost completely canceled and only a slight hiss was audible.  We then found a spot where we could mount the coil, generating the same results.

Radio Shack in the attic

Radio Shack in the attic

Approximately 1 ½ years had gone by since we started this project.   The reasons were component delays, other more interesting projects, and extreme hot and cold weather conditions experienced throughout the year under the attic roof, without insulation for my Radio Shack.  Even a thick warm Jacket and Grandma’s heating pad on my back would not allow me to stay up there more than 20 minutes during the winter months.

Testing the recorder, Feb. 1951

Testing the recorder, Feb. 1951

At the age of 18 I started my three year apprentice’s period in a  radio shop and schooling in my hometown (Kellinghusen) where I had access to a lathe, allowing me to improve the rollers of the tape feed and other drives. Finally I mounted all components on a large aluminum sheet.  A friend of mine did not like the wooden frame I had built  and took it upon himself  to surprise me with a more professional version.

Finally complete, April 1952

Finally complete, April 1952

We later added some features to our Tape Recorder that allowed us to produce echos during the recording operation by feeding a small signal from the playback head to the input of the recording amplifier, among other things.

When word got out that we had built a tape recorder we received invitations from our small City Symphony Concert group to record their practice sessions and another from a Senior Group for recording one of their speeches. Since we had no idea what to charge for our services, we accepted donation which were more than generous.

Finally complete, inside, April 1952

Finally complete, inside, April 1952

It must have been late 1953  when the first commercial reel-to-reel Magnetic Tape Recorders became available in Germany, made by AEG and Grundig.

===========================

A lot of time has passed since then. I spent about 6 Years in the Semiconductor industry (IR) and another 32 Years in world of Aerospace Engineering (at TRW, Redondo Beach, Ca.) and always enjoyed my work.

My friend Gerhard studied to be a lawyer and retired as a Judge in the city of Hamburg .

I would have never written about this subject, had it not been for my friend Randy Elwin who bugged me more than once to tell the story.  I have to say it was relatively easy for me because I had kept my notes and pictures over the years.  And as a benefit, it was nice going down Memory Lane once more. Thank you Randy!

Typical Magnetic Tape Recorder, the same we saw at the  NWDR                                           Radio Station in Hamburg, in the year 1949. (Picture from Internet)

Typical Magnetic Tape Recorder, the same we saw at the NWDR Radio Station in Hamburg, in the year 1949. (Picture from Internet)

 

 

Read about magnetic tape development http://en.wikipedia.org/wiki/Magnetic_tape_sound_recording

]]>
http://relwin.hackhut.com/2014/02/07/building-a-magnetic-tape-recorder-from-scratch-1949-1952/feed/ 0
Investigation of an OCXO and EFC Sensitivity http://punish3r.hackhut.com/2014/01/22/investigation-of-an-ocxo-and-efc-sensitivity/ http://punish3r.hackhut.com/2014/01/22/investigation-of-an-ocxo-and-efc-sensitivity/#comments Wed, 22 Jan 2014 20:35:19 +0000 http://92.173 For my GPSDO project I’ve opted for a Piezo 2940210 VCOCXO at 10 Mhz.  There is a dearth of information on this particular module available online, so I’ve put up this page to (hopefully) help anyone who has purchased one of the many that are currently available in the surplus market.

(A notation notation:  I utilize .....

Read the Rest]]> Piezo Crystal Company Model 2940210 OCXO

For my GPSDO project I’ve opted for a Piezo 2940210 VCOCXO at 10 Mhz.  There is a dearth of information on this particular module available online, so I’ve put up this page to (hopefully) help anyone who has purchased one of the many that are currently available in the surplus market.

(A notation notation:  I utilize “E” notation to indicate orders of magnitude; thus 1.5E-6 is in fact 0.0000015 and 7.4E3 is 7400)

Via the information available at N4IQT.com, the following specifications apply to this OCXO module:

Output Specifications

  • 10 Mhz Square Wave
  • 2Vp-p±10% (2.053V in this case) into 50Ω
  • Load of 50W±5%
  • Harmonics <-25dBc and Spurious signals <-60dBc

OCXO Stability

  • Ambient Temperature Stability of <±2E-9 from -30C to 60C, Referenced at 25C
  • Daily Aging Stability of <±1E-9 after the first 30 days, <±5E-10 after the first 90 days
  • Yearly Aging Stability of <±1.5E-7
  • 10 Year Aging Stability of <±4E-7
  • Input Voltage Stability of <±5E-10 for a ±2% Voltage Change
  • Short Term Stability of <±1E-10 per second
  • Load Stability of <±1E-9 for a ±5% Load Change
  • Phase Noise @10Hz, <-105dBc;  @100Hz, <-125dBc; @1kHz, <-145dBc

Pinout

  • Pin 1: Ground
  • Pin 2: EFC Voltage (0-5)
  • Pin 3: ??? (See Below)
  • Pin 4: +24V
  • Pin 5: ??? (See Below)
  • Pin 6: 10MHz Output

And here is where I began to run into conflicting information:

  1. Heater Voltage (Pin 5) of either +15V or +24V
  2. What does Pin 3 output?  Is it a VRef?  A TTL level oven monitor?
  3. Is the Output (Pin 6) 2Vp-p as listed in the spec, or 4Vp-p?
  4. What is the EFC Sensitivity in Hertz per Volt?  Is it linear?
  5. What is the overall draw on the 24V supply?

And so, not being one to let others do the heavy lifting, I broke out the test gear and started measuring…

Pin 5, Heater Voltage and Pin 3 Output

IMG_1129 So, is it +24V or +15V?  I breadboarded a 7815 and a 7805 – for the heater and EFC, respectively – and brought the +15v to Pin 5.  I routed Pin 3’s output through a 50k precision 10-turn potentiometer as a voltage divider to apply a variable voltage to the EFC pin, Pin 2.

 

 

IMG_1124Upon applying 24 volts, the oscillator began operation and Pin 3 showed 5.12V.  So far so good; the pot dividing the pin 3 voltage was adjusted to put 2.5V to the EFC pin and the oven was left to settle.  About five minutes in, the frequency began to drop very quickly and I discovered that the EFC voltage had inexplicably dropped to 200mV in an instant.  Pin 3 measured <0.5V at this time.  Hmmm…

In an attempt to lower the time spent on this endeavor, I routed Pin 3 to the board and wired in an LED and resistor to act as an indicator.  I also brought the 7805 output to the voltage divider pot and rebalanced it to 2.500V.  After allowing the oven to cool slightly, I reapplied power and the Pin 3 LED immediately illuminated, only to fully extinguish less than a minute later.  So.  Pin 3 is in fact a TTL level oven indicator and NOT a voltage reference.

Timing the oven runtime on a coldstart, the 15V input is fully sufficient to get the oven up to temperature and keep it there indefinitely.  As much as I would like to, I won’t be simplifying my power supply and running it on 24V.  I do, however, wonder about that Pin 3.  After the initial warmup, it does not go high again.  Ever.  But I know that oven has to be running intermittently to maintain the temp.  Curious.

Pin 6, Output Level

Pin 6 does indeed output 2Vp-p

Supply Draw

IMG_1121IMG_1127At 24.0V, the OCXO draws 280mA during warmup and 170mA during constant operation.  Keep in mind this is with the 15V and 5V regulators taking their source from the 24V supply as well, so there’s a reasonable bit of that wasted as heat.

 

EFC Sensitivity: A Primer

Ah, the real meat-and-potatoes of this investigation.  A critical piece of information for the disciplining of a VCXO is the sensitivity of the EFC input.  The units are in Hertz per Volt (which does not need to reduce to (s^2*A)/(m^2*kg) for those of you obsessed with dimensional analysis…).

A good example to work with are the HP 10811A and 10544A models, both of which have an ‘S’ (Sensitivity) of 1E-8 per volt.  What does this mean?  Well, the value is referenced to the output of the oscillator (10MHz or 1E7 Hertz), so in plain language, a change of one volt on the EFC equates to a change of 0.1 Hz in the output frequency.

The range of EFC input on the HP units is -5V to +5V, thus the control range is (5-(-5))*(1E7*1E-8)=1, or simply one Hertz.  Assuming you are using a DAC to drive the EFC, you can then use the number of DAC input bits to determine to smallest possible change in voltage and, by correlation, the smallest possible change in output frequency.

Continuing to work with the HP units and assuming an 18-bit DAC (which is what I’m using for this project), the smallest possible change in EFC voltage would be equal to 10/(2^18-1) volts, or 3.815E-5, or 38.15μV.  We can then apply this voltage to the EFC and net a change in output frequency of 0.1*3.815E-5= 3.518 μHz.  Referencing this back to the scale of the oscillator, a one bit change in the DAC output equates to a 3.815E-13 change in output.

Why does this all matter?  Well, the method of oscillator disciplining will determine a ‘floor’ beyond which the method cannot have a higher stability.  In this particular case, a GPSDO PLL, the stability floor is in the neighborhood of 5E-12 within a reasonably short (1E5 to 1E6 seconds) sample period (as a datapoint that’s five parts per trillion, which would be the scalar equivalent of measuring the circumference of the Earth in inches (a little over 1.577 billion) to within eight thousandths (±0.004″)).  We need the ‘step’ size – 3.815E-13 in the above example – to be far smaller than that to effectively maximize the utilization of the disciplined stability.  If the step size were exactly the same as the minimum stability, the system would continuously oscillate around the stability floor of the disciplining circuit, wasting all your hard work in making such a stable reference.

If you find yourself intrigued by the concepts of precision timing and wish to know more about accuracy, precision, stability and timing in general, check out Tom Van Baak’s awesome website, LeapSecond.com

You can also search for “Allan Variance” to investigate the measurement of stable timing sources; I have glossed over many of the details in this writeup and it really is a fascinating study.

EFC Sensitivity: Piezo 2940210 OCXO

As you can see below, my initial results showed a sensitivity of 4.6 Hz/Volt  (seen as the leading coefficient of the linear approximation), or 4.6E-7 with reference to the output frequency.   That and the aging of the unit has driven the center frequency of the EFC to about 4.34V (it should be ~2.5V, the center of the range) which will require ‘trimming': an adjustment to the crystal oscillator circuit to change the output frequency without changing the EFC voltage.

Sensitivity Graph

The OCXO has presumably been sitting, disconnected for a long while.  As such, this value is prone to drift (currently at around 0.25 Hz/Hour) until the crystal “aging” settles down.  Until that time, the OCXO cannot be trimmed effectively for constant operation.  However, this is the lesser of two potential issues…

If the full range of 0V to 5V is made available to the disciplining circuit, the scale of the sensitivity of the OCXO becomes problematic.  From the above equations, the 1-bit change in output frequency is a whopping 4.6*((5-0)/2^18-1), or 87.74 μHz.  As compared to a 10811A, that’s twenty five times larger!  Using a reference to the output frequency, that puts the sensitivity at 8.774E-12 (!!!) which is far beyond what we need it to be if we’re bothering to develop a control system with a stability floor of 5E-12.

So what’s to be done?  There are two obvious answers, assuming you don’t want to buy a new crystal oven.  One is free(ish) and one is very much not free.  The latter answer is buy a better (read: more bits) DAC.  Easy, right?  Spend anywhere from $2 to $20 and be done with it.  Right?

Wrong.  More bits = new chip = more i/o = more expensive control system = new microcontroller = new program.  So the standard application of MOAR in this case is not a good thing…  In fact it’s so bad, it means a ground-up redesign of the system, which is a major wombat in my mind.  Rather, let’s consider a change in control schema…

The free(ish) option is to change the range of the EFC control voltage.  Just because the OCXO can take 0V to 5V doesn’t mean we have to give it that.  To investigate this, we turn the above equations ‘inside out’ and solve for the range, rather than the step size.  So what if we wanted the 3.518 μHz step size of the HP oven?  At 4.6 Hz/volt this would equate to an EFC voltage change of 3.518E-6/4.6 = 7.648E-7 volts, or 764.8 nV.  Applying the same equations again, the full scale of the EFC is almost exactly 0.200 volts.  Centering this around 2.5 volts nets a range of 2.4 to 2.6 volts.  See?  Easy.

I’ll hopefully be expanding on this as the GPSDO controller portion of this project develops.  Thanks for the read!

]]> http://punish3r.hackhut.com/2014/01/22/investigation-of-an-ocxo-and-efc-sensitivity/feed/ 0
GPSDO OCXO Investigation http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/ http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/#comments Sat, 04 Jan 2014 02:21:22 +0000 http://92.166 I’ve done a quick writeup on part of a project I’ve been mulling over for a few years now, a GPS Disciplined Oscillator.  Specifically, the article covers the OCXO – Oven Controlled Crystal Oscillator – made by Piezo Crystal Company (now Vectron), a model 2940210.  I’ve been unable to find much about this unit online, so I thought I would .....

Read the Rest]]>
I’ve done a quick writeup on part of a project I’ve been mulling over for a few years now, a GPS Disciplined Oscillator.  Specifically, the article covers the OCXO – Oven Controlled Crystal Oscillator – made by Piezo Crystal Company (now Vectron), a model 2940210.  I’ve been unable to find much about this unit online, so I thought I would share what I have found thus far.  Leave any questions in the comments!

]]>
http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/feed/ 0
GPSDO OCXO Investigation http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/ http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/#comments Sat, 04 Jan 2014 02:21:22 +0000 http://92.166 I’ve done a quick writeup on part of a project I’ve been mulling over for a few years now, a GPS Disciplined Oscillator.  Specifically, the article covers the OCXO – Oven Controlled Crystal Oscillator – made by Piezo Crystal Company (now Vectron), a model 2940210.  I’ve been unable to find much about this unit online, so I thought I would .....

Read the Rest]]>
I’ve done a quick writeup on part of a project I’ve been mulling over for a few years now, a GPS Disciplined Oscillator.  Specifically, the article covers the OCXO – Oven Controlled Crystal Oscillator – made by Piezo Crystal Company (now Vectron), a model 2940210.  I’ve been unable to find much about this unit online, so I thought I would share what I have found thus far.  Leave any questions in the comments!

]]>
http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/feed/ 0
GPSDO OCXO Investigation http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/ http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/#comments Sat, 04 Jan 2014 02:21:22 +0000 http://92.166 I’ve done a quick writeup on part of a project I’ve been mulling over for a few years now, a GPS Disciplined Oscillator.  Specifically, the article covers the OCXO – Oven Controlled Crystal Oscillator – made by Piezo Crystal Company (now Vectron), a model 2940210.  I’ve been unable to find much about this unit online, so I thought I would .....

Read the Rest]]>
I’ve done a quick writeup on part of a project I’ve been mulling over for a few years now, a GPS Disciplined Oscillator.  Specifically, the article covers the OCXO – Oven Controlled Crystal Oscillator – made by Piezo Crystal Company (now Vectron), a model 2940210.  I’ve been unable to find much about this unit online, so I thought I would share what I have found thus far.  Leave any questions in the comments!

]]>
http://punish3r.hackhut.com/2014/01/03/gpsdo-ocxo-investigation/feed/ 0
Time Lapse photography http://volt.hackhut.com/2013/06/14/time-lapse-photography/ http://volt.hackhut.com/2013/06/14/time-lapse-photography/#comments Thu, 13 Jun 2013 23:19:36 +0000 http://501.11 So, I found an old camera I don’t use anymore and was wondering what shall I do with it. The camera has manual mode – good! One microcontroller later I had a working prototype of time-lapse photography set. I soldered a pair of wires to the shutter button and connected it to AVR AtTiny13 through a transoptor. The video below .....

Read the Rest]]>
SunriseSo, I found an old camera I don’t use anymore and was wondering what shall I do with it. The camera has manual mode – good! One microcontroller later I had a working prototype of time-lapse photography set. I soldered a pair of wires to the shutter button and connected it to AVR AtTiny13 through a transoptor. The video below is a result of 200 photos taken with an interval of 15s. The photos were rendered into a 20fps movie using free software called PhotoLapse. So I basically compressed almost an hour into a 10s clip. Now I see that focus of the camera wasn’t set correctly (the pictures are a bit blurred) but I think the effect is still nice.
//For best results please watch the video directly on YT and change the quality to ‘original’

Click here to view the embedded video.

]]>
http://volt.hackhut.com/2013/06/14/time-lapse-photography/feed/ 0
Portable Ammo Box Power Supply Unit PAB-PSU http://badwolf.hackhut.com/2013/02/02/portable-ammo-box-power-supply-unit-pab-psu/ http://badwolf.hackhut.com/2013/02/02/portable-ammo-box-power-supply-unit-pab-psu/#comments Sat, 02 Feb 2013 15:54:39 +0000 http://35.710 When you’re in need of a power supply,the obvious solution is to use a computer’s PSU.

When you’re short of a proper casing,why not use what’s on hand and yesterday,what was on hand was a 50 cal Ammo Box.

I know it’s not a world’s first but I really needed a PSU for some testing quick and this has been fitted together .....

Read the Rest]]> When you’re in need of a power supply,the obvious solution is to use a computer’s PSU.

When you’re short of a proper casing,why not use what’s on hand and yesterday,what was on hand was a 50 cal Ammo Box.

I know it’s not a world’s first but I really needed a PSU for some testing quick and this has been fitted together in like 4 hours.

Features:

-Portable :  Power cable is tied to the back,4 hook up wires are stashed inside a container glued to the inside of the lid.

-Light

-Strong and resistent : It’s an ammo box after all!

-Multiples outputs + 1 adjustable :  1.7/3.3/5/7/8.7/12/15.3/17/24  Volts using combinations of -12/0/3.3/5/12 V outputs

-Safe! : Most of the safety features are built-in the computer’s PSU itself,over-current/heat/shortcircuit automatically shut the unit down,reset and good to go!

Enjoy!

]]> http://badwolf.hackhut.com/2013/02/02/portable-ammo-box-power-supply-unit-pab-psu/feed/ 0
Training your PID http://lackawanna.hackhut.com/2013/01/30/training-your-pid/ http://lackawanna.hackhut.com/2013/01/30/training-your-pid/#comments Wed, 30 Jan 2013 22:04:39 +0000 http://91.536 Control theory must be on the short list for the most important subject that no one talks about. Break open a hobbyist robotics book and you are lucky if control systems are even mentioned. Control systems run our cars, fire our multi-million dollar missiles, and keep our buildings at the right temperature. The phase locked loops (PLLs) .....

Read the Rest]]>
Control theory must be on the short list for the most important subject that no one talks about. Break open a hobbyist robotics book and you are lucky if control systems are even mentioned. Control systems run our cars, fire our multi-million dollar missiles, and keep our buildings at the right temperature. The phase locked loops (PLLs) that set the frequency for our modern radios, televisions, and cellphones, and which have replaced countless analog tuned circuits, are just another PID based control system.

The old analog control systems, as well, have been silently replaced by their digital implementations. Witness the number of “computers” inside a car or a jet fighter built today. Control systems are now seemly everywhere and live in places you least suspect.

As for why control systems are not talked about, the mathematics is just hard. Although real world examples of second order systems are abundant, such as a swinging pendulum, it is the math behind the dynamic behavior of a control loop which is amazingly obtuse.

That said it is possible to design a PID control without touching the complex math. For this note I implemented a temperature control system that maintained a constant temperature on a simple resistor.

As you know there are three gain constants, one for each term used in a full PID control implementation. The three terms are the Proportional, the Integral, and the Derivative.

The PID algorithm itself is very small. To save space on my ATtiny13 I used shift multiplication instead of regular multiplication. If the particular gain value is set to negative the term is ignored.

int8_t p_gain;
int8_t i_gain;
int8_t d_gain;

static int16_t i_state, d_state;

void reset_pid ()
{
  i_state = 0;
  d_state = 0;
}

int16_t update_pid (int16_t error)
{
  int16_t drive = 0;

  drive += (p_gain < 0 ? 0 : error << p_gain);             // P term
  drive += (i_gain < 0 ? 0 : (error + i_state) >> i_gain); // I term
  drive += (d_gain < 0 ? 0 : (error - d_state) << d_gain); // D term

  i_state += error;  // update I state
  d_state = error;   // update D state
  return drive;
}

So how does one find the correct PID gain constants? What should the sampling frequency for the loop be? And an issue I faced with my own implementation, how much current should be switched through the heating element, the resistor.  Using some mathematical method is an option. There is also the open source simulator Scilab. And there is always the option of tuning the control loop the old analog way with a signal generator and oscilloscope.

There is another option though. A great benefit from implementing a PID controller in software is that its state can be logged out, say, to a host computer through a serial port. In additional a step function can be simulated in software without ever having to use a signal generator. A step function lets one see the loop’s dynamic behavior. This is accomplished by changing the PID control’s set point, or target value, to another value a good distance away. The article “PID Without a PhD” by Tim Wescott describes this particular method.

Below is my code for simulating a step function and then logging the sensor input temperature read by the PID algorithm. The three gain constants are set beforehand. The “ready” variable is set every quarter of a second by an interrupt handler.

reset_pid();                          // clear the PID algorithm's state

for (ready=0, n=0; n<300; n++) {      // do 300 iterations
  while (!ready) ; ready = 0;         // wait until time for a new sample

  temp = read_adc();                  // read the input temperature
  if (n == 0) target = temp + step;   // suddenly increase the set point
  drive = update_pid(target - temp);  // pass the error to the PID
  set_pwm(drive);                     // limit and set the PWM 

  put_char(',');                      // log the temperature
  put_hex(temp);                      // to the serial port
}

put_char('n');

Initially I only switched 60mA through a 1/4W 100ohm resistor, or about 360mW. This was not enough to raise the temperature by more than 4 degrees Celsius making it hard to ring the loop. (Apparently a 1/4W resistor has a thermal resistance of about 12C/W.) I decreased the resistor to 47ohms which increased the switched current to 125mA. I was then able to raise its temperature by at most 10 degrees Celsius. Now using a 5.4 degree Celsius step function, corresponding to an increase in value of 50 from the ADC, any ringing nicely stands out.

The IRF510 switching transistor fully turned itself on with a Rds of less than 1ohm with only a gate voltage of 5V. This is contrary to lore that such a low gate voltage will not work. The drain was at 6V when off. The switching caused a good amount of noise so a .1uF capacitor across the temperature sensor was needed otherwise the sensor was unusable.

Figure 1 shows the behavior of only the proportional term whose gain was varied from 1 to 7. Ringing is clearly evident with the higher gains.

Figure 2 shows the behavior of only the integral term for various gain terms. The windup and winddown with the higher gains can be seen. Please note that shift division is used to calculate the I term.

You might have noticed in figure 1 that the target value of 50 was never reached. This is where the I term comes in. The I term learns from the past. While the P term is concerned with the error in the present, the I term remembers the past to inform its current value. The article “PID Control without Math” by Robert Lacoste explains why this is important.

So if you think your PID is broken because it is not resting on the right value, as I did, it is not. The “loss” within the control system must be compensated by the I term as explained by Lacoste. Figure 3 shows the result when the P and I term are combined. The target value of 50 can now be reached.

While the I term looks back, the D terms looks to the future. The D term senses the speed of the error and uses that to gauge how much drive to apply. Like riding a bike, it is better to coast to a stop than to slam the brakes. The D term as a result will dampen the response of the loop. I was not able to get any meaningful data from runs using the D term alone. Wescott says as much. He recommends setting the gain for the P term to the lowest possible value. This was done for figure 4. The runs have been visually staggered so the effect of the D term can be seen better.

From all these figures I picked the putative best gain constants, P=2, I=5, and D=5. But to sure, I put together a final training round with 27 contenders. The staggered results are given in figure 5. From this the optimal PID gain constants appear to be now, P=1, I=5, and D=4. This is quite a bit different from my first choice. Nevertheless this is still not the best. See later in the note.

With respect to the sampling rate, I found that a 1 second sampling rate for my heater was too long. Any control loop will of course exhibit some delay and that delay probably needs to be observable by the PID control. At least this was my conclusion. A quarter second sampling rate allows for this. The initial delay before the temperature starts rising at the beginning of the step function can be easily seen at this sampling rate. A faster rate was not tested however because my software UART could not handle the speed.

The rule of thumb according to Wescott is that the sample time should be 1/10th to 1/100th of the settling time. The settling time is the time it takes for the system (the transient response) to move to and remain within a certain percentage (say 10%) of a steady state value.

If the sampling rate, coupled with the thermal mass of the heating element, is functionally equivalent to the role the loop filter plays in a PLL then it will be the prime factor in the transient response of the PID control. (I think that sounds right especially since F=ma as we remember.) The transient response determines the settling time, the dampening ratio, the overshoot amount, the damped natural frequency, and the loop’s bandwidth.

With the second optimal solution above I found its settling time to be around 110 seconds or 440 times the sampling time. So maybe it is not so optimal. Trying again from figure 5 and using the gain constants, P=3, I=5, and D=4, the settling time came out to be 21 seconds or 84 times the sampling time. These are the gain constants I will use for my PID controller. See figure 6.

Going out on a mathematical limb and looking at figure 1, the damped natural frequency from the P=3 and P=4 runs is about 1/(128 samples) or 1/(32 seconds). This is calculated from the ringing on these runs. The equation for the damped natural frequency is the undamped natural frequency (that is the bandwidth of the control loop) times the square root of (1 – the damping factor squared). Now estimating that the damping factor for my PID controller is around 0.8, my loop’s bandwidth can be calculated to be 0.05 Hz or 1/(20 seconds). My sampling rate is safely 80 times faster than this.

By the way, this leads me into another way to find the loop’s bandwidth. Since the damped natural frequency and undamped natural frequency approach each other as damping decreases, drive the loop into ringing with high gain and then use that ringing frequency as the bandwidth.

To sum up, training is key. So put your PID controller through its paces and I will meet you at the track.

]]>
http://lackawanna.hackhut.com/2013/01/30/training-your-pid/feed/ 0
Roomba Hacking 101 http://skaterj10.hackhut.com/2013/01/22/roomba-hacking-101/ http://skaterj10.hackhut.com/2013/01/22/roomba-hacking-101/#comments Tue, 22 Jan 2013 10:38:45 +0000 http://43.201

So you wanna hack a Roomba eh? Well here’s a collection of info to help you on your way. Myself, Jeremie, and Mark Martens did a little bit of the dirty work so you don’t have to. I hope you find this list of resources helpful:

First off somehow the ultimate resource for taking control of your Roomba, .....

Read the Rest]]>

So you wanna hack a Roomba eh? Well here’s a collection of info to help you on your way. Myself, Jeremie, and Mark Martens did a little bit of the dirty work so you don’t have to. I hope you find this list of resources helpful:

First off somehow the ultimate resource for taking control of your Roomba, which is the book:  “Hacking Roomba” by ThingM’s own Tod E. Kurt, managed to find itself on the interwebs as a full download and it hasn’t been taken down for some reason: http://www.robotiklubi.ee/_media/kursused/roomba_sumo/failid/hacking_roomba.pdf

Next you should know that while every Roomba is hackable from a general hardware perspective there is an easy way to hack em’ and there’s a hard way to hack em’ (Thanks for your hard work Hacker Dino!).  We’re just gonna focus on the easy way. Using the easy method we will absolutely need a Roomba that has  firmware that post-dates Oct. 2005, anything previous to that and you are most welcome to completely rip apart and repurpose your Roomba. The Roomba pictured (above) on the right was manufactured after October 2005 and includes what they call SCI (Serial Command Interface) Firmware. The one on the left isn’t as luckly. The SCI firmware allows  a Roomba to be externally controlled (via the SCI port) using a Microcontroller (Arduino/Freeduino/EZ-B) or other TTL-serial communications device such as FTDI breakouts, or Xbee/Synapse Wireless RF modules as well.

There’s a quick way to tell approximately what year your Roomba’s firmware is, just flip it over and find the manufacturing date, if it’s 2006 or later you are good, if it’s 2005 or earlier then you’ll have to dig a little deeper to find the exact date.

Finding your Firmware date

With a charged battery plugged in and Roomba off, hold down the power button down for 10 seconds. The Roomba will then start to continuously beep in a looping sequence. This morse-code beeping sequence is a date code in base 5 format, where “dots” equal 1’s and “dashes” are 5’s. These numbers add together to establish the firmware date. Its in the format: year-month-day with short pauses between them. Don’t worry if you miss the code the first time as it will continuously repeat the code until you power it down.

Here’s an example of the code: …. PAUSE – …. PAUSE —- .
Which translates to …. = 1+1+1+1= 4 PAUSE -…. = 5+1+1+1+1 = 9 PAUSE – – – – . = 5+5+5+5+1 = 21
So the date code is 04-09-21 = Sept 21, 2004.

Here’s the link where I got such info:
http://www.robotreviews.com/chat/viewtopic.php?t=2767

Note: If you’d like to attempt to update your Roomba’s firmware with the Scheduler please use it as a last resort as you could downgrade your firmware if you use it on a newer Roomba.

While it is possible to update a Roomba’s firmware with a Scheduler remote, unfortunately I haven’t found a Remote with firmware on it that post-dates Oct 2005. Also keep in mind that you either have to buy or build yourself a firmware uploading cable as you have to interface from the mini-B connector on the side of the scheduler remote to the SCI port on the Roomba. If you’d like to try to use the Scheduler remote to upgrade, the cable needed to program the Roomba has the following wiring pinout:

Mini-B USB                   7 Pin Din

1   RED +V                         1 +14.4V
N/C                                      2+14.4V

2   WHT  D-                        3 RxD
3    GRN  D+                      4 TxD
4    Goes to USB Pin 5   5 DD
N/C                                     6 GND
5    BLK  GND                   7 GND

In other words:

7 pin mini (1) connects to USB (1) +V
7 pin mini (2) No Connection
7 pin mini (3) connects to USB (2) D-
7 pin mini (4) connects to USB (3) D+
7 pin mini (5) connects to USB (4) GND
7 pin mini (6) No Connection
7 pin mini (7) connects to USB (5) GND

Pictured are the pinouts for the Roomba Female 7 pin Din and the Male Mini-B USB Connector, to make it easier for wiring a cable up. The cable plugs into the side of the Scheduler remote and then into the female SCI port of the Roomba. Follow the instructions from the pictures of the Scheduler Remote manual to apply a firmware update.

Note: A previous alternative to upgrading this way was to use an OSMO upgrade module for your specific Roomba, but unfortunately they are no longer available. Apparently though a fellow called Robot-Doc on the EZ-Robot forums may be able to help if you sweet talk him.

SCI Specs and Info

Here’s the Roomba SCI manual: http://www.irobot.com/images/consumer/hacker/Roomba_SCI_Spec_Manual.pdf

The SCI manual will give you the pinout of the SCI port as well as the commands to control your Roomba serially. One great command I found was to shut down the vacuum motor, this saved my head from exploding as the constant vacuum noise was a bit irritating while I was debugging. I can’t remember which code it was but I will update this post when I find it.

Serial Settings

Default baud rate: 57600
Alternate Default baud rate (using 1 of 2 configuration methods): 19200
Data bits: 8
Parity: None
Stop bits: 1
Flow control: None

Hardware Needed
  • iRobot Roomba Vacuum Cleaner – with Firmware later than Oct. 2005
  • 14.4V Roomba Battery
  • iRobot Charger (or equivalent power supply)

Specs for the iRobot Charger are:

Input – 120 VAC 60Hz 0.3A (20W)
Output
– 22VDC 0.75A – Tip Positive

A little note about the Roomba batteries:

Probably the number one reason why people either sell, give away, or throw away their Roomba is because the low end, blue NiCd based Battery sucks! They seem to run out of power extremely quickly, you’ll either want to upgrade to the Yellow Batteries or replace the batteries inside.

If you want to use factory batteries stick with the Yellow 14.4 3300mAhr NiMH batteries, even the older/worn out ones can run your roomba for at least an hour.

You could always upgrade your battery pack as well to 12 fresher Sub-C sized batteries (make sure you get the kind with tabs on them to easily solder them together). Please note that you’ll need a triangle bit to open the batteries up, or you can just use a flatblade that fits, or grind down a scrap piece of metal to fit.

New Roomba’s have a built-in shrink wrapped battery as opposed to an external removable battery, but not to worry their batteries usually last pretty well.

Building a Serial Communication cable

Just like above, when building a firmware update cable, this cable will only incorporate 3 signals (TXD, RXD, & DD) and 2 power lines (+14.V & GND).

To plug into the SCI port on the roomba you will need a mini Din connector, luckly the common PS/2 connector from an old mouse or keyboard fits quite nice once you have removed the center alignment tab. Use a pair of needle nose pliers to snap it off and you are on your way. The nice thing about a PS/2 connector is that it includes an alignment dimple at the top so you’ll never plug it in backward.

Be aware when salvaging a PS/2 connector that there are many connectors that use a reusable white thermo plastic called “Caprolactone” behind the connector for strain relief of the wires, and although it may look permanent it can easily be melted away with a heatgun.

If you don’t want to salvage a connector DJ from EZ-Robot found you can purchase PS/2 connectors sometimes quite easily from your local electronics shop. Here’s some instructions on how he easily interfaced an EZ-B to a Roomba.

To use an Arduino as the main controller first download a sample program found here and upload it to your Arduino. You’ll then want to hook up the hardware Arduino Pin 2 to Roomba TXD, Pin 3 to RXD, & pin 4 to DD and then you can rob power from the Roomba to power your Arduino from the +14.4V and GND pins to a 2.1mm Barrel plug (or you can use the Vin header). Instead of using hardware serial pins 0 & 1 we are using software serial on pins 2 & 3 to keep the hardware serial lines free for something like an xbee or synapse wireless module if we want to add it later. If you would rather use a different battery to supply your Arduino you can do that too, just make sure the GND references are tied together somewhere as both sides of the circuit need to share a common negative reference.

WIRING DIAGRAM

Now with everything plugged in, power on your roomba and your Arduino program should take over move the roomba in a certain pattern, and the front bump sensor should still be reactive. Keep in mind that you have other sensors on the Roomba to take advantage of and you now have the ability to add external sensors to the Arduino’s A/D ports if you like. Anyway, Congrats you’ve hacked your Roomba the easy way!

Couple of Troubleshooting suggestions

With the EZ-B I had a bit of trouble getting it to activate right away, turns out that with my Roomba I had to run a jumper from the DD line to Ground (breadboard jumpers work well for this) in order to take the Roomba out of sleep mode.

If your Roomba doesn’t seem to be communicating to the Arduino try swapping the Rx and Tx you may have mixed them up. It’s like I know this from experience or something :).

More great misc. resources:

http://blog.makezine.com/2008/02/29/how-to-make-a-roomba-seri/
http://www.girr.org/random_stuff/roomba.html

]]> http://skaterj10.hackhut.com/2013/01/22/roomba-hacking-101/feed/ 0
Keypad Ignition Lock for Car : Up for sale! http://badwolf.hackhut.com/2013/01/12/keypad-ignition-lock-for-car-up-for-sale/ http://badwolf.hackhut.com/2013/01/12/keypad-ignition-lock-for-car-up-for-sale/#comments Sun, 13 Jan 2013 03:27:19 +0000 http://35.707 Good day to all!

As you guys know,I’ve developped a keypad ignition lock for cars quite some time ago and now is the time to put them on sale!

I’ve personally designed,assembled and tested 3 of them so your cars can get that James bond look!

Demo:

*** The store is right here! ***

Info: Want to add a little theft deterrent to your ride? Maybe you’re .....

Read the Rest]]> Good day to all!

As you guys know,I’ve developped a keypad ignition lock for cars quite some time ago and now is the time to put them on sale!

I’ve personally designed,assembled and tested 3 of them so your cars can get that James bond look!

Demo:

Click here to view the embedded video.

*** The store is right here! ***

Info:
Want to add a little theft deterrent to your ride?
Maybe you’re just looking for that “Agent 007” or “Transporteur” look?

Well search no more!
This here is a hand assembled keypad activated ignition lock. It means that without you punching in the correct PIN, the car won’t start. Simple as that!
It doesn’t remove the need of a key though; it only adds another layer of security in the process of starting the engine. A relay is activated once the signal from the device is sent for 10 sec and the wire of your choice that once cut will render the ignition useless is plugged to it. Relay activate, cut wire ain’t cut anymore and voila!

Installation involves:
-Cutting a hole somewhere to fit the device
-Plugging it to 12V and Ground
-Cutting the ignition signal wire and connecting both ends to the relay’s screw terminal

A template to cut the device’s hole is included.

Features:
-Stainless steel laser cut faceplate
-A key switch with proper wiring is included to bypass the system if needed (optional)
-Durable Keypad
-Master PIN hard coded in the device used to change the actual PIN
-USB connector on the microcontroller for software update if ever needed
-Piezo speaker, green and blue led for feedback

Unlocking the ignition:
Punch in the PIN then press *,the green light turns on if it worked.

Changing the PIN:
Punch in the master PIN then press *, the device will beep 3 times. Punch in the PIN you desire to use then press * to confirm. Try out the new PIN to validate that it’s working.

———————————

Vous voulez ajouter un antivol supplémentaire à votre voiture?
Peut-être êtes-vous tout simplement à la recherche du look «Agent 007» ou «Transporteur” ?

Eh bien ne cherchez plus!

Ceci est un anti-démarreur à combinaison assemblé à la main. Cela veut tout simplement dire que sans le bon code PIN, la voiture ne démarrera pas. Simple comme bonjour!

Il ne supprime cependant pas la nécessité d’une clef, il ne fait qu’ajouter une autre couche de sécurité dans le processus de démarrage du moteur. Un relais est activé pendant 10 sec dès que le signal de l’appareil est envoyé et le fil de votre choix, qui une fois coupé rend l’allumage impossible est branché à celui-ci. Une fois le relais activé, le fil coupé est reconnecté et le tour est joué!

L’installation implique:
-Tailler un trou quelque part pour positionner l’appareil
-Le connecter à l’alimentation 12V et au Ground
-Couper le fil du signal d’allumage et connecter els 2 bouts de celui-ci au bornier à vis du relais.

Un gabarit pour découper le logement de l’appareil est inclut.

Caractéristiques:
– Façade en acier inoxydable découpé au laser.
-Un interrupteur à clé avec câblage approprié est inclus pour contourner le système en cas de besoin (en option)
-Clavier résistant
-Code PIN maître encodé dans le dispositif et utilisé pour modifier le code PIN actuel
-Connecteur USB sur le microcontrôleur pour la mise à jour logicielle si jamais c’est nécessaire
-Haut-parleur Piezo, LED bleu et verte pour indiquer ce qui se passe à l’usager

Déverrouillage du démarreur:
Saisissez le code PIN, puis appuyez sur *, le voyant vert s’allume si c’est le bon code et vous avez 10 secondes pour démarrer le véhicule.

Modification du code PIN:
Saisissez le code PIN maitre, puis appuyez sur *, l’appareil émet 3 beeps. Saisissez le code PIN que vous désirez utiliser, puis appuyez sur * pour confirmer. Essayez le nouveau code PIN pour confirmer que ça fonctionne bien.

]]> http://badwolf.hackhut.com/2013/01/12/keypad-ignition-lock-for-car-up-for-sale/feed/ 0