Mazda idle valve (code hacking question)

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

racingmini_mtl wrote:Possibly but you'd need a way to tell the firmware you want to disable the pin before connecting through the serial port.
I forgot that every serial interrupt is filtered via the monitor code.

Maybe I will look at my in-cricuit reflash idea after all.

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".
matt_fulghum
Experienced MS/Extra'er
Posts: 167
Joined: Mon Sep 19, 2005 3:39 pm
Contact:

Post by matt_fulghum »

if it would be helpful, I'll begin hacking away at putting in the CAN code, as I plan to start doing CAN device development for the MS very soon.
natesully
Experienced MS/Extra'er
Posts: 226
Joined: Mon Jul 25, 2005 9:13 pm

Post by natesully »

I haven't scoped, but I'm pretty sure you are correct about high freq PWM working fine- the stock (miata in this case) computer uses PWM. I just put up with the racket for now, it's fine at idle and (somehow) actually does regulate RPM like it should. I'm going to rip it out one of these days, the miata has a thermowax valve (what where they thinking?) for warm-up in addition to the PWM valve and the idle set screw.
95 Miata M-Edition, GT28 Turbo
matt_fulghum
Experienced MS/Extra'er
Posts: 167
Joined: Mon Sep 19, 2005 3:39 pm
Contact:

Post by matt_fulghum »

well with the circuit I designed with the op-amp, it's got an active low pass filter at around 90 Hz, which means that as long as you have a PWM speed that's a bit faster than that, it'll cut off the high speed junk from the PWM switching, and leave you with just a cleaaaan signal.

If 1% step accuracy could be attained at 150 Hz, then you could probably plug that signal straight into the op amp and run this circuit from the Megasquirt no sweat.

One of the major benefits I've found with driving the idle valve off of clean DC voltage instead of trying to switch it on and off very quickly is that you don't get the 50 or 60 volt spiking that you get trying to switch an inductor (like a motor/solenoid) on and off really quickly. This would be much less noisy, and might play nicer with the rest of the MS.

The LF412 is cheap too.
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

matt_fulghum wrote:if it would be helpful, I'll begin hacking away at putting in the CAN code, as I plan to start doing CAN device development for the MS very soon.
The CAN code is and always has been there.

However, last time I tried it the base MS2 CAN code didn't work for me, so the MS2/Extra port of it won't work for sure.

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".
drytoast
Helpful MS/Extra'er
Posts: 46
Joined: Thu Jun 14, 2007 3:24 am
Location: Seattle, WA

Post by drytoast »

I could be way off base here but if the valve wants a steady DC voltage, how about placing a (determine size here) capacitor across the leads of the valve? I've done that when controlling PC fans with a PWM signal. The signal at the valve will look more like a DC with oscillations than a square wave.

I'm curious myself as I am also putting stuff together on a Mazda (miata).

As for the noise, was it a small whine like sound or something bigger?

Brett
matt_fulghum
Experienced MS/Extra'er
Posts: 167
Joined: Mon Sep 19, 2005 3:39 pm
Contact:

Post by matt_fulghum »

well I've ditched the whine by putting the PWM signal through an active low pass filter with a 2.47x gain... that gives just about the right voltage going into the second stage, which controls the valve itself.

Basically, for about 8 dollars of parts, you can get a DC voltage out from the PWM signal. it works really well, at least in my testing...

I'm getting some crazy 800+ kHz oscillations at the output though. It doesn't effect the operation of the valve it seems, but I'm working on getting rid of them anyway. In doing some reading it seems like it might be the internal capacitances of the TIP120 doing nasty things with the feedback.
drytoast
Helpful MS/Extra'er
Posts: 46
Joined: Thu Jun 14, 2007 3:24 am
Location: Seattle, WA

Post by drytoast »

So is that the active low pass directly off of the MS PWM or are you still recreating your own?
natesully
Experienced MS/Extra'er
Posts: 226
Joined: Mon Jul 25, 2005 9:13 pm

Post by natesully »

Oh, I get it now. Low pass = integrator. So with the right component values, you can integrate the normal MS PWM to an analog voltage. Then amplify and feed to the valve.

But- if you put a diode and capacitor on the valve, don't you get a switch mode power supply type deal (buck converter) that achieves the same result, using the inductance of the valve itself? I think I'm going to try a large cap and see if that shuts it up. Or perhaps an inductor and cap in parallel with the valve... Or an inductor in series, and diode in parallel. I'll have to think about this.

The noise is no small wine, it's like a big, mad hornet under your hood. I can't here it with the hood on though.
95 Miata M-Edition, GT28 Turbo
matt_fulghum
Experienced MS/Extra'er
Posts: 167
Joined: Mon Sep 19, 2005 3:39 pm
Contact:

Post by matt_fulghum »

with the op amp drivers, there's no more whine (because the valve stays in one position, like it should). I managed to get rid of most that oscillation garbage. I just had to put a 1 nF cap across the base resistor for the TIP120 as a speedup cap to deal with the capacitance of the transistor itself. It didn't COMPLETELY get rid of all of it, but it's not nearly as big as before.

With the proper caps and resistors on the low pass, you could probably drive it perfectly fine off of the Megasquirt's faux-PWM output. The issue still is however that with the timer code as it is, the valve has pretty poor resolution at any reasonable speed. (I'm not sure you could happily low pass a 78 Hz signal, and with the 156 Hz output, you're running at 2% step accuracy. ick.)
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

