[help needed] UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5 #38

What engine are you torturing? Is it inside some car?
User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5 #38

Post by RadMx5 » Sun Oct 15, 2017 10:16 pm

>UPDATED - 12/17/2017<
Hi everyone, I just got back from the garage, I need some help with setting up the software bit.

I have started here: viewtopic.php?f=2&t=1275 and now Im at this point where I need some help with setting up the Tuner studio.

Hardware: Frankenso r0.5

Analog Inputs used:
I get readings from these sensors:
- CLT (shows correct temp)
- TPS (seems to work but when I fully press the pedal I got 85.45% reading, is it ok?) - if this happens, you have to calibrate the TPS in Tuner Studio
- IAT (temp looks real)
- MAF (the MAX output voltage is 12V, I think I need to use a voltage divider for now) MAF not used at all
- MAP (will be used instead of the MAF later on)a GM 3 Bar MAP Sensor is used with the Speed Density fuel algorithm.
- AFR/O2 (wired but untested yet) - Finally I got the Innovate wideband controller and a Bosh wideband sensor. All seems to work good with rusEFI! :)
- CAM (I use the U2003 Op-Amp INP11 to read the signal and it looks like it works. The OUT11(schematic page 3) is physically connected to JP05 which goes to PC6) - must be inverted in TS when using op amps
- CRANK (I use the same Op-Amp INP9 to read the signal but sometimes the signal gets lost, I dont know why...The OUT9 (schematic page 3) is physically connected to JP04 which goes to PA5) - the same here ("invert secondary" feature in Tuner Studio)

Little question for CAM and CRANK signals: these sensors are 12V powered. Therefore the sesors output stays HIGH (12V) and once it is triggered by the wheel it goes down to ground am I right? Should the output signal be lowered to 5V somehow before it gets to the OP-AMP?

