Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can a library work? #23

Open
neoblack2 opened this issue Feb 10, 2020 · 1 comment
Open

How can a library work? #23

neoblack2 opened this issue Feb 10, 2020 · 1 comment

Comments

@neoblack2
Copy link

neoblack2 commented Feb 10, 2020

We need to strive for setpoint. And in the code at the start of tuning, this is what input was like that - it will be instead of setpoint.
And all the time it will float near input.

int PID_ATune::Runtime()
{
justevaled=false;
if(peakCount>9 && running)
{
running = false;
FinishUp();
return 1;
}
unsigned long now = millis();

if((now-lastTime)<sampleTime) return false;
lastTime = now;
double refVal = *input; --------------------------------------------------------------?
justevaled=true;
if(!running)    ------------------------------------------------ first start
{ //initialize working variables the first time around
	peakType = 0;
	peakCount=0;
	justchanged=false;
	absMax=refVal;
	absMin=refVal;
	setpoint = refVal; ----------------------------------first start setpoint = input ?
	running = true;
	outputStart = *output;
	*output = outputStart+oStep;
}
else
{
	if(refVal>absMax)absMax=refVal;
	if(refVal<absMin)absMin=refVal;
}

if(refVal>setpoint+noiseBand) *output = outputStart-oStep; -------------------? input and input ?
else if (refVal<setpoint-noiseBand) *output = outputStart+oStep; ----------- ? input and input ?

"corrected" output float near input? or maybe near setpoint ???????????

@rtek1000
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants