Shop OBEX P1 Docs P2 Docs Learn Events
Frequency Multiplier — Parallax Forums

Frequency Multiplier

tt460tt460 Posts: 8
edited 2008-06-24 00:21 in BASIC Stamp
I've got a BS2 and I have a need to multiply an in-coming PWM signal at 250Hz and take it up to 3000 Hz (multiplication factor of 12)·and drive an N-type MOSFET.

This is going into an automotive application where I'm driving a high current solenoid (~ 4amps).

Anyone ever done something like this (the frequency multiplication part)·using a BS2 and have some examples?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-19 19:38
    A BS2 can't be used for this sort of thing. It can only do one thing at a time. When it's measuring the PWM signal frequency, it can't output anything. The type of external circuitry that you could use depends a lot on the details of what you want to use this for.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-19 20:33
    This is something the MoboStamp-pe could handle. The idea is to filter the 250Hz PWM via a low-pass RC circuit to create a voltage that could then be read via one of the analog inputs. The Stamp could then continuously read this voltage and update one of the PWM outputs (2.3KHz or 4.6KHz) available in the AVR coprocessors.

    An alternative, assuming the 250Hz signal is a constant frequency, would be to let the Stamp measure the positive pulse widths directly to determine the PWM duty cycle. The coprocessor would still be necessary to keep the output PWM going.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-06-19 20:41
    tt460,

    Just curious, the "base" PWM frequency is 250Hz and you want to take it to 3kHz? is that correct?

    What Duty Cycle range do you have for the PWM? 0-100%?

    Is the 250Hz fixed or·will it also vary?






    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • tt460tt460 Posts: 8
    edited 2008-06-20 11:46
    Yes, the originating signal coming out of my engine management system is at a fixed 250Hz. I need to take this to 3kHz.

    Duty cycle will cover the full range from 0 - 100%.

    Would've been nice to do this with a BS2 since I happen to have one laying around...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-20 16:55
    Since you're just using the output to modulate a MOSFET, cna we assume the 3KHz figure is merely approximate? What are the upper and lower bounds?

    -Phil
  • tt460tt460 Posts: 8
    edited 2008-06-20 17:05
    Yes, 3kHz is a target, but I can deviate from that. I learned yesterday I can actually go as high as 16 kHz. So somewhere between 3 and 16 kHz should be adequate.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-20 17:31
    What are the minimum and maximum duty cycles, and what resolution do you need? Also, is this one-off or are multiple units needed?

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 6/20/2008 5:38:09 PM GMT
  • tt460tt460 Posts: 8
    edited 2008-06-20 18:25
    Minimum duty cycle = 0% Max duty cycle = 99%. This is pretty much a one off application.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-20 19:00
    Okay, well that exhausts any chances for the BS2. Your choices are pretty much a MoboStamp-pe programmed in PBASIC, an SX programmed in SX/B or assembler, or an AVR programmed in C or assembler. Of course, there's also the Propeller, which could handle the job — along with a dozen or so others — with ease.

    -Phil
  • VelocitVelocit Posts: 119
    edited 2008-06-20 22:22
    Is this for a peak and hold fuel injector by any chance? I was just curious because 3kHz sounds like an awfully high frequency for controlling any sort of solenoid unless you're current limiting... TI makes high and low side solenoid drivers (DRV103/DRV104) that takes a pulsewidth as an input and outputs a 500Hz to 100kHz signal preceded by an optional initial delay for the current peak to open the solenoid. You determine the frequency and DC by resistors on certain pins. In your case, the frequency can be set with a standard resistor and the DC can be modulated with a digipot or the like. It can certainly drive a fast switching MOSFET, otherwise it's capable of directly handling up to almost 3 amps peak, and 1.5 amps continuous.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Paul
  • tt460tt460 Posts: 8
    edited 2008-06-23 14:07
    This is not for a P/H injector, it is actually to control transmission line pressure. It's a high current "variable force" solenoid that never actually fully closes unless the engine is shut off. As duty cycle increases, the valve opens more to relieve pressure. As duty cycle decreases, the valve closes and ups the line pressure. Obviously I'm more up on the mechanical aspects of things, more of a novice on the electronics (or at least I have an interest at increasing my knowledge in this area!).

    The solenoid is low impedance (2.66 Ohm) so amperage is about 4.5 amps. I called the solenoid manufacturer and they said they typically rate it at 1.2kHz to 3kHz, but people who have taken readings from a running car see them as high as 6kHz. A company that manufactures an aftermarket transmission controller told me they run it as high as 16 kHz to eliminate noise from the solenoid.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-23 16:35
    The maximum frequency will be more dependent on what's driving the solenoid than the solenoid itself. Since the solenoid is inductive, what it will "see" is simply an average current, assuming the switching frequency is high enough. This is because the inductance tends to resist current fluctuations like the rapid on-and-off PWM cycles, keeping the actual solenoid current relatively constant. (When the transistor is in its "off" state during the PWM cycle, this current recirculates through the "protection" diode.)

    The reason for using PWM in the first place is to eliminate heat in the driving transistor. This works because the transistor will always be either all the way on or all the way off — hardly ever in between where it dissipates power in the form of heat. It's that "hardly ever" that determines the maximum switching frequency. This is because the more times per second the transistor switches on and off, the more times per second it spends transitioning between on and off. For a given driver setup, this "between time" will be constant for each transisition, so the closer the between times are forced together (by raising the frequency) the higher the percentage of time they spend in that between or "linear zone" and the hotter they will get.

    MOSFETs are used for driving loads like your solenoid because they can exhibit very low "on" resistances. This means that when they're switched on, very little power is dissipated by the MOSFET itself. But low "on" resistance usually comes with high gate capacitance. High gate capacitance makes it more difficult to switch the transistor between on and off states quickly, because of the amount of charge that must be injected into, or drained from, the gate by the driving logic. In many high-current, high-frequency situations, special gate driver ICs are used. These have high instantaneous current source and sink capabilities — just perfect for driving capacitive loads. The aftermarket controller supplier you spoke with very quite possibly uses such an arrangement to achieve their 16KHz switching speed.

    Now, having said all that, might there be a compelling reason to use a lower frequency? Perhaps. If the valve or the solenoid that moves it is subject to "stiction", having it vibrate slightly from the lower PWM frequency may actually result in smoother motion than if were driven by a higher frequency and sticking occasionally.

    -Phil
  • tt460tt460 Posts: 8
    edited 2008-06-23 18:05
    Just how low of a frequency are you suggesting? From your post I understand that controlling a high frequency is more difficult. I initially planned to target 3kHz. I've tried controlling the solenoid at a speed of 250 Hz and slower (my ECU is limited to outputting a 250 Hz signal on the driver that controls the line pressure) and the resolution at those speeds is just too coarse. With a pressure gauge on the transmission the gauge needle bounces wildly at that speed as the solenoid tries to control line pressure.

    Thanks for your input.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-23 19:29
    Anything under 5 KHz should be possible with a logic-level MOSFET and without the need for a special MOSFET driver IC. But if the audible squeal from the solenoid is too annoying, you may want to go higher. From this point, experimentation will be your best route to a solution.

    -Phil
  • tt460tt460 Posts: 8
    edited 2008-06-24 00:21
    Thanks for everyone's feedback!
Sign In or Register to comment.