# New 6-Ch Standalone Servo Controller w/ audio



## pshort (May 6, 2008)

In the next day or so I'll be going out for fab of a new servo controller that is used along with either the Tendy mp3 board or (untested) a VMusic2 board.

Here is how it is a little bit different: data for precisely controlling all of the servos is encoded on the right audio channel, and decoded by this controller. One of the relatively user friendly PC programs (Vixen for now, perhaps VSA in the future) is used to create the sequence of device movements (perhaps for a 3-axis skull with jaw and two-axis eye control) synchronized to the audio. This is then run through a program to merge the audio data and the servo control data into an mp3 file, which is then stored on a USB flash drive (vmusic2) or an SD card (Tenda mp3 controller).

This is different from some of the other diy servo controllers that have appeared on this site. One of the other controllers (tstraub) positions one servo based on the audio volume, and another (halstaff) uses a tone on the second audio channel to trigger a software routine on the PICAXE, with all of the positioning info hand-coded in the PICAXE firmware.

At the moment I'm just putting this out here to see if it generates any interest or not.


----------



## hedg12 (Jul 6, 2008)

Very cool! Can't wait to see the finished product.


----------



## halstaff (Nov 18, 2009)

Looking forward to seeing it Phil!


----------



## spinman1949 (Jun 29, 2009)

Phil,

Will this board have a trigger input? It would be perfect if various multi action props could be independent and motion triggered or triggered via a remote. I too look forward to what you are developing. I have been preoccupied for the last year with personal issues and hopefully now I can get back into prop building.


----------



## pshort (May 6, 2008)

spinman1949,

Yes, there is a pin set aside as a trigger input without losing any servo outputs. There aren't enough pins for a trigger output, though, without giving up one of the servo output pins.


----------



## pshort (May 6, 2008)

Incidently, I have another board design that has eight servo outputs as well as provision for an LM386 audio amplifier chip for use with a non-powered speaker. At the moment I'm focusing on the six-channel controller, though.


----------



## HomeyDaClown (Oct 3, 2009)

Sounds interesting.

Been using this same technique for quite a while now with mixed results.
It's fine for a few servos but you need decent dynamic range on the audio device to reproduce decent servo PPM output. This is what made Gilderfluke famous in the professional prop control world. They used CD players with servo signals and audio on different tracks but only to control about 4 or 5 servos. The more servos you add, the more thinly you have slice the data frames to a point where it stops working or you have to add additional audio channels.

I've used a few tricks in code to get 12 servos going on an Arduino, most of it involves cleaning and shaping the audio into a digital signal that can drive servos reliably.


----------



## pshort (May 6, 2008)

Homey,

I'm not sure what you're saying. I'm encoding the servo position as digital data on the right track, analogous to how IBM and others stored data on audio cassettes back in the 70's and early 80's for the early personal computers. I think that you might be suggesting something a bit different...


----------



## hedg12 (Jul 6, 2008)

I think (bad idea, I know) that the Gilderfluke controllers actually use audio tones to select servos & set position - something similar to SMTP. The bandwidth available on CD hardware designed for audio playback and the resolution of the tone decoding circuits (LM567 or analogous) are the limiting factors - you have to leave enough "space" between channels to prevent overlap. (Or not - I vaguely remember reading something about this sometime, somewhere. The mind is the first to go...)


----------



## tstraub (Feb 26, 2012)

Sounds like a very interesting board I'll be sure to watch this thread and see how it turns out.


----------



## MonkeyBasic (Mar 22, 2009)

Interesting idea... I'll keep my eye on this


----------



## Mr_Chicken (Nov 26, 2008)

Hmm...sounds very appealing if it works the way I'm imagining it does... and of course if the price is right.


----------



## pshort (May 6, 2008)

Today I've reached one milestone - the firmware for a two-channel variant seems to be working on the bench. I've held off on sending the six-channel board out for fab, pending this result. There is a lot of work left to do on the firmware, especially in the area of making it robust.

Two other things are going to take some time - finishing the conversion software for the PC (for vixen), and creating some sort of handsome demo similar to the one that Halstaff did for his controller. Since this involves six channels, the demo wants to be really impressive, which won't come quick or easily.

