Hi Henrik ,
Sorry for the late answer .. I was busy with becoming a freak of PID![]()
Well , the first modification I did is removing the acceleration feedforward and velocity feedforward block of the PID routine just to see the raw PID feedback mechanism works without any help of those and also due to lack of the memory of my pic16f628a..
And I just added a line on the main routine where it applies the calculated P+I+D = pid output to the CCPM registers .. But unlike yours , I used such a code below ;
'------------------------
..
..
gosub PID
duty=duty+pid_out
..
..
'-----------------------------
Yet there is one more question digging my mind like hell about one code that you wrote in the INTEGRAL routine ...
IF pid_Eit>0 then pid_Ei=0
...........
Shouldn't we have cleared the pid_Ei temporary integral error accumulator storage for also the condition pid_Eit<0 ??
Bookmarks