Optical Encoder help

09 Apr 2012

I'm following this tutorial http://www.societyofrobots.com/sensors_encoder.shtml. What I'm trying to implement is having an accurate reading of the distance of my robot.

For example if in my program I want my vehicle to move 10m/s. Since I'm using an optical encoder,pretend it needs about 200ticks per second. and my encoder records 5m/s which is about 100 ticks per second. How do I program Is there any example program where I can use to do this?

Do I need PID?

10 Apr 2012

Hi Joey,

Are you saying that you tell the robot to travel at 10 m/s but it actually travels at 5 m/s (verified by the encoders)?

If this is the case then PID would certainly help. You would need the integral part of PID to help reduce the steady state error to zero. So a PI controller would be fine.

But check over your code first to make sure that any scaling you are using is correct. It's all too easy to make scaling errors which would make it look like this is happening when it isn't.

Martin

10 Apr 2012

Thanks Martin,

Yeah do you know any codes or projects that may be similar to what I'm doing? Cause without an example to look at I'm very useless.