Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: hinduja.prasad on September 29, 2009, 06:39:29 PM

Title: pid contol
Post by: hinduja.prasad on September 29, 2009, 06:39:29 PM
hi ppl.........i am planning to use pid control for my linefolllower . i got the 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 eg.like 0-255 or 2000. how exactly 2 set this range?
Title: Re: pid contol
Post by: mayukh on September 30, 2009, 10:18:27 AM
Read up on ADC... that would help solving your mystery.


__________

Regards,
Mayukh.
Title: Re: pid contol
Post by: Kohanbash on September 30, 2009, 08:54:38 PM
Hi
As the last post said you will need some type of analog to digital conversion.

After that you want to record the minimum and maximum value that the sensor reports; and those are the values that you will use.
Also for the PID you need to develop a command for the motors based on the distance reported by the sensor so you will probably want to calibrate it so you know what the values from the sensor mean.