Page 2 of 7

Re: 2003 VVT test mule Miata

Posted: Thu Nov 17, 2016 12:43 am
by AndreyB
Just added "vvt offset" field, looks like -385 is more or less the value we are looking for - this value would shift the VVT value into more human-readable range.

Re: 2003 VVT test mule Miata

Posted: Thu Nov 17, 2016 3:08 am
by stefanst
Great!
-380 offset on the VVT works well for my simulator. And that simulator goes more retarded than the real deal AFAIK. So IRL -370 or so may be enough.
The rpms and VVT angle are a bit jittery above 1500rpm or so, but that may very well be my simulator and not rusefi. 16MHz gets to be pretty slow when you're trying to work in microseconds. I may hook it up to my MS3 again to see if it's as jittery. I just don't remember.
All the important signals seem to work on the simulator as well. I guess this weekend would be a good time to hook it up to a car.

Re: 2003 VVT test mule Miata

Posted: Thu Nov 17, 2016 4:05 am
by AndreyB
Nice, my 2003 has the plastic shield with timing marks on it (protractor, I've got big words!), and crank pulley has not one but two crank marks! The left crank mark is TDC, the right crank mark is advanced by 10 degrees.

Re: 2003 VVT test mule Miata

Posted: Fri Nov 18, 2016 1:52 am
by stefanst
Was playing some more today and it turns out that when I 'rev' the engine, meaning increase or decrease the rpm, even slowly, the indicated VVT angle goes all wacky (Increase in rpm causes a negative VVT angle).

Re: 2003 VVT test mule Miata

Posted: Fri Nov 18, 2016 2:19 am
by AndreyB
stefanst wrote:when I 'rev' the engine, meaning increase or decrease the rpm, even slowly, the indicated VVT angle goes all wacky
VVT angle offset is defined by amount of time between vvt signal and previous trigger sync point, divided by current RPM

current RPM is calculated only once per 720 degrees, based on the duration of these 720 degrees - so RPM could be ~700 degrees late.

A precision improvement here would be to calculate RPM
a) based on a sliding 720, not 720 cycle
or b) based on few last teeth, not full 720 cycle

https://sourceforge.net/p/rusefi/tickets/322/

Re: 2003 VVT test mule Miata

Posted: Fri Nov 18, 2016 3:39 am
by AndreyB
Little progress on this - moved VVT synchronization closer to trigger synchronization point, should get angle reaction a bit faster.

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 3:17 am
by AndreyB
Certain bets were made so I've tried starting the car today. Trigger signal not reliable unfortunately - top two lines are supposed to have a cleaner pattern.

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 4:06 am
by stefanst
So no sitting on the sofa drinking wine with your wife on a Friday night?
Or Vodka as the case may be....
I'm confident mine will start tomorrow in the first try :)
Do you have the pullups on the 9926?

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 4:12 am
by AndreyB
2.2K pull-ups

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 5:01 am
by stefanst
I think I got 1K pullups, but I doubt that's your problem.
Didn;t have any issues on my '99 which AFAIK uses the same sensors....

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 9:31 am
by kb1gtt
To me that almost looks like what happens when you hit the pin next to the pin you are trying to connect to. Perhaps double check that you didn't wire it to the wrong pin.

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 3:29 pm
by stefanst
Just hooked my '03 up to rusefi and I get some, but not enough love. It appears that we started off wrong assumptions on the triggers. The basic shape we had is correct. But the phase difference between cam and crank is not as anticipated.
2016-11-19_10_24rpm_0_maf_NaN.png
2016-11-19_10_24rpm_0_maf_NaN.png (46.5 KiB) Viewed 8944 times
So neither Miata VVT mode nor standard Miata NB gets triggered.

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 5:04 pm
by AndreyB
At least crank sensor looks to be VR, not Hall as we thought.

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 5:55 pm
by stefanst
Cam sensor is apparently hall, but weirdly so.
output is 2.4V and, at least hooked up to Frankenso, the signal sometimes stays high, when it should drop back down. I guess this may be caused by the pullup resistor...

This is what the raw input looks like when hooked up to Frankenso board:
cam signal2.png
cam signal2.png (68.55 KiB) Viewed 8938 times
The signal seems to be staying high only when the engine is trying to catch. The only reason I could think of why this coincides is that rpm goes up a bit in those instances. But what difference that would make from a signal-standpoint has me baffled.

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 6:58 pm
by stefanst
So I pulled crank- to GND and hooked crank+ up to the crank VR in.
Raw crank signal looks like this now:
crank+.png
crank+.png (66.38 KiB) Viewed 8934 times
But I'm not getting any triggering at all from the 9926. Output just stays high.
Do I need to pull crank+ low and connect the positive signal to crank- ?

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 7:47 pm
by AndreyB
http://rusefi.com/wiki/index.php?title=Manual:Hardware:Frankenso:VR_input

We only have wire from the crank VR sensor, I believe the other side of the sensor is already GND on the harness.

So we need to GND one side of MAX9926 (0R pull-down on the Frankenso board) and feed VR signal into the other side of MAX9926 - is your signal wire currently connected to the pull-up? If so then you need to move the signal wire to the side of MAX9926 which was floating in case of Hall sensor.

In case of VR we want one side of MAX9926 to be zero and the other cross zero.

