[rusEfi] 1994 USDM Mazda Miata #11

Your chance to introduce yourself and your vehicle
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Good news everyone.

The humming noise is gone. Sounds like a stock engine. Setting the ICV solenoid frequency to 500 did it. Mine board has a diode an from what I read elsewhere that is a really good thing.

set_idle_solenoid_freq 500
writeconfig
// restart the board
// start your engine and enjoy that oh so sweet puring (except I have HLA's that tick like a bad hardrive, but that's not the boards fault)

This fix should apply to all NA and NB miatas. From what I've read 500 is the frequency the stock ecu uses.

Interesting fact: The humming noise was NOT the ICV, it was a resonance caused by the icv that happened in air box. So it came from the wrong side of the engine, that threw me off.

Caveats:
This is not tested, although I noticed the neon has the same frequency.
This is not tested, will wait for the engine to cool down and run the ICV at that frequency for a few minutes to see if it heats up or explodes or forms a black hole and really cool shit comes out, like a pegacorn an shit.. I digress. Stay tuned will report back the results.
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: 1994 USDM Mazda Miata #11

Post by AndreyB »

Yes but no. Maybe. Interesting. Weird :)

set_idle_enabled 1

would enable that naive algorithm which would try to hold idle @ targetRpm - see
set_idle_rpm 900
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

I tried those commands. No effect. Holds an idle of 1600 without any changes.
It responds to set_idle_pwm just fine, and I can make it hold an idle of around 900.

Still have to test that the solenoid is ok with these settings, haven't checked anything yet, the car has not had a chance to cool down.

Will continue testing later.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: 1994 USDM Mazda Miata #11

Post by kb1gtt »

Can you measure the DC ohms of you IAC? In this thread http://rusefi.com/forum/viewtopic.php?f=3&t=666&start=50 we measured the ohms to be 12.1 ohms and we measured the OEM ECU to use a Duty of 250Hz. From those scope readings, I want to measure the time constant of the charge / discharge cycle, then predict the impedance (equiv of AC resistance which adds to the DC resistance) . Any how, I suspect we are dealing with different IAC sol so I wonder if yours measured close to 12.1 ohms or not.
Welcome to the friendlier side of internet crazy :)
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Ok, did some testing.

Got 12.0 Ohms across the ICV solenoid.

Ran it for 30 minutes at a duty cycle of 400 with a frequency 500. The engine was off and cold. The solenoid got slightly lukewarm, no strange sounds.
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Quick update,

I got a case for the board, it needed some modifications but it works like a charm.

The idle control works.
Russian has to make some changes to the code to make it straightforward. But when everything is said an done. This should work:

Code: Select all

set_idle_rpm 900
set_idle_enabled 1
Right now it's all kid of messy but it works!
I added some loads to the idle, like head lights and power-steering and it compensated. Slowly but it compensated.

Next items:
- WBO sensor so I can actually tune the things. The WBO will be installed next week, putting it in the midpipe. Will make a separate post detailing the modifications to the board.
- Verification of what does what in the A/C. This is the first step towards getting functioning a/c. After ecu us tuned.
- Tuning idle and cranking. It's still a fight to turn the engine on, no way to fix anything until the WBO sensor is installed.
- Tune and drive this thing!
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: 1994 USDM Mazda Miata #11

Post by AndreyB »

I still need to write some code for the A/C switch, but in the meantime can you wire the harness A/C pin to the lower pad of W50? That's analog channel 6 - goes to PA1, it's set for a switch with a 10K pull-up R260.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

I want to test that the A/C lines do what is expected from the schematic before connecting them to the board.

Using this http://www.miataforumz.com/1990-200-Miata-Wiring/94sys.pdf as a reference. I want to test, another one of the miatas on this board reported his wiring didn't match to the schematic for some lines.

Inputs:
Heater Control (1S) - No idea what it does, my theory is it goes high when the heating is turned on in the console. Will measure it with A/C off, A/C on, A/C heating.
A/C enable (1Q) - Requests the ECU to turn on the a/c subsystem. Should read 12 volts when the a/c system on. 0 when A/C is disabled.

