[rusEfi] '03 Miata with VVT #28

Your chance to introduce yourself and your vehicle
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

I'll play with that tomorrow- thanks!
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '03 Miata with VVT #28

Post by kb1gtt »

Wow that's almost a 1V spike on the supply. Also happening once about every 0.08 seconds seems odd to me. Does that sync with injectors or spark? I might guess it's spark, which typically draws much more than the injectors. If it's synced with the spark, it might not be an issue for the injector dead time calc's. Is your spark sharing the conductor with the ECU? If so can you add a temporary wire to the spark that goes direct to the battery? This voltage drop might be a small resistance with something like the power relay or a small connector resistance.

How did you measure the GND. Did you connect one side of the scope to the battery negative, then the other to the GND wire inside the Frankenso?
Welcome to the friendlier side of internet crazy :)
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

I'm running sequential injection, so we're squirting once per ignition event. Meaning it could be ignition or injection- same frequency. I'll run both channels tonight- one on the supply and the other scoping the outputs (ignition or injection). That should help figuring out, what it is. Not that it really matters.
The injectors have a separate relay and fuse. ECU and ignition are powered by the same relay. So there's your more likely culprit. It's a 14 year old car. Maybe the capacitors in the electronic coils are not the best any more....
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '03 Miata with VVT #28

Post by kb1gtt »

Perhaps replacing the relay will help. Those relay contacts get corroded over time, which can cause voltage drops. I'm expecting the coil is surging in excess of 10A, everything else is probably less than 1A. Also it might not matter that much. I forget if the Vbat voltage is captured at a certain crank angle or not. So I guess @russian, does it capture the voltage at a specific crank angle? If not how hard would it be to make it capture at an angle?
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

kb1gtt wrote:So I guess @russian, does it capture the voltage at a specific crank angle? If not how hard would it be to make it capture at an angle?
It captures with low frequency right now. It could be pretty easy to start capturing within high-frequency ADC and at specific angle window at least temporarily.
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

I guess if we capture at 0º or a few degrees past, we should be pretty safe, possibly with the exception of a flat-crank V8 with 35º or more advance
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '03 Miata with VVT #28

Post by kb1gtt »

I would think you want something like this. Spark angle of cyl 1 - angle caused by dwell - 1 degree = sample angle point. For example, lets say 5mS dwell, and cyl spark at 10 degrees. I would think you would want your Vbat to be sampled at ?? angle.
-- At say 1kRPM which is 6deg/mS so 5mS is 30 degrees from dwell.
-- At say 6kRPM, which is 36deg / mS, so 5mS is 180 degrees caused from dwell. Hmmm, that doesn't work well, as you will overlap with other spark events. So never mind, this theory is a load of bunk.

Perhaps this could be best dealt with by using a table. Basically rev it through several RPM's and decide what crank angle is the most accurate voltage as seen in the tuning logs. Once this table has been entered, the normal operation would simply capture the voltage at the angle defined by that table.

Is the data logging fast enough to capture the voltage and log the voltage once every degree? Could it do it once every 10 degrees?
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

Your tune says tach is wired to PE8, does it work as just 5v signal?
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: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

stefanst wrote:No idea- Autozone "T" collection.
Dorman 47380 Vacuum Connector Value Pack, 65 Piece
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

$8 seems about right.
Tach isn't working, but I may not have wired it. AFAIK it's a simple 5V signal, but may be wrong.

I'm back to my usual confused state of mind. I had the engine running, trying to figure things out. Stopped it for a minute and it wouldn't fire again.
The 'no spark during cranking' gremlin is back:
2016-12-04_21_39_36rpm_0_No_Spark.png
2016-12-04_21_39_36rpm_0_No_Spark.png (56.13 KiB) Viewed 15769 times
I get tons of 6149 errors during cranking though. Looks like almost every event- more than 300 during a few seconds of cranking.

Displayed rpm is around 200. cranking rpm is set to 350, so I should be in cranking mode.

Also the recorded PW is around 4ms, while it should be around 12 as per my tune.

Any ideas where I'm screwing up?
Attachments
2016-12-04_21.27.58.msl
(768.8 KiB) Downloaded 676 times

[The extension msq has been deactivated and can no longer be displayed.]

stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

I may have found the fix:
Car runs and starts with crank trigger angle set to 670.
Car runs with crank trigger angle set to 666, but won't start.

Tach is hooked up, but no reaction from the dash. Need to check what it wants...
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

And one more thing: Why can I find closed loop fuel for warm-up, but not for regular running engine?

I'll be glad to reveal how I would like to see CL fuel implemented :)
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

stefanst wrote:I'll be glad to reveal how I would like to see CL fuel implemented :)
http://rusefi.com/forum/viewtopic.php?f=5&t=981 and I are waiting for your input!

Assuming #299 is resolved, some CL somewhere is the next firmware task.
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

russian wrote:
stefanst wrote:I'll be glad to reveal how I would like to see CL fuel implemented :)
http://rusefi.com/forum/viewtopic.php?f=5&t=981 and I are waiting for your input!

