To program output on and off

Function doesn't account for acceleration/deceleration of crankshaft due to pistons slowing down/speeding up around TDC.

The AI you are using is ignorant of how IC engine work. Get an upgrade.

1 Like

He has a phone

No computer no hardware just time and a AI connection

and it bombs......

1 Like

engine ECU

The code in #263 does not measure those missing pulses.

The code in #244 does.

116

cyclesCompleted++;

The computer to simulate the ECU will have to be from the NXP MPC5777C family. An 8-bit AVR doesn't have the necessary peripherals.

The computer to simulate the ECU will have to be from the NXP MPC5777C family. An 8-bit AVR doesn't have the necessary peripherals.

Well it seems his project is expanding from the crank trigger to the rest of the sensors.
I had thought about listing all the sensors but that would give him a head start on the butchering of how a FI system really works.

It fills the bill for a boring cold Friday...

Well, maybe for the full ECU. But in #244, @JohnLincoln showed that an 8bit AVR could simulate a 60-2 trigger wheel plus extra sync signals up to 6000 RPM.

It's a pretty non-real world simulation since the time between degrees varies so much in a real engine for any given average RPM. Probably good enough for OP's situation though since it will never become a functional system.

1 Like

At which degree spark plug fires ?

Depends on the car, and timing, and the rpm-based advance. Unwarrantly wild-a**-guessing 10°BTDC on cyl6, in a 1-5-3-6-2-4 cycle that would be around 350° in a 720° cycle.

TPS simulator load.

void loop() {
  float tpsVoltage = analogRead(TPS_PIN) * (5.0 / 1023.0);

  float tpsPercentage = constrain((tpsVoltage - TPS_MIN_V) / (TPS_MAX_V - TPS_MIN_V) * 100.0, 0, 100);

  int pwmValue = map(tpsPercentage, 0, 100, 0, 255);

Now you are concerned about throttle position and...load?

Draw a diagram of all your inputs and outputs to the black box that is your project.

And a schematic of how they hook up to your device.

Do you remeber me saying

Stop posting code without telling us why you have posted it and what has been changed

Do it one more time and you will be suspended

Depends on timing and how that is corrected via the knock sensors or the mass air flow data return.

What was the reason for asking your AI to write that code? There is no practical application in your project.

The reason to ask it to give me ideas how to write a code. If you see something is not correct in the code you can simply copy edit it correct it and post it if you want then we can learn it.