'92 Festiva with 1.6L SOHC

Your chance to introduce yourself and your vehicle
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '92 Festiva with 1.6L SOHC

Post by kb1gtt »

Yes that snippet helps. It notes this works very similar to a hall sensor, and almost all hall sensors are low side transistors with a pull up resistor. So yours is very likely to be the same setup as the picture I posted above.

No worries about the the series resistor on the signal wire. I suggested that just to play it safe. However with 5V and if it works, then your OK. Basically that resistor is only there to limit current if your signal exceeds 5V.

Do you have a multi-meter that can measure around 10mA of DC current? Can you measure the current in either the power wire or the ground wire for the optical sensor? Can you tell me what it reads both when the op-amp LED is bright, and when it is dim. Also what is the voltage? I know it's 5V, but is is 4.9 or other?

Once I get those readings, I think I'm going to have you change how you have the op-amp wired. Right now it's a voltage follower, but I think we want to change it to a comparator. I think that's going to be the best way to remove the noise.
Welcome to the friendlier side of internet crazy :)
skeeters_keeper
Posts: 44
Joined: Fri Nov 08, 2013 3:18 am

Re: '92 Festiva with 1.6L SOHC

Post by skeeters_keeper »

A little more info incase it will help anyone else down the road:
The BP came with two different styles of distributor. T2T52471 and T2T52471B
T2T52471 uses optical sensors and has Mitsubishi ignition module J925 http://tinyurl.com/mqaotgt

T2T52471B is the one I have pictured above (hall sensor?).

It appears that you can put that ignition module into the festiva/323 distributor and now you will have use of the fourth pin. I have not tested this yet!! Another option (if you are going to COP) is to use a miata cam pos sensor, which has the same internals but no distributor cap/rotor.


Jared, I will try to play some more tomorrow night if I can, and I'll get back with the results asap :)
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '92 Festiva with 1.6L SOHC

Post by AndreyB »

I've added a default config for this trigger shape, please activate it
set_engine_type 11
once you get the latest firmware (20140308)
See also http://rusefi.com/wiki/index.php?title=Manual:Engine_Type

I am hoping to see correct tachometer reading - that's once the noise issue is resolved completely.
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: '92 Festiva with 1.6L SOHC

Post by kb1gtt »

When you get around to trying this on the engine again, do you want to consider a change in schematic? I think you'll have better results with the attached schematic. If you need help with getting that into the breadboard layout, let me know your op-amp and I'll draw it up a bit more like it would be done on the breadboard. R1 would want to be something like 5k, and R1 would want to be something like 1k. Basically you want to hold the - side of the op-amp at around 1V to 2V, then the op-amp output will swing as the signal crosses that voltage.
Attachments
op-amp comparator
op-amp comparator
compare_op-amp.jpg (98.85 KiB) Viewed 18187 times
Welcome to the friendlier side of internet crazy :)
skeeters_keeper
Posts: 44
Joined: Fri Nov 08, 2013 3:18 am

Re: '92 Festiva with 1.6L SOHC

Post by skeeters_keeper »

kb1gtt wrote:Do you have a multi-meter that can measure around 10mA of DC current? Can you measure the current in either the power wire or the ground wire for the optical sensor? Can you tell me what it reads both when the op-amp LED is bright, and when it is dim. Also what is the voltage? I know it's 5V, but is is 4.9 or other?
I tried getting these readings tonight - I hooked up one DVM inline with the GND on the sensor to measure the current and another one between the signal pin and ground (so I could see when the trigger was triggered). But things did not work as I expected - with the key "on" (and the coil wire disconnected, so I couldn't accidentally fire a cylinder) I turned the engine over by hand - and I never got a current reading. The DVM on the signal wire was reading 9.3v and stayed the same as I turned over . My battery had a full 12.5v. When the engine was running the other day I had pretty steady ~5v so I don't understand that.


Russian - I've got the new firmware and now it says Mazda 323 :)
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: '92 Festiva with 1.6L SOHC

Post by puff »

probably you don't need to startthe engine with a key, you need to rotate the crank by hand just a bit, by several degrees so that the led in youd disty is against the slot, and then measure all the voltage and currents
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '92 Festiva with 1.6L SOHC

Post by kb1gtt »

A couple quick thoughts, have you verified the fuse is OK in your DMM? Try using a separate meter if you have a separate meter, do a beep test or check for 0 ohms instead of open circuit across your current reading meter's leads. I've seen several people take a voltage reading, then roll the dial across the current readings to turn a meter off or something like that. When they cross the current readings it blows the fuse and they don't know it. So I would say first things first. lets make sure you DMM fuse is still good. The next thing, this was the optical sensor correct? Not a hall sensor, and not a variable reluctor? A variable reluctor won't work until you get some RPM's going, most hall's will work down to 0 RPM, but not all. Some have internal circuitry but I would not expect this from an OEM device.
Welcome to the friendlier side of internet crazy :)
skeeters_keeper
Posts: 44
Joined: Fri Nov 08, 2013 3:18 am