Digital Outpus:
- Injectors (all tested and work, I use default see the attached photo for configured pins)
- Spark (works fine, I use U601 for both coil-packs, see photo for configured pins)
- Fuel pump (works)
- Idle Solenoid (I think it works) - now it works, 12V power to the valve was not soldered...
- Tachometer output (I tried to use the Tachometer output and Dizzy out, with U602 High-Low side driver powered form 5V physically connected to pin 2K of the plug but the gauge didn't move when I was cranking :? ) - Works fine I use one of the 12V high side driver and dizzy out. The tachometer does not really move while cranking anyway
- MIL (not tested yet)

The board gets power when I turn the key, once I start cranking, the discovery board resets itself (is this normal ??), this causes in losing serial communication with PC while cranking. I think its due to a big volt drop when the starter gets power. Will a bigger car battery or a bigger capacitor C1001 help? - This is solved and its more to do with me than the board :roll:
It was the PSU circuit, I put the wrong component Q1002 on the board. I was waiting 6 weeks to get the right compoonent and I almost forgot about it :D It arrived yesterday and now it is already on the frankenso board. I tested the board at home on the bench and now the board switches off when the supply voltage goes down to around 5.1V which is good as the battery voltdrop will never be that low when cranking. Before with the wrong Q1002 the board was reseting itself at 7.6V - 8V. So the wrong component was: IRFR210PBF and the right one is: DN2625K4-G The difference between them is that the first one it's enhanced mode, while we need a depletion mode in the PSU.

To get the readings from the rusefi_console I had to unplug the board from the PC, start cranking then quickly plug the USB cable to the PC and wait util it connects to the rusefi_console while cranking. I have removed sparkplugs for this test...

When I tried cranking, MAF was disconnected. While cranking I got some big backfires from the exhaust... something is not right... :roll: Solution: I use the alternative Op-Amp option for Cam and Crank sensors --> Therefore the CAM (primary) and CAM (secondary) must be inverted in TUNER STUDIO, also my trigger offset angle was completely wrong. A timing light gun comes with help here!

Please see the attached screenshots from the rusefi_console, Tuner studio, and some other stuff...

P.S The screenshot from Tuner Studio shows Sequential Injection mode, but It was set to simultaneous when I was doing the cranking test. Only the last screenshot from rusefi_console shows a sequential injection mode.
Attachments
MS Pin Configuration.bmp
MS Pin Configuration.bmp (3.71 MiB) Viewed 4405 times
MS Engine_Trigger_Cranking settings.bmp
MS Engine_Trigger_Cranking settings.bmp (3.71 MiB) Viewed 4405 times
Loosing CRANK trigger_ Ignition Advance 20 deg.png
Loosing CRANK trigger_ Ignition Advance 20 deg.png (48.89 KiB) Viewed 4405 times
Loosing CRANK trigger Ignition Advance 0 deg.png
Loosing CRANK trigger Ignition Advance 0 deg.png (46.68 KiB) Viewed 4405 times
CRANK trigger OK this time_ Ignition Advance 270 deg.png
CRANK trigger OK this time_ Ignition Advance 270 deg.png (48.13 KiB) Viewed 4405 times
CRANK trigger OK this time_ Ignition Advance 20 deg.png
CRANK trigger OK this time_ Ignition Advance 20 deg.png (46.64 KiB) Viewed 4405 times
CRANK trigger OK this time_ Ignition Advance 0 deg.png
CRANK trigger OK this time_ Ignition Advance 0 deg.png (53.78 KiB) Viewed 4405 times
Last edited by RadMx5 on Sun Dec 17, 2017 10:27 am, edited 15 times in total.

User avatar
russian
Site Admin
Posts: 9774
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by russian » Sun Oct 15, 2017 10:28 pm

cam/crank +12 power source is only that - 12v power source. I believe sensor does not output vottage anyway, it outputs "gnd" or "floating" which the circuitry converts into the readable signal with pull ups/pull downs.

Your cam/crank via op-amps is not the default setup. I wonder if the signal gets inverted and that gets the software confused. Before we attempt to start the car, can you please crankit it with "disable injection" and "disable injection" and see how reliable the tachometer signal would be?

Next step is to open logs from https://svn.code.sf.net/p/rusefi/code/m ... hunchback/ (it's an NB engine at this point so NB signals) and see if the crank/cam looks inverted or not. You can open logs with console in "log viewer" mode
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by kb1gtt » Sun Oct 15, 2017 10:59 pm

I believe the discovery will not reset unless your Frankenso 12V voltage gets down to about 4V perhaps 5V. Your injectors and ignition will not work properly below around 8V. If your battery voltage is in fact dropping below 8V, you likely have a problem. Perhaps the battery is soft, or perhaps the starter cables are causing a voltage drop. If that were the case, I would expect you to complain about the cranking being soft. So I suspect it's a different issue. I suspect the GND is lifting. Can you run a wire direct from the battery negative to the Frankenso board? A direct connection to the battery will indicate if that's the problem.

Also is you PC grounded to the mains voltage? Can you remove that ground? Basically the car is mostly isolated from GND, and can store a pile of electrons in the car. Then your GND wire on the PC is also connected to a large pile of electrons in the ground. If these two piles of electrons are connected then you can get GND currents which can cause all sorts of problems. If you PC does have a GND prong, can you temporarily disable it to see if that helps with the resetting communications?
Welcome to the friendlier side of internet crazy :)

User avatar
russian
Site Admin
Posts: 9774
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by russian » Mon Oct 16, 2017 4:51 pm

So here you are:
launch simulator.exe
set engine_type 9

as seen in https://github.com/rusefi/rusefi/blob/m ... ata_nb.cpp

And you see that the firmware expects the signals to be inverted comparing with what you see. I believe this is the different between using MAX9926 cirtuitry vs op-amp cirtuitry - the signal is inverted.

I would need to implement a new feature to invert the signal in the firmware so that your signal via the op-amp would look as the firmware expects it.
Attachments
simulator_engine_type_9.png
simulator_engine_type_9.png (26.32 KiB) Viewed 4384 times
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Mon Oct 16, 2017 5:54 pm

