Page 1 of 1

Implementation of PID controller using Qt creator

Posted: Thu Sep 06, 2018 7:29 am
by sahubhumi
I'm very new on qt creator kindly help me on writing algorithm for pid controller using Qt creator to control temperature and humidity inside the chamber. I'm using HTU21D sensor for my project.

Re: Implementation of PID controller using Qt creator

Posted: Fri Sep 07, 2018 9:36 am
by Heater
sahubhumi,

You question is a bit too vague and general to answer properly. You mention PID and Qt, which implies you are working in C++. You mention a specific sensor.

Which part(s) are you having difficulty with:

a) Understanding the PID control algorithm,

b) Writing an implementation of PID in C/C++,

c) Creating a user interface with Qt,

d) Using C++,

e) Reading the sensors

The PID control algorithm is very simple and described all around the internet. For example: https://en.wikipedia.org/wiki/PID_controller,
https://www.csimn.com/CSI_pages/PIDforDummies.html. Actually using it properly can be rather application dependent and difficult to tune the parameters. Usually requires a good deal of experimentation before getting satisfactory results.

Actually writing a PID algorithm is also very simple in any language. It's only a handful of lines of code and some simple arithmetic. If you are lazy you can find source codes for PID all over the net as well. For example: https://gist.github.com/bradley219/5373998 and https://github.com/tekdemo/MiniPID/blob ... iniPID.cpp

Creating a user interface in Qt is to big a topic for a forum thread. Again there are articles and blogs about using Qt all over the net.

Programming in C++ is too big a topic for a forum thread. Again, see internet.

I know nothing about the sensors you have there.