I have noticed one small hiccup with the Tendy controller, however. It appears to require about 4 seconds from power-up until it outputs anything (about 0.5 seconds until it responds to commands, and another 3 seconds before anything comes out). I don't know if it will respond quicker once it has been powered up for a while. Another drawback to that board is that it is a real power hog, it takes about 35 or 50 mA if I recall from testing a while back. This means that it will not be to practical to power the boards from a standard 9V battery...


----------



## JeffHaas (Sep 7, 2010)

I agree on the Tenda board, you don't want to run it with a low battery. A low battery will end up with either no MP3s playing at all, or clipping/popping noises.

But then anything I run which has several things linked to it, like you're doing, I use an AA holder with several AAs in it, so it gives me enough mA to last the night, especially if it's got audio to decode.


----------



## pshort (May 6, 2008)

Using a leftover board from a previous project, I have an eight-channel servo controller working based on this same logic. That pretty much fulfills my own needs, now to figure out where to go from here.


----------



## pshort (May 6, 2008)

Here is a photo of the 8-channel servo board and a Tenda mp3 player board. This version of the servo board is 2" x 1.5". The next version would be slightly smaller, with the middle chip (a PIC12F510) removed and the 14-pin op-amp at the bottom of the board replaced with an 8-pin op-amp. I would also attempt to add an LM386 amplifier chip to the board, so that an unpowered speaker could be used.


----------



## dionicia (Aug 4, 2007)

Very cool. I'm looking forward to seeing your progress especially if you may use vixen which I haven't seen used yet.


----------



## pshort (May 6, 2008)

OK, it's been a while. I've been working on this on-and-off. It turns out that doing a 6-channel servo controller is fairly easy, and I have a board for doing that. What's been occupying my time on this board is attempting to decode the data coming off the MP3 player at 19200 bits/second, so that I can use this design for controlling up to 32 dimming Christmas lights at a decent refresh rate (60 hz or so). It turns out this is difficult to do with the slow processor that I was using (a PIC16HV785, because it had a built-in op-amp and voltage regulator).

Anyway, rather than using a faster processor, I've decided to go with with what I've got. As a servo controller it will support up to eight servos quite handily (mostly limited by the number of pins on the part). As a light controller it will support up to 32 channels (using external dimmer controllers) with a 30 Hz refresh rate, which I think is quite adequate. Since I'm burned out on this project, I'm setting it aside for a few months, to see if I'm interested in bringing it further along at that time.


----------



## Death Master (Jul 1, 2007)

WHAT!?! You’re leaving it on that? Come on man where is the code, PCB, and parts list? It’s too good of an idea to drop. It looks like the perfect solution for small haunts to use. I really think it’s a great idea. Have been lurking on this one, now look what you did you made me say something  I mean no disrespect I just like this one a lot.


----------



## pshort (May 6, 2008)

I didn't say that I was dropping it forever, only that I'm taking a break. In any case, there is still a lot of work to be done in order for me to be confident that it will be useful to others (testing, documentation, etc).


----------



## fritz42_male (May 5, 2009)

When you resurrect it, I'd be interested in buying pcbs and micro controllers or complete boards as well.


----------



## pshort (May 6, 2008)

One concern that I've had is about the behavior of various MP3 encoders. All of my testing has been with one encoder. This encoder is LAME, running on a FreeBSD system. At the moment I've got it set to output a 384bps stream, and I haven't been placing anything other than a test signal on the left (audio) channel. I've seen some signal distortion in this setup, and I expect to see more when I place a real signal on the audio channel. More testing will tell here.

Prior to this project I had another one that used a large on-board serial EEPROM and an audio encoder. The serial EEPROM stored both a digitized audio signal and servo data. The main limitation of this design was the size of the EEPROM, which was a 32 Mb (4 MByte) part. When set up for 16-bit stereo output at a 32 KHz sample rate there was enough memory for about 30 seconds of playback. Reducing the sample rate to 16 KHz with an 8-bit mono audio signal would increase this to about 4 minutes. I'm thinking that this might be acceptable, especially if I could figure out an easy way to increase the amount of storage memory.


----------



## pshort (May 6, 2008)

