Is a good practice to use one PID in rise time and another PID for steady time in order to eliminate oscillations during steady time?

I'm trying to control temperature with PID(Kp,Ki, Kd). During the rise time the system use one PID and when target is reached the system switch to another PID with other parameter in order to eliminate the oscillation. I know that I can remove oscillations increasing Kd but in this case it does not work.

Results of real time system

Control temperature with constant PID:

Control temperature using PID1 during rise time (blue color) and when temperature reach the target, the controller is changed to PID2 (Steady state error: black color):

void setTarget(...)
{
mPid = pid1;
}

{
float e =  fabs( temperature - target);
if(e<=0)
mPID = pid2;
}


• How would you handle the transition? – A_A Jul 2 '19 at 16:26
• If implemented correctly I think this would be equivalent to gain scheduling (this can also be used on linear systems to improve performance). – fibonatic Jul 2 '19 at 17:19
• @A_A the question was updated. – sergio campo Jul 3 '19 at 10:35
• @fibonatic could you please recommend me some article or book that show me how to implement correctly this implementation in real time? – sergio campo Jul 3 '19 at 10:41
• Gain scheduling is normally used for nonlinear systems with different operating points, so most books and articles will probably be about that. In order to still show stability one could use the circle criterion. Both can be found in nonlinear systems by Khalil, however it doesn't cover gain scheduling for linear systems to improve tracking or disturbance rejection. – fibonatic Jul 4 '19 at 14:41