More on the steampunk-o-phone.

November 20th, 2010

I need to come up with a better name for this thing.

Anyway, progress is being made. As mentioned I had made up a little mount for the detection coil. This is just some scraps of brass I had in the junk box so I made a little stand with a sliding top held with thumbscrews made from more of those document interconnect things. It can adjust up and down as well as in and out so I can get a good signal from the 6 magnets around the perimeter of the platter.

IMG_9091_1 Coil mounting.

The other thing I did was fit an old 0-5 amp meter to give some (vague) indication of RPM. I found this on TradeMe for $3. It was described as being sticky and that the calibration was out but it just looked so great I had to grab it. How can you not use a meter labeled ELECTRO-TEC! It took a little while to arrive but that was due to the postie sending it to the wrong house. Luckily my neighbour came and dropped it off to me. I stripped her down (the meter – not the neighbour) and cleaned and adjusted it and I also removed the current shunt. I worked out what FSD was (20mA) and just wired it up with a series resistor so I can drive it from 0-5 volts. I mounted the meter into the top of the base. It protrudes in so it prevents the drawer coming all the way out. Drawer? Yes, I don’t think I mentioned that before. I decided to add a shallow drawer under the base board. This is to give me somewhere to hide the electronics as well as to hold an oil drip tray under the engine bearings.

IMG_9099_1 Meter mounted in base.

The other small thing I did was mount the cheap pickup I got onto a small piece of brass and soldered that to a tube that slides into the end of the tone arm. Currently it is held on with black tape but I will need to thing of something better there. It’s fully functional but not yet aesthetically pleasing!  I wired up the pickup head and took the wires to a 5 pin DIN socket in the plinth base. A cable goes from that to my stereo pre-amp. I finally used part of that old printer I pulled apart. A short length off one of the shafts was inserted into the end of the one arm to provide extra weight on the short end. Now the adjustable weight can be used to set up the stylus pressure on the needle. Pity I have no idea what that should be for this particular stylus!

I also added a little bracket made from brass and copper to the plinth to the hold the tone arm when it isn’t running on the record.

IMG_9098_1 Tone arm bracket.

I tested the audio side of things by hooking the arm to my existing pre-amp and spinning the record by hand. That worked great! I get a lot of volume from it. With the tone arm tested and working well I stared looking at my servo controller on the throttle. The idea was always to use a small hobby servo driven by an Arduino to control the throttle position based on the RPM as measured by the sensor.

My friend Mike and I spent a lot of time chatting about different algorithms to use to actually move the servo. The throttle isn’t necessarily directly proportional to the speed so what you do is this:  If the RPMs are too low you open the throttle a bit. When it speeds up you close the throttle a bit.  If it goes too fast you need to close the throttle then open it again if the speed gets too low.

Now a person can do this easily and this is how I tested the engine to figure out the right PSI and drive ratios I would need. I just tweaked everything so that at 10 PSI the platter goes at approximately 33 1/3 RPM with the throttle in mid position. But for a computer to do this, especially a little one like the Arduino it is a bit harder.

After discussing various algorithms for a bit Mike made the comment it was a pity we didn’t do more control theory papers at uni all those years ago.  It suddenly occurred to me I should ask my colleague Gareth at work since he has done robotics and other such things in the past. Turns out he has done control theory and after explaining my problem to him and explaining my approach he  said what I needed was a ………

It took him a while to remember! But it came back to him. What I needed was a PID Controller. You can read that Wikipedia link to get the exact details but basically a PID controller is a feedback controller. You tell it what value you want to maintain. This is called the set point. Then you give it the actual current value you are at. This is the input value. The PID works out the error between the two and gives you an output variable you use to modify the process.

So, in my case is I have a machine which is my steam engine driving the platter. I want the platter to rotate at 33 1/3 RPM. With my coil, a little circuit and some software I can measure the actual current speed. And I can control the speed by changing the setting of a simple valve using a servo that takes a number to tell it what position to move to.

Now I had horrible thought about having to implement all this myself in software but I did a quick search online and discovered someone has already written a PID library for the Arduino! I love the Arduino and this is what makes it great. You want to do something and chances are it’s already been done and the libraries are available and free for you to use. So I downloaded the PID library.

With the Arduino PID I can tell it the speed I want, 33 1/3 RPM, and tell it the speed I have currently and it will give me a number I use to drive the servo in order to change the speed. There is some configuration of course. You specify the output range of numbers you want and you also specify three parameters that tune the behaviour of the PID.

My throttle valve I designed to have a 90 degree throw from 45 degrees to 135 degrees. I use a simple direct linkage from the servo to the throttle so I set the PID to output between those values. So the Arduino is set up to measure the pulses from my coil as the magnets pass by it. I have the coil hooked into an Arduino analog input. You need to use a snubber diode across the coil as you do get a positive and negative induced voltage for each magnet pass and the Arduino inputs don’t like negative voltages. I use the pulses to measure the RPM of the platter. With 6 magnets you get 6 pulses per revolution of course.

I then feed the RPM into the PID object and it does it’s weebly-wobbly magic I don’t understand and gives me back a number. I feed that number into the servo object and the servo arm moves. It’s really very simple! So with the PID configured correctly I should have a system that rides the throttle to maintain my 33 1/3 RPM. I am not actually trying to be that accurate with it so far so as long as the RPM comes out at 32, 33, or 34 I am happy. I might increase my accuracy depending on how terrible the sound is later but I actually want the sound to be a bit variable to add to the charm of the device. It is a  ye-olde-time device after all!

