AngelMarc wrote: Tue Oct 21, 2025 4:03 am Got the new generic 12595966 sensor. Bench tested fine. Getting closer... again.
Coding my own open source 24x ECU [beta available]
-
MPC001
- Posts: 174
- Joined: Sat May 05, 2018 11:41 am
Re: Coding my own open source 24x ECU [beta available]
-
AngelMarc
- Posts: 612
- Joined: Sat Apr 08, 2023 11:23 am
- cars: A CB450 running to 8,000RPM with a P59.
Re: Coding my own open source 24x ECU [beta available]
I don't know WTF I'm doing wrong. But I'm getting damn sick of it. Apparently I don't know how to wire up this crank sensor in a way the Pico can deal with. Or something else not even on my radar. Project is about to the point where it gets dropped for a year or more before I even look at it again.
Don't stress specific units.
-
AngelMarc
- Posts: 612
- Joined: Sat Apr 08, 2023 11:23 am
- cars: A CB450 running to 8,000RPM with a P59.
Re: Coding my own open source 24x ECU [beta available]
Seems I somehow have issues at lower speeds. Put oscilloscope on crank sensor signal; looks flawless. Suppose Pico could be flakey from brief over-voltage spike on crank pin, but I doubt that.
That's a knockoff 12595966 sensor and half an OEM LS wheel.
https://www.youtube.com/watch?v=9gTlh2oaMDY <recording of what crank sensor and spark output are doing.
https://www.youtube.com/watch?v=9gTlh2oaMDY <recording of what crank sensor and spark output are doing.
You do not have the required permissions to view the files attached to this post.
Last edited by AngelMarc on Sat Oct 25, 2025 11:41 pm, edited 1 time in total.
Don't stress specific units.
-
antus
- Site Admin
- Posts: 10012
- Joined: Sat Feb 28, 2009 10:34 am
- cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007
Re: Coding my own open source 24x ECU [beta available]
I assume you tested the pin directly to confirm its reading high and low states correctly without the crack sensor, also confirmed by it looks like its working in some circumstances. Does it need a pull up or pull down resistor? Is it running at the correct voltage? If your gpio is 3.3 then it might need higher to run stable. Not sure, just ideas that come to mind. If you have another pi you could use it as a signal gen for testing to identify if its a hardware or software problem switching at different speeds. If you have one of these sensors on a car you could measure power and peak to peak voltages on signal there to test any assumptions.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
-
AngelMarc
- Posts: 612
- Joined: Sat Apr 08, 2023 11:23 am
- cars: A CB450 running to 8,000RPM with a P59.
Re: Coding my own open source 24x ECU [beta available]
I don't remember seeing this problem before on the bench, but I do see the same on the bench now with the signal generator. That's why I'm suspicious of the Pico, as unlikely as it seems. I mean shit, flashing the last one too many times had it doing some weird shit.
I put the oscilloscope on the Pico as I spun the engine. That's what you're seeing in the picture. That's also what the video shows, with the 'sort of almost sometimes working' behavior. The red line is spark output. Does the same whether coil is running or not, so it's not EMI. Notice how after the engine stops for a couple seconds, you see commanded spark, for some reason. That's also new. Going to order more Picos once I get some money in the bank.
Yes, pullup resistor. Pulled up to 3.3 volt instead of sensor's 5 volt supply. Already tried a small capacitor. Moved some grounds around.
I did try a 5 volt pull-up last time. My mood was "it's going to work or die".
I put the oscilloscope on the Pico as I spun the engine. That's what you're seeing in the picture. That's also what the video shows, with the 'sort of almost sometimes working' behavior. The red line is spark output. Does the same whether coil is running or not, so it's not EMI. Notice how after the engine stops for a couple seconds, you see commanded spark, for some reason. That's also new. Going to order more Picos once I get some money in the bank.
Yes, pullup resistor. Pulled up to 3.3 volt instead of sensor's 5 volt supply. Already tried a small capacitor. Moved some grounds around.
I did try a 5 volt pull-up last time. My mood was "it's going to work or die".
Don't stress specific units.
-
antus
- Site Admin
- Posts: 10012
- Joined: Sat Feb 28, 2009 10:34 am
- cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007
Re: Coding my own open source 24x ECU [beta available]
The signal looks OK. I am more suspicious of software. Do you have a way to see what is happening with the logic in the app when it is working and when it is not? What would happen if it missed an event in its sequence?
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
-
AngelMarc
- Posts: 612
- Joined: Sat Apr 08, 2023 11:23 am
- cars: A CB450 running to 8,000RPM with a P59.
Re: Coding my own open source 24x ECU [beta available]
By having an idea where the problem is and serial printing. That's only good for low speed anyway.
Toggle some outputs based on other things.
Unless you have some specific idea about software.... that doesn't help me figure it out.
Toggle some outputs based on other things.
Unless you have some specific idea about software.... that doesn't help me figure it out.
Don't stress specific units.
-
antus
- Site Admin
- Posts: 10012
- Joined: Sat Feb 28, 2009 10:34 am
- cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007
Re: Coding my own open source 24x ECU [beta available]
I would be getting creative at this point. Get the code to switch some otherwise unused GPIOs as it runs maybe, so you can put the CRO on them and see if they look like they're doing what you expect, or put some internal assertions that compare or count some things and only take action when they see something wrong, something like increment a counter on each tooth of the wheel and look for the missing pin and if its count is too high or two low flag an error. Or check 1 counts of one sequence for two of another or something like that. Anything you can come up with to validate the main loops are running properly and not getting out of whack. Could light up an error led, or just set a GPIO you check with the cro, or it could be serial output. So long as its not writing output at the speed the main loop is running at, you might be able to get something useful, but a simple led that you turn on, and nothing anywhere turns it off is probably dead simple and very obvious.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
-
AngelMarc
- Posts: 612
- Joined: Sat Apr 08, 2023 11:23 am
- cars: A CB450 running to 8,000RPM with a P59.
Re: Coding my own open source 24x ECU [beta available]
I had a suspicion of the math/tune values, because it start at 0 RPM, so the numbers rise towards infinite, but values I put in for first column were based on 20 RPM. Worst that should do is have too much advance. Fuel output was checked and seemed... mostly fine; didn't behave the same.
And again, these are new problems not depending on new input scenario. I'll replace the hardware before I do anything else.
And again, these are new problems not depending on new input scenario. I'll replace the hardware before I do anything else.
Don't stress specific units.
-
AngelMarc
- Posts: 612
- Joined: Sat Apr 08, 2023 11:23 am
- cars: A CB450 running to 8,000RPM with a P59.
Re: Coding my own open source 24x ECU [beta available]
4 more Picos on the way, and a Pico 2 for the hell of it.
Don't stress specific units.