khm 0 Posted February 20, 2017 Share Posted February 20, 2017 Hi, Is there a ready library for PID control available for MSP430F5438A or G2553 controllers. Please help if an example is available for the same. Thanks, Tanmay Quote Link to post Share on other sites
Rei Vilo 695 Posted February 20, 2017 Share Posted February 20, 2017 Look for a PID library for Arduino. Quote Link to post Share on other sites
Fmilburn 445 Posted February 20, 2017 Share Posted February 20, 2017 If you are using Energia, try this one which I have used with success: http://playground.arduino.cc/Code/PIDLibrary There are some very good links behind it on practical use and the derivation. Also do a search for PID on 43oh for posts on everything from balancing robots to sous-vide. Your implementation will depend on how fast the system you are trying to control reacts and how stable it is. Quote Link to post Share on other sites
khm 0 Posted February 17, 2018 Author Share Posted February 17, 2018 I am building a code to control a heater with a PWM output connected to an SSR using the Arduino-PID-AutoTune-Library. There are two issues I am currently facing with the above library while using the normal mode(not simulating but using actual analog input of a thermocouple) of operation. https://github.com/br3ttb/Arduino-PID-AutoTune-Library 1> The temperature overshoots when I start the operation. I tried several values for the constants(kp=2,ki=0.5,kd=2; kp=1,ki=0.8,kd=0.8; kp=1,ki=0.5,kd=0 etc), but still the temperature overshoots by a significant amount. For eg, if the Setpoint is 100 C, the process value goes upto 130-140 C before coming back to stable state between 95 to 110 C. 2> When I use the Auto tuning feature, the Arduino enters the tuning mode, but the PWM output count just toggles between 50 and 150 and it never comes out of Autotune mode and the temperature goes on increasing continuously even beyond 200 C although the set point is 100 C. Can you please help me rectify the problem? Thanks sketch_feb12a.ino Quote Link to post Share on other sites
Rei Vilo 695 Posted February 17, 2018 Share Posted February 17, 2018 Is the issue specific to Energia, or do it also occurs on Arduino? For the latter case, open a ticket at the GitHub repository. Quote Link to post Share on other sites
Fmilburn 445 Posted February 18, 2018 Share Posted February 18, 2018 These processes can be quite complex and the control is very dependent on the system. Autotune doesn't always work and hand tuning is sometimes necessary. It is impossible to guess what the constants should be without knowledge of the system and possibly experimentation. Read the background material in the link I have given above for a better idea of how PID works. If I remember correctly there is a very good link to a method for hand tuning when autotune fails. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.