PWM Frequency adjustment.....

All questions about MS2/Microsquirt/Microsquirt module. See also MS2/Extra manuals

Moderators: jsmcortina, muythaibxr

Post Reply
Winger33
MS/Extra Newbie
Posts: 26
Joined: Wed Nov 24, 2010 10:28 pm
Location: Seattle

PWM Frequency adjustment.....

Post by Winger33 »

Im trying to find were I'd change the frequency setting for a Ford Idle Air Valve in megatune for the PWM setup for it... I've read and been told that 300-320Hz is a good setting for this but don't see a option anywere to change that anyone know were I might find that in Megatune???? Thanks
88 Ranger 2.3L MS2-Extra 2.1.0
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: PWM Frequency adjustment.....

Post by elaw »

It depends on what flavor of Megasquirt you have (MS1, MS2, or MS3), what firmware you're using (B&G or Extra) and the version number of the firmware.

Once you give us that info, we should be able to help!
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: PWM Frequency adjustment.....

Post by elaw »

I realized my post above might need a little explaining...

Almost all the menus & screens in Megatune are defined based on an "ini file" that's tied to the specific firmware being used in the Megasquirt. So without knowing what firmware you're using, it's impossible to tell you how to change that setting except in uselessly general terms.
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
Winger33
MS/Extra Newbie
Posts: 26
Joined: Wed Nov 24, 2010 10:28 pm
Location: Seattle

Re: PWM Frequency adjustment.....

Post by Winger33 »

Sorry about that I'm at work and was in a bit of a hurry. Its a MS II Extra V2.0 PCB 3.57.... The Idle Air Valve is from a 88 Ford Ranger 2.3L . I saw the pull down window were you could invert ? I believe that makes the valve work in reverse of the inputs? Wich may be necessary? Thanks for your help I think this is the last little nugget I'll need before I try and turn the key and see if this thing will fire up..........
88 Ranger 2.3L MS2-Extra 2.1.0
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: PWM Frequency adjustment.....

Post by elaw »

Actually, the dialog where you set the frequency is the same as whether you set normal/inverted! It's the "PWM idle settings" dialog under "Startup / idle", and the frequency is the last item, where it says "Valve frequency 30.5 Hz * this setting".

As for normal vs. inverted, you need to know how your idle circuit is wired and whether the valve opens or closes when energized. The most common circuit (which energizes the valve when the CPU pin is high) and valves (which open when energized) use the "normal" setting.

You're not likely to break anything by using the wrong setting for normal/inverted, so you can use trial-and-error to figure it out.
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
Winger33
MS/Extra Newbie
Posts: 26
Joined: Wed Nov 24, 2010 10:28 pm
Location: Seattle

Re: PWM Frequency adjustment.....

Post by Winger33 »

Thanks Eric I actually had origanally inverted it to see if I could stop that anoying humming coming from it. It just worried me that anything sitting there vibrating like that would wear out or fail prematurely but some say its normal to do hat makes sense if we are talking about adjusting the frequency...... Thanks again for your help.
88 Ranger 2.3L MS2-Extra 2.1.0
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: PWM Frequency adjustment.....

Post by elaw »

One thing that can help with the humming is to increase the frequency. But if you go too high the valve won't respond properly. You just have to try different frequencies to get a good balance.
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
Winger33
MS/Extra Newbie
Posts: 26
Joined: Wed Nov 24, 2010 10:28 pm
Location: Seattle

Re: PWM Frequency adjustment.....

Post by Winger33 »

Ok we'll do! Thanks for the help
88 Ranger 2.3L MS2-Extra 2.1.0
Winger33
MS/Extra Newbie
Posts: 26
Joined: Wed Nov 24, 2010 10:28 pm
Location: Seattle

Re: PWM Frequency adjustment.....

Post by Winger33 »

Found the setting it through me off as it doesnt have a 300 to 320 Hz adjustment it reads 1to 8 wich I gather is 100 to 800Hz? Anyway I put it back to normal from the inverted state and set the Hz to 3 and it did quiet down a bit. Thanks again.
88 Ranger 2.3L MS2-Extra 2.1.0
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: PWM Frequency adjustment.....

Post by racingmini_mtl »