OK, I've got a board design in line with what I wrote in the last post that supports up to 8x the amount of memory there. Part of this is due to using a larger EEPROM (not available the last that I looked), and part is due to adding three more memory chips. I'm more or less finished with a PCB design for an 8-channel servo controller that is 2.2" x 2.4". Time to send in a PCB order to oshpark, I think.


----------



## fritz42_male (May 5, 2009)

Sounds good Phil.


----------



## Rage (Oct 23, 2012)

I've been lurking on this one, waiting to see how it turns out. I'm interested in making stand alone greeters and oracles in the haunt and this would be perfect.

Keep us posted on the progress.


----------



## pshort (May 6, 2008)

Still working on it. It turns out that I've got around a problem that I had on a much earlier version of the board (one memory chip only), so I'm writing code and debugging on that one. In my off-moments I'm thinking about what other features (usability and functionality) could be added to the board, and also how I would get it out to the world. One think that I'm considering is replacing one or more servo channels (out of eight currently) with motor drivers and/or motor limit-switch sensor circuits.

@rage - how long (time-wise) would your 'sequences' be? In other words, how many seconds of playback (and animatronic action) would you like to see?


----------



## Rage (Oct 23, 2012)

Phil, I think changing the original format (which you have done already from 6 to 8 servos) is a great idea. But at the same time, having the "bread and butter" out there in the market and making money is the critical issue. Once the base unit is marketable (and the interest here says it is) then adding additional options within the expandability of the board is the natural evolution. If the board can't handle expansion (to customer's wish list) then a companion product is born.

And Phil in answering your question the best I can say is it depends.......the haunt greeter ('Zombie Zake' my equivalent to the WalMart greeter) would tell the guest about the haunt, rules and expectations. How long would that take?...........hmmmm probably about 2 mins on the outside of the time margin, and 1 min on the inside. It's my desire to have the greeter then entertain the guest with a song, jokes, etc until the next crowd gathers (sequences of about 2 mins). The oracles within the haunt are decapitated heads in large bottles, swing cages, sitting on shelves, etc that are actuated by the human guides and tell the portion of the story as it relates to that room in the haunt................probably about 2-3 min in length. 

I've looked at the arduino for doing the 3 axis head and eye shift and blinks, with the scary terry handling the jaw movement...........so far the best solution for "stand alone" but requires a ardiuno, servo shield, the scary terry opamp and servos in the head of the gag. (I'm currently recasting a 4th gen Binky now to get the size constraints).

I've looked at the VSA solution, but don't want to be tied a computer for all of the gag routines which means using the RAPU, but board size is an issue (I require that all electronics and servos be in the head) not to mention the money requirements for getting 12-15 designs done.

So your design, would fall in the "perfect" category for me. But as you indicated, the size of the routines could present a problem. Maybe addressable outboard memory would be a solution.........I dunno.


----------



## pshort (May 6, 2008)

Hi, Rage,

At this point I don't know where I'm heading in terms of making this available to others. I'm not saying this to be coy or to avoid the rules on this site. Right now I'm not working, I enjoy designing and debugging this sort of thing, and the cost is minimal.

Just so that I get a picture, what are your size limits? The board that I'm currently testing is 2.0" x 1.6". This is the board with only one memory chip.

As far as memory goes, the PCB that I have on hand would be good for up to four minutes of playback, depending on the desired audio quality. Using a larger memory chip and 16000 bps, 16-bit mono audio would be good for that four minutes mentioned above. Going to stereo output would 1/2 the playback time, and going to a 32000 bps sample rate would 1/2 it again (down to 1 minute). This is all without changing the PCB to add more memory chips.


----------



## Rage (Oct 23, 2012)

Hi Phil,

Actually the bps would be suitable at 8kbps since that is comparable with "telephone" quality and which according to the general rule of thumb would be about 8 mins in length, plenty of time for the greeter and or a few added comments.

It was the size as stated in a previous post that made me interested in this project to begin with. The Arduino, servo shield, MP3 player which would fed the "scary terry" board stuffed in the skull didn't make me very happy...........possibly doable but not easily. Since I'm making a silicone skin to jacket the skull and neck I could probably move some of the boards into the neck area or upper chest but it adds additional problems to transport and compactability.


----------



## pshort (May 6, 2008)

