|
Re: encoder PIDController and set
1. If your wheel RADIUS is 10cm, then you should set setDistancePerPulse(10 * (2 * pi)/PULSES_PER_REVOLUTION). GetDistance will then get the total distance in cm and getRate will get the total cm per second.
2. Use ppr. The reason your values don't make sense is because you used circumference instead of radius.
3. I was never too sharp on this, but I BELIEVE 4X will result in you getting your ppr, while 1X will get you your cpr. In other words, you will get 1440 pulses with 4X and 360 pulses with 1X. I might have them flipped though.
4. Depends on what your PID controller is controlling. If it's controlling speed, sure. This purely depends on if you're feeding rate or distance into your PID controller.
EDIT: Major math error on my part. It should be 10*(2*pi)/PULSES_PER REVOLUTION
Last edited by ollien : Yesterday at 03:23.
Reason: I made a math error.
|