There are three values used to tune the PID and this is where it gets tricky. I basically used trial and error to set up the values for now and it seems to be working although it is probably not optimal. I have tried graphing the RPM I was getting with various parameter settings on the PID and that does show me what is happening in each individual case. But I am unable to easily compare different settings easily because although my Y axis is RPM and standard each time the X axis is samples. And the sample time depends on the RPM so it varies. I need to work out the X axis in actual time then I could compare all of the graphs together. For now though it is working well enough! Some example of the graphs I got are below are below. In the first the settings are wrong so the system was unstable and it oscillated about the set point.

pidoutput1pidoutput2PID output graphs.

To do all this testing I was driving the engine off air from my air compressor in the garage. I used my EeePC to program and monitor the Arduino as I was trying set up the PID. I wrote the values back up the serial port and later captured the text output to feed into a spreadsheet to make the graphs.

A small film of the servo being driven by the PID is here on YouTube. I set the servo to the 90 degree mid position when my sketch starts up but as soon as the PID start running it sets the servo to the slowest, or 45 degree, position. That’s why there is a big movement on the linkage when I start the platter spinning.

Before I could do all this I built a small bracket from some scrap aluminium channel to hold the servo. I extended the control arm on the servo with some strip brass so that the servo arm is the same size as the throttle control arm. I was able to then use a simple 1:1 linkage between the two. For the linkake I used little 2mm swivel ball links like those used on model aircraft and helicopters. I probably could have used a simple wire link but I love these little swivel joins and was dying to use them in something! I made a simple rod with a swivel joint on each end.

IMG_9109_1 Servo mounting and linkage to throttle.

IMG_9112_1 Linkage detail.

To cover the servo I made a small copper cover made from an old soaker plate I had lying about. It is also worth mentioning here that the drive belt I am using is a poly cord belt used on wool spinning machines (again off TradeMe). It comes in a long length that you cut to size then you melt the ends in a candle flame and press them together to form a continuous  belt. I used these belts with great success in my Wimshurst machine.

There are also two places where electrical cables need to pass into the base of the device so I made two little brass top hat style grommets to use here. The cables will be put inside old shoelaces for that old fabric cabling look.

IMG_9115_1 IMG_9125_1 Copper servo cover and linkage.

IMG_9118_1 Top hat brass cable grommet.

So now everything is pretty much tested and working – not necessarily all together though. I know the steam engine works and that the platter can be driven on air. I know I can measure the speed and control it. And I know the audio pickup works well. So there is no reason it shouldn’t all work together on steam.

But next I have to pull it all apart to finish it all off! I need to varnish the base and make up a permanent circuit instead of the breadboard I am currently using. I also need to make a new, smaller burner as my old one was a bit aggressive. And I still need to machine up the boiler safety valve. That will be set to about 10 PSI which is quite low but my engine seems to run fine on that. It always starts easily so there is easily enough torque there. I believe even the little Mamod steam engine run at 12 PSI or so.

It’s getting there!

IMG_9122_1 Test setup.

http://en.wikipedia.org/wiki/PID_controller

4 Responses to “More on the steampunk-o-phone.”

  1. Al Says:

    Asciimation – I’d like to speak you about your wonderful record player. By sheerest coincidence it falls remarkably inline with a concept that I’m developing, and I would like to discuss possibly using a sound sample and/or video images (in a creative musical fashion). Naturally, 100 percent credit would go to you. Currently, the concept is in very early stages, and I cannot offer any monetary compensation, having been unemployed for longer than I’d like to admit. I’d be happy to elaborate more about the project, if you care to even consider returning this message. For what it’s worth, I love the machine, and couldn’t have picked a better song for you to play on it in the video 🙂

  2. George Johnson Says:

    First of all, I think it’s great. I’m not particularly into SteamPunk, but I like the looks of it, and this using real steam, makes it even better!

    But for the speed control, I think first of all, you need a bigger, heavier flywheel to steady out the single cylinder pumping motion. Plus, I think that might add to the “SP” look you’re looking for.

    Secondly, I think you need a better place to control the speed. I wouldn’t do it at the throttle. Maybe a dual process, where one controls the throttle for a “gross” speed control, but you need something finer (before the flywheel).

    Perhaps set the speed a little high, then use a braking system” to slow it down to the proper speed. Like maybe a bit of felt against the flywheel. That would give you much finer control, and still doable using a simple servomotor. But that would introduce wear onto the felt, and that’s not good. But you get the idea.

    I like the use of the meter. Looks great, I love those old needle meters for something like this. Maybe you can customize it, so the needle is centered when it’s 33 1/3, and then you get a +/- of percentage or something, then you can get it as accurate as you want. (maybe even add a “DANGER ZONE” in red to it.

    Great work though, I wish I had the artistic talent for something like this.

  3. Roberta X Says:

    I’d suggest the turntable platter itself needs to be massier, to help damp flutter from the steam piston and stabilize speed. Balance and running it utterly level will also help maintain a constant speed.

    The other issue is you’re basically running a PLL here and without a lot of flywheel “filtering,” proc time of the little computer may cause excessive hunting around the desired speed. Less might be more: a little “flying ball” centrifugal speed regulator operating a needle-type steam valve (a valve like the ones in the carburettors in a stock MGB) might give tighter regulation of the speed. You’re swapping a gen-purpose digital for a bespoke analog computer.

    The pulse-y power inputs to the system from the steam engine remain a problem. A little turbine would fix that but might not have the right look. Number of power impulse per platter rev is essentially the same problem as driving a turntable with a multipole motor, like in a Sony SP-10 except you can adjust it with engine speed and pulley ratio..

  4. james Says:

    I really love the steampunk-o-phone. Very cool. I’m wondering if you’d be willing to share your arduino code? I’m trying to set up something similar with a servo controlling a gas (propane) regulator, but no one seems to have anything that does exactly that, but if i substitute degrees for rpm in your code, that should get me close… right?
    Thanks!
    -James