It's not 100Hz to 800Hz:
elaw wrote:Actually, the dialog where you set the frequency is the same as whether you set normal/inverted! It's the "PWM idle settings" dialog under "Startup / idle", and the frequency is the last item, where it says "Valve frequency 30.5 Hz * this setting".
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Winger33
MS/Extra Newbie
Posts: 26
Joined: Wed Nov 24, 2010 10:28 pm
Location: Seattle

Re: PWM Frequency adjustment.....

Post by Winger33 »

Ok well I was just interpeting the adjustment next to that only reads 1 to 8 with the up and down arrows..... I set it to 3 soooooooo is this even close. To what I want or are we on different sheets of paper here?
88 Ranger 2.3L MS2-Extra 2.1.0
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: PWM Frequency adjustment.....

Post by racingmini_mtl »

Winger33 wrote:Ok well I was just interpeting the adjustment next to that only reads 1 to 8 with the up and down arrows..... I set it to 3 soooooooo is this even close. To what I want or are we on different sheets of paper here?
30.5Hz times 3

You should also be aware that the higher the number, the lower the resolution you will get. With 3 you have a 1.17% resolution (3/256) meaning the PWM duty cycle will move in steps of 1.17%. So only go as high in frequency as you need to.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
hassmaschine
Super MS/Extra'er
Posts: 1331
Joined: Mon May 21, 2007 8:36 am

Re: PWM Frequency adjustment.....

Post by hassmaschine »

what's the trade off?

higher frequency = faster response, lower res?
lower frequency = slower respose, higher res?
jsmcortina
Site Admin
Posts: 39587
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: PWM Frequency adjustment.....

Post by jsmcortina »

The required frequency depends on the valve. My understanding is that effectively we are trying to make the valve "float" partway between open and closed.

Due to the way the (software) PWM works, as the frequency is increased the resolution decreases. On MS3 usually a hardware PWM output is used which does not have this limitation.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
pigga
Master MS/Extra'er
Posts: 618
Joined: Sat Feb 09, 2008 12:44 pm

Re: PWM Frequency adjustment.....

Post by pigga »

racingmini_mtl wrote:
Winger33 wrote:Ok well I was just interpeting the adjustment next to that only reads 1 to 8 with the up and down arrows..... I set it to 3 soooooooo is this even close. To what I want or are we on different sheets of paper here?
30.5Hz times 3

You should also be aware that the higher the number, the lower the resolution you will get. With 3 you have a 1.17% resolution (3/256) meaning the PWM duty cycle will move in steps of 1.17%. So only go as high in frequency as you need to.

Jean
Hi Jean.
I got this "Humming" as well. Increasing the frequency lowers the noise, but I get less resolution as well (as mentioned above).
I would like to know what's causing the limitation.
I know that you are offering this PWM converter Board. So...gives this the ability to run higher frequency with maximum resolution if I run MS2 on lowest frequency and set the freq. to higher value by using the converter Board?
Thomas
jsmcortina
Site Admin
Posts: 39587
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: PWM Frequency adjustment.....

Post by jsmcortina »

pigga wrote:I would like to know what's causing the limitation.
Answer:
jsmcortina wrote:Due to the way the (software) PWM works, as the frequency is increased the resolution decreases
To fully explain it, you need to look at how software PWM works.
The main clock is at 0.128ms period = 7812.5 Hz.
That is usually divided into 256 steps = 30.5Hz.
To make it faster you divide into less steps. The frequency goes up but the output becomes more coarse.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: PWM Frequency adjustment.....

Post by racingmini_mtl »

James beat me to the explanation and actually gives a better one than what I had.

And the board I offer allows you to set the PWM to the minimum frequency for the maximum resolution and the board takes that and multiplies the frequency by a factor of 2, 4, 8, 16, 32, 64, 128 or 256 depending on what you need. And the board keeps the exact same duty cycle for the output as what it gets on the input without losing resolution (up to the resolution of the timer).

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
hassmaschine
Super MS/Extra'er
Posts: 1331
Joined: Mon May 21, 2007 8:36 am

Re: PWM Frequency adjustment.....

Post by hassmaschine »

jsmcortina wrote:The required frequency depends on the valve. My understanding is that effectively we are trying to make the valve "float" partway between open and closed.

Due to the way the (software) PWM works, as the frequency is increased the resolution decreases. On MS3 usually a hardware PWM output is used which does not have this limitation.

James
oh, okay. so in my case, it's the valve itself that determines the chosen PWM frequency.
Post Reply