Background:
I have a Matlab simulation model with .m files. The functions simulate a speed control system of a vehicle. I can control the vehicle's speed by adjusting the vehicle’s acceleration and braking. The simulation runs over a set amount of time and a set number of iterations. The control output is limited to a certain range due to the vehicle's acceleration and deceleration limits. For simplicity, let’s say this range is from -1 (max braking) to +1 (max accelerating).
What I have done:
I have written a function that takes the desired vehicle speed and the current vehicle speed as inputs. I use the difference between the desired speed and actual speed as my control error for every simulation step. My function uses the error to represent a PID controller:
Proportional Control = Proportional Gain * error
Integral Control = Integral Gain * Sum of errors * Delta T
Derivative Control = Derivative Gain * (change in error) * (1/Delta T)
I have manually tuned the gains based on my visual observations of the system. I then send the final control output to the function controlling the vehicle speed. Results seem good.
Question:
How can I tune/find the optimal PID gain values for my above system considering that I do not have a plant representation or transfer function?
I have seen the Ziegler-Nichols method, but I am not sure if that is the best approach to finding optimal control gain values.
https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method
I was initially planning on finding the Transfer System/Plant model of my system but I am unsure if it would be worthwhile. I have seen there is a System Identification Toolbox in Matlab, but it seems I might as well continue to manually tune my existing PID controller rather than tuning the transfer function parameters to find the best system approximation.
Side question: What other controller types do you suggest I explore instead of PID?
Thank you for taking the time to read. I'd appreciate any feedback you could provide.