- Hello, I try to tune a PID controller for a second order system model using Reinforcement Learning like the example of Tune PI Controller using Reinforcement Learning in MATLAB ( https://it.mathworks.com/help/reinforcement-learning/ug/tune-pi-controller-using-td3.html )
- I created the system model with PID called “System_PID.slx” and simulated it to get satisfactory result.
- I also created the system model with RL_agent block “ rl_PID_Tune_mod .slx”
- I am running the code for 100 iterations.
- The ‘Agent’ loaded in workspace after training also gives satisfactory performance when it is considered as standalone controller.
- But, the value of kp, ki, kd are also generated but the value of proportional gain (kp) which is extracted from training, is very small nearly zero. As a result, the extracted Kp, Ki and Kd from ‘Agent’ are not giving the satisfactory result.
- That’s why the system is going to be unstable
- So where is the problem in the configuration of the code as given below.
- Any help is highly obelized.
simOpts = rlSimulationOptions('MaxSteps',maxsteps);
experiences = sim(env,agent,simOpts);
actor = getActor(agent);
parameters = getLearnableParameters(actor);
Ki = abs(parameters{1}(1))
Kp = abs(parameters{1}(2))
Kd = abs(parameters{1}(3))