I'm playing around with a line-follower and writing code for an Arduino using a PID and a pololu IR sensor array.
The sensor array gives figures of 0-5000 where 2,500 is dead centre. The readings come thick and fast and are good, however, maybe 1 in 20 are spurious, eg 2000,2012,2002,19,2058
The spurious 19 reading is wildly out but just one reading every 20 or so. Does the PID just ignore this as it's so rare so won't impact? Or should I code something to ignore readings that will be outside an expected range, ie within 500 of the last reading else ignore as it can't go that far out that quickly?
Thanks in advance.