Assuming #299 is resolved, some CL somewhere is the next firmware task.
I differentiate between CL fuel and Autotune.
CL fuel is on the fly. ECU reads AFR off the WB and adjusts fuel using some sort of PID on top of the VE table.
If you run a stock ECU on anything with a lambda control while reading AFRs off a wideband you see the effects of CL fuel control- the AFR oscillating around stoich.

Autotune means ECU keeps AFRs (desired and achieved) in memory and makes a suggestion for change of VE table.

Both great features, but CL should be easier and is probably more important, since autotune is already possible through Tunerstudio.
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

And still there is a lot in common between the both. Anyway, I agree that starting with CL is right and looking forward your suggestions! New topic or the autotune thread or even here if you insist :)
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

I'll see what I can do about Autotune and CL fuel descriptions. On the forum and the Wiki :)
To stay on VVT topic:
It appears that I should be able to use the FSIO to attempt and control the VVT in open-loop mode- correct? Just enter the output pin and set the table with the same number and I'm good? Somehow I think there's some more background magic involved...
FSIO_VVT.png
FSIO_VVT.png (52.94 KiB) Viewed 15759 times
FSIO_Table.png
FSIO_Table.png (37.85 KiB) Viewed 15759 times
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

Do you want OL or CL? I believe my intention was PID-based CL for VVT, it might require two lines of firmware to be changed since the testing was done with VBatt not VVT.
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

The goal is definitely CL. I just thought I might try OL first, just to see if it does anything.

And it may be trickier than the vbatt implementation, because now we need at least one EL/RPM table for the target degrees and possibly another table for seed values. Not sure what happens under cold-start with highly viscous oil either. I'm not sure if all this can be tuned out with simple PID implementation.
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

stefanst wrote:And it may be trickier than the vbatt implementation, because now we need at least one EL/RPM table
aux pid has a map already
[video][/video]
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

Awesome!

I may be able to give it a shot before I leave. But, considering my inability to understand source code and use the search feature on forums, I may need somebody to walk me through what to do.....
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

russian wrote:Your tune says tach is wired to PE8, does it work as just 5v signal?
I had my '99 stock ECU sitting on my desk, so I hooked it up and tried it. The tach signal is a 50/50 square wave between 0V and 6V. Interestingly it fires every 180deg crank angle.

I don't think we need the 50/50 or the 6V. 5V should be fine and we can probably get away with 1ms or so. I'm pretty sure I tested my dash tachometer with a 2ms 5V squarewave a few years back.
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

Reminding about road tuning this Sunday :)
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

So, @ and I did some tuning today. Car runs great, but the VE table needs some more finessing. There are a few things we observed:
  • Coils and Alternator control seem to work even without being hi-side driven. I forgot to install the pullups for the hi-side drivers and coils and alternator worked just fine (see http://rusefi.com/forum/viewtopic.php?f=4&t=450#p24857)
  • Tach signal on NB Miatas does need a true hi-side drive. It didn't work before, now, with the pullup to 5V installed, it works
  • I need to figure out how that knock-detection thingy works, Even though everybody keeps telling me that Miata heads, especially NB with mechanical (non hydraulic) lifters are too noisy to do proper electronic detection of high-rpm knock, maybe we can at least sort the low rpm stuff out.
  • I was listening to the knock sensor signal from the stock sensor, using a piezo amplifier and a headset. All I got was whine from the various PWMs, with just barely audible sounds from the engine. Does anybody know, if the stock Miata sensor is already frequency tuned to knock, so it gets louder when knock actually occurs? I was listening in on other engines, using the same amplifier, but a cheap VAG knock sensor and heard everything going on in the engine.
  • Autotune under rusefi could use a little help. When it was super-rich, or super lean, it was doing some weird stuff I didn't quite understand. We should probably set limits in AFR reading for allowing AT to be active. Maybe ignore anything under 10 and above 18 or so.
  • Fly-back diodes are important for VVT and Idle valve.
  • VVT seems to work right out of the gate. Quite interesting. Just set up your target table and away you go
  • Even though I added a lot of timing, the engine really drops off badly above 5,000rpm or so. It NEEDS the flat-top intake
Questions:
  • Why don't we need flyback diodes on injectors?
  • What settings to use for knock-detection?
  • A ton of stuff I'm forgetting right now....
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: '03 Miata with VVT #28

Post by kb1gtt »

The injector drivers on Frankenso are Over Voltage Protected (OVP) MOSFET's. This prevents the need for fly-back diodes on injectors. Fly-back diodes are slow and less accurate than the OVP circuit, but the OVP will dissipate a bunch of energy in the ECU while fly-back diodes dissipate most of that energy in the injector. You can still use the fly back diode by adding the diode to the Frankenso board, but you don't need it for injectors. However you probably want fly-back diodes for things like alternator control or IAC solenoids. Those are much higher frequency and would dissipate many more watts in the ECU. As well for those devices you want the sluggish reaction times of a fly-back topology.
Welcome to the friendlier side of internet crazy :)
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