Thanks russian for showing this, it is making more sense now!
I was wondering about the hardware but it looks like everything is fine with the hardware that receives the signals from the CAM and CRANK.

Tonight I'm going to do some scoping, to solve the discovery reset problem.
I'll also scope the tachometer signal on the stock ECU, just to see how it behaves.

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Mon Oct 16, 2017 10:36 pm

I have scoped the "2K" pin on the stock ECU and I got some nice results. The read frequency on idle RPM was around 26Hz and 14V so now I know what to expect from the frankenso.

Also I measured the volt drop on the battery while cranking and the voltage goes down to 6V when cranking... I think I'll have to replace the battery ;) and then will do some testing again. The battery must be as old as this car... :shock:

The photos should say everything :)
Attachments
Tachometer (2K pin) IDLE STOCK FREQ.BMP
Tachometer (2K pin) IDLE STOCK FREQ.BMP (329.12 KiB) Viewed 4379 times
CRANKING VOLT DROP_2.BMP
CRANKING VOLT DROP_2.BMP (329.12 KiB) Viewed 4379 times
CRANKING VOLT DROP_1.BMP
CRANKING VOLT DROP_1.BMP (329.12 KiB) Viewed 4379 times
mod_signals.JPG
mod_signals.JPG (48 KiB) Viewed 4379 times
First test scoping tachometer form diagnostic socket.JPG
First test scoping tachometer form diagnostic socket.JPG (1.26 MiB) Viewed 4379 times
diagnostic socket.JPG
diagnostic socket.JPG (1.66 MiB) Viewed 4379 times
BATTERY 45Ah 300A.JPG
BATTERY 45Ah 300A.JPG (2.35 MiB) Viewed 4379 times

NBytevenom
Posts: 102
Joined: Mon Jul 24, 2017 8:23 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by NBytevenom » Mon Oct 16, 2017 10:54 pm

You got your tach to work? I'm a bit lost on what you did to figure out on what you did to get it to work.
I'm using an assembled Frankenso. What settings are you running to drive the Tach?

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by kb1gtt » Tue Oct 17, 2017 12:25 am

As noted in the below wiki page, I planned for the Frankenso to handle for 4V for 40mS. Does your supply dip this low for this long? Also check your battery cables for corrosion. It is common this is your source of voltage drop. You multi-meter will show 0R. However when you run 150A to 200A through it it can drop allot of voltage. Can you capture this voltage drop at a faster time base?
https://rusefi.com/wiki/index.php?title ... nvironment
Welcome to the friendlier side of internet crazy :)

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Tue Oct 17, 2017 7:22 am

You got your tach to work? I'm a bit lost on what you did to figure out on what you did to get it to work.
I'm using an assembled Frankenso. What settings are you running to drive the Tach?
No it does not work yet though, what I did first is, I only scooped the tacho output signal from the stock ECU on the diagnostic socket under the bonnet, then I scooped the signal on the stock ECU inside the car on the "2K - Tach pin" marked red on the attached photo both measurements were made on running engine on idle RPM. I got the same readings from both.

This test proved the voltage level of the tachometer signal that is around 14V and also proved that I'm actually looking at the right pin.

To output the pulse from Frankenso on the hardware side I'm going to use one of the 8 channel High/Low Side driver set up for 12V not 5V and from software side in tuner studio the "Tachometer output pin" or "Dizzy out Pin" one of them I'm not sure which one I should really use.

I remember when I tested the ECU on the bench I was having some problems with the "Tachometer output pin" it was not creating any pulses but the "Dizzy out Pin" worked ok.

I'll play around with this once I get the correct CAM/CRANK triggers.
Can you capture this voltage drop at a faster time base?
Will do tonight.
Attachments
Wiring frankenso 20160227.png
Wiring frankenso 20160227.png (68.78 KiB) Viewed 4365 times

NBytevenom
Posts: 102
Joined: Mon Jul 24, 2017 8:23 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by NBytevenom » Tue Oct 17, 2017 6:28 pm

I remember when I tested the ECU on the bench I was having some problems with the "Tachometer output pin" it was not creating any pulses but the "Dizzy out Pin" worked ok.