Re: '92 Festiva with 1.6L SOHC

Post by skeeters_keeper »

puff, that's what I did - rotated the engine by hand (but with the key "on" so that I had power to the sensor)

Good idea to check the fuse... it worked fine last time I used it but it has been a while. And yes, it is an optical sensor, same as the one I took pictures of.
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: '92 Festiva with 1.6L SOHC

Post by puff »

just came to my mind: could that noise (that was the problem, right?) be caused by the reflection of light? consider using the black water-proof felt-tip pen to make that slotted disk less shiny :D
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '92 Festiva with 1.6L SOHC

Post by kb1gtt »

I don't think the sensor is doing anything wrong. I think it's an electrical issue. The STM will trigger at around .6 to .8V ish. See below picture, and notice the round nature that's close to .7V, also notice in the other picture the ringing on the bottom side. You could have either one of these issues, or both of these issues. The result would cause a couple 1's and 0's to be triggered in software. This is why I suggest the comparator, as it would trigger the input at a higher voltage. As an alternative, you could use an actual compariator, as those have some hysteresis which helps prevent the ringing. However I know you have an op-amp and it should work good enough.

Image

Or it might look something like this

Image
Welcome to the friendlier side of internet crazy :)
skeeters_keeper
Posts: 44
Joined: Fri Nov 08, 2013 3:18 am

Re: '92 Festiva with 1.6L SOHC

Post by skeeters_keeper »

Much better success tonight! I walked out to my car and was going to check the fuse in my DVM and realize immediately that I had the leads hooked up wrong for measuring current... doh.

Here the meter on the left is showing the voltage on the signal wire (.3v) and current on the gnd wire (14.9mA) this is "no signal"
VoltMeters_nosignal.jpg
VoltMeters_nosignal.jpg (391.24 KiB) Viewed 17325 times
And after rotating the engine a little by hand I got a signal:
VoltMeters_signal.jpg
VoltMeters_signal.jpg (364.47 KiB) Viewed 17325 times

So then I wired up the op-am as suggested, this is what the breadboard layout looked like:
Breadboard Setup2.jpg
Breadboard Setup2.jpg (442.15 KiB) Viewed 17325 times
I used a 5.6k resistor for R1 and a 1k resistor for R2. I have a 105 cap between 5v and gnd (I see a cap in the drawing but wasn't sure what size would be best, so I guessed).
(continued in next post)
skeeters_keeper
Posts: 44
Joined: Fri Nov 08, 2013 3:18 am

Re: '92 Festiva with 1.6L SOHC

Post by skeeters_keeper »

With it hooked up like this, but not connected to the signal wire, I started the car - the tach values were all over the place. And the signal wire was not hooked up at all? I unhooked the 5v from the opamp and it dropped to zero. Then I hooked it back up and same thing - so I unhooked the ground the the battery (the larger black wire, runs directly to the batt - terminal) - no more noise?

So I hooked up the signal wire:
TachWorksIdle.jpg
TachWorksIdle.jpg (92.99 KiB) Viewed 17325 times
Hey look! Fast idle!

Reve a little:
TachWorks2krpm.jpg
TachWorks2krpm.jpg (86.91 KiB) Viewed 17325 times
It seemed to follow the engine nicely! I took a video but can't upload it from home (limited bandwidth) I can upload it tomorrow.

With it running I tried hooking the battery ground up again - and it had lots of noise. Strange since that seemed to help before.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '92 Festiva with 1.6L SOHC

Post by kb1gtt »

This is good news and good progress. I should ask, how does the opto get the 5V? Is the op-amp the only thing connected to the opto? You mention your running the car, so apparently the engine starts, and has spark. Which means there are potential sources of noise. I would suggest as a minimum to twist your signal wire and and GND wire. Say like 1 to 3 twists every inch or so. Also if it runs, is there another circuit connected to the signal wire?

So when the signal is at 5V, and assuming the op-amp circuit is the only thing connected to that signal wire, you are only powering the internal LED(s). So the internal LED's are consuming 11.08mA. The internal LED probably drops about 1.4V, so the drop across in the internal resistor would be 5.1V - 1.4V = 3.7V. So the LED's internal resistor is 3.7V/.01108A = 334 ohms.

However when the signal is at 0.3V, it consumes 14.91mA. A difference of 3.83 mA. The transistor may not pull down to 0V for a variety of reasons, most commonly it's a problem with a leakage of the transistor. The transistor will have an internal resistance, and a leakage, which will create a minimum voltage. I've seen some hall sensors as high as .6V to .7V because of this leakage, so .3V is not bad at all. So the voltage drop across the internal signal resistor would be (5.1V - .3V) / .00383A = 1,253 ohms.

I can eyeball various capacitance's and such to figure out other potential issues. This is a good start. Some items I don't really like include how the current is running through you sensor, and a voltage signal goes up the long antenna to the MCU with very little current. This makes the signal wire susceptible to picking up external noise. It would be handy if we can drop the op-amp circuits impedance. Most RF will induce some low mA typically more like nA of current into the wire. If you have a MOHM input, that RF current can generate volts. However if you have a 10KOHM input, that nA of RF voltage will only generate mV of volts instead of larger voltages. So figuring out how to drop the op-amp circuits impedance should help with the noise issues. Let me see what you have to say about how the rest of the circuit is done and then I'll make a suggestion on how to get the op-amp a lower impedance. I think we'll be adding a resistor, but we'll see how the rest is wired. I don't want to do something that effects another circuit if another circuit is connected to the signal wire.
Welcome to the friendlier side of internet crazy :)
skeeters_keeper
Posts: 44
Joined: Fri Nov 08, 2013 3:18 am

