Hi,
I'm working on a project using PID to fine-tune an output PWM, I want to start the PID from a known good initial duty so that the PID only has to deal with the trimming.
The plan is to have a 16 x 16 array and bi-linear interpolate to get a reasonable level of smoothness.
The breakpoints on each of the axis's may not be equally spaced, i.e. the X axis values may go:
-10, 0, 2, 3, 5, 10, 15, 22, 30, 40....
I've looked at the multiMap function, but feel it's a bit clunky.
Is there a neater solution out there other than writing my own library file?
Has any one got any pointers?
Implementing the interpolation is just a matter of a few lines of code: Bilinear interpolation - Wikipedia. Certainly no need for a library.
PID is pretty robust, assuming that the system model is appropriate and the sampling intervals are uniform.
What problem are you really trying to solve and why do you think your approach will be the solution?
It's a control system for gear selection of a hydraulically operated manual gearbox.
A large factor of the whole system is how quickly it can reach a desired gear position.
I work a lot with other automotive control systems and the better systems have an initial starting duty cycle for the first "step" before the PID takes hold, in reality this first duty can be calibrated to be within 5% of the "perfect" duty with additional adders/multipliers that take into account temperature etc.
The plan is to have an initial look up table, then use PID to make any finer adjustments required with error reporting should the PID adjustment's become too large. I've used reporting of a similar type on another Arduino project to great affect to help monitor the mechanical properties that aren't so easy to measure.
Gosh, HOW MANY gears are you talking about?????? seems way over complicated to me, unless you are trying to move a multi-person vehicle with a 50cc power plant (or something of the like).
So the system model changes when the gears change.
Theoretically, in such a case, the best approach would be different sets of K values for each system model.