Hi,
I've been looking at the engine status detection code going in the last few days.
Would RpmCalculator::isRunning() be the proper source for this the engine status going forward? Or will it be broken out to a unbound function like isCranking()
I'm asking because I'm looking to fix http://sourceforge.net/p/rusefi/tickets/117 and isRunning() and isCranking() are key.
Proper source of engine status in code.
-
- contributor
- Posts: 136
- Joined: Mon Oct 13, 2014 1:04 am
- AndreyB
- Site Admin
- Posts: 14727
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Proper source of engine status in code.
C'mon, there is NO way to predict the future of this. No plans to change much around here through.
Re: #117: current status: the code is there, time to check it if works - see applyIdleSolenoidPinState
Code: Select all
/**
* Please note that this is a relatively heavy method due to getTimeNowNt usage
*/
bool isRunning(DECLARE_ENGINE_PARAMETER_F);
Code: Select all
/**
* This is public because sometimes we cannot afford to call isRunning() and the value is good enough
*/
volatile int rpmValue;
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- contributor
- Posts: 136
- Joined: Mon Oct 13, 2014 1:04 am
Re: Proper source of engine status in code.
<sarcasm> You're telling me there is _NO_ api definition document for this project, But how dare you lay a single line of code without it. </sarcasm>C'mon, there is NO way to predict the future of this. No plans to change much around here through.

Meh, no plans to change works for me. Will have the a/c code use those as well.
Will also test that ICV code later on so you have an extra data point.
-
- contributor
- Posts: 136
- Joined: Mon Oct 13, 2014 1:04 am
Re: Proper source of engine status in code.
Re: Bug 117, I tested with the following results.
Frankenso:
set_idle_enabled 1
Engine not running, switch in the on position a there is a fixed pwm value going into the ICV. Voltmeter sees about 10.3v
Stock ECU:
Engine not running, switch on the on position: Fixed pwm going into the icv. Reads about 11.2v on the voltmeter.
If we move DEFAULT_IDLE_DUTY up a little it should mirror stock perfectly, so AFIK this is mimics stock close to perfect.
Frankenso:
set_idle_enabled 1
Engine not running, switch in the on position a there is a fixed pwm value going into the ICV. Voltmeter sees about 10.3v
Stock ECU:
Engine not running, switch on the on position: Fixed pwm going into the icv. Reads about 11.2v on the voltmeter.
If we move DEFAULT_IDLE_DUTY up a little it should mirror stock perfectly, so AFIK this is mimics stock close to perfect.
Last edited by spags on Fri Dec 05, 2014 2:12 am, edited 1 time in total.
- AndreyB
- Site Admin
- Posts: 14727
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Proper source of engine status in code.
Looks like it does not work as intended - I was hoping it would not be doing anything while the engine is not spinning.
(It might be a problem by itself since it would mean idle solenoid would have to open while you are already cranking, but that's off-topic for the purposes of #117)
(It might be a problem by itself since it would mean idle solenoid would have to open while you are already cranking, but that's off-topic for the purposes of #117)
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- contributor
- Posts: 136
- Joined: Mon Oct 13, 2014 1:04 am
Re: Proper source of engine status in code.
Agreed, I imagine to do that the PWM would have to stop happening and the output voltage brought to 0. Not very familiar with the PWM code, but i think it's all in software. There must be a nice way to tell a pwm channel to stop.