matt_fulghum wrote:with the op amp drivers, there's no more whine (because the valve stays in one position, like it should). I managed to get rid of most that oscillation garbage. I just had to put a 1 nF cap across the base resistor for the TIP120 as a speedup cap to deal with the capacitance of the transistor itself. It didn't COMPLETELY get rid of all of it, but it's not nearly as big as before.

With the proper caps and resistors on the low pass, you could probably drive it perfectly fine off of the Megasquirt's faux-PWM output. The issue still is however that with the timer code as it is, the valve has pretty poor resolution at any reasonable speed. (I'm not sure you could happily low pass a 78 Hz signal, and with the 156 Hz output, you're running at 2% step accuracy. ick.)
I'm running with the higher speed output right now, 2% accuracy is still enough to control the speed accurately on my engine...

Ken
matt_fulghum
Experienced MS/Extra'er
Posts: 167
Joined: Mon Sep 19, 2005 3:39 pm
Contact:

Post by matt_fulghum »

what idle valve are you using?

The one on my engine (the 1.8L DOHC block from Mazda, used in the Miata, Protege LX, and Ford Escort GT) is (I believe) a rotational solenoid, and with anything less than about 180 Hz, it begins to totally freak out, jittering in between positions. Any higher than that, and the code starts to lose more and more accuracy.

Using that circuit I provided earlier from the idle valve output on the MS, at 78 Hz, and with a retune of the low pass filter (to filter out anything higher than, say, 50 Hz) should provide a clean, consistent voltage to the valve. I'll post a revised schematic tonight with the changes done to it that you'd need to set the low pass to a lower frequency (it's at about 88 Hz atm, which wouldn't cancel out the junk from a 78 Hz signal).

Also note that the switching transients from driving the transistor off of a PWM signal can go up to 50 or so volts. With the clean DC voltage, you don't get the switching transients because the voltage is a nice smooth curve.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

matt_fulghum wrote:what idle valve are you using?
I've used it with the stock 13b BAC valve that comes on the 2nd gen RX7, and with the stock 3-wire ISCV that comes with Toyota's silver-top 20v 4age.

I've not had any problems with either of them.

Ken
bcrx7
Helpful MS/Extra'er
Posts: 110
Joined: Sun May 02, 2004 5:37 pm
Location: Vancouver, BC

Post by bcrx7 »

What mazda valve are you using out of curiosity? I have used the Miata one, one from the Protege and one from the RX-7 and none of them needed to go over 60hz. All three work great and the RX-7 and miata even has A/C.
1984 Mazda RX-7 GTM Class (BP Engine + BW-EFR 8374 Turbo Full COP/Sequential on MS3+MS3x)
1986 Toyota 4Runner (22RE running on MS2-Extra 3.2.1)
drytoast
Helpful MS/Extra'er
Posts: 46
Joined: Thu Jun 14, 2007 3:24 am
Location: Seattle, WA

Post by drytoast »

I previously had a different aftermarket ECU on the car (99 miata) and at key-on without cranking the car, you could definitely hear a middle pitch whine from the idle valve that isn't there with the stock ECU.

With the car running, it was drowned out by other things. Not the same racket that is described earlier but that is a 95 vs. a 99 and lots changed in 99. I never looked at the signal outputs though.
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

matt_fulghum wrote:Using that circuit I provided earlier from the idle valve output on the MS, at 78 Hz, and with a retune of the low pass filter (to filter out anything higher than, say, 50 Hz) should provide a clean, consistent voltage to the valve.
That's all well and good, except that I'm pretty sure that most if not all of these valves are designed for PWM operation not steady voltage.

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".
rb26dett
Master MS/Extra'er
Posts: 497
Joined: Tue May 24, 2005 11:34 pm
Location: Auckland New Zealand

Post by rb26dett »

meaning that they will stick? from a lack of vibration and peak force? or what?

as on the average, a steady 6v will supply the same power to the device as a 50 50 12v. other than my comment at the top i'm not sure i understand how it could matter, can you enlighten me?

fred.
ms2,v3,cop,innovate,mazda fe3/fe-dohc 2l 4cyl with stock 10:1 pistons,4 stock coils,4 stock ignitors,rx7 550cc injectors maxed@6600rpm&17psi,custom everything,holset he351cw turbo,44mm ext gate,nis gtr bovs,nis gtr intercooler,70mm lexus throttle,chinese fpr,10may v2 ms2e alpha code
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

With PWM you get full effort for part of the time so small openings in particular are more reliable.
12% duty cycle might open a valve 12%, but 1.5v probably wouldn't do anything.

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".
matt_fulghum
Experienced MS/Extra'er
Posts: 167
Joined: Mon Sep 19, 2005 3:39 pm
Contact:

Post by matt_fulghum »

The idle valve on my car is most definitely a rotary solenoid, which are designed to be operated with a voltage between 0 and 12 volts. (Beyond 12 volts, it doesn't move any further). The stock ECU drives it with PWM, yes, but it is at a very high frequency so it smooths out to be effectively a normal DC voltage.

If the frequency is too low (as 158 Hz was for mine), it snaps back and forth, and quivers. Mine did this up to about 1 kHz, and even at that point, it still audibly hums. With a constant DC voltage from a bench supply, the valve operates smoothly, with no noise or jitter.

Soooooo yeah. It's NOT a servo, therefore it does NOT need a PWM signal.

For reference, this is the valve I'm talking about:
Image
Image
natesully
Experienced MS/Extra'er
Posts: 226
Joined: Mon Jul 25, 2005 9:13 pm

Post by natesully »

That valve looks way different from the Miata one I have...
95 Miata M-Edition, GT28 Turbo
Post Reply