Outputs:
Compressor enable (1J) - When grounded compressor should engage.
Cond. Fan enable (2S) - When grounded condenser fan should engage.

Which one goes to W50?
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: 1994 USDM Mazda Miata #11

Post by AndreyB »

spags wrote:Inputs:
Heater Control (1S) - No idea what it does, my theory is it goes high when the heating is turned on in the console. Will measure it with A/C off, A/C on, A/C heating.
A/C enable (1Q) - Requests the ECU to turn on the a/c subsystem. Should read 12 volts when the a/c system on. 0 when A/C is disabled.

Which one goes to W50?
Now I do not know :( I was hoping that there is just one input - the button. If we have two inputs, it looks like we need to figure out what they do. Anyway, I guess W50 would be the button regardless. I am assuming the two states of the button are disconnected and ground.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: 1994 USDM Mazda Miata #11

Post by puff »

it seems there is just some tricky logics in all these inputs/outputs: when the AC is on, the RPM usually increases (do not know the reason though - the newer -EFI- range rovers had such feature, as probably had toyota and may be something else), plus the fan turns on at lower temperature with AC on, and at higher - when AC is off (at least, AFAIK old audis had two-positions thermo-switches)
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

RPM usually increases (do not know the reason though - the newer -EFI- range rovers had such feature, as probably had toyota and may be something else), plus the fan turns on at lower temperature with AC on, and at higher - when AC is off (at least, AFAIK old audis had two-positions thermo-switches)
In mazda's (miata's anyways) it seem everything is handled mostly by the ECU and we have two fans. Pressure and temperature are regulated by switches that ride on the a/c enable line, all we have to do is honor that line's state by controlling the fan and compressor clutch. As far as I know they are both tied to the same output (different cable though). Under no condition are they supposed to have different states in the miata. It would be nice to use the condenser fan as an extra fan during very hot conditions. But hardly necessary.

The logic for handling this is probably best implemented on the idle rpm thread. It already runs and monitors rpm all the time. Increasing the rpm to take the load and idle nicely will be handled more gracefully from here as well. When A/C is enabled have a value added to the current idle pwm to absorb the load shock of the compressor turning on and change the target rpm to the a/c one (Idle is different depending if you have a/c on or off in the miata). The idle rpm thread keeps doing it's job through all of this, and does the reverse when shutting down the compressor.

The heater line, sigh... :? no idea of what it does. My theory is the a/c line stays high even when the heater is turned on. The heater line is a disable line to tell the ecu that a/c is running but the compressor does not have to be turned on because we are heating air after all. If this is true it probably changes other subtle things. It's not a very good theory but it's the best I can do.

As for how this is implemented I don't think running the a/c is worth the expense (stack and memory wise) of another thread. Also the complexity of having the idle mechanism signal back and forth is with another thread unnecessary. However, I understand this has to be implemented in a generic way so other people can take advantage of the feature. So defer to russian's good judgment on this.

I should have hard data regarding the state of these things later tonight. Stay tuned.
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Ok, here are the results of the measurements.

Both output lines work as expected. Compressor and fan worked without a hitch.
The input lines have some surprises, here is the data.

Code: Select all

All quantities in volts
O = Open

1S    | 1Q    |  AC  | Fan
-------------------------------
Op    | .36    | OFF | OFF
Op    | .36    | ON  | OFF
.24   | .19    | ON  | 4
.16   | .19    | ON  | 2
.2    | .2     | ON  | 3
1S - The heater line, should actually be called the fan line. I'm guessing it tells the ECU about the load from the fan so it can compensate.
1Q - The A/C compressor enable line. Funny thing .36v means off and .2v means go.

I think 1S can be ignored along with all the other load lines. They are nice to have but not really necessary, maybe in the future we can add all of these voltages and come up with a load compensation coefficient for idle, although i think a well tuned pid implementation can deal very well with these things.