I'll play around with this once I get the correct CAM/CRANK triggers.

So my tach dances around with the tachout pin. Between a certain set of values the tach will spike up to around 200 rpm, and then once I'm revving at like 5-6k, I get a fairly consistent readout at the tach at 800 rpmish.

With dizzy, my tach is all over the place. It jumps up to the RPM value, but then goes back down and hovers at a lower value/0.

Hopefully this can help you out a little bit.
To me it seems like the square wave output on my tachout isn't high enough Voltage wise for my tach, hence why it barely moves.

User avatar
russian
Site Admin
Posts: 9774
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by russian » Wed Oct 18, 2017 1:50 am

I think I have the code to invert trigger signals. Please create new Tuner Studio project and you will see new controls on the triger setup screen. You want to try with both signals inverted, we are hoping to make your picture match my picture.

See also https://github.com/rusefi/rusefi/issues/480
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Wed Oct 18, 2017 11:11 pm

Ok, so I've done some tests tonight

First of all: my idle valve does not work. I forgot to solder the 12V "IDLE_VALVE_12V" pin 3O on the frankenso board... Need to sort this one tomorrow.

The triggers:
I have downloaded the new rusefi_bundle.zip from: https://rusefi.com//build_server/
Created new Tuner Studio project then I configured everything the same as in my previous project and it looks like the invert primary(CAM) works, but I'm having some issues with the secondary one.
I did these cranking tests with ignition on and spark on and removed spark plugs just to relieve the starter a bit.