In other news:
I just drove the '03 to work. It fired up well enough while still pretty cold (10ºC).
Observation:
The VVT goes bats&^t crazy when the oil is cold. VVT angles are all over the place, just oscillating wildly. This will require some more tuning. Fortunately, just when I was about to hit the interstate it smoothed out. Also: Alternator control seems to be in need of more tuning. I did get some quite significant oscillation of Vbatt, especially when the VVT was going crazy. This got a lot better once the VVT smoothed out, but it's still not quite as good as you'd hope for.
Vbatt and VVT oscillations..png
Vbatt and VVT oscillations..png (34.06 KiB) Viewed 15263 times
Running Super-Rich:
The VE table was reasonably well tuned yesterday. Nothing to write home about, but good enough for driving around and not be an embarrassment. On the drive to work this morning it was running incredibly rich. Lambda was around 10 or below where it should have been 14.7 or so. I first suspected warmup enrichment, but even when the engine was all the way warmed up with CLT correction at 1.0, it was still crazy rich. It can't be Manifold Air Temperature correction either. I don't have correction programmed yet (1.0 across the board) and with colder air this morning than yesterday afternoon/evening, it should have been lean this morning, not rich. The higher the MAP, the better it was. At full throttle, AFRs were close to expected. This behavior would indicate that something was wrong with the injector dead-time calculation, since dead-time is more important at small pulsewidths, small laods than at larger ones.
With the car running super-rich, I decided to stop for gas. After the stop at the gas station I fired up the engine and everything was perfect for the last half-mile to the office. AFRs as expected. So this opened up these options:
  • Some value gets set in the firmware when you fire up the board. This value was different between starting the car cold and starting the car warm.
  • The fuel in the tank was cold and dense from sitting over night. The fuel added from the underground tank at the gas station was warmer and less dense. This seems a bit far-fetched, since we're talking a huge difference which I doubt would be caused by a small change in fuel density.
  • The cold fuel from the tank cooled the already cold from sitting overnight injectors even more. The colder coil has a shorter dead-time than a warmer coil and therefore we're injecting too much fuel when things are getting chilly. (I observed a similar behavior, but not as extreme, with my '99 Miata. But it's not as pronounced as this and I always attributed the temperature sensitivity of my setup to the fact that with 650cc injectors we need very small pulsewidths at small loads. And here we have a big impact if the deadtime is off even by 1/10 of a millisecond.) Having the car sitting at the gas station with the engine off heat-soaked the injectors a bit, their deadtime went up and AFRs at small loads were better.
None of these make me real happy. They all seem a bit far-fetched.
kb1gtt wrote:[...]However you probably want fly-back diodes for things like alternator control or IAC solenoids. Those are much higher frequency and would dissipate many more watts in the ECU. As well for those devices you want the sluggish reaction times of a fly-back topology.
Thanks- I was just wondering why we need flybacks for the solenoids, even though they're using the same drivers as the injectors, which are essentially just solenoids as well. it is quite a difference in frequency between injectors and solenoids, so dissipation of stored energy probably makes more of a difference with the solenoids.
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

stefanst wrote:The VVT goes bats&^t crazy when the oil is cold. VVT angles are all over the place, just oscillating wildly.
That's good to know! At the moment we are running pretty much first random set of parameters, hopefully there is a chance to improve even cold engine VVT with better PID settings. Looking forward your ideas :)
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

russian wrote:That's good to know! At the moment we are running pretty much first random set of parameters, hopefully there is a chance to improve even cold engine VVT with better PID settings. Looking forward your ideas :)
I'd start with a little less "P" and see what happens. Will try over lunch.
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

Reducing "P" from 2.0 to 1.5 didn't seem to have much of an effect on a warm engine with warm-ish oil. What I did notice though is that I still had oscillation, caused by a sudden jump in commanded value.
It appears that:
debugi3 is the target value in degrees x 10 (so 180 would mean we're looking for 18 degrees)
debugf1 is the actual PWM percentage on the Aux_PID which we're using
Here's the oscillation on a warm-ish engine:
VVT_Oscillations warm.png
VVT_Oscillations warm.png (22.35 KiB) Viewed 15252 times
With the oil cold this morning, it appears that the stable pwm value was around 29-30. on a warm engine the stable pwm value was around 35. So I will change my offset value to 32.
I would like to request a feature limiting the min/max PWM values. I believe the oscillation would be easier to deal with if the signal wouldn't be going out of bounds. The next test for me is to reduce the p-factor even more and see what that will do for us.
User avatar
AndreyB
Site Admin
Posts: 14328
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: '03 Miata with VVT #28

Post by AndreyB »

stefanst wrote:I would like to request a feature limiting the min/max PWM values.
https://github.com/rusefi/rusefi/issues/393
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: '03 Miata with VVT #28

Post by stefanst »

Two more things:
Yesterday and today I managed to reproduce the issue with the "wiped" firmware. In both cases it happened when shutting down the engine, while connected to the laptop after an auto-tune session. The second time I made sure to first stop autotune and apply the settings to the ECU before shutting down the engine.

According to my oscillation logs, VVT going from fully retarded to fully advanced takes approx 200ms or so. Currently the "control period" in my Aux_PID setup is set to "0". I guess that means it runs as often as makes sense. Maybe once per CAM rotation? Would there be any benefit to changing that value?
Post Reply