Connect with us

I'm a little confused about PWM

Discussion in 'General Electronics Discussion' started by Punknoodle, Jan 29, 2014.

Scroll to continue with content
  1. Punknoodle


    Jan 29, 2014

    I'm trying to get my head around some things regarding PWM. Its probably the most basic thing ever but my brain has been in overdrive for the last hour trying to work it out.

    I've only really come across the term PWM when working on different aspects of the ECU in my race car, so I'll use those examples as basis for my questions.

    First use - Boost control solenoid. This one makes sense to me. When setting this up, you need to enter the frequency of the solenoid (30Hz, for example) and then the duty cycle is varied to suit. As long as there is a duty cycle of less than 100% there will always be 30 "dips" in the square wave (for a one second interval).

    Second use - Tachometer. This one you enter in the pulses per revolution, then you enter the duty cycle. I'm assuming then, that the "frequency" of the pulses is no longer in time, but in revolutions. So if I'm doing 60RPM, and the pulses per revolution is 4, then in Hz it would be 4Hz. If I was doing 6000RPM, then in Hz it would be 400Hz. As long as the duty cycle is less than 100% there would always be 400 "dips" in the square wave (for a one second interval).

    Am I right so far? It got confusing having time/frequency as a constant on one, and the duty cycle being the constant on the other.

    What I don't understand, if I am correct so far, is why you would be able to select a 100% duty cycle in the ECU menu for the tachometer output. If that was the case, then no matter what the revolutions were, there would just be a constant 12V signal at the tachometer, wouldn't there? By reducing the duty cycle, the tachometer will still see the same number of pulses, but the off time between them will be greater as you reduce the duty cycle. I'm just trying to work out why 50% duty wouldn't be the ideal duty, as it would create a perfect square wave. Some people say the tachometer becomes too jumpy at high RPM and they have to lower the duty to 10%. Is that just do clear up the signal? More off time means the on pulses will stand out more? If that't the case, why not just have it at 10% all the time? Because it might not be long enough for the tachometer to pick it up?

    I can see why it takes time to get these things tuned, it seems like a balancing act!
  2. shumifan50


    Jan 16, 2014
    In the first case the output is being driven(output of PWM signal). I don't know what a boost control solenoid is on racing cars, but presume it drives the motor. In such a case the frequency of the pulse determines the smoothness of the motor output, while the duty cycle controls the RPM under load(the duty cycle will also affect the RPM but is subordinate to the requirement for smoothness). It is dependent on the motor used what the optimum settings are for freq/duty cycle and the requirement for smoothness. In the case of a racng car I would imagine smoothness is important and therefore higher freqiencies(up to a point) would be preferable as it would be less likely to break traction. If the duty cycle is set too low then it will also affect smoothness.

    The second case is reading(input) PWM. In this case there are several ways to determine the RPM (of presumably the wheels). It can count interrupts on the leading/trailing edge or it can measure the voltage generated. Depending on which method used, the duty cycle might or might not be that important. Counting interrupts will be more accurate in which case the frequency has to be in the range of intterupts per second that can be handled by the detector and the duty cycle must be suh that it triggers the interrupt.

    So in the end it is an art, rather than a science to set up such a racing car as it will depend on the characteristics of the car, the preferences of the driver and the electronics and electrics used.
    Last edited: Jan 29, 2014
  3. Punknoodle


    Jan 29, 2014
    Thanks for your reply mate, just to clear up what the devices are used for, the boost control solenoid is controlled by the ECU (engine control unit, or engine management system) and is just a 3 port valve placed in the vacuum line between the turbocharger and the wastegate actuator (the wastegate opens at a set pressure that it sees from the turbo, and bypasses exhaust gasses from the turbine, thus limiting boost). It's function is to be in bypass when unpowered, (fail safe), but when powered it blocks the boost pressure from getting to the actuator (and vents the actuator line). Used with PWM control, it is a very smooth and reliable way to control your boost pressure from your turbocharger.

    The tachometer is for displaying engine crankshaft RPM. It is an analogue device.
  4. shumifan50


    Jan 16, 2014
    OK that cleared that up. I was thinking model electric racing cars.

    As far as the taco is concerned: The frequency is pretty much determined by the speed of the crankshaft. The actual needle deflects based on the voltage accross its terminals. To calibrate it you change the duty cycle(and likely an inline resistance) within acceptable smoothness(stop the needle jumping).
    Last edited: Jan 29, 2014
  5. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    Yep that's PWM. The ratio between the on and off time presumably have meaning.

    But this isn't PWM. This is just a pulse train. The frequency is the important thing (that gives you the meaning). Within reason, those pulses could have a 1% duty cycle or a 99% duty cycle and the meaning would be the same.

    All you're doing is setting a sensible value, it's not really PWM.

    It seems pointless. I can't see it having any meaning. Perhaps you can set it because it's just a parameter that can be varied, but it doesn't convey any information.

    PWM means Pulse Width Modulation. If you're not varying the pulse width, then you're not doing pulse width modulation.
  6. gorgon


    Jun 6, 2011
    When setting the duty cycle of an input signal, it is just an information to the ECU, or if the ECU Control the ignition, it could be the actual duty cycle of the ignition output. The duty cycle will be the 'same' for all speeds, its the number of cycles/second that indicates the RPM.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day