go away spammer

Author Topic: PID spurious figures  (Read 2531 times)

0 Members and 1 Guest are viewing this topic.

Offline MarkyMarkTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
PID spurious figures
« on: February 21, 2015, 12:20:29 PM »
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.

Offline bdeuell

  • Robot Overlord
  • ****
  • Posts: 189
  • Helpful? 15
Re: PID spurious figures
« Reply #1 on: February 21, 2015, 02:36:06 PM »
I would filter the data (unless you can find the source of the error ... in which case i recommend you eliminate it at the source). PID will not ignore the false data but you may not see the effect depending on how you have it tuned. After eliminating the false data you may be able to tune the PID for a better response time than you were previously able to. i.e. you may have tuned the PID constants lower than would be necessary to smoothe out the glitches that this false data would cause.

Offline MarkyMarkTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: PID spurious figures
« Reply #2 on: February 21, 2015, 02:56:35 PM »
Awesome, thank you.

Offline Billy

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 2
Re: PID spurious figures
« Reply #3 on: March 14, 2015, 12:15:44 PM »
If what you were seeing was regular noise, I expect you would also see values very much higher than recent data. But since you mention it going lower, I'm guessing you have a fundamental issue.

How confident are you that the wiring is good and nothing is loose?
That "19" value seems low enough to look like an unconnected input pin.
Are you cycling through analog inputs? It may also be that your code has a bug and reads from the incorrect pin (that isn't connected) or otherwise there is some type of timing issue built into the code.

 


Get Your Ad Here