So, questions for russian and kbgtt:
Do these voltages line up with that you expected from the schematic? I expected something closer to 12v myself.
What resistor value, if any do we need to feed this into the frankenso?
Can I gang the two outputs to one lowside channel, or is it better to keep them separate?

Thanks,
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: 1994 USDM Mazda Miata #11

Post by puff »

strange values. it could well be pwm? is there a chance to use a scope for these measurements?
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

I agree, funny values. Didn't look like pwm, it was fairly steady. Unfortunately I don't have a scope to make reliably test that. I did confirm them using different grounds just to make sure.
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: 1994 USDM Mazda Miata #11

Post by puff »

crazy idea: why not measure the frequency (supposing it is pwm). if it's not, the frequency should be zero, shan't it?
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

I don't have an oscilloscope, all i have is a multimeter :( . To my knowledge you need an oscilloscope to measure frequency.

Also, I was thinking about it and there are no frequency sources (in the schematics anyways) tied to those wires.

I measured these values with the frankenso in the car at the breakout area but those lines are not connected to the board. The engine was running at the time.

It would be awesome if another of the members with a miata could measure those wires. I did multiple measurements to be sure. But another car would give me more confidence. They are wierd.

EDIT: Strike that about the frequency with a multimeter. I just need to get a proper multimeter :).
EDIT 2: Holly fucking crap, this is what a proper multimeter is worth: http://www.amazon.com/Fluke-FLUKE-87-V-Digital-Multimeter/dp/B0002YFD1K/ref=sr_1_1?ie=UTF8&qid=1416794205&sr=8-1&keywords=fluke+87
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: 1994 USDM Mazda Miata #11

Post by kb1gtt »

I seem to recall the feed back was a resistor divider, so those numbers seem to match expectations. I'm short on time right now. I'll try to reply better in a day or two.
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: 1994 USDM Mazda Miata #11

Post by kb1gtt »

Am I correct that so far page 1 of this link seems to match your setup? http://www.miataforumz.com/1990-200-Miata-Wiring/94sys.pdf

Can I get you to disconnect the battery, then measure ohms from 1S to the + battery terminal? The change the fan selector switch each and list the readings.

On the OEM setup, does the AC only work when on the low fan setting and AC switch is active? I believe that 2S is supposed to be shorted to 1Q in the ECU, such that if either the refrig pressure switch, or the heater switch trip, it kills the AC. However that schematic seems odd to me in that those only connect to GND if the fan is in the low position. I suspect there is a problem with the schematic. With the battery disconnected, can you use the DMM diode setting and measure 1Q to GND. You should get a reading when the fan is on the low setting and AC switch is active. If you don't try changing the + and - leads and see if you get a reading then. Can you get readings when on the other fan settings?

I believe 1Q is used to GND 2S when the fan is in the low position. Then when in the other higher fan settings 1S is used to GND 2S. What doesn't make sense to me is why it would ignore the AC switch when on higher fan settings, as well why it would ignore the safety switches.

I think the long term solution will be to add a slight pull up resistor to 1S and 1Q, then connect them to an input, and only allow the ECU to GND 2S when it we sees a proper signal on those pins. Also you should be using the snubbing diode thing, don't use the MOSFET voltage clamping, install a diode from 2S to 12V with white band or marked side of diode connected to the 12V side of it. Same goes for 1J and 1L. I don't know if your relays can handle the 40V spikes of the MOSFET's over voltage protection, so you might as well use the diode to keep the spikes low.
Welcome to the friendlier side of internet crazy :)
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Am I correct that so far page 1 of this link seems to match your setup? http://www.miataforumz.com/1990-200-Miata-Wiring/94sys.pdf
Yes

Will to the resistance test tonight.
On the OEM setup, does the AC only work when on the low fan setting and AC switch is active?
A/C works on the higher settings. Never checked if A/C does not work on the lowest setting (never use it) but will check later.
Curiously enough, the A/C line seemed grounded with the lowest setting. I didn't include it in the data because it made no sense to me at the time, chalked it up to malfunction or something.

