Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Frequency Addition

  1. Apr 6, 2008 #1
    Hi everyone, first post so go easy :)

    What I want to do is design a circuit to add two square wave frequencies into one output.

    The use is for a vehicle fitted with a Karman Vortex mass airflow sensor.
    The MAF sensor has a 5V square wave output of 0~150Hz.
    The vehicle has been modified with twin throttle bodies currently plumbed back to a single MAF.
    The idea is to run two MAF sensors, one for each throttle body.

    So how do I combine the two signals into one output to the ECU?
    The problem that I see is that even if the two signals are 180 degrees out of phase, they must still add. Ie. 50Hz + 50Hz input, regardless of phase, must = 100Hz output.

    All feedback appreciated,

  2. jcsd
  3. Apr 7, 2008 #2
    I think I get the idea. You don't care about phase and amplitudes. If one signal has a frequency of F1 and the other F2, you want the output to have a frequency of F1+F2, correct?

    This would be new to me. The first thing I would do is look at a PPL VCO (phase lock loop, voltage controled oscillator).
  4. Apr 7, 2008 #3
    You got it, that's exactly what I'm looking for.

    Ok then. Time to hit Google and look that up. Forgive me but I'm an electronics noob.
  5. Apr 7, 2008 #4
    the CD4046 is a CMOS PLL-VCO---of course there's always an easier way to do something.
  6. Apr 7, 2008 #5
    would a mixer work?
    it will return F1-F2 and F1+F2
    put a high pass filter to get rid of the lower frequency
  7. Apr 7, 2008 #6
    I really don't know edmondng. Care to elaborate?
    EDIT: Actually given the low frequency's I'm dealing with (30~150Hz) would it even be possible to filter out the original input frequencies?

    What about a half adder? Would that work?
    Last edited: Apr 7, 2008
  8. Apr 7, 2008 #7


    User Avatar

    Staff: Mentor

    The biggest problems are the 0 Hz thing and the "square wave" thing. You will need to understand what the ECU expects out of the MAF signal, before you can pick the best way (if one exists) of combining the two MAF signals into one for the ECU.

    For example, if the ECU divides the MAF square wave down by two right away (like, it is only rising edge sensitive), then it is easier to combine the two signals with an adder or some such thing, since you wouldn't care about the duty cycle, only getting the right number of rising edges. You should also find out about the response time and stability criteria for the ECU, since you could confuse it if the two MAF sensors rolled through phase and gave the ECU some jittery edges.

    If the ECU expects a 50% duty cycle input signal from the MAF, then you have to do more work. And the 0 Hz part is still a problem for this. What is the minimum frequency really, that is, what is it at idle. Probably not 0 Hz, right? If it is something reasonable, then you can take the two MAF signals, add them, and phase lock a 50% duty cycle signal to them as suggested already. Your comparison in the PLL will be between the added signal divided by 2, versus the PLL output signal divided by 2. That gets rid of jitter in the comparison, and as long as your PLL output is reasonably square, the ECU should be okay with it.

    But even with a PLL, you are going to have to trade off PLL lock delay and jitter numbers, versus how fast and accurate you want your ECU to be able to respond.

    You might be best off just to stay with the single MAF sensor to the ECU, and maybe make a simple comparison circuit for now that measures the difference in MAF from the two sensors, and just displays that for you to see. If the two MAFs are giving about the same readings anyway, then there is no reason to go to the pretty big trouble of combining the signals, IMO.
  9. Apr 7, 2008 #8
    Ok, the MAF sensor outputs a 5V square wave signal of ~30Hz at idle rising to ~150Hz at WOT.
    The MAF sensors output is 50% duty cycle.

    Your example above makes the most sense to me and eliminates problems introduced by phase shift.

    But your right, I need to find out if the ECU is rising edge sensitive or requires a 50% duty cycle square wave.
    So how much delay are we talking about here?

    Obviously I've got a lot to learn, I'm going to reserch about PLL's and how they work.

    Thanks for the great reply even if I didn't understand half of it :)
  10. Apr 7, 2008 #9


    User Avatar

    Staff: Mentor

    So when you go to two MAF sensors, the output frequency range of each will now be about 15Hz-75Hz, right?

    I'd suggest drawing a few representative waveforms (with different phases, etc.), to start to get an idea for how you might want to combine them. You can also do a full-digital PLL without an analog VCO for this low-frequency project. You would run a higher-freq digital clock (say, 32kHz like with a watch crystal, or 10MHz with a regular crystal oscillator), and oversample the MAF digital signals, and compute what the sum waveform would be, and output that to the ECU. That would be a fun all-digital project for you.
  11. Apr 7, 2008 #10
    You got it.
    Hahah, sounds way over my head but if you point me in the right direction I'll give it a go.
  12. Apr 7, 2008 #11


    User Avatar

    Staff: Mentor

    I'm not sure I can point you to a good design reference... maybe others reading this thread will know of a good reference for you to read up on this.

    If a brief description would help, I'll try that. Basically you would have two high-frequency counters running, counting the half periods of each of the MAF sensor outputs. Each time a counter finished counting a half period, that information would go toward adjusting the half period of your final output counter.

    So if you used a 32kHz watch crystal as your time base, you would get to a half period count of about 425/2 for a 75Hz input square wave from a MAF, and a half period count of about 2100/2 for a 15Hz input. Each time you got an update from either MAF's counter (each rising or falling edge of the MAF output waveform), you would use that number plus the most recent number from the other MAF channel to pre-set the next terminal count for the output counter. There's a little bit of arbitration and synchronization stuff that has to happen also, but that's a bit complicated to get into in this simple explanation.

    So I think you see the concept of how it would work. I still think as a practical matter, it's best to just stick with a single MAF sensor output. Well, except it just occurred to me that the MAF output will now be too low in frequency, since you have divided the airflow in half. Yikes. Any chance the ECU can be re-mapped to handle the 1/2 MAF output frequency?
  13. Apr 8, 2008 #12
    You could be making more work for yourself than necessary.

    If you expect the two MAF to output about the same frequency, you many only need to take the signal from one, and double it.

    By the way, I really like the half-adder idea. Ultimately simple, if not a bit chaotic. Of course you may never know what the ECU expects to see. But if the ECU samples the MAV infrequently, instead of every wave, or doesn't do any sort of averaging, then it wouldn't work at all.
    Last edited: Apr 8, 2008
  14. Apr 8, 2008 #13
    Well this is the problem, there is no guarantee that both MAF sensors would have the same airflow. Also if one filter was to become more restricted then the other, then that would throw it out of balance. Unfortunatly this won't work reliably.

    I'll do some asking around and find out what the ECU needs
  15. Apr 8, 2008 #14
    How about using a frequency to Voltage Converter and Voltage to frequency converter to achieve this??
    Use F to V converter for two inputs F1 and F2 to get V1 and V2 respectively, then add those two analog voltage and again use V to F converter to get a frequency output. Dont have idea on pros and cons.... just an idea to achieve frequency addition.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Frequency Addition
  1. Addition of decibels (Replies: 21)

  2. Addition of vectors (Replies: 12)