Author Topic: pid control  (Read 1564 times)

0 Members and 1 Guest are viewing this topic.

Offline hinduja.prasadTopic starter

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
pid control
« on: September 29, 2009, 06:38:13 PM »
hi ppl.........i am planning to use pid control for my linefolllower . i got essence of the algo but the problem is how to read the analog values from the IR sensors ? i came across many codes and tutorials fo pid where in they set the values of the sensors for 0-255 or 2000. how exactly 2 set this range?

Offline Half Shell

  • Robot Overlord
  • ****
  • Posts: 225
  • Helpful? 0
Re: pid control
« Reply #1 on: September 30, 2009, 07:01:16 AM »
1- Do not post the same topic in multiple forums. Especially cut and pastes. This makes it more likely that no one will answer you
2- When you refer to "some code," please link as a reference what you have seen and worked with, so we can allude to your knowledgebase

Now, to help you out.

The range that you are talking about is derived from hardware requirements at some point. ADCs on many micro controllers are typically 10 bits - this means from 0 to 1023 is the maximum range. There are still other sensors or MCUs that can only output one byte of information (8 bits), so a range of 0 to 255 is possible. This is where that range is coming from. Assuming that the PID is controlling some kind of output, the 0-255 range is the output, many MCUs have an 8 bit timer that generates a PWM that, in turn, controls a motor. The 8 bit timer translates to 0-255, 255 being a solid 5 volt output, 0 being 0 volts, and all other values being a linear representation of time pulsed high and time pulsed low.

Hope this helps!


Get Your Ad Here