Hello.
I've got a little problem with output i dont exactly know how it work.
SetPoint 0-255
Input 0-255
OutPut 0-255
double Setpoint, Input, Output;
PID myPID(&Input, &Output, &Setpoint, 2, 5, 1, DIRECT);
setup()
myPID.SetOutputLimits(-255, 255);
Input = map(analogRead(A0), 0, 1023, 0, 255);
Setpoint = 0;
myPID.SetMode(AUTOMATIC);
loop()
Setpoint = pinNumber2*2.5; // pinNumber is a value from my phone sended via ESP 0 - 255
Input = map(analogRead(A0), 0, 1023 , 0, 255);
myPID.Compute();
analogWrite(5, Output);
When i set setpoint = 150 by my phone then input take by potentiometer 140,150,144,153 cuz i dont have encoder...my output change from 0 to 255...
if i think good it should be value sth around 150 to maintain this speed or output is sth else???
Could u explain?
PS. when i set this it's working, rotate motor with speed what i want but it's not PID ;///
analogWrite(5, SetPoint);