An explanation: In the free feeding example, the void loop() on FED3 just calls fed3.run() and fed3.Feed() over and over again:
void loop() {
fed3.run(); //Call fed.run at least once per loop
fed3.Feed(); //Drop pellet
}
fed3.run() updates the screen and a couple timers which takes ~130ms. Then fed3.Feed() turns the motor until a pellet is detected, and exits the fed3.Feed() function when the pellet is removed. So if a pellet was detected during fed3.Feed() and then bobbled, FED3 will count the pellet, exit the fed3.Feed() function, call fed3.run(), and then go right back to fed3.Feed(), which will not turn the motor because the (same) pellet is ~immediately detected (and re-counted). And each time it's bobbled the process repeats, allowing for multiple counts off the same pellet.
This behavior is not ideal. I have a quick fix for you. If you add a timeout after fed3.Feed(); it will stop this rapid pellet-counting behavior for at least the duration of the timeout. You can add the following line to the free feeding example to add a 5s timeout:
void loop() {
fed3.run(); //Call fed.run at least once per loop
fed3.Feed(); //Drop pellet
fed3.Timeout(5); //5 second timeout
}
As a fix for your data that's already recorded, I would filter out rows based on the InterPelletInterval columns (Column O). In my experience, mice take ~10-20 seconds to eat a pellet, so if this interval is 0s or 1s you can assume that was a bobble and not a real pellet removal.