We will be closed on November 25, 2021 and November 26, 2021 in observance of the Thanksgiving holiday. We will resume normal operations on November 29, 2021. Wishing you a safe and happy holiday from all your friends at SparkFun!


Receive a free SparkFun USB Thumb Drive with every order this weekend. Details.

Member #529812

Member Since: March 11, 2014

Country: United States

  • Well you are correct,should of caught that. It's not a mistake that is foreign to me.

    The real problem is that we are not measuring what we are wishing to correct. Having both wheel travel the same distance isn't the same as traveling in a straight line. There are a lot of paths that aren't in a straight line that have the same distance on both wheels. This is why I now use the Line Sensor Array to introduce PID it is measuring what we are trying do. That said my test for driving with encoders is how far can the robot travel keeping the line between the two wheels, I've had robots go over 20 feet, which I thought was pretty damn good.

  • By phase I just meant the wheels were out of sync a sequence of encoder counts; (0,1) (1,1) (1,2) is not indicative of one wheel traveling faster than the other. I general suggest a deadband as a way of filtering that out. Your much higher tick count makes that much less of a concern. The way I think and explain the I term is that it is to filter out consistent error, one motor fast than the other, one wheel bigger than the other, the robot on a tilted surface may all create a long term bias in which wheel is moving faster than the other. Whereas the D term is simply an effort to prevent overshoot and create a smooth transition to driving straight on the line. I have found that the D term is generally prone to creating oscillation. I am not teaching control theory and have limited education and experience with it.

  • I've done this with the Arduino, and the parallax boebot encoders with students. They have worse resolution than your encoders (64 per wheel turn). And the motor were just servo's .

    My observation, a difficulty with initial conditions having the wheels out of phase, we didn't get into any method of PID loop tuning, and I wish there was some good examples on that because it is seriously beyond what I am comfortable with.

    I believe that you error_change is getting the derivative, integrals would be a running sum of error. I always tune the derivative last, after doing the I term.

  • I wanted to let you know that I am using your videos as part of the summer classes that I am doing for a High School First Robotics team. So keep churning them out :)

    What I am doing with this summer session is using the Arduino as a simple hard to mess up C++ programming environment. So I am going to do doing lessons on Pointer,Classes and, Algorithms and such. I hope to get the students to produced more structured programs, with the thought in mind that from an education point of view a FRC robot could implemented with an Arduinio controlling each of various subsystem (ball pick up, shooter, etc) but to do that we need to get a lot more kids up to speed on programming.

No public wish lists :(