ardu_stim help

They go by many names, P01, P10, P12, P59, E38, VPW, '0411 etc.
MPC001
Posts: 186
Joined: Sat May 05, 2018 11:41 am

Re: ardu_stim help

Post by MPC001 »

AngelMarc wrote: Thu Sep 11, 2025 3:20 am A little cut down? That I have to see.
Larger buffer/array to hold the entire 2 turns of the crank, less logic to access it.
User avatar
AngelMarc
Posts: 613
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: ardu_stim help

Post by AngelMarc »

MPC001 wrote: Thu Sep 11, 2025 4:56 am Larger buffer/array to hold the entire 2 turns of the crank
Well, that much I already did. Believe we had a conversation about it. You weren't sure why there were 48 entries in the array.
Still love to see how the logic got simpler.
Don't stress specific units.
User avatar
AngelMarc
Posts: 613
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: ardu_stim help

Post by AngelMarc »

MPC001 wrote: Thu Sep 11, 2025 1:14 am On scanning RPM PID, jitter is close to zero on Teensy 4 at 8,000rpm on E38 & no cam/crk synch errors (which seem to pop up above +/- O.75 cam degrees error).
Guess it's good it coincidentally lined up, since it's just 15 degrees increments.
If it's ever needed (nothing new uses 24x, so probably not), could do a pattern match and pulse math like my ECU code. That'd be pretty fine-tunable.
Don't stress specific units.
User avatar
AngelMarc
Posts: 613
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: ardu_stim help

Post by AngelMarc »

Big ‘G’ wrote: Mon Sep 08, 2025 10:54 pm ckp sensor a performance... but still no rpm.
I should have read that closer. I'm puzzled you get NO RPM but it throws a code at all. Maybe it's more of a crank cam corrolation code, which might be a newer, more specific code to better explain the self diagnosis. Just guessing on that.
I've mounted the trigger wheel backwards and gotten RPM reading.
When I was messing with this https://www.youtube.com/watch?v=ensFjG1Wr-U
tested a tach with it. Was before I had the signal generator figured out.
Don't stress specific units.
MPC001
Posts: 186
Joined: Sat May 05, 2018 11:41 am

Re: ardu_stim help

Post by MPC001 »

AngelMarc wrote: Thu Sep 11, 2025 5:01 am
MPC001 wrote: Thu Sep 11, 2025 4:56 am Larger buffer/array to hold the entire 2 turns of the crank
Well, that much I already did. Believe we had a conversation about it. You weren't sure why there were 48 entries in the array.
Still love to see how the logic got simpler.
240 cell buffer/arrays for 24X or 58X. This is 24X.

Code: Select all

int crank[240]  = {0,0,0,0,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,
                   0,0,0,0,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,
                   0,1,1,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,1,1,1,1,
                   0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,
                   0,0,0,0,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,
                   0,0,0,0,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,
                   0,1,1,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,1,1,1,1,
                   0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1
                   };

int cam[240]  =   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
                   };

void loop() {

if(micros() - origtime >= period) {
    difftime = micros() - origtime;
    digitalWrite(PIN_CRANK, crank[tooth]);
    digitalWrite(PIN_CAM, cam[tooth]);
    
    if(tooth != 239){
        tooth += 1;
      } else if (tooth == 239){
        tooth = 0;
      }
	origtime = micros();
    }
    }
    
MPC001
Posts: 186
Joined: Sat May 05, 2018 11:41 am

Re: ardu_stim help

Post by MPC001 »

AngelMarc wrote: Thu Sep 11, 2025 5:33 am
MPC001 wrote: Thu Sep 11, 2025 1:14 am On scanning RPM PID, jitter is close to zero on Teensy 4 at 8,000rpm on E38 & no cam/crk synch errors (which seem to pop up above +/- O.75 cam degrees error).
Guess it's good it coincidentally lined up, since it's just 15 degrees increments.
If it's ever needed (nothing new uses 24x, so probably not), could do a pattern match and pulse math like my ECU code. That'd be pretty fine-tunable.
I went for 3 degree increments. It didn't co-incidentally line up. Took some work. That's where it became clear how picky the crank/cam decode & synch logic was for the 4X cam. :)
MPC001
Posts: 186
Joined: Sat May 05, 2018 11:41 am

Re: ardu_stim help

Post by MPC001 »

FYI
P0336 is crk sensor performance - in short not seeing the correct waveform to synch on
P0016 is crk/cam correlation
Big ‘G’
Posts: 18
Joined: Mon Feb 06, 2023 1:31 am

Re: ardu_stim help

Post by Big ‘G’ »

Thanks for the wiring visual marc. mosfet tc 4420 and tc 4452v share the same pinout, that said i'm wired up exactly the same as you. looking like mpc001 may be correct about the waveform, possible error in code? guess i'll have to find me a scope
User avatar
AngelMarc
Posts: 613
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: ardu_stim help

Post by AngelMarc »

Check out the VDS1022
https://www.youtube.com/watch?v=RoEfA3B4NFI <-P59/12587603 doing what it does without a cam signal at cranking RPM, driven off my sim code
https://www.youtube.com/watch?v=e32bYJsmmgw <-My code testing the RPM limits of same P59, I never did hook up CAM signal, except on my open source ECU.
https://www.youtube.com/watch?v=zhllu_2PBBY <-Custom wheel and 12595966 sensor with 10K pullup resistor on CB450 while it's running and revving. Also same P59. I think spark EMI is what caused the dips.

This guy showing it work well with megaHz signals is why I got it. Don't make the mistake of getting the cheapest PicoScope.
https://www.youtube.com/watch?v=1ec1n9ScGTw&t=2508s <-Vintage PC signalss <-Vintage PC signals
Last edited by AngelMarc on Fri Sep 12, 2025 9:07 am, edited 2 times in total.
Don't stress specific units.
User avatar
AngelMarc
Posts: 613
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: ardu_stim help

Post by AngelMarc »

MPC001 wrote: Thu Sep 11, 2025 7:06 am
I'll have to check that while I'm more awake later.
I like the if not equal, increment, else if 0 part
Don't stress specific units.