Society of Robots - Robot Forum
Electronics => Electronics => Topic started 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?
-
Read up on ADC... that would help solving your mystery.
__________
Regards,
Mayukh.
-
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.