Currently I have written a PID controller (with pulse width modification) which sends the current temperature to a server each duty cycle. However, this is written in series and so there is a brief delay between each cycle which makes the temperature control less effective.
Furthermore it is hard to terminate the temperature controller externally once the program is called.
Is there an alternative way where I can run the PID controller and the server communication separately to reduce this delay? I could always write the data to the csv file and have another script read from said file. However it doesn't strike me as the most elegant or effective solution.
Besides scheduling, I recommend using a preemptive OS, which is the only way to assure a fixed timebase. One free option is the Wind River Linux.
I would be grateful if someone could point other good free alternatives.
How to deal with delays when using Python for control systems