What school are you working at? And what are you teaching?
Sorry for the late reply….
Using the MonoBrick communication library for a PID Controller is not recommended since there is no way to guarantee that your sample rate is constant – so this will give unexpected behaviour. You should run the PID controller directly on the brick itself. You could use the MonoBrick firmware