Holding off modifying the board until we understand what is happening more completly. But using diodes looks like a good idea.
I will also look at an alternate source for schematics. I have the factory service manual (http://www.mellens.net/mazda/) and these are from a Mitchel product. I think schematics from the manufacurer have more credibility.

Thanks.
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Ok, here are the results of testing resistance.

The resistances here are the lowest I found per a/c setting. The ones on 1S fluctuated a lot. From a few hundred ohms to those values. I re-checked the line with fan setting 1 many times. I verified with the stock ecu, setting one engages the compressor (same as every other setting). These measurements where done with the battery completely disconnected, one of the probes on the positive battery terminal, and another on the breakout area of the rusefi board. The tester was completing the circuit.

Code: Select all

OL = Open Line
All units in Ohms unless specified other wise.
| 1S | 1Q | A/C | Fan
---------------------
| OL | OL | OFF | OFF
| OL | 4M | ON  | 1
| 46 | 4M | ON  | 2
| 30 | 4M | ON  | 3
| 12 | 4M | ON  | 4
I also checked the voltages on the stock ecu while running with different states. Here are the results. These voltages make more sense than the earlier ones. Measured at the breakout area of the frankenso board.

Code: Select all

All Units in volts
| 1S | 1Q | A/C | Fan
---------------------
| 14 | 14 | OFF | OFF
| .3 | 14 | OFF | 1
| 14 | 1.0| ON  | 1
| .3 | 1.5| ON  | 2
| .3 | 1.7| ON  | 3
| .4 | 2.0| ON  | 4
| 14 | .1 | H   | 4
I've taken pictures of that area of the ECU in case it helps. Here they are
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: 1994 USDM Mazda Miata #11

Post by kb1gtt »

Oooh, pretty red case.

Can I get the 0hm readings with the AC switch on and off? The schematic shows the AC switch only going to the low position. I think they have wired the AC always on when the fan is on setting 2 or higher. Can we confirm that the AC switch is really of no importance when on the higher fan settings?

You need to use the diode setting for the 1Q measurements. In the ohms position, the multi meter generates a small voltage often 1.5V then measures the current and calculates the ohms displayed on the screen. The issue is that with 2 diode drops, you are very little current making it through the diodes, so it claims 4M. On the diode setting it generates 10mA and measures the voltage drop. Typically your meter will generate a higher voltage on the diode reading scale, which will then bias the diodes and will provide a more realistic reading.
Welcome to the friendlier side of internet crazy :)
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Ok, here are the results:
All measurements where done with the frankenso board in car.
Battery disconnected, engine switch in run position.
Black Lead on car - Red on frankenso

If the A/C button is turned on we get .518 voltage drop on the 1Q line to ground. Irrelevant of fan position, even in off. I did it to the positive terminal just for shits and giggles. Same result.

The resistance test on line 1S, Fan setting 4 and A/C off. Got a large resistance close to 8M and it slowly decreased down to 60k where it stabilized.

This and the voltage tests. Lead me to agree with you, if both lines go low (1Q AND 1S), then the ECU turns the A/C subsystem on. 1S (known as the heater line) is the fan load line. The lower it goes the higher the load. 1Q (A/C enable) is just along for the ride since fan setting 1.

Do we know enough to define what is going to be plugged where in the frankenso board? You mentioned using diodes but not where on the frankenso side they where going to be routed to. Russian was kind enough to send a bunch of 1N4007 diodes along with the board.
Oooh, pretty red case.
One does strange things in boredom :D, this way i can say my car has red undies.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: 1994 USDM Mazda Miata #11

Post by kb1gtt »

