My target is to make a Adaptive cruise controller(ACC) for a car model. So i divided the task into two parts, first--- I made a speed following model, tuned a PID controller for it. Second---- I made a distance following model, tuned a PID for this. Now i integrated the two models into a single model so that i could switch between Distance follower or speed follower based on distance between the car under consideration and the car ahead of it. My problem is individually the two controller models work fine, but when i combined these two models to get a total ACC model, its no more working, can someone please guide me as to what might be wrong, or how to tune PID's in this model.? Thanks in advance.