OK, I've just ordered a set of three boards of the next revision from oshpark. These are for my development and testing purposes. It's an all SMD board, except for the LEDs, switches and connectors. This means that it is not a DIY design. There will be another revision of the board later on because the audio chip is no longer available in the SOIC format, only a much finer-pitch form that is hard for me to solder. And since there is one fine-pitch part on it, I would go from using an FTDI module to directly using one of their chips. 

The particulars of the test board are as follows:

1) 1.8" x 2.375" - fits in a lot of different enclosures, with some holes for the polycase LP-21 enclosure.

2) User interface:
2a) Power LED
2b) Mute LED
2c) Programming (download) LED
2d) Pushbutton switch to mute
2e) Pushbutton switch to enter programming mode
2f) Trigger input (for use with Quorum A160 PIR)
2g) Eight Servo Outputs
2h) Socket for MM232R USB-RS232 Adapter
2i) Separate power inputs for logic power and servo power
2j) 6-Pin ICSP header for programming the PIC.

3) There is a single memory chip on the board. Using the largest available chip, this would be good for 44 seconds of playback with 44100 bps, 16-bit stereo sound. With 11025 bps mono sound this would increase to almost 6 minutes. Which is good for me, assuming that the sound turns out to be satisfactory.


----------



## tstraub (Feb 26, 2012)

Thanks for the update Phil I'm watching this thread closely because I think it's a great concept. Your last statement about stereo or mono has me a bit confused. I thought that the right channel always contained Data and the left always contained sound. I would assume that all the MP3 files would be stereo and all sound output would be mono. Maybe I missed something?

Tyler


----------



## pshort (May 6, 2008)

It's confusing because I've been talking about two different projects in this thread.

One project (the original one in this thread) uses a Tenda mp3 player with an SD card to store both the audio and the servo info (audio on one channel, servo data on the other).

The second project (starting in post #22) is the one that I sent out for fab today. It does not use the Tenda MP3 player nor the SD card. Instead, the audio and servo data is stored in an on-board serial memory chip in essentially the .wav format. Each word stored in the serial memory is 16-bits wide, with 15 bits holding the most significant 15 bits of audio data and the 16th bit holding one bit of servo data. The audio DAC will thus get 15 bits of audio data plus one essentially random bit (the servo data bit), which I don't think will significantly impact the audio experience.


----------



## David_AVD (Nov 9, 2012)

pshort said:


> Each word stored in the serial memory is 16-bits wide, with 15 bits holding the most significant 15 bits of audio data and the 16th bit holding one bit of servo data. The audio DAC will thus get 15 bits of audio data plus one essentially random bit (the servo data bit), which I don't think will significantly impact the audio experience.


Phil, could just just mask that LSB out or is it too much trouble for no real gain?


----------



## pshort (May 6, 2008)

Too much trouble for too little gain, I think. I'll see the impact when I test the next boards.


----------



## hydehaunt (Jan 22, 2008)

Hello,
How is your 6 ch board coming along? Will you be looking to sell/build these after they are complete? I have been in the need for this style board for a while.  Thank you, HH


----------



## pshort (May 6, 2008)

I'm back to working on this again (the version that used the Tendy board) after quite a while on other projects. The current version uses a PIC16HV785, which has built-in op-amps and a shunt regulator, quite nice even if a bit slow. This means that there are only two ICs on the board; the PIC and an LM386 audio amplifier to drive a speaker. The project is up to eight channels, largely because I thought that debugging a bit easier. There was a screw-up on the amplifier for the audio channel, so I need to spin a new version of the board.


----------



## Jack Mac (Nov 28, 2012)

Sounds great. Looking forward to seeing this controller in action.


----------



## toozie21 (Aug 23, 2012)

Wow, I am reviving a REALLY old thread, this might be a record for me!

Did this ever go anywhere Phil? I have a need to control 4 servos in sync with 30s audio clips. 

Right now I am sending I2C to a service board to handle the multiple service, but I don't know a good way to keep things in sync.

Sent from my SM-G955U using Tapatalk


----------



## pshort (May 6, 2008)

I've responded over on diyc.


----------



## Hippie Crane (Sep 17, 2019)

Look pretty cool. I'm working on one that has 15 or more channels


----------