Re: '92 Festiva with 1.6L SOHC

Post by skeeters_keeper »

Everything is still hooked up in my car like it is from the factory, and I'm getting the signal by back-probing the the connector at the ECU. So the ECU is still hooked up to the circuit. The opto sensor has 12v going into it so I'm guessing there is an internal 5v regulator.

I can "borrow" a piece of nice shielded wire from work and use the shield as my chassis ground, if that would be beneficial. Right now the black wire runs outside the car and under the hood to the - terminal of the battery, so its a pretty long run in a noisy area.

I should also mention, I still have a 1k resistor in series with the signal wire (you just can't see it in the pictures).
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '92 Festiva with 1.6L SOHC

Post by AndreyB »

I like these pictures :)

That button with the plus on it is zoom in, can you please hit it next time you try that? So that we see say 6 to 12 waves. Just to see the lack of noise.

Now a separate question how we will apply the comparator approach to the existing boards? So, do we need to adjust the boards or can we get away by figuring out a good set of resistors and capacitor value on the default analog schematic? Would the move from a breadboard to a PCB make any difference?
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
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '92 Festiva with 1.6L SOHC

Post by AndreyB »

PS: @, need your help with something. I need the log file of that noisy run - I want to look at the numbers & see if software filtering is an option.

The logs are in you 'out' folder, the file name is the time of log start. Worst case you would need to re-create that situation :)
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
skeeters_keeper
Posts: 44
Joined: Fri Nov 08, 2013 3:18 am

Re: '92 Festiva with 1.6L SOHC

Post by skeeters_keeper »

Here is a little video from last nights playing around.

User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '92 Festiva with 1.6L SOHC

Post by AndreyB »

russian wrote:how we will apply the comparator approach to the existing boards?
I know, we will use the MAX chip circuit. Problem solved?
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: '92 Festiva with 1.6L SOHC

Post by kb1gtt »

With the max chip, if you leave one wire floating, it will float to mid scale, then it will act as a comparator. So that's the typical suggestion. However the max chip is a bit pricey in low qty.

I see the circuit much better now. Can you back probe your GND at the sensor instead of the battery? Then with your signal wire and GND wires twisted, route them back to the MCU. This will likely fix the noise issues, at least for now. Of course don't wrap the wires around the ignition wires and such. Long term you will want to dedicate the crank signal(s) to the STM, but for initial testing, we can get a get you working in parallel. We can also get you say one or two channels of ignition and fuel. Then eventually we can get you to make the jump to full rusEFI.

If this doesn't fully resolve the noise issue, I have some other tricks up my sleeve, but lets try the safest things first. Also the 1k series is still OK and it's good to have.

I can probably offer some phone support come Sunday. Just FYI, if you also happen to have an opportunity to play with it on Sunday, I can be available pretty much all day.
Welcome to the friendlier side of internet crazy :)
Post Reply