Alternator control - PID implementation

It's all about the code!
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Alternator control - PID implementation

Post by AndreyB »

Fixed

Code: Select all

	/**
	 * If we have exceeded the ability of the controlled device to hit target, the I factor will keep accumulating and approach infinity.
	 * Here we limit the I-term #353
	 */
	if (iTerm > maxResult - (pTerm + dTerm + pid->offset))
		iTerm = maxResult - (pTerm + dTerm + pid->offset);

	if (iTerm < minResult - (pTerm + dTerm + pid->offset))
		iTerm = minResult - (pTerm + dTerm + pid->offset);
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
Horsty
Posts: 31
Joined: Fri Oct 07, 2016 10:38 am
Location: Cologne / Germany

Re: Alternator control - PID implementation

Post by Horsty »

spoiler: stupid question incoming! :!:
why don't you add a 12V voltage regulator on the injector high-side?

(edit @ - I assume the idea is to eliminate the variable injector lag? Editing since do not want clatter the "Alternator control - PID implementation" topic)
Track: Audi Coupé Quattro R5 Bj. '89 | 2.3 Liter | 7A | 170 bhp | Perlwhite L0A9
Daily 2014- : Volkswagen Lupo Bj. '99 | 1,0 Liter | ALL | 50 bhp | Flashred LP3G --> conversion to AEX 1.4 8v 60 bhp --> conversion to AEE 1.6 8v 75 bhp
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: Alternator control - PID implementation

Post by stefanst »

Horsty wrote:spoiler: stupid question incoming! :!:
why don't you add a 12V voltage regulator on the injector high-side?
I prefer the volyage on my injectors to be as high as possible. Higher voltage means shorter dead-time. And that means I have a little more fuel delivery capacity.
I don't see much of a reason to do so. We can characterize the injector behavior at higher voltage easy enough, so there didn't seem to be a reason to control voltage and add more electronic hardware.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: Alternator control - PID implementation

Post by kb1gtt »

Also cranking voltage can drop to 4V. Either you make a complicated buck / boost fast reacting injector regulator, or you compensate for it in software. The software works well, so I do not see a need for a 12V (or higher voltage) injector regulator.
Welcome to the friendlier side of internet crazy :)
Post Reply