Finding optimal PID gain values with no Transfer Function or Plant model

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.

• Unless you're doing something really simple, like temperature control that runs at steady state all the time, it's well worth collecting the info you have about your plant. In your case, signal_to_plant -> [actuator dynamics] -> acceleration -> [integrator] -> velocity_aka_plant_output ... so a first approximation guess at a qualitative model might be integrator-and-a-pole. Note possible difference w/ accel vs brake, esp with regard to limits (thus ARW design). throttle response might have a noticeable delay in it too, if your performance goals are aggressive. Feb 1, 2022 at 17:49
• It’s always worthwhile having a mathematical model of the physical system you are trying to control. Feb 1, 2022 at 21:21
• You would also need to define what you mean by optimal. Optimal-in-control-effort is usually in conflict with optimal-in-response-speed.
– AJN
Feb 2, 2022 at 1:52
• Ok, thank you @PeteW '@TeoProtoulis' and for the advice. Due to time constraints I was unfortunately unable to derive the mathematical model but will practise doing so with other similar examples. Feb 16, 2022 at 22:02