Generating simple tones and modulating

Discussion in 'The Projects Forum' started by cogzoid, Nov 26, 2008.

  1. cogzoid

    Thread Starter New Member

    Nov 26, 2008
    6
    0
    Hello! I am new to the forum. I have done a smidgen of electronics in the past (op-amps, filters, etc.) but it's been a while. But, I am trying to tackle a fun project that will be added to a much larger project.

    I am building an electric vehicle. I could go on and on about it, but I'll spare you. I would like to have a sound for warning pedestrians in parking lots, as the EV will be very quiet. And if I'm going to have a sound, it might as well be a fun one. I am going to try and emulate the Jetson's bubble car sound on the fly. It doesn't have to be just like the Jetson's but it should be futuristic sounding and not too annoying. I'd like to inspire both smiles and puzzled looks while I drive by. But, there's no reason to have it running at high speeds (>20mph) as the road noise will dominate, and I don't want to get annoyed by it myself.

    Here is my idea: I have a hall effect sensor on the end of the motor. It delivers 4 pulses per revolution. I could use an F to V chip, like the LM2917 to output a voltage. Then I could feed the voltage to three independent VCOs. One with a range of ~1-3Hz, another ~100-300Hz, and another with ~500-1kHz. I've simulated these frequencies with Matlab and they give close to the desired effect. I modulate the high frequency with the 1-3 hz frequency and add it to the mid range frequency. Then I can run the signal into a cheap computer speaker under the hood.

    Of course, I have a ton of questions to ask. This is definitely the most ambitious electronics project I've undertaken.

    Question 1: Is the LM2917 the best solution for turning a frequency to a voltage? The datasheet's schematic claims 1V/66Hz (which is almost perfect!) but it seems to be for a different type of magnetic rev counter input. Will it work with a Hall Effect Sensor? (At the time I don't know exactly what the signal from the Hall Effect looks like.)

    Question 2: How to create the VCOs? I have looked around at a few schematics, and I'm not sure exactly which way to go. The LM124 datasheet has a schematic, and it seems simple enough. But, I'm not exactly sure how to modify the schematic to the frequency ranges I need. It seems the capacitor and the R and R/2 resistors will be the ones I should change, but I could be mistaken. Are there other VCO schematics that I should consider? Simplicity is better for me, as fidelity is not a huge issue. Triangle waves will suffice most likely, and I feel comfortable filtering them later if they do not.

    Question 3: Modulation. The AD633 multiplyer seems like a decent choice, but I haven't played with it. Perhaps I could use a VCA? I'm new to those as well, and they will probably involve more circuit designing. Any tips?

    At the moment I'm trying to teach myself how to use MI-SUGAR (and SPICE) to simulate the schematics. If you know of an easier to use SPICE simulater for Mac, please let me know!

    I've included a zipped wav file which will play the simulation of the vehicle speeding up, coasting, and slowing down. The simulation is just with sin waves, so it won't be as interesting as the triangle waves I'll be using, but they're harder to simulate via Matlab.

    Thanks for any help or suggestions.
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, that's SORT of the sound... but not quite it...

    Try analyzing the attached .wav files (zipped together); one is the car starting up, the other shutting down.
     
  3. cogzoid

    Thread Starter New Member

    Nov 26, 2008
    6
    0
    As I said, I'm not interesting in exactly emulating the Jetson's sound. It just needs to be "futuristic" sounding and I'm happy enough with my simulation. Further analysis of the Jetson's sound would yield diminishing returns. I need help with designing the circuit. See my questions above.
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,346
  5. cogzoid

    Thread Starter New Member

    Nov 26, 2008
    6
    0
    Thanks for the link Bertus. I am probably going to use the LM124 schematic, as I prefer simplicity. But, I will check out their VCAs and such.

    At the moment I'm stuck on getting Spice to work on my computer (Mac OSX 10.4). I first tried Mi-Sugar, but I couldn't figure out how to deal with the LM124 subcircuit. Just having the subcircuit on the schematic messes up any analysis. I started with a simple lowpass filter and added components until there was an error. Adding the LM124 seems to confuse the program and it no longer acknowledges the .AC card. So, I decided to try a simpler command line spice program. I'm in the process of fiddling with it, to build my circuit.
     
  6. cogzoid

    Thread Starter New Member

    Nov 26, 2008
    6
    0
    Well, now I'm stumped... Spice seems to return a puzzling error message. I am practicing with the simulation of a simple voltage follower using the LM124. I plan on building up to the VCO. But, Spice doesn't like something about the subcircuit I downloaded from National Semiconductor.

    It returns the following errors:
    Code ( (Unknown Language)):
    1. Error on line 67 : e:1:os 1:7 1 1:poly(1) 1:16 49 1e-3 1
    2.          unknown parameter (1:16)
    3. Error on line 81 : g:1:1 1:98 1:9 1:poly(1) 1:5 6 0 9.8772e-4 0 .3459
    4.          unknown parameter (1:5)
    5. Error on line 102 : f:1:6 5 3 p:1:oly(1) v6 300u 1
    6.          unknown parameter (v6)
    But the file doesn't look like that at all. It looks like this:
    Code ( (Unknown Language)):
    1. EOS 7 1 POLY(1) 16 49 1E-3 1
    2.  
    3. G1 98 9 POLY(1) 5 6 0 9.8772E-4 0 .3459
    4.  
    5. F6 50 99 POLY(1) V6 300U 1
    For some reason it only messes up the cards with a POLY in the line. I have no clue how to begin troubleshooting this. It's like it's sabotaging my netlist and then blaming me for when it doesn't run. I'm running "Spice, version: 3f5sfix" on Max OSX 10.4. Any help at all will be very beneficial. Even if you point me towards something to read to try and figure it out.

    I've included the netlist. If you see an obvious problem, please let me know. It's only a few lines of my code with the rest of the code stolen from National Semiconductor.

    Thanks for any help.
     
  7. cogzoid

    Thread Starter New Member

    Nov 26, 2008
    6
    0
    Well, after pounding my head on SPICE for a while, I learned that the "Poly" function isn't supported in SPICE3. Using an older version of SPICE I pressed on. But, I came across a problem I hadn't thought about. It seems the oscillating nature of the VCO isn't amenable to SPICE analysis, at least I was having trouble with it.

    What is the best way to analyze the frequency output of a VCO? I'm ideally searching for a simple, unprecise VCO that I can either understand (I'm a novice) or has a formula that I can plug values into to adjust the ranges, etc.

    Basically, I'm going to be implementing three VCOs, and all three will be fed the same voltage. One VCO will have the range of 2-3Hz, another 100-300Hz, and a third 500-1kHz. Any help on how to adjust an existing VCO design to achieve such results? Can you suggest an analysis technique, or a place to read about this?

    Attached is the VCO schematic I've started with. (Perhaps you have a better one?) I would like to know the best way to adjust the frequency range and values. My poor analysis skills determine that the capacitor and the input resistors (labeled R and R/2) are obvious choices. But, is there a good way to predict the outcome before I buy my components?

    Thanks for any time spent helping this beginner.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You need to set an .IC (initial condition) for the feedback portions of the circuit. Otherwise, there will be multiple solutions, and Spice will give up.

    Another way to get around that problem is to start the supply voltage(s) at 0v, and then increase it to the operating voltage.
     
  9. cogzoid

    Thread Starter New Member

    Nov 26, 2008
    6
    0
    Thanks, I'm trying to learn via tutorials, and I guess they haven't gotten to .ICs yet!
    Back to the head pounding.
     
Loading...