If it does it when you are cornering hard, on an incline or setting off/braking, then also check the brake fluid level.
When it's near minimum and it sloshes around, it can uncover the sensor and trip a low level alarm. Hasn't happened in my forfour yet, but it did happen when the factory pads got near the wear limit on my other car.
As the pads wear, the piston is pushed out to take up the slack, and this lowers the brake fluid level in the reservoir.
Note:-When the piston is pushed/wound back in, the level rises again, so if you've ever topped it when the pads or discs were worn, it may spill out when you replace the pads.