KIKI Voilà ce que j'ai trouvé sur un site anglais
Improved PID code The method of implementing automatic reset described in using a positive feedback loop was first used with pneumatic analog controllers. It can easily be implemented digitally.
There are several advantages of this algorithm implementation. Most important, it eliminates the problems that cause the output to pull away from a limit inappropriately. It also allows the use of external feedback when required.
Variables: Input Process input InputD Process input plus derivative InputLast Process input from last pass, used in deriv. calc. Err Error, Difference between input and set point SetP Set point OutPutTemp Temporary value of output OutP Output of PID algorithm Feedback Result of lag in positive feedback loop. Mode value is ?AUTO? if loop is in automatic Action value is ?DIRECT? if loop is direct acting
The PID emulation code:
1. IF Mode = ?AUTO? THEN
2. InputD=Input+(Input-InputLast)*Derivative *60 derivative.
3. InputLast = Input
4. Err=SetP-InputD Error based on reverse action.
5. IF Action = ?DIRECT? THEN Err=0 ? Err Change sign if direct.
6. ENDIF
7. OutPutTemp = Err*Gain+Feedback Calculate the gain time the error and add the feedback.
8. IF OutPutTemp > 100 THEN OutPutTemp =100 Limit output to between
9. IF OutPutTemp < 0 THEN OutPutTemp =0 0 and 100 percent.
10. OutP = OutPutTemp The final output of the controller.
11. Feedback=Feedback+(OutP - Feedback)*ResetRate/60
12. ELSE
13. InputLast=Input While loop in manual, stay ready for bumpless switch to Auto.
14. Feedback=OutP
15. ENDIF
If external feedback is used, the variable ?OutP? in line 11 is replaced with the variable containing the external feedback.
Updated March 29, 2004 10:58:26 AM.
Back to Control Information
Privacy Policy Provided by John Shaw.
Merci de le diffuser à tout le monde
|