TEST 1: I tired inverting both signals see below results:
TEST_1.bmp
TEST_1.bmp (3.71 MiB) Viewed 4330 times
TEST__1.png
TEST__1.png (50.92 KiB) Viewed 4330 times
TEST 2: Then only primary inverted - PC6 (CAM)
TEST_2.bmp
TEST_2.bmp (3.71 MiB) Viewed 4330 times
TEST__2.png
TEST__2.png (51.2 KiB) Viewed 4330 times
TEST 3: And only secondary inverted - PA5 (CRANK)
TEST_3.bmp
TEST_3.bmp (3.71 MiB) Viewed 4330 times
TEST__3.png
TEST__3.png (50.61 KiB) Viewed 4330 times
Looks like inverting the primary signal works well, just something not right with the secondary. I tried all possible combinations of inverting these signals and I got it right one time but I really can remember what I did... :(
Maybe the Tuner Studio doesn't talk correctly to the discovery board while sending these changes? I don't know....
...the feeling when the engine almost started. But then I tried again and the triggers were messed up... :x (The cam signal was always good as inverted, just the crank is a mess)
GOOD_TRIGGER.png
GOOD_TRIGGER.png (46.05 KiB) Viewed 4330 times
If its not the firmware and not the software then it must be a hardware bug I'm afraid... maybe the filter circuit on the CRANK sensor Op-Amp ?

Battery:
Also I captured the volt drop on stock ECU when cranking directly on the battery with spark plugs in. I was really in rush, as it was getting late... You can see it takes about 50ms before the voltage increases to around 10V
Battery_Voltdrop.BMP
Battery_Voltdrop.BMP (329.12 KiB) Viewed 4330 times

User avatar
russian
Site Admin
Posts: 9774
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by russian » Thu Oct 19, 2017 2:27 am

You've noticed how I had to add the "inverted" feature for you? That's because so far all the Miata boards were really using the MAX9926 circuity for hall input. So on the one hand op-amps should kind of work, but on the other hand I personally know nothing about electricity :(

My concurn is how we get mixed inverted and not inverted - to me that sounds like some noise which drives the firmware crazy and it's either skipping fronts or fail to handle them for some reason.
Attachments
screenshot.png
screenshot.png (60.15 KiB) Viewed 4328 times
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Thu Oct 19, 2017 7:55 am

You've noticed how I had to add the "inverted" feature for you? That's because so far all the Miata boards were really using the MAX9926 circuity for hall input. So on the one hand op-amps should kind of work, but on the other hand I personally know nothing about electricity :(
Yes, and thanks for this! :)
When I first time saw the schematic with the Op-Amp solution for CAM/CRANK I thought it should work... in theory.
I won't sleep until I find what is going on with that noise signal :roll:

I hope I can spend more time on it this weekend, will get new battery, sort out the big volt drop problem, then I will focus on the triggers and then I will get the MAP and wideband O2.

...If the Op-Amp solution won't work at all, then I'll use the MAX9926.

Little quetion: once I get the correct triggers, MAP sensor, wideband and the idle valve working properly, should the engine start and keep the idle RPM? Or I will have to adjust something else in TS?

Thanks for your help guys!

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by kb1gtt » Thu Oct 19, 2017 10:24 am

Pulling low to 8V during cranking shouldn't be a problem for STM resetting. From memory I seem to recall that 5V starts to drop around 6V to 7V, and the STM shouldn't run a risk of resetting until the 5V drops to around 3.5V or less. That would happen when the battery voltage has dropped to around 5V to 6V. Your 8V might be a bit low for injectors and coil charging. However you aren't firing injectors or charging coils until you are back up to 10V or above. So I suspect this drop during cranking is not much of an issue.

I'm a bit confused about what is happening in the real world with this inverted signal thing. I see pulses which are stretch in the 1 position in software. Does a 1 = hall floating or shorting to GND? I believe the inverted thing means a 1 = 0V. If this is the case, then it's likely that your hall isn't pulling low enough to trigger the digital input to a guaranteed value. I seem to recall the guaranteed low end in the STM's input was like 0.5V or less, when referenced to the STM's GND.

Do I recall correctly that you are the white, did it yourself board? Did you use the MCP6004 on your board? This op-amp is critical. Not all rail to rail op-amps are the same. This one goes closer to the rail on the low end than several others did when we tested them out. Other op-amps won't get as close to the rails. Also check what your op-amp is driving to. It's possible that the op-amp doesn't drive low enough.
Welcome to the friendlier side of internet crazy :)

User avatar
russian
Site Admin
Posts: 9774
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by russian » Thu Oct 19, 2017 11:39 am

RadMx5 wrote:Little quetion: once I get the correct triggers, MAP sensor, wideband and the idle valve working properly, should the engine start and keep the idle RPM? Or I will have to adjust something else in TS?
If you settings are close or equal to set engine_type 9 the engine should just run?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Sat Oct 28, 2017 7:44 pm

Another miata running on rusEFI!!!! :D

I'm still in the garage, I'll upload some videos and give you more details later. The tach also works which is nice!


User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Sun Oct 29, 2017 11:30 am

To make any further progress I had to get a map sensor and a timing light gun. Previously I had the trigger angle offset set to 276 degrees (I went through this topic many times: https://rusefi.com//forum/viewtopic.php?f=3&t=987)
and I though it is gonna work. (should it?)

I'm using this map: Image

After checking the ignition timing with timing gun and fixed timing at 0 deg it appeared that the ignition is firing way too early. Finally I found the offset angle which is 359 deg and the TDC mark in rusEFI console appears to be correct.
2017-10-28_18_44_12rpm_0_359 offset injection OFF.png
2017-10-28_18_44_12rpm_0_359 offset injection OFF.png (44.29 KiB) Viewed 4250 times
Then I turned on the injection and cranked again, that was the moment it started first time :)

I would really appreciate If anyone can explain me the trigger offset angle what it is? I don't really understand it. I think I know how to use it but I don't get how it works... Is it the offset angle after the STM controller synchronizes the first pattern of the cam and crank signals to find TDC? Why my offset is different than the one from here: https://rusefi.com//forum/viewtopic.php?f=3&t=987

The good thing is that the car is running and it confirms that many little problems no longer exist... Such as used op-amp circuit to read CAM/CRANK signals. I'm getting almost perfect trigger signals. The "invert primary/secondary" option in Tuner Studio seems to work fine. Thanks to russian for adding this in the Tuner Studio!

Tachometer also works which is nice. I use one of the high side drivers and dizzy out pin to control it. Also the driver is set to 12V.

Today when I was watching the videos I've realized I made silly mistake with the map sensor. I have installed it between the air filter and the throttle body... dont ask me why... so on the videos it reads the atmospheric pressure and the value doesn't change much. Silly mistake... :shock: I'll change it today.

On the second video, I get errors in the rusefi_console, not sure why...

I've realized when I first time found rusEFI I started ordering parts for frankenso r0.5 juat to give it a try. I had really poor understanding of engines and EFI systems. I spent many days researching info about my car and engine control in general.
Also many late nights on the frankenso board, wiring diagrams and schematics just to make sure I won't burn my car when I plug it in... :lol:
Now I still have lacks of knowledge but I know things I didn't know before. We all learn little things every day! It just takes time... Theory is always a little different than practice :)


Things to do:
Complete the alternator control circuit. It does not work at the moment and in the videos the battery voltage gauge is correct the alternator is just not charging the battery yet.
Buy and install a wide band sensor for closed-loop fuel control.
Complete the knock sensor circuit. By the way is the software actually ready for knock detection?
Last thing start saving some money for turbo, pistons, another engine... (all the mechanical parts)
Last edited by RadMx5 on Thu Nov 02, 2017 9:31 pm, edited 1 time in total.

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by RadMx5 » Sun Oct 29, 2017 7:41 pm

Looks like the alternator control works!
I have wired the alternator field pin "1O" to HL4. My Tuner Studio settings:
Alternator settings.JPG
Alternator settings.JPG (47.58 KiB) Viewed 4237 times
I don't get the target voltage 14.4V I get around 13.4V instead, but I think that's ok for now, can play with the settings later.

I have changed the MAP sensor pressure source:
IMG_15344.JPG
IMG_15344.JPG (1.15 MiB) Viewed 4237 times
Now the readings look better :)