In case of Hall we want one side of MAX9926 to be floating (2.5v internally) and the other side to be 0 or 5v which would be crossing the floating 2.5v

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 8:17 pm
by stefanst
Connected crank- to GND and crank+ to VR.
Crank seems to work now, but I believe there's still some strange noise on there.

But cam is still totally weird.
Step1 (posted before):
CAM hooked up to cam- input with 1k pullup -> cam signal sometimes stays high when engine starts to 'catch'. Signal level is approx 2.3V - 2.4V

Step2
Disconnected the cam sensor wire from the circuit and scoped the output-> Signal was clean, but of course engine didn't try to 'catch'. Also signal level is reduced to 1.5V or so and is more noisy (sorry, forgot to take a picture of scope trace)

Step3
Removed w1003 in order to disconnect 1k pullup -> exact same as in step1. 2.4V signal level and signal stays high when engine is trying to catch.

What gets me is how the hell is the Max9926 circuit backfeeding into the sensor? That's the only way I can see this happening at all. And how does the signal level stay at 2.4V with the pullup disconnected?

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 8:42 pm
by stefanst
According to MSextra forum both crank and cam sensors on the 99+ Miata are hall.
http://www.msextra.com/forums/viewtopic.php?f=101&t=28944#p192331
Since we were at least somewhat successful using the crank+ as input and grounding crank-, I'll try the same with the cam input and see what happens.

Re: 2003 VVT test mule Miata

Posted: Sat Nov 19, 2016 9:26 pm
by stefanst
No luck. Signal still stays high both cam and crank.
Will study some more.

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 12:15 am
by stefanst
The signals are definitely hall sensors. And they are low-ish voltage (500mV level or so) and high-noise.
Below is the signal from the crank sensor. As soon as the engine starts catching we get the signal staying high. It looks a little bit like the signal is going inverted.
crank+ catching.png
crank+ catching.png (68.17 KiB) Viewed 8923 times
Does somebody have an extra sensor (cam or crank) that we could put in a testrig to figure this stupid thing out?

Here's a bit of cam signal
cam+ catching inverted.png
cam+ catching inverted.png (68.86 KiB) Viewed 8923 times

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 12:18 am
by AndreyB
i should have a spare cam from my uk order and tomorrow will grab another one from white parts car

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 1:28 am
by AndreyB
its weird that signal shape is so close to 99 but sensors somehow work differently

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 2:41 am
by stefanst
@kb1gtt is coming to the rescue and asked me to measure some things. So I plopped the stock ECU back in and measured a little. The cam sensor is much more easily accessed, so I used that for taking measurements.
Results:
With the stock ECU the output switches from ~0.3V to 5.0V. When it's at 0.3V, it sinks about 1.4mA of current.
I also measured the resistance between +5V and the crank in on my stock '99 ECU (same crank sensor AFAIK) and got 3.2kOhm.
So the math seems to work- 4.7V/3.2kOhm comes out to 1.5mA.
Looks like a 3k pullup should do the trick. But it's too late in the evening to successfully solder smd. So tomorrow. Or maybe Monday.....

Weird thing is that @russian is using a 2.2kOhm resistor as pullup on his board and I would have expected that to work well, even causing a bit higher current. But he's experiencing the same problem.

EDIT: since we're sinking just 1.4mA, it would probably be a good idea to use shielded cable for the harness extension. It's not that surprising anymore that we''re getting a lot of noise.

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 2:53 am
by kb1gtt
I don't know the saturation current of this particular hall sensor. Typically it's between 5mA and 20mA. I suspect the funky pulses seen above was a current limiting feature of the hall kicking in. I would suggest 3.2k or more. Below it could cause more problems. If you use a larger resistor your 0.3V will probably raise a bit. However the MAX chip triggers very close to 2.5V, so you have allot of room before you would get false triggers to the STM32 chip. So you should be OK with a lager resistor.

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 2:56 am
by stefanst
I should have some 3.3k here somewhere. Will try those.
Current limiting may indeed be what caused the trouble. We'll know more soon....

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 4:18 am
by stefanst
I decided to give it one more shot and install some 5K pullups. Crank signal looks perfect now. Still have the same trouble with the cam signal. Once the engine starts catching, the signal stays on high for some events. Current limiting sounds like the best explanation. But come on- 1mA? How can 1mA be too much?
5V 5K pullup cam problem.png
5V 5K pullup cam problem.png (53.55 KiB) Viewed 8914 times
cam 5V 5K pullup.png
cam 5V 5K pullup.png (115.88 KiB) Viewed 8914 times

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 10:02 am
by kb1gtt
Could this be mechanical chatter? Is the VVT electronically controlled? If how is it controlled, PWM, bang bang, other?

How does the cam get adjusted physically? I see pictures on the interwebs that seem to show the cam angle is physically changed. Or is there a cam adjustment thing like what they have in VTEC Honda engines?

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 12:43 pm
by AndreyB
VVT is via a solenoid forcing oil at the cam gear - but VVT does not have the range to produce a signal like that, the signal shows a cam stopped for quite some time totally unrealistic.

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 1:08 pm
by stefanst
In addition, we're not controlling VVT yet, so it's just set fully retarded by the spring. And I doubt we have enough oil pressure during cranking to really do anything.

Re: 2003 VVT test mule Miata

Posted: Sun Nov 20, 2016 1:10 pm
by AndreyB
Still, how comes same everything worked on your 99? eBay says same cam sensor 99-05. Do you want to move cam from 99 to 03 or is it too much effort?