Electronics > Beginners
Autotune PID C code microcontroller start point
(1/1)
Vindhyachal.takniki:
1. Want to write autotuen PID for heater application. Can you point to some good starting point for c code?
2. Any reference library for this?
3. tried autotune arduino PID library, but temp is oscillating at set point.
Mattjd:
Id suggest tuning the gain values in say simulink or by hand and then transferring to C.
Rerouter:
Split it into 2 parts, the PID control, and the autotuning,
Each of these have a number of approaches, but lets say we stick to the normal PID control
So you now want to auto-tune it, the most common approach is called "step response", where it fixes the output, wait for it to stabilize, change the output by a step of x% wait for it to stabalise, and using the data between those 2 points to work out which values you want (sometimes PI or PD control can behave better than PID)
I would begin by putting together the PID or reusing an existing one, you can do auto-tuning with normal PID libraries,
Mechatrommer:
the academic version is called "adaptive control" or maybe the "robust control", prepare for heavy math belt. the non-academic, or maybe the empiric method is Ziegler–Nichols tuning method but its heuristic and meant to be done manually by human anyway...trying to do that automatically in code probably resulting in less than ideal time solution, and re-testing, adjustment or recalibration probably will interrupt the working operation of the system, hence the "adaptive" method is developed, i've never tried any of them so this is just a wild guess.
Navigation
[0] Message Index
Go to full version