...it would be too good without any issues. I have noticed a problem above 5000 RPM. For some reason I can't see the triggers in engine sniffier rusefi_console at these RPMs.
But in Tuner Studio it shows a trigger error in the left bottom corner, and it starts firing in the exhaust. You can hear it in one of the uploaded videos.
trigger error around 5k rpm.bmp
trigger error around 5k rpm.bmp (3.71 MiB) Viewed 4237 times
I'll scope the trigger signals on PC6 and PA5 pins just to see if its a hardware problem. If not what else can cause this? I haven't changed the fuel and ignition tables yet.

And some questions: could someone explain what is the difference between the speed desity fuel algorithm and MAP? I have tried both. The throttle response seems to be a lot better on the speed density algorithm. On MAP when I press the throttle it just drops out of RPM.

Is there a chance the stock narrow band oxygen sensor showing some meaningful values like on the attached photo? Or the stock narrow band will not show properly on rusEFI?

User avatar
russian
Site Admin
Posts: 9774
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: UK Mazda MX5 miata NB 1.8 1999 - Future Turbo project r0

Post by russian » Sun Oct 29, 2017 7:53 pm

RadMx5 wrote:Is there a chance the stock narrow band oxygen sensor showing some meaningful values like on the attached photo? Or the stock narrow band will not show properly on rusEFI?
I do not have relevant experience but the popular opinion is that you at least need more presice approximation which we do not have yet - see https://github.com/rusefi/rusefi/issues/385

As for engine sniffer turning off above 5K that's a performance optimization "int engineSnifferRpmThreshold;Engine sniffer would be disabled above this rpm\"
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by kb1gtt » Sun Oct 29, 2017 11:02 pm

I believe that "simple on off mode" has been the more successful alternator control. Basically it's on, until you reach the target, then it's off. When it drops below 14.4, it turns back on again. Perhaps others can comment about this. As I recall, the PID approach has been difficult for people to tune properly.
Welcome to the friendlier side of internet crazy :)

User avatar
russian
Site Admin
Posts: 9774
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by russian » Sun Oct 29, 2017 11:12 pm

