See figures below to understand how each parameter (shown in figure titles) affect the feedback loop stability.
The parameters which were varied are shown below. Note that setting refConst = False will randomly change the reference value:
reference = 1
controller_gain = 0.5
plant_gain = 1
sensor_gain = 1
timeDelay = 5
# Keep reference constant?
refConst = True