I do not think 1S is used for any kind of sensing or feedback, it appears to be either connected to GND or not. Your voltage readings are likely a small drop across a couple mili ohms of resistance in connections. The change in ohms is likely either from various contact resistances as you make and break contacts, or as temperature changes. I need to draw up some schematics to explain what I believe is happening. I think this system is really simple. Also I think the only reason why 1Q exists is because the slower fan might not pull enough heat away which can create to much pressure in the AC hoses. So they added some safety switches. I think the ECU is simple a wire connecting 2S to 1S and 1Q.

About 1Q. the .5V when connected through a DMM makes sense, as the DMM will limit the current to very small currents. Once under "normal" loads you should drop about 1.5V.

I really need to draw those schematics, but that will have to wait a bit.
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: 1994 USDM Mazda Miata #11

Post by kb1gtt »

I got a minute to draw this up more in a way that is probably easier to understand. See attached drawing. Basically when the fan selector switch is in position 2, it allows the AC to work, but with some additional safeties. When in position 3,4 and 5, it simple operates with out the additional safeties.
IMAG0686[1].jpg
IMAG0686[1].jpg (943.62 KiB) Viewed 18628 times
I suggest we change it like this
IMAG0687[1].jpg
IMAG0687[1].jpg (884.16 KiB) Viewed 18628 times
Those are around a 1K to 10K resistor to pull up that input, then the various switches can pull it down. The operation would be that if the input is 12V or a 1 in software, and you have RPM's from the engine, then turn on outputs activating the AC and radiator fan.
Welcome to the friendlier side of internet crazy :)
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Yay, thanks.

Questions regarding the ports to be used on the frankenso side.

- A few posts back Russian mentioned using W50 as an input. Is that still valid? Do I have to have any pull ups, he mentioned it's already setup with a 10K,
- For the output, what is the snubbing diode stuff you mentioned. I imagine it's not the low sides.
- Your schematics show separate switches for 1J and 2S, to be clear those are going to be two separate output ports. If so any ports you recomend?
- Any desired power rating for those resistors between the inputs and outputs?

Also, installing the wideband this weekend, so we can move on to actually tuning the engine instead of dealing with accessories.

Thanks a lot for helping me through this. Once we are done will roll all of this into a nice 94 miata how to.
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: 1994 USDM Mazda Miata #11

Post by AndreyB »

[quote="spags"
- A few posts back Russian mentioned using W50 as an input. Is that still valid? Do I have to have any pull ups, he mentioned it's already setup with a 10K,[/quote]

Code: Select all

engineConfiguration->acSwitchAdc = EFI_ADC_1; // PA1, W50 on Frankenso

Code: Select all

	/**
	 * todo: make this flexible
	 *
	 * for now we are looking for a pull-up. High level means input switch is floating (which is OFF position)
	 * low value means input is ground - which means ON.
	 */
	return getVoltageDivided(engine->engineConfiguration->acSwitchAdc) < 2.5;
eval ac_toggle is your new friend on the way to A/C control logic implemented via FSIO
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

Here is my interpretation of kb1gtt's schematic as applied to my frankenso board.

Can somebody with more knowledge about electronics have a look at this and confirm that it looks sane?

Code: Select all

              1J
1Q -- (R10K)--|
   |        D7 Low side 
   |
   |                2S
1S -- (R10K)--------|
   |              E3 Low side 
  W50 Input
spags
contributor
contributor
Posts: 136
Joined: Mon Oct 13, 2014 1:04 am

Re: 1994 USDM Mazda Miata #11

Post by spags »

AC Input detection works, more details along with a more complete and detailed explanation of the hows and whys to come.

But in short, disregard the earlier schematic I posted and jump 1Q to W50, and check that "eval ac_enable" it corresponds to the switch positions. And it works, heater line can be ignored.

Disclamer: The software around this feature is still changing and will be documented when more complete so don't use this as a reference.
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: 1994 USDM Mazda Miata #11

Post by AndreyB »

It's eval ac_on_switch in trunk now
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: 1994 USDM Mazda Miata #11

Post by kb1gtt »

Looks good to me don't forget the diodes
Welcome to the friendlier side of internet crazy :)
Post Reply