kb1gtt wrote:I believe that "simple on off mode" has been the more successful alternator control...As I recall, the PID approach has been difficult for people to tune properly.
Respectufully it's the other way around :roll:
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by RadMx5 » Mon Oct 30, 2017 3:25 pm

I tried both, the PID control and ON/OFF mode. The PID method with the settings shown in the above photo seems to work a lot better. I'll make some videos to show you how it behaves using both PID and ON/OFF mode.

By the way... This can be useful for other people, I found some answers to my previous questions :lol:

Fuel algorithms explanation can be actually found here, I just never scrolled the page down enough to read this info.

Trigger offset: some good info here and here
Last edited by RadMx5 on Mon Oct 30, 2017 9:57 pm, edited 1 time in total.

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

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by puff » Mon Oct 30, 2017 3:46 pm

the first and the second link are the same.

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by RadMx5 » Mon Oct 30, 2017 10:13 pm

Thanks puff, have changed the link.

Now while watching the videos I've just noticed the oscilloscope doesn't show crank signal frequency above about 294Hz. I'll have to scope it again tomorrow, I'll try to change the time scale as well to better see the signal.
Anyway is it normal the signal changes amplitude on higher RPM?

[video]https://www.youtube.com/watch?v=OnAYwmb ... e=youtu.be[/video]
[video]https://www.youtube.com/watch?v=NgEpS3DcxqY[/video]
[video]https://www.youtube.com/watch?v=oljOYfK3VgI[/video]
[video]https://www.youtube.com/watch?v=-J1MagaA5T0[/video]
[video]https://www.youtube.com/watch?v=DIUd8BXUtGE[/video]

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by RadMx5 » Tue Oct 31, 2017 8:39 pm

I couldn't go to the garage tonight... But I was thinking about it a bit during the day. In the above video where I show the crank signal you can see the lowest voltage level is around 520mV when the engine idles which is ok.
As the RPM increase the lowest detected voltage increases as well and it goes up to 1V. The maximum measured voltage does not change as you can see in that video.

I found this in google which shows the STM32 input voltage levels:
stm32f103_io_characteristics.png
stm32f103_io_characteristics.png (52.83 KiB) Viewed 4184 times
source: https://www.eevblog.com/forum/microcont ... -1-8-volt/

I think this can be the problem, the STM32 does not recognize a logic "0" signal above 5000 RPM.

It is definitely a hardware problem. Could it be something to do with the ground?? Any suggestions?

P.S
During this test my laptop wasn't plugged to the board.

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

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by puff » Tue Oct 31, 2017 11:49 pm

what's the type of your crank position sensor? and what was the circuit? It seems like some pull-up resistor is way too strong.

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by kb1gtt » Wed Nov 01, 2017 1:37 am

As your fuel injectors open more they overlap more. As your spark plugs fire more, they put more current on your ground wire. This ground wire is a resistor, and as you run current through it, your ECU ground voltage increases. You can decrease this resistance by adding a fatter wire. If you can can you solder a 12AWG wire to the GND pad, then connect the other end directly to the battery. That will likely indicate if your GND is lifting. If it's is lifting, it can be caused by the physical connections in the harness, or some where as it goes back to the battery. Also did your OEM harness have multiple GND connections? If so you could get a better ground if you connect these multiple connections.
Welcome to the friendlier side of internet crazy :)

User avatar
RadMx5
Posts: 77
Joined: Wed Sep 20, 2017 3:04 pm

Re: UK Mazda MX5 miata NB 1.8'99 - Future Turbo project r0.5

Post by RadMx5 » Wed Nov 01, 2017 8:24 am

what's the type of your crank position sensor? and what was the circuit? It seems like some pull-up resistor is way too strong.
Here is my circuit:
Op-Amp Crank.png
Op-Amp Crank.png (48.62 KiB) Viewed 4166 times
You can decrease this resistance by adding a fatter wire
I'll try with a direct ground wire from the battery to the rusEFI, and see if it helps, if not ill try different resistor value, and show you the results.

Thanks for help!

Post Reply